August 17, 2025

Hello, Neural Network 1.5! Float vs Double.

Last time I added a brief note about choosing float over double, where I said that float is better - because we’ll work mostly with small numbers, so the precision is not an issue, and because GPUs prefer floats (at least, mass-consumer GPUs). Also, logic says that float should be faster - addition and subtraction should take the same amount of cycles, but memory throughput should be better with float, since more data can fit into a single cache line. Read more

August 14, 2025

Hello, Neural Network!

I don’t remember when AI became a big thing. It didn’t happen suddenly, but it did happen fast. Three or four years ago, my friend - a big AI fan but not a programmer - told me he didn’t need to learn programming languages because ChatGPT could write programs. I asked him to create a simple ping-pong game with it; the language didn’t matter. He couldn’t - the tool didn’t understand what he wanted, produced incorrect code, and it was impossible to tell it to fix just that specific part. Read more

February 4, 2022

Vulkan with rust by example 6. Depth buffer.

In the previous step, we finally got our first image. But unfortunately, it was broken - the polygons were drawn in the incorrect order. I omit the depth buffer management to make the complex Vulkan a little bit simpler. Also, I wanted to show how to change the existing renderer. With all the knowledge we have, it should be quite simple. Read more

January 22, 2022

Vulkan with rust by example 4. Swapchain.

At this point, we have shaders, static data is uploaded to the GPU, the pipelines are set up, and we’re almost ready to start to draw. Except that we don’t have an image where we can draw. An image is just memory, and this entire step is dedicated to these special images for drawing - swapchain images. Read more

January 17, 2022

Vulkan with rust by example 3. Pipelines.

In the previous step we uploaded the data to the GPU, but we still don’t know how to use it. Today we’ll fill that gap partially. We need to tell Vulkan upfront which resources we’re going to use for a particular effect. We do it via pipelines. Read more

January 5, 2022

Vulkan with Rust by example 0. Introduction.

Hi everybody. Today I’d like to talk about Vulkan - the modern API for communication with a GPU device. Though there’re already tons of information and tutorials on the web I’m writing this tutorial for several reasons: I don’t want this series to be about general usage of the API. Instead, I want to focus on a single purpose application, more or less complex, not just a triangle, and explain how everything works by looking at a concrete example. Instead of C/C++, I want to try Rust programming language because at the moment of writing there’s simply no information about the subject. The popular tutorials are a bit outdated. No, they are great and work fine, but Vulkan evolves, and new features and paradigms appear with time. I want to understand Vulkan better. And, as you know, trying to explain something helps to understand it better. Read more

August 8, 2020

How to use Vulkan Timestamp Queries.

At some point in my development life, I decided that I want to know how fast my GPU can crack the tasks I throw at it. And if you read this then you probably want to know it too. I expect that you know that measure a GPU time on the CPU makes no sense since CPU and GPU are two different processors and if you place std::chrono::some_clock::now() before and after a draw call it will always give you a time near to zero. Luckily Vulkan provides a tool to make time snapshots - the so-called Queries. There’re multiple different query types but today we’ll talk about Timestamp Queries. Read more

If you like what I do you can buy me a coffee © nikitablack 2021

Powered by Hugo & Kiss.