quakeforge/libs/video/renderer/vulkan/shader/oit_store.finc
Bill Currie 0ccee3032e [vulkan] Add partial support for cube maps to OIT
Partial because frame buffer creation isn't handled yet (using six
layers), but using layer a layer capable view and shaders doesn't cause
problems (other than maybe slightly slower code).
2023-02-14 13:24:47 +09:00

14 lines
378 B
Text

#include "oit.h"
void
StoreFrag (vec4 color, float depth)
{
int index = atomicAdd (numFragments, 1);
ivec3 coord = ivec3(gl_FragCoord.xy, gl_ViewIndex);
if (index < maxFragments) {
int prevIndex = imageAtomicExchange (heads, coord, index);
fragments[index].color = color;
fragments[index].depth = depth;
fragments[index].next = prevIndex;
}
}