mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
std140 requires 16 bytes alignment and it makes alignment of uvec2 in SkinData be equal to 16 bytes instead of 8 bytes.
31 lines
874 B
C
31 lines
874 B
C
#ifndef INCLUDED_COMMON_COMPUTE
|
|
#define INCLUDED_COMMON_COMPUTE
|
|
|
|
#include "common/descriptor_indexing.h"
|
|
#include "common/texture.h"
|
|
#include "common/uniform.h"
|
|
|
|
#if STAGE_COMPUTE
|
|
|
|
#if USE_SPIRV
|
|
#define STORAGE_2D(LOCATION, FORMAT, NAME) \
|
|
layout(set = 2, binding = LOCATION, FORMAT) uniform image2D NAME
|
|
#if USE_DESCRIPTOR_INDEXING
|
|
#define STORAGE_BUFFER(LOCATION) \
|
|
layout(std430, set = 2, binding = LOCATION)
|
|
#else
|
|
#define STORAGE_BUFFER(LOCATION) \
|
|
layout(std430, set = 1, binding = LOCATION)
|
|
#endif
|
|
#else
|
|
// We use offset to the binding slot for OpenGL to avoid overlapping with other
|
|
// textures as OpenGL doesn't have sets.
|
|
#define STORAGE_2D(LOCATION, FORMAT, NAME) \
|
|
layout(binding = LOCATION, FORMAT) uniform image2D NAME
|
|
#define STORAGE_BUFFER(LOCATION) \
|
|
layout(std430, binding = LOCATION)
|
|
#endif
|
|
|
|
#endif // STAGE_COMPUTE
|
|
|
|
#endif // INCLUDED_COMMON_COMPUTE
|