Skip to Content
GPGPU Programming for Games and Science
book

GPGPU Programming for Games and Science

by David H. Eberly
August 2014
Intermediate to advanced
469 pages
16h 30m
English
A K Peters/CRC Press
Content preview from GPGPU Programming for Games and Science
GPU Computing 143
G
y
-1
N
y
=G
y
*T
y
threads
0
g
y
N
x
=G
x
*T
x
threads
0
g
x
G
x
-1
T
y
-1
0
t
y
0
t
x
T
x
-1
(T
x
*g
x
+t
x
, T
y
*g
y
+t
y
)
Base index of upper left
corner is (N
x
*g
x
, N
y
*g
y
)
FIGURE 4.8: An illustration of Equation (4.22) that relates the dispatch
thread ID to the group ID and the group thread ID.
t as an int2 for convenience. Notice that output is a 2D texture. This compute
shader has no need for texture sampling, so we can look up the texture values
directly without sampling. The
operator[] provides the direct lookup and it
expects a 2-tuple for the index. Because
t is already a 2-tuple, I can use it as
is. However, if I had declared
int3 t, then I would need to perform the lo ...
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

Graphics Gems V (IBM Version)

Graphics Gems V (IBM Version)

Alan W. Paeth
GPU Pro 6

GPU Pro 6

Wolfgang Engel

Publisher Resources

ISBN: 9781466595354