955 Commits

Author SHA1 Message Date
Chip Davis
787086351f MVKBuffer: Force managed storage for linear textures on shared buffers.
Shared storage on textures is disallowed on macOS.

Fixes #573.
2019-05-01 09:37:27 -05:00
Bill Hollings
1b60679104
Merge pull request #571 from cdavis5e/fix-query-race
Fix a race condition between sync objects and queries.
2019-04-30 15:33:16 -04:00
Bill Hollings
85a3af59e1
Merge pull request #585 from cdavis5e/tess-pipeline-no-shaders
MVKPipeline: Account for tessellation shaders as well.
2019-04-30 12:43:49 -04:00
Chip Davis
cd26de225b MVKPipeline: Account for tessellation shaders as well.
If we don't have them, it's not a tessellation pipeline.
2019-04-29 17:40:03 -05:00
Chip Davis
1188edca76 Get rid of the queue idle event, too.
Put the fence back on the last submission.

This mostly reverts the last of the original change, save for a few
formatting changes and deletions of unused cruft.
2019-04-29 16:05:50 -05:00
Chip Davis
ba7c578827 Get rid of the 'command buffer done' event.
Since we no longer have a completion block which runs asynchronously,
the race condition it was meant to guard against can no longer happen.
2019-04-29 13:15:27 -05:00
Chip Davis
256ffc6d31 Try to capture only the work queued up to this point in a fence. 2019-04-25 23:11:24 -05:00
Chip Davis
4591cac69b MVKVector: Make this more amenable to the standard algorithms. 2019-04-24 15:00:46 -05:00
Chip Davis
43f97113b6 Perform query pool copies on the device side. 2019-04-24 14:20:13 -05:00
Bill Hollings
fc1ce42a37
Merge pull request #578 from mbarriault/master
Fix case where viewport/scissor doesn't get set properly when mixing dynamic and static-configured pipelines in the same command buffer.
2019-04-23 15:36:24 -04:00
Michael Barriault
b24d2e35ef Fix inequality. 2019-04-23 19:44:04 +01:00
Michael Barriault
cbd772a9d7 Refactor again to simplify conditionals. 2019-04-23 19:39:04 +01:00
Michael Barriault
dec40811ae Refactor to reduce code duplication. 2019-04-23 17:23:49 +01:00
Michael Barriault
a336e64bea Fix case where viewport/scissor doesn't get set properly when mixing dynamic and static-configured pipelines in the same command buffer. 2019-04-22 19:26:00 +01:00
Bill Hollings
e89e9dcfd6
Merge pull request #577 from mbarriault/master
Fix unused attachments terminating loop early.
2019-04-22 11:44:38 -04:00
Michael Barriault
0670ea133d Tweak counting logic 2019-04-22 15:48:48 +01:00
Michael Barriault
17da3e4d00 Move color attachment array access back inside if block. 2019-04-22 14:49:18 +01:00
Michael Barriault
eb468b7014 Fix unused attachments terminating loop early. 2019-04-20 23:01:57 +01:00
Bill Hollings
1c34873425
Merge pull request #576 from billhollings/master
MoltenVKShaderConverter enhancements
2019-04-19 12:12:18 -04:00
Bill Hollings
c2bb18e264 Update What's New document. 2019-04-18 18:38:11 -04:00
Bill Hollings
ee6e6f5ad0 Enable AMD and NV GLSL extensions when building glslang for MoltenVKGLSLToSPIRVConverter. 2019-04-18 17:39:25 -04:00
Bill Hollings
e91d2f6b35 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-04-18 15:12:42 -04:00
Bill Hollings
b29f6e47cc
Merge pull request #575 from mbarriault/master
Resolves issues with tessellation
2019-04-18 15:09:17 -04:00
Bill Hollings
62f374bf7e Allow building external dependency libraries in Debug mode.
Add ExternalDependencies (Debug) scheme to ExternalDependencies Xcode project.
Add --debug option to fetchDependencies script.
Support Release, Debug & Latest directories in External/build directory.
Enable DEPLOYMENT_POSTPROCESSING build setting when compiling
SPIRV-Tools to avoid warning spam when building dylibs.
Disable visibility warnings when building MoltenVKShaderConverter
in Release mode from external libraries built in Debug mode.
Always use -Xlinker -w option when creating dylibs to disable visibility warnings.
2019-04-18 15:08:39 -04:00
Michael Barriault
231196092b Fix spaces->tabs for consistency. 2019-04-17 22:51:40 +01:00
Michael Barriault
08d3d91016 Update to latest SPIRV-Cross. 2019-04-17 22:37:52 +01:00
Michael Barriault
11865f3809 Merge remote-tracking branch 'origin/master'
* origin/master:
2019-04-17 21:35:08 +01:00
Michael Barriault
ea5e38093a Work around potential Metal bug with stage in indirect buffers. Exact size isn't needed in our case anyway. 2019-04-17 21:31:38 +01:00
Michael Barriault
be54e748f0 Fix tessellated indirect draws using wrong kernels to map parameters. 2019-04-17 21:30:42 +01:00
Bill Hollings
eca03b8de1 MoltenVKShaderConverter tool add MSL version and platform command-line options.
Add SPIRVToMSLConverterOptions::platform to track platform. Default to build platform.
Update default SPIRVToMSLConverterOptions MSL version to 2.1.
MoltenVKShaderConverter test MSL compilation use same MSL version as conversion.
Default min perf tracking value to 0.0.
SPIRVToMSLConverter.h reference spirv.hpp via SPIRV-Cross framework.
Update What's New document.
2019-04-17 16:09:07 -04:00
Chip Davis
48d319432a MVKCountingEvent -> MVKSemaphoreImpl.
Remove the redundant class I added. Simplify a bit.
2019-04-17 10:42:25 -05:00
Michael Barriault
0aed9167c1 Tweak tabbing for consistency. 2019-04-16 18:12:10 +01:00
Michael Barriault
ef3e590617 Use empty depth state for tessellation vertex pre-pass. 2019-04-16 18:03:51 +01:00
Michael Barriault
2d627c6b8f Fix intermediate Metal renderpasses load and store actions maintaining attachments appropriately. 2019-04-16 18:03:15 +01:00
Bill Hollings
6bbd0eca75
Merge pull request #574 from mbarriault/master
Fix zero local threadgroup size in indirect rendering.
2019-04-15 17:33:35 -04:00
Michael Barriault
4c4332b848 Fix zero local threadgroup size in indirect rendering. 2019-04-15 17:58:26 +01:00
Bill Hollings
588f0ed5c8
Merge pull request #572 from cdavis5e/fix-tess-vertex-count
Don't use setVertexBytes() for passing vertex counts.
2019-04-15 11:38:23 -04:00
Chip Davis
5df1b1b7db Don't use setVertexBytes() for passing vertex counts.
In a tessellated draw, the vertex shader will take a `device` pointer to
the vertex count. It must be a `device` pointer, because the `constant`
AS on Mac requires 256-byte alignment, which we cannot guarantee,
particularly with an indirect draw. But, the `setVertexBytes:...` method
cannot be used with the `device` AS. So, we need yet another temporary
buffer to hold this value in the `device` AS.

Fixes #566.
2019-04-13 12:49:20 -05:00
Chip Davis
9a0c4f6cef Fix a race condition between sync objects and queries.
In the past, MoltenVK signaled fences and semaphores immediately when
Metal reported that the batch was finished executing. But, some commands
do work in completion handlers that run concurrently with this. In
particular, in #278 I shunted copying query pool results onto a
different dispatch queue. This caused a race between this block and the
block which signals fences and semaphores.

Since some commands do work in completion handlers, the handler which
signals semaphores and fences must wait until these handlers finish
running. Also because of this, it is not adequate to submit a fence-only
request to implement `vkQueueWaitIdle()`. So, that function must now
wait for all submissions to complete. To preserve the invariant that
fence-only submissions are equivalent to `vkQueueWaitIdle()`, this
change also makes fence signaling wait for all submissions.

If the queue is continually supplied with new work, this implementation
may delay signaling fences indefinitely. Ideally, fences would only wait
for all work up to that point to complete before signaling. But I'm not
sure how to accomplish that yet.

Fixes #454.
2019-04-12 00:17:46 -05:00
Bill Hollings
d57704b69f
Merge pull request #570 from billhollings/master
Update dependency libraries for SDK 1.1.106.
2019-04-11 18:41:18 -04:00
Bill Hollings
c425602ee7
Merge pull request #569 from mbarriault/master
Fix tessellation pipeline re-clearing attachments.
2019-04-11 18:31:15 -04:00
Bill Hollings
189a41e8d2 Update dependency libraries for SDK 1.1.106. 2019-04-11 17:52:50 -04:00
Michael Barriault
9e7fe1b642 Fix tessellation pipeline re-clearing attachments. 2019-04-11 22:37:19 +01:00
Bill Hollings
ebce19b0b7 Add MoltenVKShaderConverter tool option to log shader conversion performance.
Move MVKOSExtension.h/mm to from MoltenVK to Common
and move MTLDevice functions to MVKDevice.
2019-04-11 14:26:35 -04:00
Bill Hollings
b09f52c50a Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2019-04-11 10:00:20 -04:00
Bill Hollings
562093d2ed
Merge pull request #565 from mbarriault/master
Several fixes regarding tessellation, especially in indexed and instanced rendering
2019-04-11 09:55:14 -04:00
Bill Hollings
f326f0caec Log shader performance statistics in any runtime if
MVKConfiguration::performanceLoggingFrameCount is non-zero.
2019-04-09 23:24:44 -04:00
Michael Barriault
90baed604e Fix crash vertex pre-pass in tessellation pipeline due to being created with line topology but rendered with points. 2019-04-09 20:03:18 +01:00
Michael Barriault
761d80f81f Fix vertex pre-pass in tessellation pipeline not encoding. 2019-04-09 20:00:44 +01:00
Michael Barriault
a995a3b926 Fix patch count in tessellation pipeline. 2019-04-09 19:59:46 +01:00