OSDN Git Service
Ben Clayton [Tue, 26 Feb 2019 16:52:12 +0000 (16:52 +0000)]
CMake: Add DCHECK_ALWAYS_ON flag
Enables macros like ASSERT, UNIMPLEMENTED even in release builds.
Bug: b/
126329018
Change-Id: I7d810862b16d85b0a4ffc6b39a655cc73d4c669a
Reviewed-on: https://swiftshader-review.googlesource.com/c/25557
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Tue, 26 Feb 2019 17:24:46 +0000 (17:24 +0000)]
Fix warnings raised during release builds
Bug: b/
123933266
Change-Id: If4dc4858c8a81dd5e7b3510a08e7dbae74051483
Reviewed-on: https://swiftshader-review.googlesource.com/c/25556
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Tue, 26 Feb 2019 16:50:31 +0000 (16:50 +0000)]
Suppress LLVM warnings raised during release builds.
Made these suppressions only apply to LLVM as they're scary to be ignored generally.
Bug: b/
123933266
Change-Id: I23c01f4cad0bac706f515642ce482703a1161d67
Reviewed-on: https://swiftshader-review.googlesource.com/c/25555
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>
Chris Forbes [Wed, 27 Feb 2019 05:22:32 +0000 (21:22 -0800)]
Return newly-created value from SpirvRoutine::createIntermediate
All the callers needed to fetch this immediately afterward; save some
effort.
Bug: b/
126475489
Change-Id: I622d30aa955c27df8e12fdf87762c0db96133666
Reviewed-on: https://swiftshader-review.googlesource.com/c/25648
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>
Chris Forbes [Tue, 26 Feb 2019 02:14:42 +0000 (18:14 -0800)]
Implement indexed draws
Adds support for vkBindIndexBuffer and vkDrawIndexed.
There is significant duplication currently between Draw::play and
DrawIndexed::play, but most of it is going to evaporate when we
solve the context stomping problems.
Bug: b/
118619338
Change-Id: If8e9f7b1f11a3c763e73663733697fddd3e1fcac
Reviewed-on: https://swiftshader-review.googlesource.com/c/25508
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Alexis Hetu [Fri, 15 Feb 2019 19:56:22 +0000 (14:56 -0500)]
Descriptor sets binding
This cl partially implements vkCmdBindDescriptorSets. It allows
binding descriptor sets to the proper pipeline bind point and
descriptor set binding location. Dynamic offsets are not yet
supported.
Bug b/
123244275 b/
118619338
Change-Id: I91b14b79cb6cf00a4fabb6962938e7f55d5b6c22
Reviewed-on: https://swiftshader-review.googlesource.com/c/24909
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Tue, 26 Feb 2019 22:03:00 +0000 (17:03 -0500)]
Simple PipelineBarrier implementation
The simplest PipelineBarrier implementation is to call Renderer::synchronize().
This removes the synchronization mechanism from the draw commands, while still
allowing the tests to pass successfully.
Bug b/
118619338
Change-Id: If7d9c14170db6f9a74a54c45a978d3ce78a1cdca
Reviewed-on: https://swiftshader-review.googlesource.com/c/25608
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Logan Chien [Tue, 26 Feb 2019 05:39:52 +0000 (13:39 +0800)]
Fix REACTOR_USE_SUBZERO flag
This commit fixes REACTOR_USE_SUBZERO flag. The commit
fde88d96a5 sets
REACTOR_USE_SUBZERO to `false` to disable the SubZero backend. However,
other Android.mk uses `ifdef` to check whether the SubZero backend is
enabled. As a result, the SubZero backend is always selected because
both `REACTOR_USE_SUBZERO := true` and `REACTOR_USE_SUBZERO := false`
are considered as defined.
This commit replaces `ifdef REACTOR_USE_SUBZERO` with
`ifeq ($(REACTOR_USE_SUBZERO),true)` to fix the problem.
Bug: b/
115344057
Test: Build libEGL_swiftshader and libGLES_swiftshader for Android
Change-Id: I83f2dc5018857c630a71a1b7eae636983283783a
Reviewed-on: https://swiftshader-review.googlesource.com/c/25528
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Cody Schuffelen <schuffelen@google.com>
Tested-by: Logan Chien <loganchien@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Thu, 14 Feb 2019 18:43:22 +0000 (18:43 +0000)]
Add Print helpers to reactor
New tools for debugging JITed code.
rr::Print() is a new function that emits a call to printf() using the provided message and optional values. There is also an overload that accepts additional file, line, and function parameters to help identify the call site.
Format values passed to rr::Print() are implicity cast to a new rr::PrintValues type which does the work of dispatching the value type to the correct printf() format specifier(s) and argument value(s). A single rr::Print() format value can automatically be expanded into multiple printf values - for example an rr::Float4 will expand to "%f %f %f %f" and four scalar float values.
rr::Print() format values can be any of the following types:
* Reactor LValues, RValues, Pointers.
* Standard Plain-Old-Value types (int, float, bool, etc)
* Custom types that specialize the PrintValue::Ty template struct.
* Static arrays in the form T[N] where T can be any of the above.
The sw::Vector4f and sw::Vector4s types have already had custom formatters written.
These new functions and types described above are typically not called directly. Instead there are two helper macros which simplifies usage:
RR_LOG() is a new macro that wraps rr::Print(), automatically populating the function, file and line parameters and appending a newline to the string.
RR_WATCH() is a new helper macro that prints the name and value of all the supplied arguments. For example, if you had the Int and bool variables 'foo' and 'bar' that you want to print, you can simply write:
RR_WATCH(foo, bar)
When this JIT compiled code is executed, it will print:
"foo: 1, bar: true"
All of this code is disabled in non-debug builds, or if the reactor backend is not LLVM 7+.
Change-Id: Ia39b1e507b6afaa3bb1d33e40b1333017f4b4f21
Reviewed-on: https://swiftshader-review.googlesource.com/c/24768
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Alexis Hetu [Tue, 26 Feb 2019 22:11:23 +0000 (17:11 -0500)]
VS build fix
Change-Id: I7e6589870b539e775371e8941a07a48ca9e0cad7
Reviewed-on: https://swiftshader-review.googlesource.com/c/25628
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Mon, 25 Feb 2019 21:35:59 +0000 (13:35 -0800)]
Fix point rendering
- Point size limits were left at [0,0], forcing all points to zero coverage.
Introduce a config value for the maximum, and plumb this through to drive
physical device limits query.
- Fix all interpolants being replaced with pointcoord
Bug: b/
124177079
Change-Id: I281dd3214537f15858afbd3890cf70f8850fa4aa
Reviewed-on: https://swiftshader-review.googlesource.com/c/25489
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Mon, 25 Feb 2019 21:34:59 +0000 (13:34 -0800)]
OpAccessChain: Remove pointer walking inside loop
This cannot occur. The initial stripping of <base>'s pointer type is
already handled outside the loop.
Bug: b/
124388146
Change-Id: I55ea64e868308bfbab72aaefca0fd367916f6e69
Reviewed-on: https://swiftshader-review.googlesource.com/c/25488
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Alexis Hetu [Tue, 26 Feb 2019 19:42:36 +0000 (14:42 -0500)]
Replace uses of sw::Surface with vk::ImageView in the Renderer
sw::Surface contains a locking mechanism which is no longer required
in Vulkan. The app is now responsible for making sure the lifetime of
the objects is long enough for the driver to be able to use them in
any operation where they are required.
A few shortcuts were taken here:
- ImageView::getSampleCount() currently always returns the largest
available sample count.
- ImageView::subresourceRange.levelCount is not taken into account
- Context::getMultiSampleCount() still uses attachment 0 to get
the samples count, which may be incorrect.
Bug b/
118619338
Change-Id: I8cd49926a1537c0f2bc20e6516f12d7de67d6c65
Reviewed-on: https://swiftshader-review.googlesource.com/c/25588
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sat, 23 Feb 2019 01:21:23 +0000 (17:21 -0800)]
Fix various issues in vertex fetch setup
There are still some minor sins in here -- we should really unfuse
attributes from buffers completely -- but this is enough to have vertex
fetch work for all per-vertex attribute scenarios.
Bug: b/
124177079
Change-Id: I2a7a1a6f049aa80c1a527e9fa9643bb33701d165
Reviewed-on: https://swiftshader-review.googlesource.com/c/25448
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Nicolas Capens [Tue, 26 Feb 2019 15:47:20 +0000 (10:47 -0500)]
Fix fuzzer build
VertexProcessor multiSampling state was eliminated.
Change-Id: I0507c80faff9e00b36d26ea96e3bc3a8e837d574
Reviewed-on: https://swiftshader-review.googlesource.com/c/25569
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Fri, 15 Feb 2019 19:41:03 +0000 (14:41 -0500)]
Work around x86-64 calling convention bug
Microsoft's x86-64 calling convention ABI requires registers XMM6-15 to
be preserved by the callee:
https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2017#calling-convention-defaults
Currently only the System V calling convention's behavior is supported,
which does not have any callee-saved XMM registers.
Fixing this properly is non-trivial and this bug is blocking other
projects, so a temporary workaround is to limit Subzero to use only
scratch registers XMM0-XMM5.
Bug chromium:931926
Bug swiftshader:22
Change-Id: If3fde2295fc65fc52042124afe7dfc46873cce3f
Reviewed-on: https://swiftshader-review.googlesource.com/c/25568
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Ben Clayton [Mon, 25 Feb 2019 11:54:43 +0000 (11:54 +0000)]
SpirvShader: Decouple SPIR-V type attributes from object representation
StorageClass, sizeInComponents, isBuiltInBlock are all attributes of the Type, not the Object.
Add 'type' field to Object so type information can easily be looked up regardless of definition opcode.
Add 'element' field to Type, simplifying the likes of WalkAccessChain.
Fixes the weird edge case of OpVariable's sizeInComponents being the size of the pointee, not its type (the pointer).
Bug: b/
126126820
Change-Id: I2d1d93e03ee0253a87f831031c3b2806b1d80de0
Reviewed-on: https://swiftshader-review.googlesource.com/c/25408
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Wed, 20 Feb 2019 14:36:27 +0000 (14:36 +0000)]
Strongly type object / type identifiers.
Prevents you from mixing them up by mistake, and provides better self-documentation on function signatures.
Bug: b/
126126820
Change-Id: I21ce20ded434ca3d5d03ebf3f9027cf6f6b5386f
Reviewed-on: https://swiftshader-review.googlesource.com/c/25068
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Chris Forbes [Fri, 22 Feb 2019 21:43:46 +0000 (13:43 -0800)]
Remove VertexProcessor::multisampling state bit
The vertex processor doesn't need to know.
V3: also remove from GL side, which didn't use it either.
Change-Id: Id0624fb2700222be6238a8449b32b334755a45e7
Reviewed-on: https://swiftshader-review.googlesource.com/c/25332
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Hernan Liatis [Mon, 25 Feb 2019 23:50:26 +0000 (15:50 -0800)]
Wrong macro being #undef'd in VkGetProcAddress
MAKE_VULKAN_INSTANCE_ENTRY never got undefined
Bug: b/
125417927
Change-Id: I0fd5d8054748ff6279a65a5086e9a717441e583f
Reviewed-on: https://swiftshader-review.googlesource.com/c/25469
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
Hernan Liatis [Sat, 23 Feb 2019 01:46:19 +0000 (17:46 -0800)]
Fix minor issue in vkCreateInstance extension loop
Extension checking in vkCreateInstance would simply
loop through the first extension requested. This
bug did not show up earlier (or at all) because
erroneous situations would cause early exits in
the loader.
Bug: b/
125943360
Change-Id: Id664f46d09dce1b3530670ae826314b26797b5be
Reviewed-on: https://swiftshader-review.googlesource.com/c/25368
Tested-by: Hernan Liatis <hliatis@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Fri, 15 Feb 2019 21:41:12 +0000 (16:41 -0500)]
PipelineLayout implementation
Initial basic implementation of PipelineLayout. The information
stored in the PipelineLayout will be used, among other things,
to properly bind descriptor sets affected by a dynamic offset.
Bug b/
118386749
Change-Id: I05fa6f9c7740cf79a802a5276e2d88f6e6e4ebe7
Reviewed-on: https://swiftshader-review.googlesource.com/c/24948
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sat, 23 Feb 2019 01:39:57 +0000 (17:39 -0800)]
Suppress warnings for more instructions that require no work
Change-Id: Iacb323b4cc0c0b0373791b3aa3a5f0b4dcaffa44
Reviewed-on: https://swiftshader-review.googlesource.com/c/25428
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Alexis Hetu [Wed, 20 Feb 2019 22:02:14 +0000 (17:02 -0500)]
Assert there are no unmatched eglBindTexImage/eglReleaseTexImage
Two consecutive eglBindTexImage calls on the same buffer (texture)
would eventually result in a crash if the texture is released before
the egl surfaces, so this assert is meant to perform an early
detection of a harder to detect future issue.
Bug chromium:932986 chromium:929088
Change-Id: I10b3892fe06d491c8a0a09dec84678b25f49c6ab
Reviewed-on: https://swiftshader-review.googlesource.com/c/25128
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Thu, 7 Feb 2019 18:13:16 +0000 (18:13 +0000)]
Fix CMake build documentation
4c9f04bbebc added the build directory, so drop the docs for `mkdir`.
Change-Id: Idc7437c0c72666f2c115bb0ddbd753a3179dba79
Reviewed-on: https://swiftshader-review.googlesource.com/c/24508
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Fri, 22 Feb 2019 21:39:52 +0000 (13:39 -0800)]
Remove remnants of non-descriptor UBO support
All vulkan resource access will be through descriptors. We don't need
any of this context-side state.
Bug: b/
125909515
Change-Id: Id6d1da0f8a851e057dd3a16fc844b6a70cf9b935
Reviewed-on: https://swiftshader-review.googlesource.com/c/25330
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Fri, 22 Feb 2019 21:35:21 +0000 (13:35 -0800)]
Remove remnants of GL-style user clip planes
Vulkan doesn't have user clip planes in the legacy GL sense -- there is
an optional feature to supply GLSL1.30-style clip distances out of the
vertex shader, but the actual plane handling is the shader's problem.
We also don't support this optional feature.
Bug: b/
125909515
Change-Id: I6dfc3eda613982112786a52517d1cd126146c590
Reviewed-on: https://swiftshader-review.googlesource.com/c/25329
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Fri, 22 Feb 2019 21:31:32 +0000 (13:31 -0800)]
Remove transform feedback remnants
Bug: b/
125909515
Change-Id: I18f1ed398d85a914863f4b93a2795637e20028b6
Reviewed-on: https://swiftshader-review.googlesource.com/c/25328
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Thu, 21 Feb 2019 22:58:28 +0000 (14:58 -0800)]
Set render targets correctly when drawing
There are some horrible hacks in here -- the draw command should not be
doing anywhere near this much work -- but this gets us to first
triangle.
Passes: dEQP-VK.api.smoke.triangle
Bug: b/
124177079
Change-Id: I4240cb8cdce2f4bbb804e88e66d1695ab0b0e41e
Reviewed-on: https://swiftshader-review.googlesource.com/c/25212
Tested-by: 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>
Chris Forbes [Fri, 22 Feb 2019 17:45:06 +0000 (09:45 -0800)]
Wire up cull mode handling to Vulkan pipeline
Bug: b/
124177079
Change-Id: I8e55607c8ff7f9c2d2356268bedf170cf27eeb99
Reviewed-on: https://swiftshader-review.googlesource.com/c/25268
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Ben Clayton [Thu, 21 Feb 2019 15:55:54 +0000 (15:55 +0000)]
Kokoro: Run unit tests.
Change-Id: I88d914d9aa30291e938b65519ebfecb577c5d33e
Reviewed-on: https://swiftshader-review.googlesource.com/c/25170
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Raymond Chiu <chiur@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Chris Forbes [Fri, 22 Feb 2019 00:49:51 +0000 (16:49 -0800)]
Silence emit-time warnings for many instructions
These instructions don't require any work in the emit phase.
Change-Id: I1f82e785afe9a3e3871637349fca3eac3435ab6c
Reviewed-on: https://swiftshader-review.googlesource.com/c/25189
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Chris Forbes [Fri, 22 Feb 2019 17:43:30 +0000 (09:43 -0800)]
Remove alpha test plumbing
Vulkan does not have alpha test. Apps are expected to use discard in the
shader instead.
Change-Id: Idc1d8d2a74f5728cf70c653a5139a0ca1674ca37
Reviewed-on: https://swiftshader-review.googlesource.com/c/25211
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Thu, 21 Feb 2019 18:20:26 +0000 (10:20 -0800)]
Restore vertex fetch state update from context -> state
This is required to have the vertex fetch state actually available at
JIT time.
Bug: b/
124177079
Change-Id: Ibb548c372ee349d3a5312bb46dddcf13257dc294
Reviewed-on: https://swiftshader-review.googlesource.com/c/25188
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Chris Forbes [Wed, 20 Feb 2019 21:00:54 +0000 (13:00 -0800)]
Implement proper handling of constants
Previously we had only supported simple integer constants, as that was
enough to parse array declarations etc. Fully implement constants,
including large null objects, and constant composites constructed out
of other constants.
Bug: b/
124934655
Change-Id: Ia1087f62a2bd75a3ca2f784ea24b0b3f01984ad9
Reviewed-on: https://swiftshader-review.googlesource.com/c/25148
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Tue, 19 Feb 2019 17:08:56 +0000 (17:08 +0000)]
Add CMake flag to treat warnings as errors
Disabled by default by the request of Nicolas.
Bug: b/
123933266
Change-Id: Ie1217dc6c96ec85c9daf8246de785c8729386634
Reviewed-on: https://swiftshader-review.googlesource.com/c/25015
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Hernan Liatis [Thu, 21 Feb 2019 21:46:36 +0000 (13:46 -0800)]
vkGetDescriptorSetLayoutSupportKHR listed wrong
The above function, while listed with the device
functions, was using MAKE_VULKAN_INSTANCE_ENTRY()
instead of MAKE_VULKAN_DEVICE_ENTRY()
Bug: b/
125417927
Change-Id: I66865468f50b2db3f6904fab40f79db3346431a2
Reviewed-on: https://swiftshader-review.googlesource.com/c/25209
Kokoro-Presubmit: Hernan Liatis <hliatis@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
Hernan Liatis [Thu, 21 Feb 2019 20:57:52 +0000 (12:57 -0800)]
Update ICD version to 3.0
Needed to call VkCreateXXXSurfaceKHR() functions,
where XXX is the platform name.
Bug: b/
125405086
Change-Id: Id0de2ee02bd3b7d5b37eda202fb26e4ad3265bf3
Reviewed-on: https://swiftshader-review.googlesource.com/c/25208
Kokoro-Presubmit: Hernan Liatis <hliatis@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
Ben Clayton [Tue, 12 Feb 2019 11:24:29 +0000 (11:24 +0000)]
GLES: Fix race in Renderer destruction
The clipper and blitter were being destructed before the worker threads were stopped.
Also nullify after deleting other fields - this would have been much harder to detect if the clipper and blitter were not already being nullified after destruction.
Tested with:
./unittests --gtest_repeat=100 --gtest_filter=SwiftShaderTest.TransformFeedback_DrawArraysInstanced
Bug: b/
124288179
Change-Id: Iefea829dfb8556c877c0a086253c5924c54aa638
Reviewed-on: https://swiftshader-review.googlesource.com/c/24748
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Tue, 19 Feb 2019 17:08:14 +0000 (17:08 +0000)]
Silence warnings: Ignore pedantic warnings with compiler flags
Addressing this one toolchain at a time, as not all warning names are the same across toolchains.
Bug: b/
123933266
Change-Id: I618ebafb5ff18a885c71a8e2fa1943befc6786b6
Reviewed-on: https://swiftshader-review.googlesource.com/c/25014
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Thu, 21 Feb 2019 11:05:27 +0000 (11:05 +0000)]
GLES: Fix OOB access of labelBlock.
This was being incorrectly sized by the number of functions, not the highest label in use.
While investigating this, I've realized that the sanity checks to ensure there are no dead functions was never going to fire as the function list was built from the list of called functions. Instead I've changed the function scanning pass to look for labels starting a LABEL-RET pair.
Bug: b/
125183107
Change-Id: Ic921097ed42a96b52f1ab7c9590c02fb3552b565
Reviewed-on: https://swiftshader-review.googlesource.com/c/25168
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Ben Clayton [Thu, 21 Feb 2019 12:37:53 +0000 (12:37 +0000)]
GLES: Add tests to exersise sparse labels.
Reproduces the issues reported by b/
125183107.
Bug: b/
125183107
Change-Id: If0f2ab3fcc8c065409fdbbc6df670f78a78fa3f7
Reviewed-on: https://swiftshader-review.googlesource.com/c/25169
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Chris Forbes [Wed, 20 Feb 2019 01:19:48 +0000 (17:19 -0800)]
Connect fragment shader outputs to raster operations stage
Bug: b/
124177079
Change-Id: I0dbcd154c2a28c43d9895e264cc794fc2ed289f2
Reviewed-on: https://swiftshader-review.googlesource.com/c/25029
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Wed, 20 Feb 2019 01:01:28 +0000 (17:01 -0800)]
Add epilog pass to copy outputs out to pipeline
Bug: b/
124177079
Change-Id: I1779ed78ccfdb6c77bcf55ba109ae93fc75171ff
Reviewed-on: https://swiftshader-review.googlesource.com/c/24989
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>
Chris Forbes [Wed, 20 Feb 2019 01:41:41 +0000 (17:41 -0800)]
Fix WalkAccessChain to actually walk type tree properly
This was completely broken -- we weren't walking down the type tree at
all.
Bug: b/
124388146
Change-Id: I359d121403c3413e74427fadf57fd4c3d52f7661
Reviewed-on: https://swiftshader-review.googlesource.com/c/25088
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>
Chris Forbes [Wed, 20 Feb 2019 00:40:57 +0000 (16:40 -0800)]
Remove needless unique_ptr wrapping from inputs/outputs
Bug: b/
124534397
Change-Id: Icfe0d83b0e8df648c90ba7f250924ad28dd06b55
Reviewed-on: https://swiftshader-review.googlesource.com/c/25108
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Sat, 16 Feb 2019 00:00:08 +0000 (16:00 -0800)]
Separate intermediate values from lvalues
The vast majority of values in a SPIRV program are intermediates -- they
are guaranteed written to exactly once, by the instruction which defines
them.
Initially we had treated these the same as mutable (stack) variables, but
that produces wasteful code full of loads and stores.
Instead, represent intermediate values as a bundle of RValue<Float4>,
representing an rvalue float-sized value per SIMD lane. Introduce the
new type Intermediate to hold these bundles to allow incremental
construction of the individual RValue<Float4> objects within the bundle.
Bug: b/
124534397
Change-Id: Ibb663773100d017de117111705b530b092f87ea2
Reviewed-on: https://swiftshader-review.googlesource.com/c/24968
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Wed, 20 Feb 2019 10:22:09 +0000 (10:22 +0000)]
SpirvShader: Split objects from types.
Change-Id: Ifbcb30da30b912a1a60f5799717869c8d56cd90b
Reviewed-on: https://swiftshader-review.googlesource.com/c/25018
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Wed, 20 Feb 2019 08:53:50 +0000 (08:53 +0000)]
Silence warnings: Add override to overriden virtual functions
Bug: b/
123933266
Change-Id: I3e5f028ab323f361840a6326a1b7834995e8b8e3
Reviewed-on: https://swiftshader-review.googlesource.com/c/25017
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Tue, 19 Feb 2019 17:06:30 +0000 (17:06 +0000)]
Silence warnings: Remove bit-packing of Vulkan state
This produces a non-silenceable warning about enum fields being too small to store all enum values.
Nicolas agreed we can just drop the bitpacking for vulkan state.
Bug: b/
123933266
Change-Id: Idf09be3ef122fca70da8d877a211368b7fd8a995
Reviewed-on: https://swiftshader-review.googlesource.com/c/25013
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Nico Weber [Wed, 20 Feb 2019 14:23:05 +0000 (09:23 -0500)]
swiftshader: Remove semicolons.
Bug: chromium:926235
Change-Id: I9d5a28e1dd2ee6619ee0fefcd9f3798ca22be45b
Reviewed-on: https://swiftshader-review.googlesource.com/c/25048
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Nico Weber <thakis@chromium.org>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Tue, 19 Feb 2019 16:50:48 +0000 (16:50 +0000)]
Silence warnings: Remove all unused local variables
Bug: b/
123933266
Change-Id: If8fa478aa65f5c0046ca635a8d133911f8a59977
Reviewed-on: https://swiftshader-review.googlesource.com/c/25010
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Tue, 19 Feb 2019 17:04:37 +0000 (17:04 +0000)]
Fix mismatch of enum types in equality test
Lost in the noise of other warnings
Bug: b/
123933266
Change-Id: I4c4eecb55a364c9afacf52b790f43f9d5c9640cb
Reviewed-on: https://swiftshader-review.googlesource.com/c/25012
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Tue, 19 Feb 2019 16:39:36 +0000 (16:39 +0000)]
Silence warnings: Add default cases to partial enum switches.
Fixes warnings about switch statements not handling all enum values.
Bug: b/
123933266
Change-Id: I0372ebf2412452622eb99ea7bba7ebc5cedd385c
Reviewed-on: https://swiftshader-review.googlesource.com/c/25009
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Tue, 12 Feb 2019 09:38:02 +0000 (09:38 +0000)]
GLES: Add unit tests for compile time limits
Compiles and links shaders that perform deep nesting of control blocks and calls.
Bug: b/
123587120
Change-Id: I8f19611cbe6d36990ad368a600d2d5be20b1ea07
Reviewed-on: https://swiftshader-review.googlesource.com/c/24728
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Ben Clayton [Tue, 19 Feb 2019 18:50:29 +0000 (18:50 +0000)]
Remove sw::BoundedIndex
Not longer needed after https://swiftshader-review.googlesource.com/c/SwiftShader/+/24668
Change-Id: Ib345e5f288123387d44d230438da899120be830a
Reviewed-on: https://swiftshader-review.googlesource.com/c/25016
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Ben Clayton [Mon, 11 Feb 2019 20:59:19 +0000 (20:59 +0000)]
GLES: Remove hardcoded shader limits
Perform whole-shader analysis to determine usage limits.
Use these limits to allocate compile time and runtime arrays.
Removes the constants:
MAX_SHADER_NESTED_LOOPS
MAX_SHADER_NESTED_IFS
MAX_SHADER_CALL_STACK_SIZE
Also switched to using dynamic containers to remove the MAX_SHADER_CALL_SITES limit, which I believe to have been buggy and broken.
Bug: b/
123587120
Change-Id: I89be80072183ac2aac28124df236888309e7207c
Reviewed-on: https://swiftshader-review.googlesource.com/c/24668
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Chris Forbes [Sat, 16 Feb 2019 00:39:17 +0000 (16:39 -0800)]
Accumulate compile-time constant and runtime offsets separately
This makes WalkAccessChain slightly easier on the backend -- there is
less constant folding to do.
Bug: b/
124388146
Change-Id: I4e76c3e494278e1399b8a86134b652c2a6d96d8c
Reviewed-on: https://swiftshader-review.googlesource.com/c/24988
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Ben Clayton [Thu, 14 Feb 2019 19:31:30 +0000 (19:31 +0000)]
GLES: Fix for crashes when sampling certain textures.
There was an optimization that skipped a [0, 1] clamp for a particular sampling mode as it assumed
the input coordinates were always within these bounds.
However, if the texture sample coordinates were inf or NaN, this assumption broke, causing the
returned address to be outside the bounds of the image data.
Bug: b/
123731195
Bug: b/
124368982
Change-Id: I0af34ee4c2792b19081d9270fd0b1e0d0559287e
Reviewed-on: https://swiftshader-review.googlesource.com/c/24868
Reviewed-by: 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>
Ben Clayton [Tue, 19 Feb 2019 11:42:31 +0000 (11:42 +0000)]
vkCmdBlitImage: Make a copy of the VkImageBlit structure
Don't hold a pointer to the structure - there's no guarantees it'll still be vaild by command buffer execution time.
Fixes flakiness of the dEQP-VK.memory.pipeline_barrier.transfer_dst_storage_image.* tests
Bug: b/
124729778
Change-Id: I747512b1a34c5d4d7dff227b15b08c69d07b298d
Reviewed-on: https://swiftshader-review.googlesource.com/c/25008
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Alexis Hetu [Fri, 15 Feb 2019 19:42:38 +0000 (14:42 -0500)]
vkGetRenderAreaGranularity implementation
There's no reason to have any limitation on granularity in
SwiftShader, so the granularity is always 1 pixel.
Passes all tests in:
dEQP-VK.api.granularity
Bug b/
119620965
Change-Id: Ie2f09737c0054da1b6806b9572e515446a8b1263
Reviewed-on: https://swiftshader-review.googlesource.com/c/24890
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Fri, 15 Feb 2019 20:56:14 +0000 (15:56 -0500)]
Prevent Pipeline crashing on missing non mandatory structures
When constructing a Graphics pipeline, some structures may or may
not exist, depending on what will be used by the render pass. These
structures (viewportState, multisampleState, depthStencilState and
colorBlendState) are now checked before being used, since it is
allowed for these to be null.
Bug b/
118386749
Change-Id: If2759ae2554a98143b30e70624a0dc8d88c5bd43
Reviewed-on: https://swiftshader-review.googlesource.com/c/24911
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Wed, 13 Feb 2019 20:24:35 +0000 (12:24 -0800)]
Support loads and stores of interface variables
Bug: b/
124388146
Change-Id: I2c422dc2f85730f4c4bef45388e77028465ea9ba
Reviewed-on: https://swiftshader-review.googlesource.com/c/24828
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>
Chris Forbes [Tue, 12 Feb 2019 20:38:26 +0000 (20:38 +0000)]
Add SpirvRoutine::getValue helper
- Provides a point to complain if something is not yet defined.
- Allows avoiding ugly syntax from use of unique_ptr
Bug: b/
124388146
Change-Id: Ib55023fff5c90b71a41c5f558544be65250bb67d
Reviewed-on: https://swiftshader-review.googlesource.com/c/24791
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Chris Forbes [Tue, 12 Feb 2019 20:10:05 +0000 (20:10 +0000)]
Implement some common forms of OpAccessChain
Bug: b/
124388146
Change-Id: I948ad5607c1e41be920006aaa4b7d18d210af4a3
Reviewed-on: https://swiftshader-review.googlesource.com/c/24790
Tested-by: 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>
Chris Forbes [Tue, 12 Feb 2019 18:56:38 +0000 (18:56 +0000)]
Implement some common forms of OpStore
Bug: b/
124388146
Change-Id: Ia3c4e6c81432dcfbca5bdd21c857108ee14bda9b
Reviewed-on: https://swiftshader-review.googlesource.com/c/24788
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Mon, 11 Feb 2019 00:20:16 +0000 (00:20 +0000)]
Implement some common forms of OpLoad
Bug: b/
124388146
Change-Id: I79b4c3bc59631332f4748394a166612ad5d975de
Reviewed-on: https://swiftshader-review.googlesource.com/c/24600
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Wed, 13 Feb 2019 19:45:27 +0000 (11:45 -0800)]
Templatize PopulateInterface & friends
I need to also walk interface objects in shader prolog & epilog; will
reuse this logic.
Bug: b/
124388146
Change-Id: Ida735f58aa1bc36d83e4a6ea3c16925a9c5656b0
Reviewed-on: https://swiftshader-review.googlesource.com/c/24808
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Tue, 12 Feb 2019 19:24:50 +0000 (19:24 +0000)]
Split out decoration application helpers to avoid some iterator noise
Bug: b/
124388146
Change-Id: I17531e47fc6fc4b296f893f94beb75f471847fd3
Reviewed-on: https://swiftshader-review.googlesource.com/c/24789
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Sun, 10 Feb 2019 23:03:12 +0000 (23:03 +0000)]
Fix handling of pointer sizes; we want them to be 1
Bug: b/
124388146
Change-Id: Id528368106eb0d09930ff4fccbe94704b585a531
Reviewed-on: https://swiftshader-review.googlesource.com/c/24599
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sun, 10 Feb 2019 22:42:42 +0000 (22:42 +0000)]
Add analysis pass support for OpLoad and OpAccessChain
These are our first instructions which yield ssavalues.
For OpAccessChain, also track the base pointer (which we always know at
compile time, until we do full variable pointers support).
The value representation for OpAccessChain's result has two parts:
- per-lane Int offset into whatever the thing is
- shared (and statically known) base reference.
Bug: b/
124388146
Change-Id: I364375719b6e396b802de06093454c8f0e76adb6
Reviewed-on: https://swiftshader-review.googlesource.com/c/24598
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sun, 10 Feb 2019 22:41:21 +0000 (22:41 +0000)]
Handle more instructions in spirv analysis pass
Most of these are "we know we can just ignore this instruction", but
also sanity check for the lowering passes applied before this -- if any
of those instructions remain, then we're very likely to do the wrong
thing.
Bug: b/
124388146
Change-Id: I3f8f66121f57f20cc93abdbd26c575baf03d9c94
Reviewed-on: https://swiftshader-review.googlesource.com/c/24597
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sun, 10 Feb 2019 22:09:15 +0000 (22:09 +0000)]
Remove more obsolete machinery from PixelProcessor
Bug: b/
124177079
Change-Id: Ibe657d802c38b84bf2017a8aeaf38f887910bc60
Reviewed-on: https://swiftshader-review.googlesource.com/c/24596
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sun, 10 Feb 2019 22:04:56 +0000 (22:04 +0000)]
Remove depthOverride pixel state bit
This can be queried directly from the shader
Bug: b/
124177079
Change-Id: I08aac7f77fb59f005295de3d417d24bf61fb3906
Reviewed-on: https://swiftshader-review.googlesource.com/c/24595
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sun, 10 Feb 2019 21:26:27 +0000 (21:26 +0000)]
Correctly determine whether we need to compute centroids
Bug: b/
124177079
Change-Id: I20132ffd5f73c19715393740c27f77e71a3c3c88
Reviewed-on: https://swiftshader-review.googlesource.com/c/24594
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Sun, 10 Feb 2019 21:03:00 +0000 (21:03 +0000)]
Wire up FS input to the shader
Bug: b/
124177079
Change-Id: I8dac28d2c55ce1c4eb9a815bfad56ba917be32c5
Reviewed-on: https://swiftshader-review.googlesource.com/c/24593
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Sun, 10 Feb 2019 20:58:46 +0000 (20:58 +0000)]
Remove VertexProcessor shader constants mechanism
Bug: b/
124177079
Change-Id: I5293ed6c564219f7a47baea7b62240b3104bd1f9
Reviewed-on: https://swiftshader-review.googlesource.com/c/24592
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Sun, 10 Feb 2019 20:18:50 +0000 (20:18 +0000)]
Wire VS interfaces onto spirv shader
Bug: b/
124177079
Change-Id: Idd7ae86fc2d4e79a8d4b8e395eb0e547a0ba6470
Reviewed-on: https://swiftshader-review.googlesource.com/c/24591
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Sun, 10 Feb 2019 19:52:08 +0000 (19:52 +0000)]
Set up VertexIndex builtin properly
Bug: b/
124177079
Change-Id: Ie51c9e8865f12583ece35a1d1d6c558d2ed1281b
Reviewed-on: https://swiftshader-review.googlesource.com/c/24590
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>
Chris Forbes [Sun, 10 Feb 2019 19:39:49 +0000 (19:39 +0000)]
Do initial integration of spirv code generation with FS
Very incomplete, but let's at least call the right things
Bug: b/
124177079
Change-Id: I0592460f4be3327bdb8290a16739c5c7dfca19be
Reviewed-on: https://swiftshader-review.googlesource.com/c/24589
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>
Chris Forbes [Sun, 10 Feb 2019 19:21:59 +0000 (19:21 +0000)]
Remove various legacy parts of FS plumbing
Vulkan has no purpose for this
Bug: b/
124177079
Change-Id: If2a3c824fac2645386091f6104c89a079f242d22
Reviewed-on: https://swiftshader-review.googlesource.com/c/24588
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>
Chris Forbes [Sat, 2 Feb 2019 23:23:01 +0000 (15:23 -0800)]
Rework setup, VS->FS structures, etc for Vulkan
- Remnants of old fixed function attributes all gone
- Initial support for some builtins to prove the model
- Setup now driven by correct shader state
- VS->FS intermediate structure matches SPIRV model -- builtins are not
in location space; location space itself is flat scalars rather than
vec4-oriented.
There are still some vertex pipe features which are not supported, as
ES3 didn't have them -- proper handling of noperspective, etc.
Change-Id: Ia8e3c72af54c4d1cbcc18482a741daa5e8e7c053
Bug: b/
120799499
Reviewed-on: https://swiftshader-review.googlesource.com/c/24376
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
Chris Forbes [Sat, 2 Feb 2019 23:18:52 +0000 (15:18 -0800)]
Start building up code generation
- Introduce (perhaps poorly named) SpirvRoutine type for
routine-emit-time state (reactor objects).
- Add SpirvShader::emitEarly (intended for definitions that are needed
in shader preamble) and SpirvShader::emit (intended for general actual
code generation) passes.
- Wire up new passes to VertexProgram/VertexRoutine
Change-Id: Iac42eae7dc04adfd4163fd74ba407b613551d14e
Bug: b/
120799499
Reviewed-on: https://swiftshader-review.googlesource.com/c/24375
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>
Hernan Liatis [Fri, 8 Feb 2019 22:08:21 +0000 (14:08 -0800)]
Allow creation of VkInstances that support Xlib surfaces
Bug: b/
124265819
Change-Id: I4a1d32e38219171c7b9094335af9a6deef7f8dd8
Reviewed-on: https://swiftshader-review.googlesource.com/c/24568
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Hernan Liatis <hliatis@google.com>
Nicolas Capens [Tue, 12 Feb 2019 05:32:31 +0000 (00:32 -0500)]
Replace vulkan.h includes with vulkan_core.h
vulkan_core.h only includes 'core' Vulkan declarations, while vulkan.h
consists of vulkan_core.h plus platform-specific headers.
Only Window System Integration (WSI) and closely related source files
should have a need to include vulkan.h. Everything else, in particular
our back-end, should not require anything Vulkan platform-specific.
This avoids issues such as Xlib defining global macros which clash with
C++ type and variable names.
Bug b/
124265819
Change-Id: I6c250f27aef39b98a2a8b677c169df060698f104
Reviewed-on: https://swiftshader-review.googlesource.com/c/24709
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Tue, 12 Feb 2019 05:09:23 +0000 (00:09 -0500)]
Fix Visual Studio build.
SPIRV-Tools include directory was missing, and all projects should link
using the static runtime library.
Bug b/
123642959
Change-Id: I8ab915270115c810a91ff013d56a5bbb0a01d4a1
Reviewed-on: https://swiftshader-review.googlesource.com/c/24708
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Mon, 11 Feb 2019 21:02:23 +0000 (16:02 -0500)]
Remove shader call stack bounding
The root cause of a shader call stack overflow was fixed in
https://swiftshader-review.googlesource.com/c/SwiftShader/+/24628
All shaders should now be validated not to exceed our call stack size
before reaching this lowering stage of compilation. Thus the run-time
checks can be removed.
This partially reverts
https://swiftshader-review.googlesource.com/c/SwiftShader/+/23568
Bug b/
123587120
Change-Id: I04fc2613da7526992dd52c323deca8d9ad2c30c0
Reviewed-on: https://swiftshader-review.googlesource.com/c/24648
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Nicolas Capens [Mon, 11 Feb 2019 19:27:55 +0000 (14:27 -0500)]
Fix shader call stack size mismatch
https://swiftshader-review.googlesource.com/c/SwiftShader/+/16328
increased the maximum call depth validated by the GLSL ES compiler,
without increasing the stack size supported by our back-end.
The sw::MAX_SHADER_CALL_STACK_SIZE of the back-end is now statically
passed to an es2::MAX_SHADER_CALL_STACK_SIZE (has to remain equal or
smaller) and then passed to the GLSL compiler's resources limits.
Bug b/
123587120
Change-Id: I9a56d5b4e980dc0881c238669d2b786bb3c855e3
Reviewed-on: https://swiftshader-review.googlesource.com/c/24628
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Thu, 31 Jan 2019 15:54:05 +0000 (07:54 -0800)]
Use spirv-tools optimizer in GraphicsPipeline
Run some optimization passes before lowering the code, to allow for a
simpler compiler.
Current passes:
- Exhaustively inline functions
- Apply and freeze specialization constants
I expect this set of passes will change somewhat as the
compiler evolves. We may want to stop inlining at some point.
Bug: b/
124058197
Bug: b/
124056625
Change-Id: Ib2a3dc2d2599449d45ac7ebb1de107deba8eb2c3
Reviewed-on: https://swiftshader-review.googlesource.com/c/24288
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Chris Forbes [Thu, 27 Dec 2018 19:50:15 +0000 (11:50 -0800)]
Replace Shader,VertexShader,PixelShader with SpirvShader
Also deletes tons of fixed-function-centric stuff that will never be
used by the Vulkan backend. Very little of the SPIRV integration
actually does anything interesting yet (we don't generate code) but this
wires on the new shader representation.
Bug: b/
120799499
Change-Id: Ib76e2086113098aebd526a0da461689d4344e8c2
Reviewed-on: https://swiftshader-review.googlesource.com/c/23090
Tested-by: 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>
Chris Forbes [Sat, 29 Dec 2018 00:04:57 +0000 (16:04 -0800)]
Add assert for broken locations
Change-Id: I4750715a635ca3f929ae8d282c6cbaedfd4186f3
Reviewed-on: https://swiftshader-review.googlesource.com/c/23490
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Wed, 6 Feb 2019 11:54:15 +0000 (11:54 +0000)]
CMake: Generate the ICD json file into the output directory
Bug b/
116336664
Change-Id: I1df29a8ef6b2700089ee5cc104b28ed898ccec1b
Reviewed-on: https://swiftshader-review.googlesource.com/c/24470
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Ben Clayton [Wed, 6 Feb 2019 10:28:14 +0000 (10:28 +0000)]
vscode: Rewrite tasks.json
• Update to the latest config version
• Change the build folder to "${workspaceRoot}/build"
• Add option to control cmake build type
• Add new task to push current branch to gerrit
Change-Id: I0465bec244ebc06fd7f0f460f5673ed666077a1d
Reviewed-on: https://swiftshader-review.googlesource.com/c/24468
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
Cody Schuffelen [Thu, 7 Feb 2019 22:31:59 +0000 (14:31 -0800)]
Early exit in es2::Context::drawElements on count=0.
This fixes an issue where es2::Context::drawElements would still try to
read draw data even when there are 0 elements to draw, causing a buffer
overflow on draw data.
This was found by running Android ES3 dEQP under ASAN. The failing tests
are EQP-GLES3.functional.primitive_restart.[begin_restart,
begin_restart_duplicate_restarts, begin_restart_end_restart,
begin_restart_end_restart_duplicate_restarts,
end_restart_duplicate_restarts, duplicate_restarts].*
The crashing dEQP tests cover glDrawElementsInstanced,
glDrawRangeElements, and glDrawElements. These all converge onto
es2::Context::drawElements.
Bug: b/
123716871
Change-Id: I4bca0616eb9f92bf18a3331459f3dcd06b8ac9a9
Signed-off-by: Cody Schuffelen <schuffelen@google.com>
Test: cts-tradefed run commandAndExit cts -m CtsDeqpTestCases --module-arg 'CtsDeqpTestCases:include-filter:dEQP-GLES3.functional.primitive_restart.*'
Reviewed-on: https://swiftshader-review.googlesource.com/c/24548
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Thu, 7 Feb 2019 18:50:10 +0000 (13:50 -0500)]
Update and Fill Buffers
Implemented vkCmdUpdateBuffer and vkCmdFillBuffer.
Passes all tests in:
dEQP-VK.api.fill_and_update_buffer.*
Bug b/
118619338 b/
118383648
Change-Id: I3cf317b4cb766618a54b2550019ac2702c24bfed
Reviewed-on: https://swiftshader-review.googlesource.com/c/24529
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Alexis Hetu [Tue, 22 Jan 2019 22:01:28 +0000 (17:01 -0500)]
Basic DescriptorPool and DescriptorSetLayout implementation
This cl is a minimal implementation of DescriptorPool and
DescriptorSetLayout.
A DescriptorSet itself is just a straight memory pointer.
A DescriptorPool is a memory pool where DescriptorSets are
allocated. The DescriptorPool object itself is little more
than a memory allocator.
A few minor optimizations were made to speed up the default
case:
- The Descriptor pool starts looking for a large enough
memory block at the end of the pool, which should be optimal
if the DescriptorSets are allocated linearly
- When allocating multiple DescriptorSets at once, the pool
first attempts to allocated all of them contiguously. This
prevents looking for free memory blocks multiple times and
once again should be optimal if the DescriptorSets are
allocated linearly
Note: For now, DescriptorSetLayout::GetDescriptorSize() is a
dummy function which always returns the same size for
every Descriptor type. This will be implemented properly
case by case as we add support for new Descriptor types.
Passes all tests in:
dEQP-VK.api.*descriptor*
Bug b/
123244275
Change-Id: I2a2e73396e38dae28b59b77243cd8a366b35c12c
Reviewed-on: https://swiftshader-review.googlesource.com/c/24028
Tested-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Nicolas Capens [Mon, 4 Feb 2019 21:23:25 +0000 (16:23 -0500)]
Add SPIRV-Tools to the Vulkan build.
Bug b/
123642959
Change-Id: I8edc9ac199b2d212b9e563dcc31f9f46757ed596
Reviewed-on: https://swiftshader-review.googlesource.com/c/24351
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Nicolas Capens [Fri, 1 Feb 2019 03:09:03 +0000 (22:09 -0500)]
Add Visual Studio project files for SPIRV-Tools.
SPIRV-Tools comes with CMake build files. Integrating it into our
custom Visual Studio solution requires making the project files that
it generates path independent so that they can be checked into the
repository.
This is achieved by the build/cmake.sh shell script that is intended
to be run from the Git Bash shell. It needs to be re-run when any
CMakeLists.txt file changes.
.gitignore was modified to allow for build files under the build/
directory to be checked in. CMakeFiles/ and CMakeCache.txt are ignored
because they contain absolute paths and aren't necessary for building.
Bug b/
123642959
Change-Id: I0706e3302d16144ecb9c0802cec897aa66affe6f
Reviewed-on: https://swiftshader-review.googlesource.com/c/24349
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Nicolas Capens [Thu, 31 Jan 2019 20:17:13 +0000 (15:17 -0500)]
Switch to SPIRV-Headers from subtree.
Use the SPIRV-Headers files from the subtree copy in third_party,
instead of the ones in include/spirv.
Bug b/
123642959
Change-Id: I79f77d2f659d5623583b2de40536dec0c79e2f7f
Reviewed-on: https://swiftshader-review.googlesource.com/c/24348
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Nicolas Capens [Tue, 5 Feb 2019 20:13:08 +0000 (15:13 -0500)]
Suppress Clang warning for unsupported warning.
Clang doesn't support the unused-lambda-capture warning until version
5.0: http://releases.llvm.org/5.0.0/tools/clang/docs/DiagnosticsReference.html#wunused-lambda-capture
Bug b/
123933266
Change-Id: I6c5681a64e08ab479d726679ec18447dec926630
Reviewed-on: https://swiftshader-review.googlesource.com/c/24448
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>