Skip to main content
33 votes
Accepted

What does GPU assembly look like?

You're tilting at windmills trying to learn "GPU assembly", and it's due to the differences between how CPUs and GPUs are made and sold. Each CPU has what's called an instruction set architecture, ...
Dan Hulme's user avatar
  • 6,840
25 votes

Why can't we have hardware-specific graphics APIs?

Wouldn't it be better if each GPU vendor provided their own graphics API? ... no. First, the GPU doesn't belong to you. It belongs to the platform, the OS. In order for different programs to ...
Nicol Bolas's user avatar
  • 9,852
15 votes
Accepted

Why do GPUs still have rasterizers?

In short, performance reasons are why they aren't programmable. History and Market In the past, there used to be separate cores for vertex and fragment processors to avoid bloated FPU designs. There ...
aces's user avatar
  • 1,353
14 votes

Why can't we have hardware-specific graphics APIs?

In the early years of the PC, it was common for every game (and other piece of software that needed them) to ship with its own set of sound and graphics drivers. This had a number of drawbacks: Every ...
IMSoP's user avatar
  • 241
12 votes
Accepted

What are 'mesh clusters' / hierarchical cluster culling (with LOD?) / triangle cluster culling and how do they relate?

First, to preface: the reason it's hard to find details about these hierarchical cluster culling systems because they are a still emerging field, at the very cutting edge of real-time rendering ...
Nathan Reed's user avatar
  • 25.1k
11 votes

Why did tessellation come to be a prominent feature?

The main purpose of tesselation is to increase the resolution of the mesh, while only transferring a small amount of triangle data around. In addition, tessellation allows you to dynamically change ...
RichieSams's user avatar
  • 3,792
10 votes
Accepted

Why do adjacent triangles never overlap when rasterized?

This is the same problem as discussed in What are sample gaps during scan conversion? Briefly, rasterisation - at least with the majority of hardware systems - tests at a single 'infinitesimal' point ...
Simon F's user avatar
  • 4,306
10 votes
Accepted

What modern real-time rendering applications still use fragment shader depth writes / late-Z?

Any techniques that involve raytracing in the fragment shader might want to write Z in order that the depth buffer contain an accurate representation of the raytraced surface. For example: Distance-...
Nathan Reed's user avatar
  • 25.1k
9 votes
Accepted

What is the difference in overlay and framebuffer?

As you've understood, the framebuffer is an array in memory that holds all the pixels to display on the screen. On a desktop PC, it's probably special memory on the graphics card, but in a SoC with ...
Dan Hulme's user avatar
  • 6,840
9 votes

Why are oct trees so much more common than hash tables?

Lots of things here. "When reading papers". What papers? If the topic of the paper is about something other than the spatial partitioning structure, it could be fair to use whatever knowing that the ...
Angelo Pesce's user avatar
9 votes
Accepted

Is vkCmdPushDescriptorSetKHR efficient?

What you're ultimately trying to do is, between draw calls, change some state that allows one to select which set of read-only data to use in the rendering process. There are many techniques for this. ...
Nicol Bolas's user avatar
  • 9,852
9 votes
Accepted

Double buffering always necessary?

Indeed there are/were 'just in time' renderers. For example, Dreamcast (PowerVR CLX2) had a mode where the 'frame buffer' only had to be a few rows of tiles in size. The system would be rendering ...
Simon F's user avatar
  • 4,306
8 votes

The mathematics of two dimensional interpolation on a quad

(It actually is easier to think (and compute) about this with triangles, but for the sake of the answer, let's first stick to your quad example.) For this you just have to define the point you're ...
Christian Rau's user avatar
7 votes

Can a scene graph be stored in the GPU?

Short answer: Yes, It can be done. But no one does so. Long answer: Scene graphs can be stored and processed on a GPU using OpenCL/WebCL. But it is not practical to do so. Updating scene graphs (a ...
Mary Chang's user avatar
7 votes
Accepted

Where is the best place for Tangent-bitangent calculation, in shader or in C/CPP code?

Doing it in the CPU side during initialization is what I'd go for, this is assuming you are initialising that data once and passing it to the GPU. On the GPU side, doing the calculations per fragment ...
Fred Garnier's user avatar
7 votes
Accepted

What mechanisms are being used by Directx12 and Vulkan APIs in order to communicate with graphic card drivers internally?

It's very different between the Khronos standards (including Vulkan) and DirectX. In DirectX, Microsoft implements the API, but they publish to GPU vendors a HAL API. There's actually two HALs: one ...
Dan Hulme's user avatar
  • 6,840
7 votes
Accepted

Why sending data from gpu to cpu is slower than cpu to gpu?

The actual sending of data is the same. The PCIe bus is the same speed in both directions. However when programming there is a big difference namely that when you send you can immediately start doing ...
ratchet freak's user avatar
7 votes
Accepted

Binding vs bindless

When a shader accesses a resource (buffer or texture), it needs some information about that resource to be able to do so correctly. On a modern GPU, that information will generally just be some kind ...
Nicol Bolas's user avatar
  • 9,852
6 votes

Creating shared vertex normals on GPU

For an nVidia only solution you can use floating point atomic add intrinsics (like NvInterlockedAddFp32) Unlocking GPU Intrinsics in HLSL | NVIDIA Developer I tried this on 80.000 vertex mesh and it'...
Florent Tournade's user avatar
6 votes
Accepted

How to get started writing a low-level GPU profiler?

For basic GPU timing data, you can use D3D timestamp queries or the equivalent OpenGL timer queries. Any low-level hardware data like cache misses is going to be extremely vendor-specific. Each GPU ...
Nathan Reed's user avatar
  • 25.1k
6 votes
Accepted

How to ensure a fragment shader only runs once

I don't think your approach is viable for a variety of reasons. a GPU is heavily cache-dependent for performance. Pulling the same pixels over and over will just measure how fast a cache hit is. ...
ratchet freak's user avatar
6 votes
Accepted

Can I use QueryPerformanceCounter to measure single draw or compute call performance?

That diagram includes a CPU block titled "wait for GPU". I do not see the part of your code that includes an equivalent command. Furthermore, even if it did include ...
Nicol Bolas's user avatar
  • 9,852
6 votes
Accepted

Can I use my phone's gpu as an external gpu for my laptop?

No. Your phone's GPU is in one chip with the CPU, some of the memory, and its display controller, and they're all tightly integrated together. Also, there'd be no way to connect it efficiently to the ...
Dan Hulme's user avatar
  • 6,840
5 votes
Accepted

Distributed parallel rendering in Gaming or VR rendering

You are essentially correct in assuming that it is technically feasible to distribute the rendering computation workload. It is, essentially, a computation workload like any other; possibly even ...
IneQuation's user avatar
5 votes

Compute shaders: one-time-only versus persistent buffers

Yes, it's totally possible, and in fact it's preferable to keep buffers in memory if you will be accessing them over the life of your program, rather than deallocating and reallocating them again. I ...
russ's user avatar
  • 2,402
5 votes
Accepted

How did the hard, accurate shadows, work in early 3d (2000 - 2004) games?

Having not worked on these games, I can only speculate... but from your description, it sounds like a crude shadow map with orthogonal projection and no depth information. It probably has (or had) a ...
Olivier's user avatar
  • 1,585
5 votes

What does GPU assembly look like?

What you've read is correct. In general, GPU vendors do not release lists of machine instructions for their GPUs. That said, you can do something similar to assembly programming on the GPU by using ...
user1118321's user avatar
  • 3,421
5 votes

What does GPU assembly look like?

For Nvidia GPUs there are several machine languages all of which can be read here: https://docs.nvidia.com/cuda/cuda-binary-utilities/index.html#instruction-set-ref Above the "Instruction Set ...
Danil's user avatar
  • 51
5 votes

Difference in pixels between different monitors' sizes

The answer to both your questions is the same: the physical size of the monitor makes no difference at all. If your screen is 1920x1080 pixels, and you display a 960x540 image without any scaling, the ...
Dan Hulme's user avatar
  • 6,840

Only top scored, non community-wiki answers of a minimum length are eligible