Skip to content

Commit

Permalink
Merge pull request #149 from billhollings/master
Browse files Browse the repository at this point in the history
Add features to support Vulkan CTS.
  • Loading branch information
billhollings authored May 4, 2018
2 parents 18cc70e + 84f92e0 commit 6088fa8
Show file tree
Hide file tree
Showing 23 changed files with 443 additions and 335 deletions.
9 changes: 7 additions & 2 deletions ExternalRevisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,17 @@ If you make changes to the `SPIRV-Cross` repository, you can regression test you

cd External/SPIRV-Cross
./checkout_glslang_spirv_tools.sh
./build_glslang_spirv_tools.sh

2. Run the regression tests:
2. Build `SPIRV-Cross`:

make

3. Run the regression tests:

./test_shaders.sh

3. If your changes result in different expected output for a reference shader, and the new results
4. If your changes result in different expected output for a reference shader, and the new results
are correct, you can update the reference shader for a particular regression test by deleting
that reference shader, in either `External/SPIRV-Cross/reference/shaders-msl` or
`External/SPIRV-Cross/reference/opt/shaders-msl`, and running the test again. The test will
Expand Down
2 changes: 1 addition & 1 deletion ExternalRevisions/SPIRV-Cross_repo_revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7796a9f3ec94733830ad8c648157a3b1c5693e34
2792f8f3f2ce5cf970ef1cb7ab144445a4f1f6f8
72 changes: 48 additions & 24 deletions MoltenVK/MoltenVK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions MoltenVK/MoltenVK/API/mvk_datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ extern "C" {
/** Enumerates the data type of a format. */
typedef enum {
kMVKFormatNone, /**< Format type is unknown. */
kMVKFormatColorFloat, /**< A floating point color. */
kMVKFormatColorInt, /**< A signed integer color. */
kMVKFormatColorUInt, /**< An unsigned integer color. */
kMVKFormatColorHalf, /**< A 16-bit floating point color. */
kMVKFormatColorFloat, /**< A 32-bit floating point color. */
kMVKFormatColorInt8, /**< A signed 8-bit integer color. */
kMVKFormatColorUInt8, /**< An unsigned 8-bit integer color. */
kMVKFormatColorInt16, /**< A signed 16-bit integer color. */
kMVKFormatColorUInt16, /**< An unsigned 16-bit integer color. */
kMVKFormatColorInt32, /**< A signed 32-bit integer color. */
kMVKFormatColorUInt32, /**< An unsigned 32-bit integer color. */
kMVKFormatDepthStencil, /**< A depth and stencil value. */
} MVKFormatType;

Expand Down
2 changes: 1 addition & 1 deletion MoltenVK/MoltenVK/API/vk_mvk_moltenvk.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern "C" {
*/
#define MVK_VERSION_MAJOR 1
#define MVK_VERSION_MINOR 0
#define MVK_VERSION_PATCH 4
#define MVK_VERSION_PATCH 5

#define MVK_MAKE_VERSION(major, minor, patch) (((major) * 10000) + ((minor) * 100) + (patch))
#define MVK_VERSION MVK_MAKE_VERSION(MVK_VERSION_MAJOR, MVK_VERSION_MINOR, MVK_VERSION_PATCH)
Expand Down
4 changes: 2 additions & 2 deletions MoltenVK/MoltenVK/Commands/MVKCmdDraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ void mvkCmdDrawIndexed(MVKCommandBuffer* cmdBuff,
void mvkCmdDrawIndirect(MVKCommandBuffer* cmdBuff,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t drawCount,
uint32_t stride);

/** Adds an indirect indexed draw command to the specified command buffer. */
void mvkCmdDrawIndexedIndirect(MVKCommandBuffer* cmdBuff,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t drawCount,
uint32_t stride);

16 changes: 8 additions & 8 deletions MoltenVK/MoltenVK/Commands/MVKCmdDraw.mm
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@

void MVKCmdDrawIndirect::setContent(VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t drawCount,
uint32_t stride) {
MVKBuffer* mvkBuffer = (MVKBuffer*)buffer;
_mtlIndirectBuffer = mvkBuffer->getMTLBuffer();
_mtlIndirectBufferOffset = mvkBuffer->getMTLBufferOffset() + offset;
_mtlIndirectBufferStride = stride;
_drawCount = count;
_drawCount = drawCount;

// Validate
clearConfigurationResult();
Expand Down Expand Up @@ -211,13 +211,13 @@

void MVKCmdDrawIndexedIndirect::setContent(VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t drawCount,
uint32_t stride) {
MVKBuffer* mvkBuffer = (MVKBuffer*)buffer;
_mtlIndirectBuffer = mvkBuffer->getMTLBuffer();
_mtlIndirectBufferOffset = mvkBuffer->getMTLBufferOffset() + offset;
_mtlIndirectBufferStride = stride;
_drawCount = count;
_drawCount = drawCount;

// Validate
clearConfigurationResult();
Expand Down Expand Up @@ -294,20 +294,20 @@ void mvkCmdBindIndexBuffer(MVKCommandBuffer* cmdBuff,
void mvkCmdDrawIndirect(MVKCommandBuffer* cmdBuff,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t drawCount,
uint32_t stride) {
MVKCmdDrawIndirect* cmd = cmdBuff->_commandPool->_cmdDrawIndirectPool.acquireObject();
cmd->setContent(buffer, offset, count, stride);
cmd->setContent(buffer, offset, drawCount, stride);
cmdBuff->addCommand(cmd);
}

void mvkCmdDrawIndexedIndirect(MVKCommandBuffer* cmdBuff,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t count,
uint32_t drawCount,
uint32_t stride) {
MVKCmdDrawIndexedIndirect* cmd = cmdBuff->_commandPool->_cmdDrawIndexedIndirectPool.acquireObject();
cmd->setContent(buffer, offset, count, stride);
cmd->setContent(buffer, offset, drawCount, stride);
cmdBuff->addCommand(cmd);
}

Expand Down
Loading

0 comments on commit 6088fa8

Please sign in to comment.