Skip to Content
GPU Pro 7
book

GPU Pro 7

by Wolfgang Engel
March 2016
Intermediate to advanced
320 pages
9h 14m
English
A K Peters/CRC Press
Content preview from GPU Pro 7
3. Deferred Attribute Interpolation Shading 93
1 #e x t e n si on GL NV shader thread group : e nable
2 uint sid =0; // Shading sample address
3 if (( gl_ThreadInWarpNV &3)==0) // One thread allocates memory.
4 sid = atomicCounterIncrement ( ctr_shading_samples );
5 // Communicate to all invocations .
6 uint sid_sw = floatBitsToUint (
7 quadSwizzle0NV ( uintBitsToFloat( sid )));
8 if ( sid_sw == 0 ) { // Fails when there are helperinvocations .
9 if( sid == 0 ) // Allocate shading samples for all invocations .
10 sid = atomicCounterIncrement ( ctr_shading_samples );
11 store_shading_sample ( sid );
12 } else if (( gl_ThreadInWarpNV &0x03)==0) {
13 sid
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

GPU Pro 4

GPU Pro 4

Wolfgang Engel
GPU Pro 5

GPU Pro 5

Wolfgang Engel
GPU Pro 6

GPU Pro 6

Wolfgang Engel
GPU PRO 3

GPU PRO 3

Wolfgang Engel

Publisher Resources

ISBN: 9781498742542