Hot answers tagged

29 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,700
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,697
23 votes
Accepted

Why do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?

Speed is the most common reason why this is not done. In fact you can do what you propose, if you make your own operating system, its just going to be very slow for architectural reasons. So the ...
joojaa's user avatar
  • 8,397
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 do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?

work on any 32-bit color GPU (even old ones)? Bit of history here: this is how games were done on PC up until graphical accelerators started to become available in the mid-90s. It did indeed work on ...
pjc50's user avatar
  • 241
14 votes

Why do we have graphics frameworks like OpenGL and DirectX, when games could just draw pixels directly?

Just to add to joojaa's answer, things are still being drawn pixel by pixel. You're just generating the pixels using a vertex shader/assembler/rasterizer, then texturing and lighting them using a ...
russ's user avatar
  • 2,372
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
11 votes
Accepted

Does prerendering actually help performance?

As far as I know, this sort of thing is mainly about shader compilation. One of the main reasons why a game may experience hitches the first time something renders is that the shaders necessary to ...
Nathan Reed's user avatar
  • 24.8k
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,732
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,171
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
  • 24.8k
10 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
  • 24.8k
9 votes

Cloud based VR would be the future?

As other people have mentioned, due to network latency issues, I think that full rendering on a cloud server and streaming video to a client device is unlikely to be workable. Even if the latency can ...
Nathan Reed's user avatar
  • 24.8k
9 votes
Accepted

Are draw calls executed in parallel or sequentially or both?

The result should be as if it was executed sequentially one triangle at a time. This is important so that each frame is deterministic. If it wasn't then drawing the same frame multiple times could ...
ratchet freak's user avatar
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,700
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,697
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

How many polygons in a scene can modern hardware reach while maintaining realtime, and how to get there?

I think it is commonly accepted that real time is everything that is above interactive. And interactive is defined as "responds to input but is not smooth in the fact that the animation seems jaggy". ...
v.oddou's user avatar
  • 623
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

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

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,700
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

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,171
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,697
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
  • 24.8k
6 votes
Accepted

Gpu derivatives. How it's done across 2x2 boundary?

In Vulkan the shader only looks at each 2x2 and won't attempt to look beyond the neighbourhood: http://vulkan-spec-chunked.ahcox.com/ch15s05.html $$dPdx_{0,0}=dPdx_{1, 0} = P_{1,0}−P_{0,0}\\ dPdx_{2,...
ratchet freak's user avatar
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,697

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