#Steps to render a 2d matrix of points.

6 messages · Page 1 of 1 (latest)

low salmon
#

I finished the Vulkan Tutorial, and wanted to move forward with a more complex render. So I generated a 2d matrix of perlin noise(normalized values between 0-1).

I did some research, and it seemed the suggestion was to use a texture sample instead of an SSBO because its faster? So I'm wondering what are the "high level" steps that are needed to setup a texture sample and render my 2d matrix to my viewport. I'm intending to pass the vertex data through the texture, so we only sample the image through the fragment shader to colorize the points.

I am mainly focused on the render section because I'm just reusing my context/window code to setup up the environment.

This is my understanding of what needs to be done, in order:

Create an image, and an image view to receive the data
Set up a staging buffer to pack the matrix into so that we can submit it to the GPU
Copy the buffer to the image
Set up an image barrier
Change the state of the image to VK_IMAGE_LAYOUT_SHADER_READ_ONLY
Set up another barrier
Setup a sampler to sample the texture
Load the fragment shader
Setup descriptor sets
Create/Bind the pipeline with the Descriptor Sets/Shaders
Bind the descriptor sets
Record/Submit the command buffer

Is this correct? Am I missing important steps?

short river
#

what you've described looks fine

#

tho you are missing a barrier before copying

#

you've prob swapped 2 lines there so

Set up an image barrier to Change the state of the image to VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
Copy the buffer to the image
Set up another barrier to Change the state of the image to VK_IMAGE_LAYOUT_SHADER_READ_ONLY
#

these you can do in whatever order you wish in relation to the above

Setup a sampler to sample the texture
Load the shaders
Setup descriptor sets
Create the pipeline
#

ohh and you forgot the part where you bind the image to the set unless you're putting that under "setup sets"