Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Sofus Albert Høgsbro Rose
vulkan-engine
Commits
aa26ef30
Verified
Commit
aa26ef30
authored
Oct 10, 2017
by
Sofus Albert Høgsbro Rose
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A sturdy Vulkan app that draw a tri. Yay :) !
parent
a842451f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Makefile
Makefile
+1
-1
src/main.cpp
src/main.cpp
+6
-6
No files found.
Makefile
View file @
aa26ef30
...
...
@@ -16,7 +16,7 @@ SHADIR = shaders
TARGET
=
learn
LIBS
=
-L
$(VULKAN_SDK_PATH)
/lib
`
pkg-config
--static
--libs
glfw3
`
-lvulkan
CXXFLAGS
=
-Wall
-fopenmp
-I
$(VULKAN_SDK_PATH)
/include
-std
=
c++14
-DNDEBUG
CXXFLAGS
=
-Wall
-I
$(VULKAN_SDK_PATH)
/include
-std
=
c++14
-O3
-DNDEBUG
CXX
=
g++
LINKER
=
g++
...
...
src/main.cpp
View file @
aa26ef30
...
...
@@ -295,7 +295,7 @@ class HelloTriangleApplication {
vkEnumerateInstanceExtensionProperties
(
nullptr
,
&
extensionCount
,
extensionProps
.
data
());
//Read into the vector.
std
::
cout
<<
"
Available
Extensions:"
<<
std
::
endl
;
std
::
cout
<<
"
Loaded
Extensions:"
<<
std
::
endl
;
for
(
const
auto
&
extension
:
extensionProps
)
{
std
::
cout
<<
"
\t
"
<<
extension
.
extensionName
<<
std
::
endl
;
...
...
@@ -894,12 +894,12 @@ class HelloTriangleApplication {
dependency
.
dstSubpass
=
0
;
//The index of our one and only subpass. dst must be higher than src to prevent cyclic dependencies.
//Wait for the swap chain to finish reading from the image before accessing it.
dependency
.
srcStageMask
=
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
;
//The operations to wait
on
.
dependency
.
srcStageMask
=
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
;
//The operations to wait
for
.
dependency
.
srcAccessMask
=
0
;
//The operations we should wait to do.
//The operation that should wait is r/w of the color attachment in the color attachment stage.
// Prevent the transition from happening until it's actually allowed.
dependency
.
dstStageMask
=
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
;
//The operations to wait
on
.
dependency
.
dstStageMask
=
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
;
//The operations to wait
for
.
dependency
.
dstAccessMask
=
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT
|
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT
;
//The operations to wait to do.
...
...
@@ -1220,7 +1220,7 @@ class HelloTriangleApplication {
//To allocate command buffers, we need a VkCommandBufferAllocateInfo struct param.
VkCommandBufferAllocateInfo
allocInfo
=
{};
allocInfo
.
sType
=
VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
;
allocInfo
.
commandPool
=
commandPool
;
;
//The command pool.
allocInfo
.
commandPool
=
commandPool
;
//The command pool.
// The level parameter specifies if the allocated command buffers are primary or secondary.
// Primary: Can be submitted for execution, but can't be called from other command buffers.
...
...
@@ -1379,13 +1379,13 @@ class HelloTriangleApplication {
presentInfo
.
waitSemaphoreCount
=
1
;
//Wait for one semaphore to submit the result back to the swap chain.
presentInfo
.
pWaitSemaphores
=
signalSemaphores
;
//The semaphores to wait for before submitting the render result.
VkSwapchainKHR
swapChains
[]
=
{
swapChain
};
//The swap cain to present to.
VkSwapchainKHR
swapChains
[]
=
{
swapChain
};
//The swap c
h
ain to present to.
presentInfo
.
swapchainCount
=
1
;
//Using one swapchain.
presentInfo
.
pSwapchains
=
swapChains
;
//The swapchains to use.
presentInfo
.
pImageIndices
=
&
imageIndex
;
//The index of the image to present, for each swap chain.
presentInfo
.
pResults
=
nullptr
;
//Can check every individual swap chain to see if presentation was successful. Useless with only one.
//Time to submit the
request
to present an image to the swap chain onto the presentQueue!
//Time to submit the
command
to present an image to the swap chain onto the presentQueue!
result
=
vkQueuePresentKHR
(
presentQueue
,
&
presentInfo
);
// Remake the swap chain if it's suboptimal here.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment