6 votes
Accepted

Dealing with wasted space when using SIMD on CPU for vector maths

There's a third option you've neglected. Because of how graphics APIs work, typically you have to copy the data between the CPU and GPU anyway - even if you're on a mobile SoC where they share the ...
Dan Hulme's user avatar
  • 6,810
5 votes
Accepted

Why do I need memory barrier when doing atomic operations?

glMemoryBarrier is for when you want to make writes from one rendering command visible to reads from a subsequent rendering command. That is, you can do all the ...
Nicol Bolas's user avatar
  • 9,782
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,392
5 votes
Accepted

Register pressure in Compute Shader

Lowering register pressure doesn't necessarily give you any performance boost though. I recently went through this exercise myself on GCN architectures (for a simple ray tracer) and reduced register ...
JarkkoL's user avatar
  • 3,636
5 votes
Accepted

How can an OpenGL visualization run for weeks?

Opengl doesn't care how long it has been running. However there are a few other challenges with long running applications in general: memory leaks, both normal ones and opengl resources. lack of ...
ratchet freak's user avatar
4 votes

Should you measure mesh complexity in triangles or vertices?

Since you're talking about "vertex shaders" and "fragments", I assume that your question is to be interpreted in the context of real-time rendering using the graphics pipeline on a modern GPU through ...
Michael Kenzel's user avatar
4 votes

memory consumption for a true color frame buffer

True color is 8 bits per color channel, so 3 bytes per pixel. 1024x768 is 785,408 pixels. At 3 bytes per pixel that is 2,356,224 bytes. Since it's double buffered we double that number to 4,712,448 ...
Alan Wolfe's user avatar
  • 7,801
4 votes

Where is the shown display image actually stored and accessed?

For modern GPUs it's commonly stored in VRAM which for discrete GPUs are separate from the CPU memory. This usually means there is a penalty associated with letting the CPU access this as the data ...
PaulHK's user avatar
  • 2,322
4 votes
Accepted

Do I need to use glMemoryBarrier with atomic counters?

The post October 22, 2019 version of the OpenGL 4.6 standard gives atomic counters the same incoherency restrictions as image load/store and SSBO operations. You have to use explicit barriers to ...
Nicol Bolas's user avatar
  • 9,782
4 votes
Accepted

Can meshes be reused in raytracing?

Example code tends to be bad code from a performance (or even software engineering) standpoint because... it's an example. Its primary purpose is to make it clear how to do a thing, not to do it in an ...
Nicol Bolas's user avatar
  • 9,782
4 votes
Accepted

In what scenarios and how does GL_ARB_buffer_storage help performance?

The marquee feature of buffer storage is not immutability of the allocation itself, but instead is a feature you couldn't have without immutable allocation: persistently mapped buffers. Pre-...
Nicol Bolas's user avatar
  • 9,782
3 votes
Accepted

Zero-copy texture reading from CPU memory

Is such a method of zero-copy texture loading possible/optimal on modern discrete graphics hardware? You say that as though it were optimal back then. The Intel 740 was not exactly warmly embraced by ...
Nicol Bolas's user avatar
  • 9,782
3 votes

Dealing with wasted space when using SIMD on CPU for vector maths

While the existing answer adress your question quite well, I'd like to add some general advice, even if you might already be aware of that. Rather than just wasting that fourth component on the GPU, ...
Christian Rau's user avatar
3 votes

Could a hexagonal pixel array store an image more efficiently?

If one examines old CRT television displays, one will observe red, green, and blue phosphor dots in a triangular lattice. Some LCD television sets had a somewhat similar arrangement; pixels were ...
supercat's user avatar
  • 171
3 votes

How can I chase down VRAM & GTT memory leaks?

Assuming your code has several locations that can allocate/release GPU memory, but you don't know which one leaks. Maybe you can try to add a GPU memory monitor to that code. When GPU memory is ...
wip's user avatar
  • 1,861
3 votes

How can I chase down VRAM & GTT memory leaks?

Probably not. Most OpenGL resources (framebuffers, vertex buffer objects, textures &c.) are controlled by host code (i.e. your C++ code), but take up GPU memory. OpenGL doesn't make it very easy ...
Dan Hulme's user avatar
  • 6,810
3 votes
Accepted

What is the typical use case for rendering to an image through imageStore?

I've used imageStore as part of compute shaders doing surface extraction. I've only ever used it in compute shaders, to store the calculated data in a texture to be ...
russ's user avatar
  • 2,392
3 votes

Handling GPU resource management

Whenever there's too much churn of things being created and destroyed, regardless of the specifics of the situation, a common way to dealing with this is to make free object pools. How these work is ...
Alan Wolfe's user avatar
  • 7,801
3 votes
Accepted

Should you measure mesh complexity in triangles or vertices?

Vertex count may be more accurate of a measurement of "mesh memory usage and mesh rendering time", but vertex count is not nearly as easily measured. Yes, given a specific mesh with all of its ...
Nicol Bolas's user avatar
  • 9,782
3 votes

How can an OpenGL visualization run for weeks?

Yes, of course. The duration it has to run for doesn't make much difference. Your Android smartphone's main GUI is OpenGL, and phones typically have an uptime longer than four weeks. Air Traffic ...
Dan Hulme's user avatar
  • 6,810
2 votes

How can an OpenGL visualization run for weeks?

To make an application, OpenGL or not, run for extended time safety-critical applications are mostly built to restart on error, be it a driver bug, your application is broken, or hardware failure. If ...
Andreas's user avatar
  • 359
2 votes
Accepted

How can I control memory for command allocators and command queues in D3D12?

You don't. These objects typically work with CPU memory, not device memory. And to the extent that they involve device memory, such allocations tend to be rare and/or fixed in size (a queue may have ...
Nicol Bolas's user avatar
  • 9,782
2 votes
Accepted

What does the z-buffer look like in memory?

The Z buffer used to be specialized memory set aside for a single purpose, some web sites still explain it like that, but no longer. Now the Z buffer is just a chunk of memory you allocate, or an API ...
pmw1234's user avatar
  • 3,219
1 vote
Accepted

Does OpenGL allocate on glBegin/glEnd?

OpenGL implementations aren't assumed to have unlimited memory, but the specification imposes no specific restrictions on this. That is, you can't ask how many vertices you can send. Instead, if you ...
Nicol Bolas's user avatar
  • 9,782
1 vote
Accepted

D3D11 Map forces synchronization

Yes, Map can force synchronization in some situations. In D3D11, the driver handles GPU command recording, submission and synchronization. When you make D3D11 calls,...
Nathan Reed's user avatar
1 vote

Is it possible to bind dynamic texture samplers to a shader in DX12?

Yes it is possible by putting Samplers in descriptor tables to dynamically assign and index into them. Source: https://youtu.be/Wbnw87tYqVg?t=754 Here's an example that uses the HLSL root signature ...
mbl's user avatar
  • 301
1 vote
Accepted

What objects do get loaded into GDDR?

Typically you will need VRAM to store your frame buffer (memory used to store pixels for use with the display and for rendering). This would usually be 4 bytes per pixel so a 1080p frame buffer is ...
PaulHK's user avatar
  • 2,322
1 vote

Dealing with wasted space when using SIMD on CPU for vector maths

The conversion from option A is likely faster than you think. See, for example, Intel's version which claims to do the round trip at 1.5 cycles per vector with AVX. There are also some operations ...
Olivier's user avatar
  • 1,585
1 vote

Why smoothed meshes in 3D studio end up with the same number of vertices/triangles? How then can they be smoothed with the same geometry?

I can see two ways of doing "smoothing". The first one is smoothing what's mostly related to the appearance (in your case the normals). The other way is smoothing the geometry itself. In the ...
user8469759's user avatar

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