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

Vulkan compute shader: xorblend cache. More...

Go to the source code of this file.

Macros

#define history_head   int(ext.u3.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.
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 xorHistory (ivec2 p, ivec2 size)
 Evaluates xorHistory 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: xorblend cache.

Definition in file xorblend_cache.comp.

Macro Definition Documentation

◆ history_head

#define history_head   int(ext.u3.x)

Definition at line 17 of file xorblend_cache.comp.

◆ SIZE

#define SIZE   8

Definition at line 85 of file xorblend_cache.comp.

◆ USE_HISTORY_TEXTURE_ARRAY

#define USE_HISTORY_TEXTURE_ARRAY   1

Definition at line 89 of file xorblend_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 32 of file xorblend_cache.comp.

References clampPos().

◆ 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 xorblend_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 145 of file xorblend_cache.comp.

References main(), and xorHistory().

◆ 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 42 of file xorblend_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 106 of file xorblend_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 124 of file xorblend_cache.comp.

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

◆ 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 52 of file xorblend_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 80 of file xorblend_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 70 of file xorblend_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 61 of file xorblend_cache.comp.

References toU8().

◆ xorHistory()

vec3 xorHistory ( ivec2 p,
ivec2 size )

Evaluates xorHistory for this shader effect.

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

Definition at line 134 of file xorblend_cache.comp.

References sampleHistoryU8(), sampleSourceU8(), SIZE, toRGB(), and xorHistory().

Referenced by main(), and xorHistory().

Variable Documentation

◆ ext

ext

Definition at line 16 of file xorblend_cache.comp.

◆ INV_255

const float INV_255 = 1.0 / 255.0

Definition at line 24 of file xorblend_cache.comp.