mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-12-14 06:31:38 +00:00
15 lines
364 B
Text
15 lines
364 B
Text
|
#include "oit.h"
|
||
|
|
||
|
void
|
||
|
StoreFrag (vec4 color, float depth)
|
||
|
{
|
||
|
int index = atomicAdd (numFragments, 1);
|
||
|
ivec2 coord = ivec2(gl_FragCoord.xy);
|
||
|
if (index < maxFragments) {
|
||
|
int prevIndex = imageAtomicExchange (heads, coord, index);
|
||
|
fragments[index].color = color;
|
||
|
fragments[index].depth = depth;
|
||
|
fragments[index].next = prevIndex;
|
||
|
}
|
||
|
}
|