Skip to main content
30 votes
Accepted

How does GPU handle texture and VRAM?

GPU compressed texture formats like DXT / BC / ETC are specifically designed to be read directly from their compressed form. They don't need to be unpacked into a raw RGBA buffer. The way this works ...
DMGregory's user avatar
  • 135k
9 votes

What's the difference between CUDA and Shader?

In opposite to Shaders, CUDA is not restricted to a specific step of the rendering pipeline. It can be used to do calculations that are best suited for the GPU architecture, allowing people to take ...
Hatoru Hansou's user avatar
8 votes

How does GPU handle texture and VRAM?

Answers to your questions really depends on the platform. Generally BC formats are kept in compressed form in memory and decompression is done in flight by GPU texture units, but there are exceptions. ...
JarkkoL's user avatar
  • 870
5 votes
Accepted

Compressed vs Uncompressed Textures differences?

All GPU texture compressions are lossy. There is a slight degradation in image quality that may or may not be noticeable depending on what is in the texture. The compressed textures are stored ...
Stephane Hockenhull's user avatar
4 votes
Accepted

Why do GPUs have limited amount of allocations?

It's not correct to say that - as a general case - GPUs have a fixed limit on the number of allocations that may be made. What the Vulkan documentation for ...
Maximus Minimus's user avatar
4 votes
Accepted

Simple square vertex lifting shader

This is actually an illusion. The vertices are not lifted: There aren't enough vertices in the model to create the pinata effect. Here are the tricks: The normal map has squares in it to create the ...
Stephane Hockenhull's user avatar
4 votes
Accepted

Why isn't more culling being done on the GPU?

Non-optimality in terms of architecture. Wrong tool for the job. GPU-optimal tasks are highly parallel: vertex processing, texture processing, computing boid motion, with all kernel-threads running ...
Engineer's user avatar
  • 30k
3 votes
Accepted

Which memory is used in D3D12 resources?

They are not 3 types of memory. They're 2 different things (physical and virtual memory) and a 3rd that combines the first two for convenience. Placed resources are blocks of physical memory that the ...
Stephane Hockenhull's user avatar
3 votes

Pseudo random number generation in compute shader

You have to consider that one GPGPU invocation executes all CSMain in parallel, conceptually all at the same time. So every pixel in your texture will come back ...
Stephane Hockenhull's user avatar
3 votes

Data flow with PhysX on a dedicated GPU

Even if you have a dedicated PhysX card, some of the processing is still done on the CPU, as mentioned here. This means that all data must be sent back to the cpu, and then forwarded on to the GPU. ...
benh's user avatar
  • 581
3 votes

What's the difference between CUDA and Shader?

Shaders are typically referenced in the context of a graphics API, like OpenGL or Direct3D. They originated as small program that allowed tweaking the lighting calculations for a surfade, aka "shading"...
Sean Middleditch's user avatar
3 votes

Simple coherent noise function to use in a GLSL shader

The best you can do is using a texture to get the noise from, note that this is not the same as sampling a noise texture, you are just getting the random values from the texture so you can animate it ...
Felipe Gutierrez's user avatar
3 votes
Accepted

How to render a grid of dots being exactly 1x1 pixel wide using a shader?

This does pretty well, though I found I needed to add a small fudge factor to avoid dots occasionally winking out when the grid point exactly straddled the border between pixels, but this does create ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

What is GPU instancing and what are its differences in comparison to standard instancing?

Very simple: "non-GPU" instancing doesn't exist. Doing more work on the GPU is the whole point of instancing. Moreover, instancing improves performance by reducing the amount of data that has to be ...
Lorenzo Gatti's user avatar
2 votes
Accepted

DirectX Performance Issue: Rendering to texture

The answer to the first part is easy, R32G32B32A32_FLOAT is a massively expensive format to use for GPUs. It uses 128 bits per pixel compared to R8G8B8A8_UNORM which uses only 32. So by changing it ...
Muzza's user avatar
  • 176
2 votes
Accepted

Data flow with PhysX on a dedicated GPU

It is worth noting that the render pipeline and the physics calculations are already logically separated in your application's code. Render pipelines usually require specific data formats for the ...
Djindjidj's user avatar
  • 406
2 votes
Accepted

GLSL shader performance reduced by loop?

I've encountered this issue when implementing other shader types with certain hardware configurations. I believe the issue lies with ...
Ian Young's user avatar
  • 2,649
2 votes

How to resize a D3D11Texture2D?

CopyResource does not support scaling. Mapping would work, but: You would need to write your own scaling algorithm You would need to download the data from GPU to system memory before scaling, You ...
Maximus Minimus's user avatar
2 votes
Accepted

How OpenGL running without GPU?

How do you know your programs are running if you can't see anything on your screen? Or to put it another way - you still have a GPU of some description in your computer, because in addition to ...
Maximus Minimus's user avatar
2 votes

How do multiple render targets get rendered onto the back buffer(s) then screen?

The render targets become sampling textures for a final compositing pass shader rendering to the back buffer. The GPU doesn't do any automatic flattening. It all has to be done in a shader. Ping-...
Stephane Hockenhull's user avatar
2 votes

OpenGL Texture Zig-Zag Artifacts Over Time

To me it actually looks and sounds like bad video memory or core issue. Sometimes video cards can start to corrupt their outputs as the silicon degrades. If other cards do not show this artifact, then ...
Carlstone's user avatar
2 votes

Should calculations be done on the CPU or GPU?

A few rules of thumb around this, if the calculation only needs to be done once and applies to the entire object, then you will get best bang for buck calculating it prior to loading onto the GPU. IF ...
ErnieDingo's user avatar
  • 1,150
2 votes
Accepted

Unity Build GPU Performance

What you are experiencing are various bottlenecks when performance isn't purposely limited. If you run a game (even a static none-moving cube) a typical game engine will tell the GPU to render and ...
user3797758's user avatar
  • 3,641
2 votes
Accepted

Map() fails when reading back GPU Texture

You can't read back from a texture using Map() on a deferred context: If you call Map on a deferred context, you can only pass D3D11_MAP_WRITE_DISCARD, ...
Panda Pajama's user avatar
  • 13.4k
2 votes

How to temporarily set additional system environment variable only in 'play' mode inside godot editor?

Seems the solution that works so far is to write my own shell script. Here's the script: ...
ArchBug's user avatar
  • 21
2 votes

Why do we use GLSL(Shader) instead of CUDA?

The intuition that CUDA is objectively "better than" dedicated rendering APIs for common rendering workloads is not a good guide. These are not two competing software libraries that serve ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

Is DirectX 12 or lower just an API?

Shall it support all GPUs? Or just newer GPUs? What about the version of the Windows OS supported? From Nvidia, DirectX12 supports all GPUs using the Ampere (RTX 3000 Series), Turing (RTX 2000 Series)...
Pow's user avatar
  • 404
1 vote

Is it possible to achieve the same performance of CUDA on OpenCL?

It's performance vs. compatibility. CUDA only works on "CUDA enabled" graphics cards. That means CUDA code can be sure that certain hardware features are present and can get more out of the GPU. ...
Raphael Schmitz's user avatar
1 vote

GPU (render time) increase if screen size increase

In your GPU there's a thing called fragment shader which gets executed for each pixel. Fragment shader does some calculation to determine the colour for a pixel. The complexity of this shader varies ...
videogamechef's user avatar

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