Commit 00424c1b by Ben Clayton

Reintroduce "VkDebug: Update macros to address issues in b/127433389"

36411219 had preprocessor issues on Windows. This should now work on all platforms. I had to change UNIMPLEMENTED() and UNREACHABLE() to always take a format parameter to make this work on MSVC. This doesn't seem like a terrible thing though - especially if we can incorporate the frequency of hit UNIMPLEMENTED()'s to steer our focus. Change-Id: Idc58dbe6caa3fb51e085c3b236904c640091deec Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27468 Presubmit-Ready: Ben Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent c2bb50b7
...@@ -1496,7 +1496,7 @@ namespace sw ...@@ -1496,7 +1496,7 @@ namespace sw
if(!blitRoutine) if(!blitRoutine)
{ {
criticalSection.unlock(); criticalSection.unlock();
UNIMPLEMENTED(); UNIMPLEMENTED("blitRoutine");
return nullptr; return nullptr;
} }
...@@ -1518,7 +1518,7 @@ namespace sw ...@@ -1518,7 +1518,7 @@ namespace sw
if((region.srcSubresource.layerCount != region.dstSubresource.layerCount) || if((region.srcSubresource.layerCount != region.dstSubresource.layerCount) ||
(region.srcSubresource.aspectMask != region.dstSubresource.aspectMask)) (region.srcSubresource.aspectMask != region.dstSubresource.aspectMask))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("region");
} }
if(region.dstOffsets[0].x > region.dstOffsets[1].x) if(region.dstOffsets[0].x > region.dstOffsets[1].x)
......
...@@ -279,7 +279,7 @@ namespace sw ...@@ -279,7 +279,7 @@ namespace sw
mainBlockId = Block::ID(it.word(1)); mainBlockId = Block::ID(it.word(1));
break; break;
default: default:
ERR("Unexpected opcode '%s' following OpFunction", OpcodeName(it.opcode()).c_str()); WARN("Unexpected opcode '%s' following OpFunction", OpcodeName(it.opcode()).c_str());
} }
} }
ASSERT(mainBlockId.value() != 0); // Function's OpLabel not found ASSERT(mainBlockId.value() != 0); // Function's OpLabel not found
...@@ -424,7 +424,7 @@ namespace sw ...@@ -424,7 +424,7 @@ namespace sw
break; break;
default: default:
UNIMPLEMENTED(OpcodeName(insn.opcode()).c_str()); UNIMPLEMENTED("%s", OpcodeName(insn.opcode()).c_str());
} }
} }
} }
...@@ -1227,7 +1227,7 @@ namespace sw ...@@ -1227,7 +1227,7 @@ namespace sw
break; break;
default: default:
UNIMPLEMENTED(OpcodeName(insn.opcode()).c_str()); UNIMPLEMENTED("opcode: %s", OpcodeName(insn.opcode()).c_str());
break; break;
} }
} }
......
...@@ -392,14 +392,14 @@ namespace sw ...@@ -392,14 +392,14 @@ namespace sw
Type const &getType(Type::ID id) const Type const &getType(Type::ID id) const
{ {
auto it = types.find(id); auto it = types.find(id);
ASSERT(it != types.end()); ASSERT_MSG(it != types.end(), "Unknown type %d", id.value());
return it->second; return it->second;
} }
Object const &getObject(Object::ID id) const Object const &getObject(Object::ID id) const
{ {
auto it = defs.find(id); auto it = defs.find(id);
ASSERT(it != defs.end()); ASSERT_MSG(it != defs.end(), "Unknown object %d", id.value());
return it->second; return it->second;
} }
......
...@@ -601,7 +601,7 @@ VkResult CommandBuffer::begin(VkCommandBufferUsageFlags flags, const VkCommandBu ...@@ -601,7 +601,7 @@ VkResult CommandBuffer::begin(VkCommandBufferUsageFlags flags, const VkCommandBu
if(pInheritanceInfo) if(pInheritanceInfo)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pInheritanceInfo");
} }
if(state != INITIAL) if(state != INITIAL)
...@@ -646,7 +646,7 @@ void CommandBuffer::beginRenderPass(VkRenderPass renderPass, VkFramebuffer frame ...@@ -646,7 +646,7 @@ void CommandBuffer::beginRenderPass(VkRenderPass renderPass, VkFramebuffer frame
if(contents != VK_SUBPASS_CONTENTS_INLINE) if(contents != VK_SUBPASS_CONTENTS_INLINE)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("VK_SUBPASS_CONTENTS_INLINE");
} }
addCommand<BeginRenderPass>(renderPass, framebuffer, renderArea, clearValueCount, clearValues); addCommand<BeginRenderPass>(renderPass, framebuffer, renderArea, clearValueCount, clearValues);
...@@ -666,18 +666,18 @@ void CommandBuffer::endRenderPass() ...@@ -666,18 +666,18 @@ void CommandBuffer::endRenderPass()
void CommandBuffer::executeCommands(uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) void CommandBuffer::executeCommands(uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("executeCommands");
} }
void CommandBuffer::setDeviceMask(uint32_t deviceMask) void CommandBuffer::setDeviceMask(uint32_t deviceMask)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("setDeviceMask");
} }
void CommandBuffer::dispatchBase(uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, void CommandBuffer::dispatchBase(uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ,
uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("dispatchBase");
} }
void CommandBuffer::pipelineBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, void CommandBuffer::pipelineBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask,
...@@ -698,7 +698,7 @@ void CommandBuffer::bindPipeline(VkPipelineBindPoint pipelineBindPoint, VkPipeli ...@@ -698,7 +698,7 @@ void CommandBuffer::bindPipeline(VkPipelineBindPoint pipelineBindPoint, VkPipeli
addCommand<PipelineBind>(pipelineBindPoint, pipeline); addCommand<PipelineBind>(pipelineBindPoint, pipeline);
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("pipelineBindPoint");
} }
} }
...@@ -713,46 +713,46 @@ void CommandBuffer::bindVertexBuffers(uint32_t firstBinding, uint32_t bindingCou ...@@ -713,46 +713,46 @@ void CommandBuffer::bindVertexBuffers(uint32_t firstBinding, uint32_t bindingCou
void CommandBuffer::beginQuery(VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) void CommandBuffer::beginQuery(VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("beginQuery");
} }
void CommandBuffer::endQuery(VkQueryPool queryPool, uint32_t query) void CommandBuffer::endQuery(VkQueryPool queryPool, uint32_t query)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("endQuery");
} }
void CommandBuffer::resetQueryPool(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) void CommandBuffer::resetQueryPool(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("resetQueryPool");
} }
void CommandBuffer::writeTimestamp(VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) void CommandBuffer::writeTimestamp(VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("writeTimestamp");
} }
void CommandBuffer::copyQueryPoolResults(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, void CommandBuffer::copyQueryPoolResults(VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount,
VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("copyQueryPoolResults");
} }
void CommandBuffer::pushConstants(VkPipelineLayout layout, VkShaderStageFlags stageFlags, void CommandBuffer::pushConstants(VkPipelineLayout layout, VkShaderStageFlags stageFlags,
uint32_t offset, uint32_t size, const void* pValues) uint32_t offset, uint32_t size, const void* pValues)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pushConstants");
} }
void CommandBuffer::setViewport(uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) void CommandBuffer::setViewport(uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports)
{ {
// Note: The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT dynamic state enabled // Note: The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_VIEWPORT dynamic state enabled
UNIMPLEMENTED(); UNIMPLEMENTED("setViewport");
} }
void CommandBuffer::setScissor(uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) void CommandBuffer::setScissor(uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors)
{ {
// Note: The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled // Note: The bound graphics pipeline must have been created with the VK_DYNAMIC_STATE_SCISSOR dynamic state enabled
UNIMPLEMENTED(); UNIMPLEMENTED("setScissor");
} }
void CommandBuffer::setLineWidth(float lineWidth) void CommandBuffer::setLineWidth(float lineWidth)
...@@ -762,7 +762,7 @@ void CommandBuffer::setLineWidth(float lineWidth) ...@@ -762,7 +762,7 @@ void CommandBuffer::setLineWidth(float lineWidth)
// If the wide lines feature is not enabled, lineWidth must be 1.0 // If the wide lines feature is not enabled, lineWidth must be 1.0
ASSERT(lineWidth == 1.0f); ASSERT(lineWidth == 1.0f);
UNIMPLEMENTED(); UNIMPLEMENTED("setLineWidth");
} }
void CommandBuffer::setDepthBias(float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) void CommandBuffer::setDepthBias(float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor)
...@@ -772,7 +772,7 @@ void CommandBuffer::setDepthBias(float depthBiasConstantFactor, float depthBiasC ...@@ -772,7 +772,7 @@ void CommandBuffer::setDepthBias(float depthBiasConstantFactor, float depthBiasC
// If the depth bias clamping feature is not enabled, depthBiasClamp must be 0.0 // If the depth bias clamping feature is not enabled, depthBiasClamp must be 0.0
ASSERT(depthBiasClamp == 0.0f); ASSERT(depthBiasClamp == 0.0f);
UNIMPLEMENTED(); UNIMPLEMENTED("setDepthBias");
} }
void CommandBuffer::setBlendConstants(const float blendConstants[4]) void CommandBuffer::setBlendConstants(const float blendConstants[4])
...@@ -782,7 +782,7 @@ void CommandBuffer::setBlendConstants(const float blendConstants[4]) ...@@ -782,7 +782,7 @@ void CommandBuffer::setBlendConstants(const float blendConstants[4])
// blendConstants is an array of four values specifying the R, G, B, and A components // blendConstants is an array of four values specifying the R, G, B, and A components
// of the blend constant color used in blending, depending on the blend factor. // of the blend constant color used in blending, depending on the blend factor.
UNIMPLEMENTED(); UNIMPLEMENTED("setBlendConstants");
} }
void CommandBuffer::setDepthBounds(float minDepthBounds, float maxDepthBounds) void CommandBuffer::setDepthBounds(float minDepthBounds, float maxDepthBounds)
...@@ -793,7 +793,7 @@ void CommandBuffer::setDepthBounds(float minDepthBounds, float maxDepthBounds) ...@@ -793,7 +793,7 @@ void CommandBuffer::setDepthBounds(float minDepthBounds, float maxDepthBounds)
ASSERT(minDepthBounds >= 0.0f && minDepthBounds <= 1.0f); ASSERT(minDepthBounds >= 0.0f && minDepthBounds <= 1.0f);
ASSERT(maxDepthBounds >= 0.0f && maxDepthBounds <= 1.0f); ASSERT(maxDepthBounds >= 0.0f && maxDepthBounds <= 1.0f);
UNIMPLEMENTED(); UNIMPLEMENTED("setDepthBounds");
} }
void CommandBuffer::setStencilCompareMask(VkStencilFaceFlags faceMask, uint32_t compareMask) void CommandBuffer::setStencilCompareMask(VkStencilFaceFlags faceMask, uint32_t compareMask)
...@@ -803,7 +803,7 @@ void CommandBuffer::setStencilCompareMask(VkStencilFaceFlags faceMask, uint32_t ...@@ -803,7 +803,7 @@ void CommandBuffer::setStencilCompareMask(VkStencilFaceFlags faceMask, uint32_t
// faceMask must not be 0 // faceMask must not be 0
ASSERT(faceMask != 0); ASSERT(faceMask != 0);
UNIMPLEMENTED(); UNIMPLEMENTED("setStencilCompareMask");
} }
void CommandBuffer::setStencilWriteMask(VkStencilFaceFlags faceMask, uint32_t writeMask) void CommandBuffer::setStencilWriteMask(VkStencilFaceFlags faceMask, uint32_t writeMask)
...@@ -813,7 +813,7 @@ void CommandBuffer::setStencilWriteMask(VkStencilFaceFlags faceMask, uint32_t wr ...@@ -813,7 +813,7 @@ void CommandBuffer::setStencilWriteMask(VkStencilFaceFlags faceMask, uint32_t wr
// faceMask must not be 0 // faceMask must not be 0
ASSERT(faceMask != 0); ASSERT(faceMask != 0);
UNIMPLEMENTED(); UNIMPLEMENTED("setStencilWriteMask");
} }
void CommandBuffer::setStencilReference(VkStencilFaceFlags faceMask, uint32_t reference) void CommandBuffer::setStencilReference(VkStencilFaceFlags faceMask, uint32_t reference)
...@@ -823,7 +823,7 @@ void CommandBuffer::setStencilReference(VkStencilFaceFlags faceMask, uint32_t re ...@@ -823,7 +823,7 @@ void CommandBuffer::setStencilReference(VkStencilFaceFlags faceMask, uint32_t re
// faceMask must not be 0 // faceMask must not be 0
ASSERT(faceMask != 0); ASSERT(faceMask != 0);
UNIMPLEMENTED(); UNIMPLEMENTED("setStencilReference");
} }
void CommandBuffer::bindDescriptorSets(VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, void CommandBuffer::bindDescriptorSets(VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout,
...@@ -834,7 +834,7 @@ void CommandBuffer::bindDescriptorSets(VkPipelineBindPoint pipelineBindPoint, Vk ...@@ -834,7 +834,7 @@ void CommandBuffer::bindDescriptorSets(VkPipelineBindPoint pipelineBindPoint, Vk
if(dynamicOffsetCount > 0) if(dynamicOffsetCount > 0)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("bindDescriptorSets");
} }
for(uint32_t i = 0; i < descriptorSetCount; i++) for(uint32_t i = 0; i < descriptorSetCount; i++)
...@@ -855,7 +855,7 @@ void CommandBuffer::dispatch(uint32_t groupCountX, uint32_t groupCountY, uint32_ ...@@ -855,7 +855,7 @@ void CommandBuffer::dispatch(uint32_t groupCountX, uint32_t groupCountY, uint32_
void CommandBuffer::dispatchIndirect(VkBuffer buffer, VkDeviceSize offset) void CommandBuffer::dispatchIndirect(VkBuffer buffer, VkDeviceSize offset)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("dispatchIndirect");
} }
void CommandBuffer::copyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) void CommandBuffer::copyBuffer(VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions)
...@@ -974,7 +974,7 @@ void CommandBuffer::clearAttachments(uint32_t attachmentCount, const VkClearAtta ...@@ -974,7 +974,7 @@ void CommandBuffer::clearAttachments(uint32_t attachmentCount, const VkClearAtta
void CommandBuffer::resolveImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, void CommandBuffer::resolveImage(VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout,
uint32_t regionCount, const VkImageResolve* pRegions) uint32_t regionCount, const VkImageResolve* pRegions)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("resolveImage");
} }
void CommandBuffer::setEvent(VkEvent event, VkPipelineStageFlags stageMask) void CommandBuffer::setEvent(VkEvent event, VkPipelineStageFlags stageMask)
...@@ -996,7 +996,7 @@ void CommandBuffer::waitEvents(uint32_t eventCount, const VkEvent* pEvents, VkPi ...@@ -996,7 +996,7 @@ void CommandBuffer::waitEvents(uint32_t eventCount, const VkEvent* pEvents, VkPi
uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("waitEvents");
} }
void CommandBuffer::draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) void CommandBuffer::draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance)
...@@ -1011,12 +1011,12 @@ void CommandBuffer::drawIndexed(uint32_t indexCount, uint32_t instanceCount, uin ...@@ -1011,12 +1011,12 @@ void CommandBuffer::drawIndexed(uint32_t indexCount, uint32_t instanceCount, uin
void CommandBuffer::drawIndirect(VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) void CommandBuffer::drawIndirect(VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("drawIndirect");
} }
void CommandBuffer::drawIndexedIndirect(VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) void CommandBuffer::drawIndexedIndirect(VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("drawIndexedIndirect");
} }
void CommandBuffer::submit(CommandBuffer::ExecutionState& executionState) void CommandBuffer::submit(CommandBuffer::ExecutionState& executionState)
......
...@@ -14,25 +14,61 @@ ...@@ -14,25 +14,61 @@
#include "VkDebug.hpp" #include "VkDebug.hpp"
#include <string>
#include <stdarg.h> #include <stdarg.h>
namespace vk namespace vk
{ {
void trace(const char *format, ...)
void tracev(const char *format, va_list args)
{ {
#ifndef SWIFTSHADER_DISABLE_TRACE
if(false) if(false)
{ {
FILE *file = fopen("debug.txt", "a"); FILE *file = fopen(TRACE_OUTPUT_FILE, "a");
if(file) if(file)
{ {
vfprintf(file, format, args);
fclose(file);
}
}
#endif
}
void trace(const char *format, ...)
{
va_list vararg; va_list vararg;
va_start(vararg, format); va_start(vararg, format);
vfprintf(file, format, vararg); tracev(format, vararg);
va_end(vararg); va_end(vararg);
}
fclose(file); void warn(const char *format, ...)
} {
} va_list vararg;
va_start(vararg, format);
tracev(format, vararg);
va_end(vararg);
va_start(vararg, format);
vfprintf(stderr, format, vararg);
va_end(vararg);
}
void abort(const char *format, ...)
{
va_list vararg;
va_start(vararg, format);
tracev(format, vararg);
va_end(vararg);
va_start(vararg, format);
vfprintf(stderr, format, vararg);
va_end(vararg);
::abort();
} }
} }
...@@ -27,77 +27,85 @@ ...@@ -27,77 +27,85 @@
namespace vk namespace vk
{ {
// Outputs text to the debugging log // Outputs text to the debugging log
void trace(const char *format, ...); void trace(const char *format, ...);
inline void trace() {} inline void trace() {}
// Outputs text to the debugging log and prints to stderr.
void warn(const char *format, ...);
inline void warn() {}
// Outputs the message to the debugging log and stderr, and calls abort().
void abort(const char *format, ...);
} }
// A macro to output a trace of a function call and its arguments to the debugging log // A macro to output a trace of a function call and its arguments to the
// debugging log. Disabled if SWIFTSHADER_DISABLE_TRACE is defined.
#if defined(SWIFTSHADER_DISABLE_TRACE) #if defined(SWIFTSHADER_DISABLE_TRACE)
#define TRACE(message, ...) (void(0)) #define TRACE(message, ...) (void(0))
#else #else
#define TRACE(message, ...) vk::trace("trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) #define TRACE(message, ...) vk::trace("%s:%d TRACE: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#endif #endif
// A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing. // A macro to print a warning message to the debugging log and stderr to denote
#if defined(SWIFTSHADER_DISABLE_TRACE) // an issue that needs fixing.
#define FIXME(message, ...) (void(0)) #define FIXME(message, ...) vk::warn("%s:%d FIXME: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__);
#else
#define FIXME(message, ...) do {vk::trace("fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false); abort();} while(false)
#endif
// A macro to output a function call and its arguments to the debugging log, in case of error. // A macro to print a warning message to the debugging log and stderr.
#if defined(SWIFTSHADER_DISABLE_TRACE) #define WARN(message, ...) vk::warn("%s:%d WARNING: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__);
#define ERR(message, ...) (void(0))
// A macro that prints the message to the debugging log and stderr and
// immediately aborts execution of the application.
//
// Note: This will terminate the application regardless of build flags!
// Use with extreme caution!
#undef ABORT
#define ABORT(message, ...) vk::abort("%s:%d ABORT: " message "\n", __FILE__, __LINE__, ##__VA_ARGS__)
// A macro that delegates to:
// ABORT() in debug builds (!NDEBUG || DCHECK_ALWAYS_ON)
// or
// WARN() in release builds (NDEBUG && !DCHECK_ALWAYS_ON)
#undef DABORT
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#define DABORT(message, ...) ABORT(message, ##__VA_ARGS__)
#else #else
#define ERR(message, ...) do {vk::trace("err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false); abort();} while(false) #define DABORT(message, ...) WARN(message, ##__VA_ARGS__)
#endif #endif
// A macro asserting a condition and outputting failures to the debug log // A macro asserting a condition.
// If the condition fails, the condition and message is passed to DABORT().
#undef ASSERT_MSG
#define ASSERT_MSG(expression, format, ...) do { \
if(!(expression)) { \
DABORT("ASSERT(%s): " format "\n", #expression, ##__VA_ARGS__); \
} } while(0)
// A macro asserting a condition.
// If the condition fails, the condition is passed to DABORT().
#undef ASSERT #undef ASSERT
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#define ASSERT(expression) do { \ #define ASSERT(expression) do { \
if(!(expression)) { \ if(!(expression)) { \
ERR("\t! Assert failed in %s(%d): "#expression"\n", __FUNCTION__, __LINE__); \ DABORT("ASSERT(%s)\n", #expression); \
assert(expression); \
abort(); \
} } while(0) } } while(0)
#else
#define ASSERT(expression) (void(0))
#endif
// A macro to indicate unimplemented functionality // A macro to indicate unimplemented functionality.
#undef UNIMPLEMENTED #undef UNIMPLEMENTED
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) #define UNIMPLEMENTED(format, ...) DABORT("UNIMPLEMENTED: " format, ##__VA_ARGS__)
#define UNIMPLEMENTED(...) do { \
vk::trace("\t! Unimplemented: %s(%d): ", __FUNCTION__, __LINE__); \
vk::trace(__VA_ARGS__); \
vk::trace("\n"); \
assert(false); \
abort(); \
} while(0)
#else
#define UNIMPLEMENTED(...) FIXME("\t! Unimplemented: %s(%d)\n", __FUNCTION__, __LINE__)
#endif
// A macro for code which is not expected to be reached under valid assumptions // A macro for code which is not expected to be reached under valid assumptions.
#undef UNREACHABLE #undef UNREACHABLE
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) #define UNREACHABLE(format, ...) DABORT("UNREACHABLE: " format, ##__VA_ARGS__)
#define UNREACHABLE(value) do { \
ERR("\t! Unreachable case reached: %s(%d). %s: %d\n", __FUNCTION__, __LINE__, #value, value); \
assert(false); \
abort(); \
} while(0)
#else
#define UNREACHABLE(value) ERR("\t! Unreachable reached: %s(%d). %s: %d\n", __FUNCTION__, __LINE__, #value, value)
#endif
// A macro asserting a condition and outputting failures to the debug log, or return when in release mode. // A macro asserting a condition and performing a return.
#undef ASSERT_OR_RETURN #undef ASSERT_OR_RETURN
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
#define ASSERT_OR_RETURN(expression) ASSERT(expression)
#else
#define ASSERT_OR_RETURN(expression) do { \ #define ASSERT_OR_RETURN(expression) do { \
if(!(expression)) { \ if(!(expression)) { \
ASSERT(expression); \
return; \ return; \
} } while(0) } } while(0)
#endif
#endif // VK_DEBUG_H_ #endif // VK_DEBUG_H_
...@@ -204,7 +204,7 @@ const uint8_t* DescriptorSetLayout::GetInputData(const VkWriteDescriptorSet& des ...@@ -204,7 +204,7 @@ const uint8_t* DescriptorSetLayout::GetInputData(const VkWriteDescriptorSet& des
return reinterpret_cast<const uint8_t*>(descriptorWrites.pBufferInfo); return reinterpret_cast<const uint8_t*>(descriptorWrites.pBufferInfo);
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("descriptorType");
return nullptr; return nullptr;
} }
} }
......
...@@ -49,7 +49,7 @@ Device::Device(const Device::CreateInfo* info, void* mem) ...@@ -49,7 +49,7 @@ Device::Device(const Device::CreateInfo* info, void* mem)
if(pCreateInfo->enabledLayerCount) if(pCreateInfo->enabledLayerCount)
{ {
// "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations." // "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations."
UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. UNIMPLEMENTED("enabledLayerCount"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.
} }
blitter = new sw::Blitter(); blitter = new sw::Blitter();
......
...@@ -89,7 +89,7 @@ void Image::getSubresourceLayout(const VkImageSubresource* pSubresource, VkSubre ...@@ -89,7 +89,7 @@ void Image::getSubresourceLayout(const VkImageSubresource* pSubresource, VkSubre
(pSubresource->aspectMask == VK_IMAGE_ASPECT_DEPTH_BIT) || (pSubresource->aspectMask == VK_IMAGE_ASPECT_DEPTH_BIT) ||
(pSubresource->aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT))) (pSubresource->aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT)))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("aspectMask");
} }
auto aspect = static_cast<VkImageAspectFlagBits>(pSubresource->aspectMask); auto aspect = static_cast<VkImageAspectFlagBits>(pSubresource->aspectMask);
pLayout->offset = getMemoryOffset(aspect, pSubresource->mipLevel, pSubresource->arrayLayer); pLayout->offset = getMemoryOffset(aspect, pSubresource->mipLevel, pSubresource->arrayLayer);
...@@ -111,7 +111,7 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion) ...@@ -111,7 +111,7 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion)
(pRegion.srcSubresource.baseArrayLayer != 0) || (pRegion.srcSubresource.baseArrayLayer != 0) ||
(pRegion.srcSubresource.layerCount != 1)) (pRegion.srcSubresource.layerCount != 1))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("srcSubresource");
} }
if(!((pRegion.dstSubresource.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) || if(!((pRegion.dstSubresource.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) ||
...@@ -120,7 +120,7 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion) ...@@ -120,7 +120,7 @@ void Image::copyTo(VkImage dstImage, const VkImageCopy& pRegion)
(pRegion.dstSubresource.baseArrayLayer != 0) || (pRegion.dstSubresource.baseArrayLayer != 0) ||
(pRegion.dstSubresource.layerCount != 1)) (pRegion.dstSubresource.layerCount != 1))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("dstSubresource");
} }
VkImageAspectFlagBits srcAspect = static_cast<VkImageAspectFlagBits>(pRegion.srcSubresource.aspectMask); VkImageAspectFlagBits srcAspect = static_cast<VkImageAspectFlagBits>(pRegion.srcSubresource.aspectMask);
...@@ -210,7 +210,7 @@ void Image::copy(VkBuffer buf, const VkBufferImageCopy& region, bool bufferIsSou ...@@ -210,7 +210,7 @@ void Image::copy(VkBuffer buf, const VkBufferImageCopy& region, bool bufferIsSou
(region.imageSubresource.aspectMask == VK_IMAGE_ASPECT_DEPTH_BIT) || (region.imageSubresource.aspectMask == VK_IMAGE_ASPECT_DEPTH_BIT) ||
(region.imageSubresource.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT))) (region.imageSubresource.aspectMask == VK_IMAGE_ASPECT_STENCIL_BIT)))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("imageSubresource");
} }
VkImageAspectFlagBits aspect = static_cast<VkImageAspectFlagBits>(region.imageSubresource.aspectMask); VkImageAspectFlagBits aspect = static_cast<VkImageAspectFlagBits>(region.imageSubresource.aspectMask);
...@@ -541,7 +541,7 @@ void Image::clear(void* pixelData, VkFormat format, const VkImageSubresourceRang ...@@ -541,7 +541,7 @@ void Image::clear(void* pixelData, VkFormat format, const VkImageSubresourceRang
if((subresourceRange.baseMipLevel != 0) || if((subresourceRange.baseMipLevel != 0) ||
(subresourceRange.levelCount != 1)) (subresourceRange.levelCount != 1))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("subresourceRange");
} }
device->getBlitter()->clear(pixelData, format, this, subresourceRange, &renderArea); device->getBlitter()->clear(pixelData, format, this, subresourceRange, &renderArea);
...@@ -551,7 +551,7 @@ void Image::clear(const VkClearColorValue& color, const VkImageSubresourceRange& ...@@ -551,7 +551,7 @@ void Image::clear(const VkClearColorValue& color, const VkImageSubresourceRange&
{ {
if(!(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)) if(!(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("aspectMask");
} }
device->getBlitter()->clear((void*)color.float32, getClearFormat(), this, subresourceRange); device->getBlitter()->clear((void*)color.float32, getClearFormat(), this, subresourceRange);
...@@ -562,7 +562,7 @@ void Image::clear(const VkClearDepthStencilValue& color, const VkImageSubresourc ...@@ -562,7 +562,7 @@ void Image::clear(const VkClearDepthStencilValue& color, const VkImageSubresourc
if((subresourceRange.aspectMask & ~(VK_IMAGE_ASPECT_DEPTH_BIT | if((subresourceRange.aspectMask & ~(VK_IMAGE_ASPECT_DEPTH_BIT |
VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) VK_IMAGE_ASPECT_STENCIL_BIT)) != 0)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("aspectMask");
} }
if(subresourceRange.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) if(subresourceRange.aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT)
...@@ -588,7 +588,7 @@ void Image::clear(const VkClearValue& clearValue, const VkRect2D& renderArea, co ...@@ -588,7 +588,7 @@ void Image::clear(const VkClearValue& clearValue, const VkRect2D& renderArea, co
(subresourceRange.baseMipLevel != 0) || (subresourceRange.baseMipLevel != 0) ||
(subresourceRange.levelCount != 1)) (subresourceRange.levelCount != 1))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("subresourceRange");
} }
if(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) if(subresourceRange.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT)
......
...@@ -84,12 +84,12 @@ void ImageView::clear(const VkClearValue& clearValue, const VkImageAspectFlags a ...@@ -84,12 +84,12 @@ void ImageView::clear(const VkClearValue& clearValue, const VkImageAspectFlags a
if(!imageTypesMatch(image->getImageType())) if(!imageTypesMatch(image->getImageType()))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("imageTypesMatch");
} }
if(image->getFormat() != format) if(image->getFormat() != format)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("format");
} }
VkImageSubresourceRange sr = subresourceRange; VkImageSubresourceRange sr = subresourceRange;
...@@ -103,12 +103,12 @@ void ImageView::clear(const VkClearValue& clearValue, const VkImageAspectFlags a ...@@ -103,12 +103,12 @@ void ImageView::clear(const VkClearValue& clearValue, const VkImageAspectFlags a
if(!imageTypesMatch(image->getImageType())) if(!imageTypesMatch(image->getImageType()))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("imageTypesMatch");
} }
if(image->getFormat() != format) if(image->getFormat() != format)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("format");
} }
VkImageSubresourceRange sr; VkImageSubresourceRange sr;
......
...@@ -655,7 +655,7 @@ void PhysicalDevice::getImageFormatProperties(VkFormat format, VkImageType type, ...@@ -655,7 +655,7 @@ void PhysicalDevice::getImageFormatProperties(VkFormat format, VkImageType type,
pImageFormatProperties->maxArrayLayers = 1; // no 3D + layers pImageFormatProperties->maxArrayLayers = 1; // no 3D + layers
break; break;
default: default:
UNREACHABLE(type); UNREACHABLE("VkImageType: %d", int(type));
break; break;
} }
......
...@@ -53,7 +53,7 @@ sw::DrawType Convert(VkPrimitiveTopology topology) ...@@ -53,7 +53,7 @@ sw::DrawType Convert(VkPrimitiveTopology topology)
ASSERT(false); ASSERT(false);
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("topology");
} }
return sw::DRAW_TRIANGLELIST; return sw::DRAW_TRIANGLELIST;
...@@ -119,7 +119,7 @@ sw::StreamType getStreamType(VkFormat format) ...@@ -119,7 +119,7 @@ sw::StreamType getStreamType(VkFormat format)
case VK_FORMAT_R32G32B32A32_SFLOAT: case VK_FORMAT_R32G32B32A32_SFLOAT:
return sw::STREAMTYPE_FLOAT; return sw::STREAMTYPE_FLOAT;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("format");
} }
return sw::STREAMTYPE_BYTE; return sw::STREAMTYPE_BYTE;
...@@ -179,7 +179,7 @@ uint32_t getNumberOfChannels(VkFormat format) ...@@ -179,7 +179,7 @@ uint32_t getNumberOfChannels(VkFormat format)
case VK_FORMAT_R32G32B32A32_SFLOAT: case VK_FORMAT_R32G32B32A32_SFLOAT:
return 4; return 4;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("format");
} }
return 0; return 0;
...@@ -194,19 +194,17 @@ std::vector<uint32_t> preprocessSpirv( ...@@ -194,19 +194,17 @@ std::vector<uint32_t> preprocessSpirv(
spvtools::Optimizer opt{SPV_ENV_VULKAN_1_1}; spvtools::Optimizer opt{SPV_ENV_VULKAN_1_1};
opt.SetMessageConsumer([](spv_message_level_t level, const char*, const spv_position_t& p, const char* m) { opt.SetMessageConsumer([](spv_message_level_t level, const char*, const spv_position_t& p, const char* m) {
const char* category = "";
switch (level) switch (level)
{ {
case SPV_MSG_FATAL: case SPV_MSG_FATAL: category = "FATAL"; break;
case SPV_MSG_INTERNAL_ERROR: case SPV_MSG_INTERNAL_ERROR: category = "INTERNAL_ERROR"; break;
case SPV_MSG_ERROR: case SPV_MSG_ERROR: category = "ERROR"; break;
ERR("%d:%d %s", p.line, p.column, m); case SPV_MSG_WARNING: category = "WARNING"; break;
break; case SPV_MSG_INFO: category = "INFO"; break;
case SPV_MSG_WARNING: case SPV_MSG_DEBUG: category = "DEBUG"; break;
case SPV_MSG_INFO:
case SPV_MSG_DEBUG:
TRACE("%d:%d %s", p.line, p.column, m);
break;
} }
vk::trace("%s: %d:%d %s", category, p.line, p.column, m);
}); });
opt.RegisterPass(spvtools::CreateInlineExhaustivePass()); opt.RegisterPass(spvtools::CreateInlineExhaustivePass());
...@@ -264,13 +262,13 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -264,13 +262,13 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
(pCreateInfo->basePipelineHandle != VK_NULL_HANDLE) || (pCreateInfo->basePipelineHandle != VK_NULL_HANDLE) ||
(pCreateInfo->basePipelineIndex != 0)) (pCreateInfo->basePipelineIndex != 0))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo settings");
} }
const VkPipelineVertexInputStateCreateInfo* vertexInputState = pCreateInfo->pVertexInputState; const VkPipelineVertexInputStateCreateInfo* vertexInputState = pCreateInfo->pVertexInputState;
if(vertexInputState->flags != 0) if(vertexInputState->flags != 0)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("vertexInputState->flags");
} }
// Context must always have a PipelineLayout set. // Context must always have a PipelineLayout set.
...@@ -285,7 +283,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -285,7 +283,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
bufferStrides[desc.binding] = desc.stride; bufferStrides[desc.binding] = desc.stride;
if(desc.inputRate != VK_VERTEX_INPUT_RATE_VERTEX) if(desc.inputRate != VK_VERTEX_INPUT_RATE_VERTEX)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("vertexInputState->pVertexBindingDescriptions[%d]", i);
} }
} }
...@@ -305,7 +303,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -305,7 +303,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
if((assemblyState->flags != 0) || if((assemblyState->flags != 0) ||
(assemblyState->primitiveRestartEnable != 0)) (assemblyState->primitiveRestartEnable != 0))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pInputAssemblyState settings");
} }
context.drawType = Convert(assemblyState->topology); context.drawType = Convert(assemblyState->topology);
...@@ -317,7 +315,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -317,7 +315,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
(viewportState->viewportCount != 1) || (viewportState->viewportCount != 1) ||
(viewportState->scissorCount != 1)) (viewportState->scissorCount != 1))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pViewportState settings");
} }
scissor = viewportState->pScissors[0]; scissor = viewportState->pScissors[0];
...@@ -329,7 +327,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -329,7 +327,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
(rasterizationState->depthClampEnable != 0) || (rasterizationState->depthClampEnable != 0) ||
(rasterizationState->polygonMode != VK_POLYGON_MODE_FILL)) (rasterizationState->polygonMode != VK_POLYGON_MODE_FILL))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pRasterizationState settings");
} }
context.rasterizerDiscard = rasterizationState->rasterizerDiscardEnable; context.rasterizerDiscard = rasterizationState->rasterizerDiscardEnable;
...@@ -359,7 +357,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -359,7 +357,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
(multisampleState->alphaToCoverageEnable != 0) || (multisampleState->alphaToCoverageEnable != 0) ||
(multisampleState->alphaToOneEnable != 0)) (multisampleState->alphaToOneEnable != 0))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("multisampleState");
} }
} }
else else
...@@ -373,7 +371,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -373,7 +371,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
if((depthStencilState->flags != 0) || if((depthStencilState->flags != 0) ||
(depthStencilState->depthBoundsTestEnable != 0)) (depthStencilState->depthBoundsTestEnable != 0))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("depthStencilState");
} }
context.depthBufferEnable = depthStencilState->depthTestEnable; context.depthBufferEnable = depthStencilState->depthTestEnable;
...@@ -408,7 +406,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -408,7 +406,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
((colorBlendState->logicOpEnable != 0) && ((colorBlendState->logicOpEnable != 0) &&
(colorBlendState->attachmentCount > 1))) (colorBlendState->attachmentCount > 1)))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("colorBlendState");
} }
blendConstants.r = colorBlendState->blendConstants[0]; blendConstants.r = colorBlendState->blendConstants[0];
...@@ -421,7 +419,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn ...@@ -421,7 +419,7 @@ GraphicsPipeline::GraphicsPipeline(const VkGraphicsPipelineCreateInfo* pCreateIn
const VkPipelineColorBlendAttachmentState& attachment = colorBlendState->pAttachments[0]; const VkPipelineColorBlendAttachmentState& attachment = colorBlendState->pAttachments[0];
if(attachment.colorWriteMask != (VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT)) if(attachment.colorWriteMask != (VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("colorWriteMask");
} }
context.alphaBlendEnable = attachment.blendEnable; context.alphaBlendEnable = attachment.blendEnable;
...@@ -455,7 +453,7 @@ void GraphicsPipeline::compileShaders(const VkAllocationCallbacks* pAllocator, c ...@@ -455,7 +453,7 @@ void GraphicsPipeline::compileShaders(const VkAllocationCallbacks* pAllocator, c
{ {
if (pStage->flags != 0) if (pStage->flags != 0)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pStage->flags");
} }
auto module = Cast(pStage->module); auto module = Cast(pStage->module);
...@@ -497,7 +495,7 @@ uint32_t GraphicsPipeline::computePrimitiveCount(uint32_t vertexCount) const ...@@ -497,7 +495,7 @@ uint32_t GraphicsPipeline::computePrimitiveCount(uint32_t vertexCount) const
case sw::DRAW_TRIANGLEFAN: case sw::DRAW_TRIANGLEFAN:
return vertexCount - 2; return vertexCount - 2;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("drawType");
} }
return 0; return 0;
......
...@@ -27,7 +27,7 @@ namespace vk ...@@ -27,7 +27,7 @@ namespace vk
// pipelineStatistics member of the VkQueryPoolCreateInfo structure." // pipelineStatistics member of the VkQueryPoolCreateInfo structure."
if(pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS) if(pCreateInfo->queryType == VK_QUERY_TYPE_PIPELINE_STATISTICS)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->queryType");
} }
} }
...@@ -48,7 +48,7 @@ namespace vk ...@@ -48,7 +48,7 @@ namespace vk
char* data = static_cast<char*>(pData); char* data = static_cast<char*>(pData);
for(uint32_t i = 0; i < pQueryCount; i++, data += pStride) for(uint32_t i = 0; i < pQueryCount; i++, data += pStride)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("queries");
} }
} }
} // namespace vk } // namespace vk
...@@ -110,7 +110,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCre ...@@ -110,7 +110,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCre
if(pCreateInfo->enabledLayerCount) if(pCreateInfo->enabledLayerCount)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->enabledLayerCount");
} }
for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; ++i) for (uint32_t i = 0; i < pCreateInfo->enabledExtensionCount; ++i)
...@@ -146,7 +146,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCre ...@@ -146,7 +146,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo* pCre
// Vulkan structures in this Specification." // Vulkan structures in this Specification."
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext");
} }
} }
...@@ -234,7 +234,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysic ...@@ -234,7 +234,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysic
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("tiling");
} }
vk::Cast(physicalDevice)->getImageFormatProperties(format, type, tiling, usage, flags, pImageFormatProperties); vk::Cast(physicalDevice)->getImageFormatProperties(format, type, tiling, usage, flags, pImageFormatProperties);
...@@ -293,7 +293,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c ...@@ -293,7 +293,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
if(pCreateInfo->enabledLayerCount) if(pCreateInfo->enabledLayerCount)
{ {
// "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations." // "The ppEnabledLayerNames and enabledLayerCount members of VkDeviceCreateInfo are deprecated and their values must be ignored by implementations."
UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. UNIMPLEMENTED("pCreateInfo->enabledLayerCount"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.
} }
...@@ -391,7 +391,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c ...@@ -391,7 +391,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
break; break;
default: default:
// "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]" // "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]"
UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. UNIMPLEMENTED("extensionCreateInfo->sType"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.
break; break;
} }
...@@ -404,7 +404,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c ...@@ -404,7 +404,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
{ {
if(!vk::Cast(physicalDevice)->hasFeatures(*(pCreateInfo->pEnabledFeatures))) if(!vk::Cast(physicalDevice)->hasFeatures(*(pCreateInfo->pEnabledFeatures)))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pEnabledFeatures");
return VK_ERROR_FEATURE_NOT_PRESENT; return VK_ERROR_FEATURE_NOT_PRESENT;
} }
} }
...@@ -416,7 +416,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c ...@@ -416,7 +416,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c
const VkDeviceQueueCreateInfo& queueCreateInfo = pCreateInfo->pQueueCreateInfos[i]; const VkDeviceQueueCreateInfo& queueCreateInfo = pCreateInfo->pQueueCreateInfos[i];
if(queueCreateInfo.pNext || queueCreateInfo.flags) if(queueCreateInfo.pNext || queueCreateInfo.flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("queueCreateInfo.pNext || queueCreateInfo.flags");
} }
ASSERT(queueCreateInfo.queueFamilyIndex < queueFamilyPropertyCount); ASSERT(queueCreateInfo.queueFamilyIndex < queueFamilyPropertyCount);
...@@ -558,7 +558,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryA ...@@ -558,7 +558,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory(VkDevice device, const VkMemoryA
// includes a handle of the sole buffer or image resource that the memory *can* be bound to." // includes a handle of the sole buffer or image resource that the memory *can* be bound to."
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("allocationInfo->sType");
break; break;
} }
...@@ -700,7 +700,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhys ...@@ -700,7 +700,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhys
VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) VKAPI_ATTR VkResult VKAPI_CALL vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkQueueBindSparse");
return VK_SUCCESS; return VK_SUCCESS;
} }
...@@ -711,7 +711,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreat ...@@ -711,7 +711,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreat
if(pCreateInfo->pNext) if(pCreateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext");
} }
return vk::Fence::Create(pAllocator, pCreateInfo, pFence); return vk::Fence::Create(pAllocator, pCreateInfo, pFence);
...@@ -763,7 +763,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaph ...@@ -763,7 +763,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore(VkDevice device, const VkSemaph
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::Semaphore::Create(pAllocator, pCreateInfo, pSemaphore); return vk::Semaphore::Create(pAllocator, pCreateInfo, pSemaphore);
...@@ -784,7 +784,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreat ...@@ -784,7 +784,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreat
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::Event::Create(pAllocator, pCreateInfo, pEvent); return vk::Event::Create(pAllocator, pCreateInfo, pEvent);
...@@ -830,7 +830,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryP ...@@ -830,7 +830,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool(VkDevice device, const VkQueryP
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::QueryPool::Create(pAllocator, pCreateInfo, pQueryPool); return vk::QueryPool::Create(pAllocator, pCreateInfo, pQueryPool);
...@@ -861,7 +861,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCre ...@@ -861,7 +861,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer(VkDevice device, const VkBufferCre
if(pCreateInfo->pNext) if(pCreateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext");
} }
return vk::Buffer::Create(pAllocator, pCreateInfo, pBuffer); return vk::Buffer::Create(pAllocator, pCreateInfo, pBuffer);
...@@ -882,7 +882,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBuffe ...@@ -882,7 +882,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferView(VkDevice device, const VkBuffe
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::BufferView::Create(pAllocator, pCreateInfo, pView); return vk::BufferView::Create(pAllocator, pCreateInfo, pView);
...@@ -903,7 +903,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreat ...@@ -903,7 +903,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreat
if(pCreateInfo->pNext) if(pCreateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext");
} }
vk::Image::CreateInfo imageCreateInfo = vk::Image::CreateInfo imageCreateInfo =
...@@ -938,7 +938,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageV ...@@ -938,7 +938,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView(VkDevice device, const VkImageV
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::ImageView::Create(pAllocator, pCreateInfo, pView); return vk::ImageView::Create(pAllocator, pCreateInfo, pView);
...@@ -959,7 +959,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkSha ...@@ -959,7 +959,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateShaderModule(VkDevice device, const VkSha
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::ShaderModule::Create(pAllocator, pCreateInfo, pShaderModule); return vk::ShaderModule::Create(pAllocator, pCreateInfo, pShaderModule);
...@@ -980,7 +980,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPi ...@@ -980,7 +980,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineCache(VkDevice device, const VkPi
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::PipelineCache::Create(pAllocator, pCreateInfo, pPipelineCache); return vk::PipelineCache::Create(pAllocator, pCreateInfo, pPipelineCache);
...@@ -997,14 +997,14 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCac ...@@ -997,14 +997,14 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyPipelineCache(VkDevice device, VkPipelineCac
VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkGetPipelineCacheData");
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) VKAPI_ATTR VkResult VKAPI_CALL vkMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkMergePipelineCaches");
return VK_SUCCESS; return VK_SUCCESS;
} }
...@@ -1089,7 +1089,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkP ...@@ -1089,7 +1089,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreatePipelineLayout(VkDevice device, const VkP
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::PipelineLayout::Create(pAllocator, pCreateInfo, pPipelineLayout); return vk::PipelineLayout::Create(pAllocator, pCreateInfo, pPipelineLayout);
...@@ -1110,7 +1110,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerC ...@@ -1110,7 +1110,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateSampler(VkDevice device, const VkSamplerC
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::Sampler::Create(pAllocator, pCreateInfo, pSampler); return vk::Sampler::Create(pAllocator, pCreateInfo, pSampler);
...@@ -1131,7 +1131,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, cons ...@@ -1131,7 +1131,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, cons
if(pCreateInfo->pNext) if(pCreateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext");
} }
return vk::DescriptorSetLayout::Create(pAllocator, pCreateInfo, pSetLayout); return vk::DescriptorSetLayout::Create(pAllocator, pCreateInfo, pSetLayout);
...@@ -1152,7 +1152,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkD ...@@ -1152,7 +1152,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkD
if(pCreateInfo->pNext) if(pCreateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext");
} }
return vk::DescriptorPool::Create(pAllocator, pCreateInfo, pDescriptorPool); return vk::DescriptorPool::Create(pAllocator, pCreateInfo, pDescriptorPool);
...@@ -1173,7 +1173,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescript ...@@ -1173,7 +1173,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescript
if(flags) if(flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("flags");
} }
return vk::Cast(descriptorPool)->reset(); return vk::Cast(descriptorPool)->reset();
...@@ -1186,7 +1186,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const V ...@@ -1186,7 +1186,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const V
if(pAllocateInfo->pNext) if(pAllocateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pAllocateInfo->pNext");
} }
return vk::Cast(pAllocateInfo->descriptorPool)->allocateSets( return vk::Cast(pAllocateInfo->descriptorPool)->allocateSets(
...@@ -1218,7 +1218,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFram ...@@ -1218,7 +1218,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateFramebuffer(VkDevice device, const VkFram
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::Framebuffer::Create(pAllocator, pCreateInfo, pFramebuffer); return vk::Framebuffer::Create(pAllocator, pCreateInfo, pFramebuffer);
...@@ -1238,7 +1238,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRende ...@@ -1238,7 +1238,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice device, const VkRende
if(pCreateInfo->pNext || pCreateInfo->flags) if(pCreateInfo->pNext || pCreateInfo->flags)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags");
} }
return vk::RenderPass::Create(pAllocator, pCreateInfo, pRenderPass); return vk::RenderPass::Create(pAllocator, pCreateInfo, pRenderPass);
...@@ -1267,7 +1267,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkComm ...@@ -1267,7 +1267,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkComm
if(pCreateInfo->pNext) if(pCreateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext");
} }
return vk::CommandPool::Create(pAllocator, pCreateInfo, pCommandPool); return vk::CommandPool::Create(pAllocator, pCreateInfo, pCommandPool);
...@@ -1296,7 +1296,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const V ...@@ -1296,7 +1296,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const V
if(pAllocateInfo->pNext) if(pAllocateInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pAllocateInfo->pNext");
} }
return vk::Cast(pAllocateInfo->commandPool)->allocateCommandBuffers( return vk::Cast(pAllocateInfo->commandPool)->allocateCommandBuffers(
...@@ -1318,7 +1318,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffe ...@@ -1318,7 +1318,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuffer commandBuffe
if(pBeginInfo->pNext) if(pBeginInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pBeginInfo->pNext");
} }
return vk::Cast(commandBuffer)->begin(pBeginInfo->flags, pBeginInfo->pInheritanceInfo); return vk::Cast(commandBuffer)->begin(pBeginInfo->flags, pBeginInfo->pInheritanceInfo);
...@@ -1668,7 +1668,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, c ...@@ -1668,7 +1668,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderPass(VkCommandBuffer commandBuffer, c
if(pRenderPassBegin->pNext) if(pRenderPassBegin->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pRenderPassBegin->pNext");
} }
vk::Cast(commandBuffer)->beginRenderPass(pRenderPassBegin->renderPass, pRenderPassBegin->framebuffer, vk::Cast(commandBuffer)->beginRenderPass(pRenderPassBegin->renderPass, pRenderPassBegin->framebuffer,
...@@ -1715,7 +1715,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2(VkDevice device, uint32_t bin ...@@ -1715,7 +1715,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2(VkDevice device, uint32_t bin
{ {
if(pBindInfos[i].pNext) if(pBindInfos[i].pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pBindInfos[%d].pNext", i);
} }
vk::Cast(pBindInfos[i].buffer)->bind(pBindInfos[i].memory, pBindInfos[i].memoryOffset); vk::Cast(pBindInfos[i].buffer)->bind(pBindInfos[i].memory, pBindInfos[i].memoryOffset);
...@@ -1727,7 +1727,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2(VkDevice device, uint32_t bin ...@@ -1727,7 +1727,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkBindBufferMemory2(VkDevice device, uint32_t bin
VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) VKAPI_ATTR VkResult VKAPI_CALL vkBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkBindImageMemory2");
return VK_SUCCESS; return VK_SUCCESS;
} }
...@@ -1737,19 +1737,19 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, u ...@@ -1737,19 +1737,19 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceGroupPeerMemoryFeatures(VkDevice device, u
device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures); device, heapIndex, localDeviceIndex, remoteDeviceIndex, pPeerMemoryFeatures);
ASSERT(localDeviceIndex != remoteDeviceIndex); // "localDeviceIndex must not equal remoteDeviceIndex" ASSERT(localDeviceIndex != remoteDeviceIndex); // "localDeviceIndex must not equal remoteDeviceIndex"
UNREACHABLE(remoteDeviceIndex); // Only one physical device is supported, and since the device indexes can't be equal, this should never be called. UNREACHABLE("remoteDeviceIndex: %d", int(remoteDeviceIndex)); // Only one physical device is supported, and since the device indexes can't be equal, this should never be called.
} }
VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) VKAPI_ATTR void VKAPI_CALL vkCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkCmdSetDeviceMask");
} }
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) VKAPI_ATTR void VKAPI_CALL vkCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkCmdDispatchBase");
} }
VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) VKAPI_ATTR VkResult VKAPI_CALL vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties)
...@@ -1776,7 +1776,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2(VkDevice device, const ...@@ -1776,7 +1776,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetImageMemoryRequirements2(VkDevice device, const
if(pInfo->pNext || pMemoryRequirements->pNext) if(pInfo->pNext || pMemoryRequirements->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pInfo->pNext || pMemoryRequirements->pNext");
} }
vkGetImageMemoryRequirements(device, pInfo->image, &(pMemoryRequirements->memoryRequirements)); vkGetImageMemoryRequirements(device, pInfo->image, &(pMemoryRequirements->memoryRequirements));
...@@ -1789,7 +1789,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const ...@@ -1789,7 +1789,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const
if(pInfo->pNext) if(pInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pInfo->pNext");
} }
VkBaseOutStructure* extensionRequirements = reinterpret_cast<VkBaseOutStructure*>(pMemoryRequirements->pNext); VkBaseOutStructure* extensionRequirements = reinterpret_cast<VkBaseOutStructure*>(pMemoryRequirements->pNext);
...@@ -1805,7 +1805,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const ...@@ -1805,7 +1805,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetBufferMemoryRequirements2(VkDevice device, const
} }
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED("extensionRequirements->sType");
break; break;
} }
...@@ -1822,7 +1822,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2(VkDevice device, ...@@ -1822,7 +1822,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetImageSparseMemoryRequirements2(VkDevice device,
if(pInfo->pNext || pSparseMemoryRequirements->pNext) if(pInfo->pNext || pSparseMemoryRequirements->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pInfo->pNext || pSparseMemoryRequirements->pNext");
} }
vkGetImageSparseMemoryRequirements(device, pInfo->image, pSparseMemoryRequirementCount, &(pSparseMemoryRequirements->memoryRequirements)); vkGetImageSparseMemoryRequirements(device, pInfo->image, pSparseMemoryRequirementCount, &(pSparseMemoryRequirements->memoryRequirements));
...@@ -1875,7 +1875,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physica ...@@ -1875,7 +1875,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physica
break; break;
default: default:
// "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]" // "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]"
UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. UNIMPLEMENTED("extensionFeatures->sType"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.
break; break;
} }
...@@ -1932,7 +1932,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2(VkPhysicalDevice physi ...@@ -1932,7 +1932,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties2(VkPhysicalDevice physi
break; break;
default: default:
// "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]" // "the [driver] must skip over, without processing (other than reading the sType and pNext members) any structures in the chain with sType values not defined by [supported extenions]"
UNIMPLEMENTED(); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here. UNIMPLEMENTED("extensionProperties->sType"); // TODO(b/119321052): UNIMPLEMENTED() should be used only for features that must still be implemented. Use a more informational macro here.
break; break;
} }
...@@ -1949,7 +1949,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice ...@@ -1949,7 +1949,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2(VkPhysicalDevice
if(pFormatProperties->pNext) if(pFormatProperties->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pFormatProperties->pNext");
} }
vkGetPhysicalDeviceFormatProperties(physicalDevice, format, &(pFormatProperties->formatProperties)); vkGetPhysicalDeviceFormatProperties(physicalDevice, format, &(pFormatProperties->formatProperties));
...@@ -1962,7 +1962,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2(VkPhysi ...@@ -1962,7 +1962,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2(VkPhysi
if(pImageFormatInfo->pNext || pImageFormatProperties->pNext) if(pImageFormatInfo->pNext || pImageFormatProperties->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pImageFormatInfo->pNext || pImageFormatProperties->pNext");
} }
return vkGetPhysicalDeviceImageFormatProperties(physicalDevice, return vkGetPhysicalDeviceImageFormatProperties(physicalDevice,
...@@ -1981,7 +1981,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalD ...@@ -1981,7 +1981,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalD
if(pQueueFamilyProperties && pQueueFamilyProperties->pNext) if(pQueueFamilyProperties && pQueueFamilyProperties->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pQueueFamilyProperties->pNext");
} }
vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount, vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, pQueueFamilyPropertyCount,
...@@ -1994,7 +1994,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice ...@@ -1994,7 +1994,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice
if(pMemoryProperties->pNext) if(pMemoryProperties->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pMemoryProperties->pNext");
} }
vkGetPhysicalDeviceMemoryProperties(physicalDevice, &(pMemoryProperties->memoryProperties)); vkGetPhysicalDeviceMemoryProperties(physicalDevice, &(pMemoryProperties->memoryProperties));
...@@ -2007,7 +2007,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhy ...@@ -2007,7 +2007,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2(VkPhy
if(pProperties && pProperties->pNext) if(pProperties && pProperties->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pProperties->pNext");
} }
vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, pFormatInfo->format, pFormatInfo->type, vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice, pFormatInfo->format, pFormatInfo->type,
...@@ -2030,7 +2030,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueu ...@@ -2030,7 +2030,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueu
if(pQueueInfo->pNext) if(pQueueInfo->pNext)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pQueueInfo->pNext");
} }
// The only flag that can be set here is VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT // The only flag that can be set here is VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT
...@@ -2051,14 +2051,14 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueu ...@@ -2051,14 +2051,14 @@ VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue2(VkDevice device, const VkDeviceQueu
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) VKAPI_ATTR VkResult VKAPI_CALL vkCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkCreateSamplerYcbcrConversion");
return VK_SUCCESS; return VK_SUCCESS;
} }
VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) VKAPI_ATTR void VKAPI_CALL vkDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator)
{ {
TRACE("()"); TRACE("()");
UNIMPLEMENTED(); UNIMPLEMENTED("vkDestroySamplerYcbcrConversion");
} }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate)
...@@ -2068,7 +2068,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device, ...@@ -2068,7 +2068,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplate(VkDevice device,
if(pCreateInfo->pNext || pCreateInfo->flags || (pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)) if(pCreateInfo->pNext || pCreateInfo->flags || (pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET))
{ {
UNIMPLEMENTED(); UNIMPLEMENTED("pCreateInfo->pNext || pCreateInfo->flags || (pCreateInfo->templateType != VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET)");
} }
return vk::DescriptorUpdateTemplate::Create(pAllocator, pCreateInfo, pDescriptorUpdateTemplate); return vk::DescriptorUpdateTemplate::Create(pAllocator, pCreateInfo, pDescriptorUpdateTemplate);
...@@ -2095,7 +2095,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties(VkPhysica ...@@ -2095,7 +2095,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalBufferProperties(VkPhysica
TRACE("(VkPhysicalDevice physicalDevice = 0x%X, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo = 0x%X, VkExternalBufferProperties* pExternalBufferProperties = 0x%X)", TRACE("(VkPhysicalDevice physicalDevice = 0x%X, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo = 0x%X, VkExternalBufferProperties* pExternalBufferProperties = 0x%X)",
physicalDevice, pExternalBufferInfo, pExternalBufferProperties); physicalDevice, pExternalBufferInfo, pExternalBufferProperties);
UNIMPLEMENTED(); UNIMPLEMENTED("vkGetPhysicalDeviceExternalBufferProperties");
} }
VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties)
...@@ -2103,7 +2103,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysical ...@@ -2103,7 +2103,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalFenceProperties(VkPhysical
TRACE("(VkPhysicalDevice physicalDevice = 0x%X, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo = 0x%X, VkExternalFenceProperties* pExternalFenceProperties = 0x%X)", TRACE("(VkPhysicalDevice physicalDevice = 0x%X, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo = 0x%X, VkExternalFenceProperties* pExternalFenceProperties = 0x%X)",
physicalDevice, pExternalFenceInfo, pExternalFenceProperties); physicalDevice, pExternalFenceInfo, pExternalFenceProperties);
UNIMPLEMENTED(); UNIMPLEMENTED("vkGetPhysicalDeviceExternalFenceProperties");
} }
VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties)
...@@ -2111,7 +2111,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhys ...@@ -2111,7 +2111,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceExternalSemaphoreProperties(VkPhys
TRACE("(VkPhysicalDevice physicalDevice = 0x%X, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo = 0x%X, VkExternalSemaphoreProperties* pExternalSemaphoreProperties = 0x%X)", TRACE("(VkPhysicalDevice physicalDevice = 0x%X, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo = 0x%X, VkExternalSemaphoreProperties* pExternalSemaphoreProperties = 0x%X)",
physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties); physicalDevice, pExternalSemaphoreInfo, pExternalSemaphoreProperties);
UNIMPLEMENTED(); UNIMPLEMENTED("vkGetPhysicalDeviceExternalSemaphoreProperties");
} }
VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment