September 3, 2025

Hello, Neural Network 2! Follow the White Rabbit.

Last time, we ended with a working naive implementation of a simple neural network. We also briefly touched on the performance difference between floats and doubles. But as you may remember, the ultimate goal is to train the network on a GPU using Vulkan Compute. In Vulkan Compute shaders (I’ll use GLSL as the shader language), we don’t have anything comparable to the C++ standard library. In fact, we have very little - just basic arithmetic operations and a small set of built-in functions. Read more

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

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

Powered by Hugo & Kiss.