ACMX Vulkan Shader Library
GLSL 4.50 shader effects for ACMX's Vulkan renderer
Loading...
Searching...
No Matches
acidcam_004_history_xor_cache.comp File Reference

Vulkan compute shader: acidcam 004 history xor cache. More...

Go to the source code of this file.

Macros

#define alpha   ext.u0.x
#define history_head   int(ext.u3.x)
#define iFrame   int(ext.u2.x)
#define SIZE   8
#define USE_HISTORY_TEXTURE_ARRAY   1

Functions

 layout (set=0, binding=1, std140) uniform SpriteExtended
 layout (local_size_x=16, local_size_y=16) in
 layout (set=0, binding=5, rgba8) writeonly uniform image2D outputImage
 layout (set=0, binding=0) uniform sampler2D samp
ivec2 clampPos (ivec2 p, ivec2 size)
 Evaluates clampPos for this shader effect.
vec2 pixelUv (ivec2 p, ivec2 size)
 Evaluates pixelUv for this shader effect.
vec3 sampleSource (ivec2 p, ivec2 size)
 Evaluates sampleSource for this shader effect.
uvec3 toU8 (vec3 color)
 Evaluates toU8 for this shader effect.
vec3 toRGB (uvec3 color)
 Evaluates toRGB for this shader effect.
uvec3 sampleSourceU8 (ivec2 p, ivec2 size)
 Evaluates sampleSourceU8 for this shader effect.
uvec3 mul8 (uvec3 value, int scale)
 Evaluates mul8 for this shader effect.
int effectBlockSize ()
 Evaluates effectBlockSize for this shader effect.
int effectHistoryIndex ()
 Evaluates effectHistoryIndex for this shader effect.
vec3 sampleHistory (int index, ivec2 p, ivec2 size)
 Evaluates sampleHistory for this shader effect.
uvec3 sampleHistoryU8 (int index, ivec2 p, ivec2 size)
 Evaluates sampleHistoryU8 for this shader effect.
vec3 historyXor (ivec2 p, ivec2 size)
 Evaluates historyXor for this shader effect.
void main ()
 Executes the compute shader entry point.

Variables

 ext
const float INV_255 = 1.0 / 255.0

Detailed Description

Vulkan compute shader: acidcam 004 history xor cache.

Definition in file acidcam_004_history_xor_cache.comp.

Macro Definition Documentation

◆ alpha

#define alpha   ext.u0.x

Definition at line 17 of file acidcam_004_history_xor_cache.comp.

◆ history_head

#define history_head   int(ext.u3.x)

Definition at line 18 of file acidcam_004_history_xor_cache.comp.

◆ iFrame

#define iFrame   int(ext.u2.x)

Definition at line 19 of file acidcam_004_history_xor_cache.comp.

◆ SIZE

#define SIZE   8

Definition at line 107 of file acidcam_004_history_xor_cache.comp.

◆ USE_HISTORY_TEXTURE_ARRAY

#define USE_HISTORY_TEXTURE_ARRAY   1

Definition at line 111 of file acidcam_004_history_xor_cache.comp.

Function Documentation

◆ clampPos()

ivec2 clampPos ( ivec2 p,
ivec2 size )

Evaluates clampPos for this shader effect.

Parameters
pInput value for the calculation.
sizeInput value for the calculation.
Returns
Computed ivec2 value.

Definition at line 36 of file acidcam_004_history_xor_cache.comp.

References clampPos().

◆ effectBlockSize()

int effectBlockSize ( )

Evaluates effectBlockSize for this shader effect.

Returns
Computed int value.

Definition at line 102 of file acidcam_004_history_xor_cache.comp.

References alpha, and effectBlockSize().

◆ effectHistoryIndex()

int effectHistoryIndex ( )

Evaluates effectHistoryIndex for this shader effect.

Returns
Computed int value.

Definition at line 125 of file acidcam_004_history_xor_cache.comp.

References effectHistoryIndex(), iFrame, and SIZE.

Referenced by columnBlend(), effectHistoryIndex(), historyXor(), main(), mirrorTrail(), rowBlend(), and temporalBlend().

◆ historyXor()

vec3 historyXor ( ivec2 p,
ivec2 size )

Evaluates historyXor for this shader effect.

Parameters
pInput value for the calculation.
sizeInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 164 of file acidcam_004_history_xor_cache.comp.

References effectBlockSize(), effectHistoryIndex(), historyXor(), mul8(), sampleHistoryU8(), sampleSourceU8(), and toRGB().

Referenced by historyXor(), and main().

◆ layout() [1/4]

layout ( local_size_x = 16,
local_size_y = 16 )

References layout().

◆ layout() [2/4]

layout ( set = 0,
binding = 0 )

References layout().

◆ layout() [3/4]

layout ( set = 0,
binding = 1,
std140  )

Definition at line 7 of file acidcam_004_history_xor_cache.comp.

References layout().

◆ layout() [4/4]

layout ( set = 0,
binding = 5,
rgba8  )

References layout().

◆ main()

void main ( void )

Executes the compute shader entry point.

Definition at line 173 of file acidcam_004_history_xor_cache.comp.

References historyXor(), and main().

◆ mul8()

uvec3 mul8 ( uvec3 value,
int scale )

Evaluates mul8 for this shader effect.

Parameters
valueInput value for the calculation.
scaleInput value for the calculation.
Returns
Computed uvec3 value.

Definition at line 94 of file acidcam_004_history_xor_cache.comp.

References mul8().

◆ pixelUv()

vec2 pixelUv ( ivec2 p,
ivec2 size )

Evaluates pixelUv for this shader effect.

Parameters
pInput value for the calculation.
sizeInput value for the calculation.
Returns
Computed vec2 value.

Definition at line 46 of file acidcam_004_history_xor_cache.comp.

References clampPos(), and pixelUv().

◆ sampleHistory()

vec3 sampleHistory ( int index,
ivec2 p,
ivec2 size )

Evaluates sampleHistory for this shader effect.

Parameters
indexInput value for the calculation.
pInput value for the calculation.
sizeInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 136 of file acidcam_004_history_xor_cache.comp.

References history_head, pixelUv(), sampleHistory(), and SIZE.

◆ sampleHistoryU8()

uvec3 sampleHistoryU8 ( int index,
ivec2 p,
ivec2 size )

Evaluates sampleHistoryU8 for this shader effect.

Parameters
indexInput value for the calculation.
pInput value for the calculation.
sizeInput value for the calculation.
Returns
Computed uvec3 value.

Definition at line 154 of file acidcam_004_history_xor_cache.comp.

References sampleHistory(), sampleHistoryU8(), and toU8().

Referenced by historyXor(), metalMedianBlend(), sampleHistoryU8(), and xorHistory().

◆ sampleSource()

vec3 sampleSource ( ivec2 p,
ivec2 size )

Evaluates sampleSource for this shader effect.

Parameters
pInput value for the calculation.
sizeInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 56 of file acidcam_004_history_xor_cache.comp.

References pixelUv(), and sampleSource().

◆ sampleSourceU8()

uvec3 sampleSourceU8 ( ivec2 p,
ivec2 size )

Evaluates sampleSourceU8 for this shader effect.

Parameters
pInput value for the calculation.
sizeInput value for the calculation.
Returns
Computed uvec3 value.

Definition at line 84 of file acidcam_004_history_xor_cache.comp.

References sampleSource(), sampleSourceU8(), and toU8().

◆ toRGB()

vec3 toRGB ( uvec3 color)

Evaluates toRGB for this shader effect.

Parameters
colorInput value for the calculation.
Returns
Computed vec3 value.

Definition at line 74 of file acidcam_004_history_xor_cache.comp.

References INV_255, and toRGB().

◆ toU8()

uvec3 toU8 ( vec3 color)

Evaluates toU8 for this shader effect.

Parameters
colorInput value for the calculation.
Returns
Computed uvec3 value.

Definition at line 65 of file acidcam_004_history_xor_cache.comp.

References toU8().

Variable Documentation

◆ ext

ext

Definition at line 16 of file acidcam_004_history_xor_cache.comp.

◆ INV_255

const float INV_255 = 1.0 / 255.0

Definition at line 28 of file acidcam_004_history_xor_cache.comp.