Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
3a438632
Commit
3a438632
authored
3 years ago
by
Vanessa Karolek
Browse files
Options
Downloads
Patches
Plain Diff
[
#92
] add TODOs for descriptor sets
parent
fd48ade9
No related branches found
No related tags found
1 merge request
!75
Resolve "RTX-Module"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/rtx/src/main.cpp
+22
-13
22 additions, 13 deletions
projects/rtx/src/main.cpp
with
22 additions
and
13 deletions
projects/rtx/src/main.cpp
+
22
−
13
View file @
3a438632
...
...
@@ -102,12 +102,12 @@ int main(int argc, const char** argv) {
vkcv
::
ShaderProgram
sceneShaderProgram
;
vkcv
::
shader
::
GLSLCompiler
compiler
;
compiler
.
compile
(
vkcv
::
ShaderStage
::
VERTEX
,
std
::
filesystem
::
path
(
"resources/shaders/shader.vert"
),
[
&
sceneShaderProgram
](
vkcv
::
ShaderStage
shaderStage
,
const
std
::
filesystem
::
path
&
path
)
{
sceneShaderProgram
.
addShader
(
shaderStage
,
path
);
});
compiler
.
compile
(
vkcv
::
ShaderStage
::
FRAGMENT
,
std
::
filesystem
::
path
(
"resources/shaders/shader.frag"
),
[
&
sceneShaderProgram
](
vkcv
::
ShaderStage
shaderStage
,
const
std
::
filesystem
::
path
&
path
)
{
sceneShaderProgram
.
addShader
(
shaderStage
,
path
);
...
...
@@ -120,9 +120,13 @@ int main(int argc, const char** argv) {
}
const
vkcv
::
VertexLayout
sceneLayout
(
bindings
);
const
auto
&
material0
=
scene
.
getMaterial
(
0
);
// TODO
// vkcv::DescriptorSetLayoutHandle vertexShaderDescriptorSetLayout = core.createDescriptorSetLayout(bunnyShaderProgram.getReflectedDescriptors().at(0));
// vkcv::DescriptorSetHandle vertexShaderDescriptorSet = core.createDescriptorSet(vertexShaderDescriptorSetLayout);
const
vkcv
::
PipelineConfig
scenePipelineDefinition
{
sceneShaderProgram
,
UINT32_MAX
,
...
...
@@ -132,7 +136,12 @@ int main(int argc, const char** argv) {
{
core
.
getDescriptorSetLayout
(
material0
.
getDescriptorSetLayout
()).
vulkanHandle
},
true
};
vkcv
::
PipelineHandle
scenePipeline
=
core
.
createGraphicsPipeline
(
scenePipelineDefinition
);
// TODO
// vkcv::DescriptorWrites vertexShaderDescriptorWrites;
// vertexShaderDescriptorWrites.storageBufferWrites = { vkcv::BufferDescriptorWrite(0, matrixBuffer.getHandle()) };
// core.writeDescriptorSet(vertexShaderDescriptorSet, vertexShaderDescriptorWrites);
if
(
!
scenePipeline
)
{
std
::
cout
<<
"Error. Could not create graphics pipeline. Exiting."
<<
std
::
endl
;
return
EXIT_FAILURE
;
...
...
@@ -141,29 +150,29 @@ int main(int argc, const char** argv) {
vkcv
::
ImageHandle
depthBuffer
=
core
.
createImage
(
vk
::
Format
::
eD32Sfloat
,
windowWidth
,
windowHeight
).
getHandle
();
const
vkcv
::
ImageHandle
swapchainInput
=
vkcv
::
ImageHandle
::
createSwapchainImageHandle
();
auto
start
=
std
::
chrono
::
system_clock
::
now
();
while
(
window
.
isWindowOpen
())
{
vkcv
::
Window
::
pollEvents
();
if
(
window
.
getHeight
()
==
0
||
window
.
getWidth
()
==
0
)
continue
;
uint32_t
swapchainWidth
,
swapchainHeight
;
if
(
!
core
.
beginFrame
(
swapchainWidth
,
swapchainHeight
))
{
continue
;
}
if
((
swapchainWidth
!=
windowWidth
)
||
((
swapchainHeight
!=
windowHeight
)))
{
depthBuffer
=
core
.
createImage
(
vk
::
Format
::
eD32Sfloat
,
swapchainWidth
,
swapchainHeight
).
getHandle
();
windowWidth
=
swapchainWidth
;
windowHeight
=
swapchainHeight
;
}
auto
end
=
std
::
chrono
::
system_clock
::
now
();
auto
deltatime
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
end
-
start
);
start
=
end
;
cameraManager
.
update
(
0.000001
*
static_cast
<
double
>
(
deltatime
.
count
()));
...
...
@@ -175,7 +184,7 @@ int main(int argc, const char** argv) {
vkcv
::
DrawcallInfo
&
drawcallInfo
)
{
pushConstants
.
appendDrawcall
(
MVP
);
};
scene
.
recordDrawcalls
(
cmdStream
,
cameraManager
.
getActiveCamera
(),
scenePass
,
...
...
@@ -183,7 +192,7 @@ int main(int argc, const char** argv) {
sizeof
(
glm
::
mat4
),
recordMesh
,
renderTargets
);
core
.
prepareSwapchainImageForPresent
(
cmdStream
);
core
.
submitCommandStream
(
cmdStream
);
core
.
endFrame
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment