488 Commits

Author SHA1 Message Date
Bill Hollings
697cd55e85
Merge pull request #338 from cdavis5e/attrib-divisor-zero
MVKPipeline: Set the stepRate to 0 when the attribute divisor is 0.
2018-11-06 17:45:20 -05:00
Bill Hollings
2fa610a510
Merge pull request #339 from cdavis5e/memoryless-storage
Add a memory type for memoryless storage on iOS.
2018-11-06 17:45:00 -05:00
Chip Davis
325c9f5555 Add a memory type for memoryless storage on iOS.
This exposes `MTLStorageTypeMemoryless` on iOS as lazily allocated
device-private memory. The semantics of lazily allocated memory are
exactly those of memoryless storage: namely, it can only be used with
images, and only those used as transient attachments. This enables
Vulkan clients to take advantage of this new storage mode starting on
iOS 10.
2018-11-06 15:39:16 -06:00
Chip Davis
56b70090b2 MVKPipeline: Set the stepRate to 0 when the attribute divisor is 0.
Otherwise, Metal asserts.
2018-11-06 15:34:03 -06:00
Bill Hollings
8a807b7c47
Merge pull request #336 from cdavis5e/no-optimal-shared-mac
MVKImage: Don't say shared memory is allowed on Mac.
2018-11-06 15:48:35 -05:00
Chip Davis
9c9b207b0a MVKImage: Don't say shared memory is allowed on Mac.
It isn't. Unfortunately, we have to say it is allowed for linear images,
per the Vulkan spec.
2018-11-05 16:16:02 -06:00
Bill Hollings
1d64dae0cc
Merge pull request #326 from DiegoAce/master
Force Bitcode When Building
2018-11-05 17:14:57 -05:00
Bill Hollings
976aa8cd47
Merge pull request #335 from ryandesign/script-cleanup
create_dylib.sh cleanup
2018-11-05 16:58:32 -05:00
Bill Hollings
6e1c10e03a
Merge pull request #333 from spadix0/fix-memorytypes-order
Fix memoryTypes order on macOS to match spec
2018-11-05 16:44:15 -05:00
Bill Hollings
e8ca167d5e
Merge pull request #332 from cdavis5e/3d-2d-image-view-checks
MVKImageView: Perform the usage check if we're mapping a subset of a 3D image.
2018-11-05 16:16:18 -05:00
Bill Hollings
3cd21a40d1
Merge pull request #331 from cdavis5e/all-unused-attachments
MVKPipeline: Also create a dummy attachment if all attachments are unused.
2018-11-05 16:13:24 -05:00
Bill Hollings
3b76e73fb3
Merge pull request #330 from cdavis5e/relax-linear-mem
MVKDeviceMemory: Relax memory requirements for linear images.
2018-11-05 16:05:04 -05:00
Ryan Schmidt
7354f8ddcd Use the -arch flag(s) specified by Xcode 2018-11-05 06:57:19 -06:00
Ryan Schmidt
82cf1328f2 Use the C++ library specified by Xcode.
It's almost certainly libc++ but it doesn't hurt to specify it.
2018-11-05 06:57:19 -06:00
Ryan Schmidt
b25e207c3b Don't manually link with -lSystem
The compiler adds the system library automatically.
2018-11-05 06:57:19 -06:00
Ryan Schmidt
d367bc7109 Use clang++ not clang to link C++ code
When using a C++ compiler it's unnecessary to specify -lc++ because
that's done automatically.
2018-11-05 06:57:06 -06:00
spadix0
de28fe1a9c Fix memoryTypes order on macOS to match spec
Fixes #314
2018-11-01 14:22:05 -07:00
Chip Davis
bbd6f18f66 MVKImageView: Perform the usage check if we're mapping a subset of a 3D image.
If only some of the 3D image is selected by the view, then we would skip
the usage checks after printing the warning about using a subset.
2018-11-01 10:04:12 -05:00
Chip Davis
32238634ba MVKPipeline: Also create a dummy attachment if all attachments are unused.
Some clients (DXVK primarily) always set all eight color attachments,
even if they are unused. Metal will treat them as though they weren't
specified at all. If none are used, then Metal won't know how big to
make the render area, and the pipeline will fail validation. We have to
treat this case the same as if no attachments were given.
2018-11-01 10:01:32 -05:00
Chip Davis
c9f42d5a94 MVKDeviceMemory: Relax memory requirements for linear images.
Allow linear images to use host-coherent memory. But map its internal
storage mode to `MTLStorageModeManaged`, so we know that we need to keep
it in sync manually.
2018-11-01 09:58:48 -05:00
DiegoAce
b91882cfc8 Force Bitcode When Building
Enabling bitcode in Xcode only adds the -fembed-bitcode-marker flag, which doesn't actually create bitcode. The Archive action transforms that flag to -fembed-bitcode which actually creates the bitcode. Adding the User-Defined Setting BITCODE_GENERATION_MODE=bitcode forces bitcode to be created without archiving.
2018-10-31 16:44:59 -05:00
Bill Hollings
e8b33cb216
Merge pull request #325 from billhollings/master
Refactor the build environment.
2018-10-31 14:41:23 -04:00
Bill Hollings
a670412cf8 Fix Travis build and rename MVKPipelineLayout::getMaxTextureIndex() to getTextureCount(). 2018-10-31 13:28:42 -04:00
Bill Hollings
403cedf0c8 Add README placeholder files for empty template directories. 2018-10-31 00:18:25 -04:00
Bill Hollings
025259426c Refactor the build environment.
Support creation of static library and build framework and dynamic library from it.
Add Makefile to better support command line or script building integration.
Update demos to each use one of framework, static library, and dynamic library.
Refactor and rename the build scripts.
Refactor and rename the Xcode Schemes.
Update build and runtime documentation.
Update What's New document.
2018-10-30 23:16:12 -04:00
Bill Hollings
aba70b867b
Merge pull request #313 from billhollings/master
Support polygonMode VK_POLYGON_MODE_POINT.
2018-10-25 16:57:49 -04:00
Bill Hollings
6215bbe04a Update What's New document. 2018-10-25 16:06:57 -04:00
Bill Hollings
480d5b239a Support polygonMode VK_POLYGON_MODE_POINT.
Support MTLPrimitiveTopologyClass on iOS in addition to macOS.
2018-10-24 17:06:19 -04:00
Bill Hollings
ac61f9185f vkCreateInstance returns VK_ERROR_INCOMPATIBLE_DRIVER if Metal not available. 2018-10-22 17:21:55 -04:00
Bill Hollings
79e4d75e1b
Merge pull request #305 from billhollings/master
Update shader caching for compatibility with texture swizzling.
2018-10-19 15:50:32 -07:00
Bill Hollings
af0c1a08f1 Update shader caching for compatibility with texture swizzling.
MVKPipelineLayout set auxiliary buffer MSL index relative to already-calculated
push constant buffer MSL index.
MVKPipeline destructor release auxiliary buffer MTLBuffer instance.
Nudge MVK_VERSION_PATCH.
2018-10-17 16:57:21 -07:00
Bill Hollings
6c0ab0f4c2
Merge pull request #304 from cdavis5e/wolf2-packed-pixels
Correct MTLPixelFormats for a couple of formats.
2018-10-16 14:55:44 -04:00
Bill Hollings
91c1947889
Merge pull request #303 from cdavis5e/component-swizzle
Support arbitrary swizzles of image data.
2018-10-16 14:55:21 -04:00
Chip Davis
e7af5bed64 Correct MTLPixelFormats for a couple of formats.
Set `MTLPixelFormatRG11B10Float` for `VK_FORMAT_B10G11R11_UFLOAT_PACK32`
and `MTLPixelFormatRGB9E5Float` for `VK_FORMAT_E5B9R9G9_UFLOAT_PACK32`.

This should fix the rest of #302.
2018-10-16 11:41:46 -05:00
Chip Davis
082d282b28 Support arbitrary swizzles of image data.
The swizzles are passed to shaders that need them using an "auxiliary
buffer", for which there must be room in the function argument table.
Code is inserted into the shaders to swizzle reads from sampled
textures--per the Vulkan spec, component mappings must only be applied
to sampled images.

Update SPIRV-Cross to pull in some fixes for handling swizzled image
data. Bump MoltenVK version.
2018-10-16 11:33:13 -05:00
Bill Hollings
7dd143411a
Merge pull request #298 from francoisbertelatschrodinger/whitespaces
Make PhaseScriptExecution works when SRCROOT path has whitespaces.
2018-10-15 13:54:07 -04:00
Khronos Group Webmaster
562065becf
Create CODE_OF_CONDUCT.md 2018-10-10 16:04:15 -04:00
Bill Hollings
e651841e67
Merge pull request #300 from billhollings/master
Include struct size parameter in VK_MVK_moltenvk extension functions that pass structs that might change size across extension versions.
2018-10-09 16:14:55 -04:00
Bill Hollings
209ed01acc Update VulkanSamples to latest version, and update What's New document. 2018-10-09 15:18:48 -04:00
Bill Hollings
aad51f82f2 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-10-09 11:56:42 -04:00
Bill Hollings
2adc450c62 Include struct size parameter in VK_MVK_moltenvk extension functions
that pass structs that might change size across extension versions
2018-10-08 20:22:12 -04:00
François Bertel
014b936c4e Make PhaseScriptExecution works when SRCROOT path has whitespaces. 2018-10-08 14:11:39 -04:00
Bill Hollings
4640d273af
Merge pull request #296 from cdavis5e/copy-image-compat-format
vkCmdCopyImage: Allow copies between compatible formats.
2018-10-03 13:14:35 -04:00
Chip Davis
b8202e7b65 Forbid copying between 3D texture and a 2D array texture.
Metal doesn't support that yet.
2018-10-03 11:24:49 -05:00
Bill Hollings
2204113b86
Merge pull request #295 from cdavis5e/blend-state-unused
MVKPipeline: Don't set blend state for unused attachments.
2018-10-03 12:00:07 -04:00
Bill Hollings
2444dfee37
Merge pull request #294 from cdavis5e/vertex-rgb10a2-unorm
Map VK_FORMAT_A2B10G10R10_UNORM_PACKED to an MTLVertexFormat.
2018-10-03 11:59:49 -04:00
Bill Hollings
b173ea5964
Merge pull request #293 from cdavis5e/linear-tiled-props
MVKDevice: Correct properties of linear-tiled images.
2018-10-03 10:50:11 -04:00
Bill Hollings
d0b111ef46
Merge pull request #292 from cdavis5e/dedicated-free
MVKDeviceMemory: Allow dedicated allocations to forget their resources.
2018-10-03 10:44:14 -04:00
Chip Davis
44c9aaa957 vkCmdCopyImage: Allow copies between compatible formats.
The docs for the `MTLBlitCommandEncoder`'s `copyFromTexture:...` method
state that the source and destination textures must have the same
format.

This was true when it was written in the iOS 8 timeframe for Metal 1.0.
But, I suspect it was changed in Metal 1.1 when support was added for
texture views of differing formats. Like with texture views, the two
formats now need only be compatible. This is the same behavior that
Vulkan prescribes.
2018-10-03 09:42:31 -05:00
Bill Hollings
f8c85b1850
Merge pull request #291 from cdavis5e/fix-vertex-divisor
MVKPipeline: Fix getting the vertex attribute divisor struct.
2018-10-03 10:41:45 -04:00