diff options
Diffstat (limited to 'source/blender/gpu/GPU_texture.h')
-rw-r--r-- | source/blender/gpu/GPU_texture.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h index 3d99a3c8a56..a1e00793857 100644 --- a/source/blender/gpu/GPU_texture.h +++ b/source/blender/gpu/GPU_texture.h @@ -41,6 +41,31 @@ struct PreviewImage; struct GPUFrameBuffer; typedef struct GPUTexture GPUTexture; +/* GPU Samplers state + * - Specify the sampler state to bind a texture with. + * - Internally used by textures. + * - All states are created at startup to avoid runtime costs. + */ + +typedef enum eGPUSamplerState { + GPU_SAMPLER_FILTER = (1 << 0), + GPU_SAMPLER_MIPMAP = (1 << 1), + GPU_SAMPLER_REPEAT_S = (1 << 2), + GPU_SAMPLER_REPEAT_T = (1 << 3), + GPU_SAMPLER_REPEAT_R = (1 << 4), + GPU_SAMPLER_CLAMP_BORDER = (1 << 5), /* Clamp to border color instead of border texel. */ + GPU_SAMPLER_COMPARE = (1 << 6), + GPU_SAMPLER_ANISO = (1 << 7), + /* Don't use that. */ + GPU_SAMPLER_MAX = (1 << 8), +} eGPUSamplerState; + +#define GPU_SAMPLER_DEFAULT GPU_SAMPLER_FILTER +#define GPU_SAMPLER_REPEAT (GPU_SAMPLER_REPEAT_S | GPU_SAMPLER_REPEAT_T | GPU_SAMPLER_REPEAT_R) + +void GPU_samplers_init(void); +void GPU_samplers_free(void); + /* GPU Texture * - always returns unsigned char RGBA textures * - if texture with non square dimensions is created, depending on the |