809 Commits

Author SHA1 Message Date
aerofly
ffc74f3673
Update SPIRVToMSLConverter.cpp 2018-12-15 18:21:13 +01:00
Bill Hollings
19a83e32d3
Merge pull request #406 from billhollings/master
Add missing include MVKEnvironment.h to MVKImage.mm.
2018-12-15 10:28:11 -05:00
Bill Hollings
a9573782a1 Add missing include MVKEnvironment.h to MVKImage.mm. 2018-12-14 18:59:54 -05:00
Bill Hollings
ae5aa3b17c
Merge pull request #403 from cdavis5e/push-descriptor-2
vkCmdPushDescriptorSet: Fix mapping of binding numbers to descriptor layouts.
2018-12-14 18:26:51 -05:00
Chip Davis
b9fddfb1f8 vkCmdPushDescriptorSet: Fix mapping of binding numbers to descriptor layouts.
In the past, this function just used the passed-in binding number to
index into the array of bindings. When the binding numbers and the
indices of the array matched up, this worked really well.

When they didn't, it broke spectacularly.

So now we keep track of which binding numbers map to which elements in
the array. That way, we don't have to assume that the array indices and
the binding numbers will match up.
2018-12-14 16:10:37 -06:00
Bill Hollings
0ee58d2d42
Merge pull request #402 from cdavis5e/non-2d-depth
Forbid depth/stencil formats on anything but 2D images.
2018-12-14 14:29:05 -05:00
Bill Hollings
c6bf5c3b3a
Merge pull request #401 from cdavis5e/cmd-pool-transfer-image
MVKCommandPool: Destroy transfer images using the device.
2018-12-14 14:27:42 -05:00
Bill Hollings
afb5bd034b
Merge pull request #400 from cdavis5e/vertex-stride-mult-4
MVKPipeline: Reject non-multiple-of-4 vertex buffer strides.
2018-12-14 14:25:42 -05:00
Bill Hollings
6cae45aac8
Merge pull request #399 from billhollings/master
Cube demo on iOS support Portrait and Landscape device orientation.
2018-12-14 13:04:52 -05:00
Chip Davis
23ab87a1c8 Forbid depth/stencil formats on anything but 2D images. 2018-12-14 11:55:13 -06:00
Chip Davis
24fae026b9 MVKCommandPool: Destroy transfer images using the device.
Since we created them using the device. Otherwise, the device won't know
that it needs to stop tracking them for the purposes of generating
memory barriers.
2018-12-14 08:17:49 -06:00
Chip Davis
cb61882ed6 MVKPipeline: Reject non-multiple-of-4 vertex buffer strides.
Metal unfortunately insists on this, or it will assert.
2018-12-14 08:16:48 -06:00
aerofly
fba2eefa5e Modify MVKVector with feedback from cdavis5e 2018-12-14 14:19:30 +01:00
Bill Hollings
fc77281567 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-12-13 18:11:37 -05:00
Bill Hollings
4b66a6ca24 Cube demo on iOS support Portrait and Landscape device orientation. 2018-12-13 18:10:56 -05:00
Bill Hollings
b4b2ca6b45
Merge pull request #397 from cdavis5e/sampler-border-colors
MVKSampler: Support border colors.
2018-12-13 15:31:43 -05:00
Bill Hollings
bc30eae4eb
Merge pull request #396 from cdavis5e/aux-buffer-offsets
MVKPipeline: Set auxiliary buffer offsets once, on layout creation.
2018-12-13 15:31:11 -05:00
Chip Davis
cef610ee14 MVKSampler: Support border colors.
In Metal 1.2 on Mac, the `MTLSamplerAddressModeClampToBorderColor`
address mode was added. This mode actually lets clients specify the
border color, instead of hardcoding it to black (opaque without alpha,
transparent with alpha). Use this new mode instead of
`MTLSamplerAddressModeClampToZero` when possible.
2018-12-12 14:03:47 -06:00
aerofly
6aad9dc0ba fix conflicts 2018-12-12 20:57:11 +01:00
Chip Davis
6f4c3d639f MVKPipeline: Set auxiliary buffer offsets once, on layout creation.
This avoids extra work. It also avoids a race condition flagged by tsan.
2018-12-12 13:44:58 -06:00
Bill Hollings
b8da89ac1e
Merge pull request #395 from billhollings/master
vkCmdClearAttachments apply [[render_target_array_index]] more carefully.
2018-12-12 14:41:41 -05:00
aerofly
2b19954d11
Merge branch 'master' into master 2018-12-12 20:11:18 +01:00
aerofly
5811ae5811 fix conflicts 2018-12-12 20:09:24 +01:00
Bill Hollings
f1af7a4a2e vkCmdClearAttachments apply [[render_target_array_index]] only if not multisampling,
or multisampling texture arrays are supported.
2018-12-12 11:43:50 -05:00
aerofly
a4c6f64ecf Default to swizzle_texture_samples=false 2018-12-12 17:38:42 +01:00
aerofly
4cae69542d Update fork to latest MoltenVK 2018-12-12 16:24:57 +01:00
aerofly
8c1581f247 Update fork to latest MoltenVK 2018-12-12 16:08:22 +01:00
Bill Hollings
da598c0061
Merge pull request #392 from billhollings/master
MSL don't emit memory_scope after MSL 2.0.
2018-12-12 08:33:41 -05:00
Bill Hollings
b804fd536c
Merge pull request #391 from cdavis5e/format-features
Add new formats and fix existing ones
2018-12-12 08:33:12 -05:00
Bill Hollings
8051a36016
Merge pull request #390 from cdavis5e/pow2-image-align
MVKImage: Round up byte alignment to the nearest power of 2.
2018-12-12 08:32:02 -05:00
Chip Davis
3d424679f3 Add support for VK_FORMAT_A2R10G10B10_UNORM_PACK32.
This format was added in Metal 2 (iOS 11, macOS 10.13), and is intended
for rendering to wide-color (10bpc) displays.
2018-12-11 17:40:21 -06:00
Chip Davis
e9158463a6 On macOS, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 can only be filtered. 2018-12-11 17:40:21 -06:00
Chip Davis
15b67b4311 On macOS, linear textures cannot be blitted to.
Since they cannot be render targets.

I wonder if we could work around that using a shader.
2018-12-11 17:40:21 -06:00
Chip Davis
35573832dc Give every image format we support the BLIT_SRC feature.
All that is required is that we can either read the format
(`TRANSFER_SRC`) or sample from it (`SAMPLED_IMAGE`). Every image format
that Metal supports supports those two features.

This marks the depth/stencil formats as able to be the source of a
blit. The spec requires in particular that `D16_UNORM` and `D32_SFLOAT`
support that.
2018-12-11 17:40:21 -06:00
Chip Davis
282699d755 Depth formats cannot be used for a VkBufferView.
It is not possible to create a linear texture from a depth/stencil
format. Therefore, we can't support buffer views in these formats.
2018-12-11 17:40:21 -06:00
Chip Davis
a1d8de5da2 Correct supported features of compressed formats.
Compressed formats only support reading and filtering. They also can't
be used to create linear textures, so they can't be used for buffer
views, either.
2018-12-11 17:40:21 -06:00
Chip Davis
5c65330e50 Add some more vertex formats.
Use `MTLVertexFormatChar`, `UChar`, `Short`, `UShort`, and `Half` when
available. Add `MTLVertexFormatUChar4Normalized_BGRA` for
`VK_FORMAT_B8G8R8A8_UNORM`.

These are only available on Metal 2.0 (iOS 11, macOS 10.13) and up, so
this adds what MoltenVK was using before as a fallback, similar to how
some `MTLPixelFormat`s have substitutes.
2018-12-11 17:40:21 -06:00
Chip Davis
4bbbbbd783 MVKImage: Round up byte alignment to the nearest power of 2. 2018-12-11 17:38:47 -06:00
Bill Hollings
98dd858d82 Merge branch 'master' of https://github.com/KhronosGroup/MoltenVK 2018-12-11 18:27:40 -05:00
Bill Hollings
e6dfdca6c0 MSL don't emit memory_scope after MSL 2.0.
For each GPU, log MSL version and updated list of feature sets.
Add SPIRVToMSLConverterOptions::printMSLVersion() function.
Update to latest SPIRV-Cross version.
Update MoltenVK version to 1.0.29.
2018-12-11 18:27:01 -05:00
Bill Hollings
03086fbd86
Merge pull request #388 from cdavis5e/fix-khr-maintenance3
Use MVKDevice::getMVKDevice() to get the real underlying device.
2018-12-11 18:24:27 -05:00
Bill Hollings
5633cc58e3
Merge pull request #387 from cdavis5e/all-unused-attachments-3
MVKGraphicsPipeline: Add dummy attachments even when rasterization is off.
2018-12-11 18:20:42 -05:00
Bill Hollings
aad5ba63a3
Merge pull request #386 from cdavis5e/cmd-transfer-8bit-format
Don't use char/uchar for clearing/copying 8-bit formats.
2018-12-11 18:19:42 -05:00
Bill Hollings
c9475cb464
Merge pull request #384 from cdavis5e/a8b8g8r8-pack32
Support A8B8G8R8_PACK32 formats.
2018-12-11 18:14:48 -05:00
Bill Hollings
8ef4aa9801
Merge pull request #385 from cdavis5e/non-blittable-rt-usage
MVKImage: Don't set MTLTextureUsageRenderTarget for non-blittable formats.
2018-12-11 18:10:59 -05:00
Chip Davis
39afc5d553 Use MVKDevice::getMVKDevice() to get the real underlying device.
Mea culpa.
2018-12-11 15:28:03 -06:00
Chip Davis
cb583fa8e3 MVKGraphicsPipeline: Add dummy attachments even when rasterization is off.
Turns out I was wrong. Metal expects at least one attachment to define
the size of the framebuffer, whether or not rasterization is on.
2018-12-11 15:25:54 -06:00
Chip Davis
569879a10e Don't use char/uchar for clearing/copying 8-bit formats.
Metal doesn't allow using that as a texture's sampled data type or as a
fragment shader's output type.
2018-12-11 15:24:48 -06:00
Chip Davis
b413ec1676 MVKImage: Don't set MTLTextureUsageRenderTarget for non-blittable formats.
Setting that usage bit on a non-renderable format, especially a
compressed one, will cause Metal to crash. (And I mean crash, without
raising an assertion failure.)
2018-12-11 15:23:36 -06:00
Chip Davis
c80c42dedd Support A8B8G8R8_PACK32 formats.
Because they're packed formats, they correspond to
`MTLPixelFormatRGBA8`. In fact, these formats would only be distinct on
a big endian system, and no current Apple hardware is big endian
anymore.
2018-12-11 15:21:30 -06:00