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
Sample Applications 391
In the second (and optimal) attempt, we will use
minmax8, minmax12,and
minmax16 multiple times. Each time, though, we must copy two unprocessed
elements rather than one in order to set up for the next smaller subset. The
compute shader for the median filtering is shown in Listing 7.23.
#include ”MedianShared . h l s l i
Texture2D<float> input ;
RWTexture2D<float> output ;
[ numthreads (NUM
X THREADS , NUM Y THREADS , 1 ) ]
void CSMai n ( i nt2 dt : SV
DispatchThreadID)
{
float4 e [7]; // 28 sl o t s , we u s e t h e f i r s t 25
LoadNeighbors( input , dt , e );
minmax16(e ); // D i s c a rd min/max o f v0 . . v1 5 (2n +1=25, n+2<16). ...
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