Fixed typos
This commit is contained in:
parent
3e5f545b83
commit
e1ec3b6c78
11 changed files with 23 additions and 29 deletions
|
|
@ -33,7 +33,7 @@ namespace vks
|
||||||
|
|
||||||
/** @brief Usage flags to be filled by external source at buffer creation (to query at some later point) */
|
/** @brief Usage flags to be filled by external source at buffer creation (to query at some later point) */
|
||||||
VkBufferUsageFlags usageFlags;
|
VkBufferUsageFlags usageFlags;
|
||||||
/** @brief Memory propertys flags to be filled by external source at buffer creation (to query at some later point) */
|
/** @brief Memory property flags to be filled by external source at buffer creation (to query at some later point) */
|
||||||
VkMemoryPropertyFlags memoryPropertyFlags;
|
VkMemoryPropertyFlags memoryPropertyFlags;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ namespace vks
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// The return value of this callback controls wether the Vulkan call that caused the validation message will be aborted or not
|
// The return value of this callback controls whether the Vulkan call that caused the validation message will be aborted or not
|
||||||
// We return VK_FALSE as we DON'T want Vulkan calls that cause a validation message to abort
|
// We return VK_FALSE as we DON'T want Vulkan calls that cause a validation message to abort
|
||||||
// If you instead want to have calls abort, pass in VK_TRUE and the function will return VK_ERROR_VALIDATION_FAILED_EXT
|
// If you instead want to have calls abort, pass in VK_TRUE and the function will return VK_ERROR_VALIDATION_FAILED_EXT
|
||||||
return VK_FALSE;
|
return VK_FALSE;
|
||||||
|
|
@ -170,7 +170,7 @@ namespace vks
|
||||||
|
|
||||||
void endRegion(VkCommandBuffer cmdBuffer)
|
void endRegion(VkCommandBuffer cmdBuffer)
|
||||||
{
|
{
|
||||||
// Check for valid function (may not be present if not runnin in a debugging application)
|
// Check for valid function (may not be present if not running in a debugging application)
|
||||||
if (pfnCmdDebugMarkerEnd)
|
if (pfnCmdDebugMarkerEnd)
|
||||||
{
|
{
|
||||||
pfnCmdDebugMarkerEnd(cmdBuffer);
|
pfnCmdDebugMarkerEnd(cmdBuffer);
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,7 @@ namespace vks
|
||||||
* @param queue Pointer
|
* @param queue Pointer
|
||||||
* @param copyRegion (Optional) Pointer to a copy region, if NULL, the whole buffer is copied
|
* @param copyRegion (Optional) Pointer to a copy region, if NULL, the whole buffer is copied
|
||||||
*
|
*
|
||||||
* @note Source and destionation pointers must have the approriate transfer usage flags set (TRANSFER_SRC / TRANSFER_DST)
|
* @note Source and destination pointers must have the appropriate transfer usage flags set (TRANSFER_SRC / TRANSFER_DST)
|
||||||
*/
|
*/
|
||||||
void copyBuffer(vks::Buffer *src, vks::Buffer *dst, VkQueue queue, VkBufferCopy *copyRegion = nullptr)
|
void copyBuffer(vks::Buffer *src, vks::Buffer *dst, VkQueue queue, VkBufferCopy *copyRegion = nullptr)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ namespace vks
|
||||||
*
|
*
|
||||||
* @param magFilter Magnification filter for lookups
|
* @param magFilter Magnification filter for lookups
|
||||||
* @param minFilter Minification filter for lookups
|
* @param minFilter Minification filter for lookups
|
||||||
* @param adressMode Adressing mode for the U,V and W coordinates
|
* @param adressMode Addressing mode for the U,V and W coordinates
|
||||||
*
|
*
|
||||||
* @return VkResult for the sampler creation
|
* @return VkResult for the sampler creation
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ public:
|
||||||
VK_CHECK_RESULT(fpGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, &formatCount, surfaceFormats.data()));
|
VK_CHECK_RESULT(fpGetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, &formatCount, surfaceFormats.data()));
|
||||||
|
|
||||||
// If the surface format list only includes one entry with VK_FORMAT_UNDEFINED,
|
// If the surface format list only includes one entry with VK_FORMAT_UNDEFINED,
|
||||||
// there is no preferered format, so we assume VK_FORMAT_B8G8R8A8_UNORM
|
// there is no preferred format, so we assume VK_FORMAT_B8G8R8A8_UNORM
|
||||||
if ((formatCount == 1) && (surfaceFormats[0].format == VK_FORMAT_UNDEFINED))
|
if ((formatCount == 1) && (surfaceFormats[0].format == VK_FORMAT_UNDEFINED))
|
||||||
{
|
{
|
||||||
colorFormat = VK_FORMAT_B8G8R8A8_UNORM;
|
colorFormat = VK_FORMAT_B8G8R8A8_UNORM;
|
||||||
|
|
@ -276,7 +276,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param width Pointer to the width of the swapchain (may be adjusted to fit the requirements of the swapchain)
|
* @param width Pointer to the width of the swapchain (may be adjusted to fit the requirements of the swapchain)
|
||||||
* @param height Pointer to the height of the swapchain (may be adjusted to fit the requirements of the swapchain)
|
* @param height Pointer to the height of the swapchain (may be adjusted to fit the requirements of the swapchain)
|
||||||
* @param vsync (Optional) Can be used to force vsync'd rendering (by using VK_PRESENT_MODE_FIFO_KHR as presentation mode)
|
* @param vsync (Optional) Can be used to force vsync-ed rendering (by using VK_PRESENT_MODE_FIFO_KHR as presentation mode)
|
||||||
*/
|
*/
|
||||||
void create(uint32_t *width, uint32_t *height, bool vsync = false)
|
void create(uint32_t *width, uint32_t *height, bool vsync = false)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ namespace vks
|
||||||
ktx_uint8_t *ktxTextureData = ktxTexture_GetData(ktxTexture);
|
ktx_uint8_t *ktxTextureData = ktxTexture_GetData(ktxTexture);
|
||||||
ktx_size_t ktxTextureSize = ktxTexture_GetSize(ktxTexture);
|
ktx_size_t ktxTextureSize = ktxTexture_GetSize(ktxTexture);
|
||||||
|
|
||||||
// Get device properites for the requested texture format
|
// Get device properties for the requested texture format
|
||||||
VkFormatProperties formatProperties;
|
VkFormatProperties formatProperties;
|
||||||
vkGetPhysicalDeviceFormatProperties(device->physicalDevice, format, &formatProperties);
|
vkGetPhysicalDeviceFormatProperties(device->physicalDevice, format, &formatProperties);
|
||||||
|
|
||||||
|
|
@ -334,7 +334,7 @@ namespace vks
|
||||||
|
|
||||||
ktxTexture_Destroy(ktxTexture);
|
ktxTexture_Destroy(ktxTexture);
|
||||||
|
|
||||||
// Create a defaultsampler
|
// Create a default sampler
|
||||||
VkSamplerCreateInfo samplerCreateInfo = {};
|
VkSamplerCreateInfo samplerCreateInfo = {};
|
||||||
samplerCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
samplerCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
||||||
samplerCreateInfo.magFilter = VK_FILTER_LINEAR;
|
samplerCreateInfo.magFilter = VK_FILTER_LINEAR;
|
||||||
|
|
@ -348,7 +348,7 @@ namespace vks
|
||||||
samplerCreateInfo.minLod = 0.0f;
|
samplerCreateInfo.minLod = 0.0f;
|
||||||
// Max level-of-detail should match mip level count
|
// Max level-of-detail should match mip level count
|
||||||
samplerCreateInfo.maxLod = (useStaging) ? (float)mipLevels : 0.0f;
|
samplerCreateInfo.maxLod = (useStaging) ? (float)mipLevels : 0.0f;
|
||||||
// Only enable anisotropic filtering if enabled on the devicec
|
// Only enable anisotropic filtering if enabled on the device
|
||||||
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
samplerCreateInfo.maxAnisotropy = device->enabledFeatures.samplerAnisotropy ? device->properties.limits.maxSamplerAnisotropy : 1.0f;
|
||||||
samplerCreateInfo.anisotropyEnable = device->enabledFeatures.samplerAnisotropy;
|
samplerCreateInfo.anisotropyEnable = device->enabledFeatures.samplerAnisotropy;
|
||||||
samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
|
samplerCreateInfo.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,7 @@ void vkglTF::Texture::fromglTfImage(tinygltf::Image &gltfimage, std::string path
|
||||||
// @todo: Use ktxTexture_GetVkFormat(ktxTexture)
|
// @todo: Use ktxTexture_GetVkFormat(ktxTexture)
|
||||||
format = VK_FORMAT_R8G8B8A8_UNORM;
|
format = VK_FORMAT_R8G8B8A8_UNORM;
|
||||||
|
|
||||||
// Get device properites for the requested texture format
|
// Get device properties for the requested texture format
|
||||||
VkFormatProperties formatProperties;
|
VkFormatProperties formatProperties;
|
||||||
vkGetPhysicalDeviceFormatProperties(device->physicalDevice, format, &formatProperties);
|
vkGetPhysicalDeviceFormatProperties(device->physicalDevice, format, &formatProperties);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ namespace vks
|
||||||
public:
|
public:
|
||||||
std::vector<std::unique_ptr<Thread>> threads;
|
std::vector<std::unique_ptr<Thread>> threads;
|
||||||
|
|
||||||
// Sets the number of threads to be allocted in this pool
|
// Sets the number of threads to be allocated in this pool
|
||||||
void setThreadCount(uint32_t count)
|
void setThreadCount(uint32_t count)
|
||||||
{
|
{
|
||||||
threads.clear();
|
threads.clear();
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ VkPipelineShaderStageCreateInfo VulkanExampleBase::loadShader(std::string fileNa
|
||||||
#else
|
#else
|
||||||
shaderStage.module = vks::tools::loadShader(fileName.c_str(), device);
|
shaderStage.module = vks::tools::loadShader(fileName.c_str(), device);
|
||||||
#endif
|
#endif
|
||||||
shaderStage.pName = "main"; // todo : make param
|
shaderStage.pName = "main";
|
||||||
assert(shaderStage.module != VK_NULL_HANDLE);
|
assert(shaderStage.module != VK_NULL_HANDLE);
|
||||||
shaderModules.push_back(shaderStage.module);
|
shaderModules.push_back(shaderStage.module);
|
||||||
return shaderStage;
|
return shaderStage;
|
||||||
|
|
@ -814,7 +814,7 @@ bool VulkanExampleBase::initVulkan()
|
||||||
if (settings.validation)
|
if (settings.validation)
|
||||||
{
|
{
|
||||||
// The report flags determine what type of messages for the layers will be displayed
|
// The report flags determine what type of messages for the layers will be displayed
|
||||||
// For validating (debugging) an appplication the error and warning bits should suffice
|
// For validating (debugging) an application the error and warning bits should suffice
|
||||||
VkDebugReportFlagsEXT debugReportFlags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
|
VkDebugReportFlagsEXT debugReportFlags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
|
||||||
// Additional flags include performance info, loader and layer debug messages, etc.
|
// Additional flags include performance info, loader and layer debug messages, etc.
|
||||||
vks::debug::setupDebugging(instance, debugReportFlags, VK_NULL_HANDLE);
|
vks::debug::setupDebugging(instance, debugReportFlags, VK_NULL_HANDLE);
|
||||||
|
|
@ -891,7 +891,7 @@ bool VulkanExampleBase::initVulkan()
|
||||||
|
|
||||||
physicalDevice = physicalDevices[selectedDevice];
|
physicalDevice = physicalDevices[selectedDevice];
|
||||||
|
|
||||||
// Store properties (including limits), features and memory properties of the phyiscal device (so that examples can check against them)
|
// Store properties (including limits), features and memory properties of the physical device (so that examples can check against them)
|
||||||
vkGetPhysicalDeviceProperties(physicalDevice, &deviceProperties);
|
vkGetPhysicalDeviceProperties(physicalDevice, &deviceProperties);
|
||||||
vkGetPhysicalDeviceFeatures(physicalDevice, &deviceFeatures);
|
vkGetPhysicalDeviceFeatures(physicalDevice, &deviceFeatures);
|
||||||
vkGetPhysicalDeviceMemoryProperties(physicalDevice, &deviceMemoryProperties);
|
vkGetPhysicalDeviceMemoryProperties(physicalDevice, &deviceMemoryProperties);
|
||||||
|
|
@ -922,10 +922,10 @@ bool VulkanExampleBase::initVulkan()
|
||||||
// Create synchronization objects
|
// Create synchronization objects
|
||||||
VkSemaphoreCreateInfo semaphoreCreateInfo = vks::initializers::semaphoreCreateInfo();
|
VkSemaphoreCreateInfo semaphoreCreateInfo = vks::initializers::semaphoreCreateInfo();
|
||||||
// Create a semaphore used to synchronize image presentation
|
// Create a semaphore used to synchronize image presentation
|
||||||
// Ensures that the image is displayed before we start submitting new commands to the queu
|
// Ensures that the image is displayed before we start submitting new commands to the queue
|
||||||
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.presentComplete));
|
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.presentComplete));
|
||||||
// Create a semaphore used to synchronize command submission
|
// Create a semaphore used to synchronize command submission
|
||||||
// Ensures that the image is not presented until all commands have been sumbitted and executed
|
// Ensures that the image is not presented until all commands have been submitted and executed
|
||||||
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.renderComplete));
|
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.renderComplete));
|
||||||
|
|
||||||
// Set up submit info structure
|
// Set up submit info structure
|
||||||
|
|
@ -2116,10 +2116,7 @@ void VulkanExampleBase::setupRenderPass()
|
||||||
VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &renderPass));
|
VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &renderPass));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanExampleBase::getEnabledFeatures()
|
void VulkanExampleBase::getEnabledFeatures() {}
|
||||||
{
|
|
||||||
// Can be overriden in derived class
|
|
||||||
}
|
|
||||||
|
|
||||||
void VulkanExampleBase::windowResize()
|
void VulkanExampleBase::windowResize()
|
||||||
{
|
{
|
||||||
|
|
@ -2205,10 +2202,7 @@ void VulkanExampleBase::handleMouseMove(int32_t x, int32_t y)
|
||||||
mousePos = glm::vec2((float)x, (float)y);
|
mousePos = glm::vec2((float)x, (float)y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VulkanExampleBase::windowResized()
|
void VulkanExampleBase::windowResized() {}
|
||||||
{
|
|
||||||
// Can be overriden in derived class
|
|
||||||
}
|
|
||||||
|
|
||||||
void VulkanExampleBase::initSwapchain()
|
void VulkanExampleBase::initSwapchain()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ protected:
|
||||||
std::chrono::time_point<std::chrono::high_resolution_clock> lastTimestamp;
|
std::chrono::time_point<std::chrono::high_resolution_clock> lastTimestamp;
|
||||||
// Vulkan instance, stores all per-application states
|
// Vulkan instance, stores all per-application states
|
||||||
VkInstance instance;
|
VkInstance instance;
|
||||||
// Physical device (GPU) that Vulkan will ise
|
// Physical device (GPU) that Vulkan will use
|
||||||
VkPhysicalDevice physicalDevice;
|
VkPhysicalDevice physicalDevice;
|
||||||
// Stores physical device properties (for e.g. checking device limits)
|
// Stores physical device properties (for e.g. checking device limits)
|
||||||
VkPhysicalDeviceProperties deviceProperties;
|
VkPhysicalDeviceProperties deviceProperties;
|
||||||
|
|
@ -314,7 +314,7 @@ public:
|
||||||
virtual void mouseMoved(double x, double y, bool &handled);
|
virtual void mouseMoved(double x, double y, bool &handled);
|
||||||
/** @brief (Virtual) Called when the window has been resized, can be used by the sample application to recreate resources */
|
/** @brief (Virtual) Called when the window has been resized, can be used by the sample application to recreate resources */
|
||||||
virtual void windowResized();
|
virtual void windowResized();
|
||||||
/** @brief (Virtual) Called when resources have been recreated that require a rebuild of the command buffers (e.g. frame buffer), to be implemente by the sample application */
|
/** @brief (Virtual) Called when resources have been recreated that require a rebuild of the command buffers (e.g. frame buffer), to be implemented by the sample application */
|
||||||
virtual void buildCommandBuffers();
|
virtual void buildCommandBuffers();
|
||||||
/** @brief (Virtual) Setup default depth and stencil views */
|
/** @brief (Virtual) Setup default depth and stencil views */
|
||||||
virtual void setupDepthStencil();
|
virtual void setupDepthStencil();
|
||||||
|
|
@ -337,7 +337,7 @@ public:
|
||||||
/** @brief Adds the drawing commands for the ImGui overlay to the given command buffer */
|
/** @brief Adds the drawing commands for the ImGui overlay to the given command buffer */
|
||||||
void drawUI(const VkCommandBuffer commandBuffer);
|
void drawUI(const VkCommandBuffer commandBuffer);
|
||||||
|
|
||||||
/** Prepare the next frame for workload sumbission by acquiring the next swap chain image */
|
/** Prepare the next frame for workload submission by acquiring the next swap chain image */
|
||||||
void prepareFrame();
|
void prepareFrame();
|
||||||
/** @brief Presents the current image to the swap chain */
|
/** @brief Presents the current image to the swap chain */
|
||||||
void submitFrame();
|
void submitFrame();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue