464 Commits

Author SHA1 Message Date
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
Chip Davis
a0a93e0cdb MVKPipeline: Don't set blend state for unused attachments.
Some clients always set blend state for all eight attachments, even if
the attachments are unused. Since the attachments are unused, the
expectation is that the corresponding blend states won't matter. But in
Metal, there's no way to tell if an attachment won't be used. So, if you
enable blending on an unused attachment, its pixel format will be
`MTLPixelFormatInvalid`, which doesn't support blending; Metal will
assert on this.
2018-10-03 09:39:42 -05:00
Chip Davis
0171fd46c5 Set the VERTEX_BUFFER feature bit on VK_FORMAT_A2B10G10R10_UNORM_PACK32.
Since we can use it in a vertex buffer now.
2018-10-03 09:37:31 -05:00
Bill Hollings
4fba647123 Optimize scheme configuration and make consistent. 2018-10-03 10:09:47 -04:00
Khronos Group Webmaster
625b33839a
Revert LICENSE to Apache 2.0 2018-10-03 10:06:43 -04:00
Chip Davis
230ec2569e Map VK_FORMAT_A2B10G10R10_UNORM_PACKED to an MTLVertexFormat.
Use `MTLVertexFormatUInt1010102Normalized`. This is the unsigned
equivalent to the signed `MTLVertexFormatInt1010102Normalized`, which we
already use for `VK_FORMAT_A2B10G10R10_SNORM_PACKED`.
2018-10-02 18:24:49 -05:00
Chip Davis
b86e6b2be3 MVKDevice: Correct properties of linear-tiled images.
According to the Vulkan spec, linear-tiled images *may* not be supported
unless certain restrictions are satisfied. That means that
implementations may support features--or restrictions--above and beyond
the restrictions given in the Vulkan spec.

Metal places these limitations on linear textures:
* They must be 2D.
* They may only have one mip level.
* They may only have one array layer.
* They may not be multisampled--sample count must be one.
* On macOS, they may not be used as attachments.
* They may not be depth/stencil textures.
* They may not have a compressed format.

Have `vkGetPhysicalDeviceFormatProperties()` and
`vkGetPhysicalDeviceImageFormatProperties()` return results consistent
with these constraints. Also, allow creation of linear textures with
usages other than `VK_IMAGE_USAGE_TRANSFER_{SRC,DST}_BIT`.
2018-10-02 18:14:33 -05:00
Chip Davis
6da32e55b0 MVKDeviceMemory: Allow dedicated allocations to forget their resources.
Otherwise, if the resource is destroyed first (which it almost always
will be), then when the `VkDeviceMemory` is freed, it will access a
freed resource, at which point it will then proceed to fandango on core.
2018-10-02 18:00:38 -05:00
Chip Davis
9490e96164 MVKPipeline: Fix getting the vertex attribute divisor struct.
Bah. I read the spec wrong. It's hung off the vertex input state, not
the top-level create info.
2018-10-02 18:00:13 -05:00
Bill Hollings
b296f51153 Fix descriptive comments in fetchDependencies script. 2018-10-02 15:14:33 -04:00
Bill Hollings
a3f571e89b Include version number in VK_MVK_moltenvk extension functions that pass structs that might change. 2018-10-02 12:48:51 -04:00
Bill Hollings
70dae8946a
Merge pull request #290 from billhollings/master
Allocate MVKDescriptorSets from a pool within MVKDescriptorPool.
2018-10-01 16:59:57 -04:00
Bill Hollings
05e028084b Update What's New document. 2018-10-01 16:32:50 -04:00
Bill Hollings
c933330406 Allocate MVKDescriptorSets from a pool within MVKDescriptorPool,
keyed by MVKDescriptorSetLayout reference.

Add MVKObjectPool subclass MVKDeviceObjectPool.
Enlarge window dimensions on macOS Cube demo.
2018-09-30 18:07:13 -04:00
Bill Hollings
26c7b69a3f
Merge pull request #288 from billhollings/master
Update glslang version and What's New document.
2018-09-27 22:36:08 -04:00
Bill Hollings
cded63b008 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-09-27 18:21:05 -04:00
Bill Hollings
9f28854a2a Update glslang version and What's New document. 2018-09-27 18:20:20 -04:00
Bill Hollings
dc0da2ceb6
Merge pull request #287 from cdavis5e/render-area
Use the passed render area to set the render target extent.
2018-09-27 18:17:25 -04:00
Chip Davis
6f1c97966c Use the passed render area to set the render target extent.
Use the smaller of the render area and the framebuffer area.
2018-09-27 16:29:37 -05:00
Bill Hollings
7ffc5bd806
Merge pull request #286 from cdavis5e/resource-array-dynamic-indexing
Support the shader{Sampled,Storage}ImageArrayDynamicIndexing feature.
2018-09-27 17:27:11 -04:00
Bill Hollings
dfcc815c82
Merge pull request #285 from cdavis5e/tsan-build
Build the dylib with -fsanitize=thread when tsan is enabled.
2018-09-27 17:25:50 -04:00
Khronos Group Webmaster
7953a73016
Update LICENSE
Change Apache 2.0 to Khronos Apache 2.0 CLA
2018-09-27 17:09:36 -04:00
Bill Hollings
8c58c0bf72
Merge pull request #284 from cdavis5e/no-attachments
Add a dummy attachment in case no attachments were specified.
2018-09-27 16:29:06 -04:00
Chip Davis
fcbbdc1948 Support the shader{Sampled,Storage}ImageArrayDynamicIndexing feature.
Update SPIRV-Cross to support dynamic indexing on iOS 10... and to
actually support arrays of input buffers (which should've been present
before I flipped the `shader{Uniform,Storage}BufferArrayDynamicIndexing`
switch).

Bump patch version.

Fixes #96.
2018-09-27 13:11:55 -05:00
Chip Davis
522793e680 Build the dylib with -fsanitize=thread when tsan is enabled. 2018-09-27 11:27:36 -05:00