Commit Graph

5 Commits

Author SHA1 Message Date
Friedemann Kleint
2677ad78e6 Vulkan Examples: Fix Clang warnings about initialization of VkClearColorValue
hellovulkanwindow.cpp(97,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0.0f, m_green, 0.0f, 1.0f };
hellovulkantexture.cpp(771,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0, 0, 0, 1 };
..\shared\trianglerenderer.cpp(455,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0, 0, 0, 1 };
renderer.cpp(896,38):  warning: suggest braces around initialization of subobject [-Wmissing-braces]
    VkClearColorValue clearColor = { 0.67f, 0.84f, 0.9f, 1.0f };

Change-Id: I3c2403699059dac2f88541f2a2102b774db0c887
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-04-30 08:35:15 +00:00
Laszlo Agocs
414c058ca7 hellovulkantexture: Fix issues with new validation layer
Upgrading to a recent Vulkan SDK (e.g. 1.0.61) leads to getting
a few previously unseen warnings from the validation layers.

Fix these:

vkDebug: ParameterValidation: 8: vkCreateSampler(): The
samplerAnisotropy feature was not enabled at device-creation
time, so the maxAnisotropy member of the VkSamplerCreateInfo
structure must be 1.0 but is 0.000000.

vkDebug: DS: 461375808: vkCmdPipelineBarrier():
pImageMemBarriers[0].srcAccessMask (0x4000) is not supported by
srcStageMask (0x1). The spec valid usage text states 'Any given
element of pMemoryBarriers, pBufferMemoryBarriers or
pImageMemoryBarriers must not have any access flag included in
its srcAccessMask member if that bit is not supported by any of
the pipeline stages in srcStageMask, as specified in the table of
supported access types.'

vkDebug: DS: 6: vkCmdDraw(): Cannot use image 0x7 with specific
layout VK_IMAGE_LAYOUT_GENERAL that doesn't match the actual
current layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL.

vkDebug: DS: 61: Descriptor set 0xc encountered the following
validation error at vkCmdDraw() time: Image layout specified at
vkUpdateDescriptorSets() time doesn't match actual image layout
at time descriptor is used. See previous error callback for
specific details.

Change-Id: I1a3200221ac725c2fa661eff3ac075262b9355c2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-10-16 08:15:39 +00:00
Marc Mutz
5336e061ec QVulkanWindow: return QMatrix4x4 by value
The function never returns nullptr, so return the matrix by value.

Change-Id: I7c1eeb43b9693866049763565b575348ddd35548
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-05-22 09:23:15 +00:00
Laszlo Agocs
dfef2e3f3e Clarify the front face winding order in the Vulkan examples
After applying the correction matrix the front face is CW, not CCW.

The examples work either way but fix them up to avoid reader confusion.

Change-Id: I491e6dc17c21897a59f36d32061e937f2b6c4c9d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-26 22:40:18 +00:00
Laszlo Agocs
8d72aba9e3 Introduce QVulkanWindow
A convenience subclass of QWindow that provides a Vulkan-capable
window with a double-buffered FIFO swapchain.

While advanced use cases are better served by a custom QWindow
subclass, many applications can benefit from having a convenient
helper that makes getting started easier.

Add also three examples of increasing complexity, and a variant that
shows embeddeding into widgets via QWindowContainer.

[ChangeLog][QtGui] Added QVulkanWindow, a convenience subclass of
QWindow.

Task-number: QTBUG-55981
Change-Id: I6cdc9ff1390ac6258e278377233fd369a0bfeddc
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-22 15:40:57 +00:00