<blockquote>
<p>Is the division of the coordinates x/w,y/w,z/w the last operation that happens on the GPU?</p>
</blockquote>
<p>The division you are referring to is generally called &quot;The Perspective Divide&quot;. You can google it and get information overload on helpful documentation. The division itself happens after the geometry shader before the fragment shader as part of rasterization. And is part of the process that creates the fragments that the pixel shader is run on. It is also an important part of vertex attribute interpolation. All of OpenGL, Vulkan, DirectX perform the perspective divide in the same place which is done by the GPU's hardware.</p>
<p>The most adopted floating point standard is IEEE 754 and yes virtually all vendors implement and follow these standards. I highly recommend (slowly) wrapping your mind around this standard to get a deeper understanding of how floats are processed. Here is a good first factoid to memorize (if you want): The standard put the sign bit for floating point numbers in the same place as the sign bit for integers to make conversion between and understanding both easier.</p>
<p>Quantization in this context refers to the accuracy of floating point numbers. There are many numbers that can not be fully represented in floating point math on the GPU, such as 1/3. Quantization is the process of representing that number as closely as possible within the limitations of the hardware. But minor difference in hardware implementations that are still standards compliant can and often will produce slightly different results.</p>
<p>Rather then focus on the limits of floating point numbers or attempting to write code that operates at the edge of these limits, coders generally use techniques that avoid the issue altogether like utilizing hardware offset capabilities to side step the issue completely is one method. (but is situation specific, like when applying decals)</p>

CC BY-SA 4.0
2020-11-16T15:38:39.473Z
Hello, thank you for your exhaustive answer this will very much help me forward!
Just a short part on the quantization, this means the fragments are not quantized on lets say a pixel cube with 1024x1024x1024 but still use the full precision of loat?
Anima
CC BY-SA 4.0
2020-11-17T00:27:52.123Z
Its better to think of floats as either can be fully represented or can't be fully represented. Any multiple of 2 can be fully represented by a floating point number exactly. Issues with quantization occur when 2 numbers that can not be fully represented are the multiplied together and the error which was minor previously begins to multiply. When generating fragments, the exact positions can always be calculated since texels are computed on boundaries that can be exactly represented inside the values stored on the GPU.
pmw1234
CC BY-SA 4.0
2020-11-17T00:38:08.820Z
I recommend writing a small test program that adds a very small amount to a floating point number in a loop allowing it to accumulate, say 0.0001f it will slowly accumulate until the number becomes to large to fully represent. Along the way it will begin to skip certain numbers, before stopping to accumulate all together. There is a really great website that explains really well but I can seem to find a link to it...sorry.
pmw1234
CC BY-SA 4.0
2020-11-16T12:59:34.500Z
2020-11-16T12:59:34.500Z
pmw1234
<p>I have a few short question regarding operations happening in the rendering pipeline (OpenGL, Vulkan, I'd expect for all questions to have similar answers for these two frameworks while DirectX might work a bit different).</p>
<p>Is the division of the coordinates <code>x/w</code>,<code>y/w</code>,<code>z/w</code> the last operation that happens on the GPU? Or are there other operations that happen afterwards? I wasn't really able to find any information on that, could anyone point me into the right direction?</p>
<p>Furthermore, concerning the depth of fragments, as far as I understand a quantization takes place to discrete units of depth, but I couldn't find anything detailed if these operations follow some kind of IEEE standard or if they have their own standards, maybe even depending on the manufacturer. Does anyone know more detail about this or could point me into the right direction?</p>
<p>In general are there some, more or less, complete information about the possible operations (besides of course programmable operations during the programmable shader stages), the error bounds, etc. for operations on the GPU?</p>
<p>Kind regards and thank you in advance.</p>

CC BY-SA 4.0
2020-11-16T09:59:03.720Z
Have you read this?
https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview
gallickgunner
<opengl><gpu><vulkan>
Operations in the Rendering Pipeline
Anima
# Operations in the Rendering Pipeline

(Asked by: username_0 on 2020-11-16)

I have a few short question regarding operations happening in the rendering pipeline (OpenGL, Vulkan, I'd expect for all questions to have similar answers for these two frameworks while DirectX might work a bit different).

Is the division of the coordinates `x/w`,`y/w`,`z/w` the last operation that happens on the GPU? Or are there other operations that happen afterwards? I wasn't really able to find any information on that, could anyone point me into the right direction?

Furthermore, concerning the depth of fragments, as far as I understand a quantization takes place to discrete units of depth, but I couldn't find anything detailed if these operations follow some kind of IEEE standard or if they have their own standards, maybe even depending on the manufacturer. Does anyone know more detail about this or could point me into the right direction?

In general are there some, more or less, complete information about the possible operations (besides of course programmable operations during the programmable shader stages), the error bounds, etc. for operations on the GPU?

Kind regards and thank you in advance.

**Tags:** opengl, gpu, vulkan

> **Comments:**
> **username_1**: Have you read this? https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview  

---

## 1 answers

### Answer by username_2 on 2020-11-16. Score: 1 | Accepted answer

> Is the division of the coordinates x/w,y/w,z/w the last operation that happens on the GPU?

The division you are referring to is generally called "The Perspective Divide". You can google it and get information overload on helpful documentation. The division itself happens after the geometry shader before the fragment shader as part of rasterization. And is part of the process that creates the fragments that the pixel shader is run on. It is also an important part of vertex attribute interpolation. All of OpenGL, Vulkan, DirectX perform the perspective divide in the same place which is done by the GPU's hardware.

The most adopted floating point standard is IEEE 754 and yes virtually all vendors implement and follow these standards. I highly recommend (slowly) wrapping your mind around this standard to get a deeper understanding of how floats are processed. Here is a good first factoid to memorize (if you want): The standard put the sign bit for floating point numbers in the same place as the sign bit for integers to make conversion between and understanding both easier.

Quantization in this context refers to the accuracy of floating point numbers. There are many numbers that can not be fully represented in floating point math on the GPU, such as 1/3. Quantization is the process of representing that number as closely as possible within the limitations of the hardware. But minor difference in hardware implementations that are still standards compliant can and often will produce slightly different results.

Rather then focus on the limits of floating point numbers or attempting to write code that operates at the edge of these limits, coders generally use techniques that avoid the issue altogether like utilizing hardware offset capabilities to side step the issue completely is one method. (but is situation specific, like when applying decals)

> **Comments:**
> **username_0**: Hello, thank you for your exhaustive answer this will very much help me forward! Just a short part on the quantization, this means the fragments are not quantized on lets say a pixel cube with 1024x1024x1024 but still use the full precision of loat?  
> **username_2**: Its better to think of floats as either can be fully represented or can't be fully represented. Any multiple of 2 can be fully represented by a floating point number exactly. Issues with quantization occur when 2 numbers that can not be fully represented are the multiplied together and the error which was minor previously begins to multiply. When generating fragments, the exact positions can always be calculated since texels are computed on boundaries that can be exactly represented inside the values stored on the GPU.  
> **username_2**: I recommend writing a small test program that adds a very small amount to a floating point number in a loop allowing it to accumulate, say 0.0001f it will slowly accumulate until the number becomes to large to fully represent. Along the way it will begin to skip certain numbers, before stopping to accumulate all together. There is a really great website that explains really well but I can seem to find a link to it...sorry.  

---

