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
Bill Hollings
0764843898
Merge pull request #383 from cdavis5e/memory-bind-after-map
...
MVKDeviceMemory: Try creating an MTLBuffer before allocating heap memory.
2018-12-11 16:09:20 -05:00
Bill Hollings
570c67c5dc
Merge pull request #382 from cdavis5e/sparse-props
...
Explicitly set number of sparse image property/requirement info sets to 0.
2018-12-11 15:50:45 -05:00
Bill Hollings
a98d1a989c
Merge pull request #381 from cdavis5e/asan-build
...
Build the dylib with -fsanitize=address when asan is enabled.
2018-12-11 15:50:03 -05:00
Bill Hollings
7c03db9e4f
Merge pull request #380 from cdavis5e/debug-dsym-file-2
...
Fix name of generated dSYM file.
2018-12-11 15:49:09 -05:00
Bill Hollings
c6cca34510
Merge pull request #379 from cdavis5e/2dms-array-image-2
...
MVKImage: Support image views of 2D multisample array images.
2018-12-11 15:48:17 -05:00
Bill Hollings
15a52437f2
Merge pull request #378 from cdavis5e/pack16-formats
...
Correct mapping of packed 16-bit formats.
2018-12-11 15:47:05 -05:00
Chip Davis
b64485bf2a
MVKDeviceMemory: Try creating an MTLBuffer before allocating heap memory.
...
If the device memory is subsequently bound to a `VkBuffer` after it has
been mapped, the heap memory will be freed, leaving dangling pointers in
the client. Instead, create an `MTLBuffer` right away--it is *device*
memory after all--and use its memory.
Another option might be to use `-[MTLDevice
newBufferWithBytesNoCopy:length:options:deallocator:]`, but that
requires that the entire allocation come from a single contiguous
virtual memory mapping, a requirement that is not necessarily satisfied
by `malloc(3)` memory.
Fixes #377 .
2018-12-10 14:55:49 -06:00
Chip Davis
1d2da75eb5
Explicit set number of sparse image property/requirement info sets to 0.
...
Since these functions return void, there's no indication of an error
from them.
2018-12-10 14:54:23 -06:00
Chip Davis
aec492cfca
Build the dylib with -fsanitize=address when asan is enabled.
2018-12-10 14:53:23 -06:00
Chip Davis
63b291a6c1
Fix name of generated dSYM file.
2018-12-10 14:52:24 -06:00
Chip Davis
8b0ea361f1
MVKImage: Support image views of 2D multisample array images.
...
A bit that I missed in my initial change to add this.
2018-12-10 14:50:47 -06:00