Samplers

enum hk_sampler_filter_e

Values:

enumerator HK_SAMPLER_FILTER_DEFAULT

Sampler default filter mode.

enumerator HK_SAMPLER_FILTER_NEAREST

Sampler nearest filter mode: nearest manhattan distance value to the center of the textured pixel.

enumerator HK_SAMPLER_FILTER_LINEAR

Sampler linear filter mode: weighted average of the four elements thats are closest to the center of the textured pixel.

enumerator HK_SAMPLER_FILTER_COUNT

Do not use. Internal usage only.

enum hk_sampler_wrap_mode_e

Values:

enumerator HK_SAMPLER_WRAP_MODE_DEFAULT

Sampler default wrapping mode.

enumerator HK_SAMPLER_WRAP_MODE_REPEAT

Sampler repeat wrapping mode.

enumerator HK_SAMPLER_WRAP_MODE_MIRRORED_REPEAT

Sampler mirrored repeat wrapping mode.

enumerator HK_SAMPLER_WRAP_MODE_CLAMP_TO_EDGE

Sampler clamp to texture edge wrapping mode.

enumerator HK_SAMPLER_WRAP_MODE_CLAMP_TO_BORDER

Sampler clamp to texture border wrapping mode.

enumerator HK_SAMPLER_WRAP_MODE_COUNT

Do not use. Internal usage only.

enum hk_sampler_border_e

Values:

enumerator HK_SAMPLER_BORDER_DEFAULT

Sampler default border color.

enumerator HK_SAMPLER_BORDER_BLACK_TRANSPARENT_F

Sampler rgba:(0f,0f,0f,0f) border color.

enumerator HK_SAMPLER_BORDER_BLACK_TRANSPARENT_I

Sampler rgba:(0i,0i,0i,0i) border color.

enumerator HK_SAMPLER_BORDER_BLACK_OPAQUE_F

Sampler rgba:(0f,0f,0f,1f) border color.

enumerator HK_SAMPLER_BORDER_BLACK_OPAQUE_I

Sampler rgba:(0i,0i,0i,1i) border color.

enumerator HK_SAMPLER_BORDER_WHITE_OPAQUE_F

Sampler rgba:(1f,1f,1f,1f) border color.

enumerator HK_SAMPLER_BORDER_WHITE_OPAQUE_I

Sampler rgba:(1i,1i,1i,1i) border color.

enumerator HK_SAMPLER_BORDER_COUNT

Do not use. Internal usage only.

struct hk_gfx_sampler_desc

Graphics sampler configuration data structure.

Public Members

char label[HK_MAX_LABEL_SIZE]

Optional label/name. Useful when debugging.

hk_sampler_filter_e min_filter

Texture minification flag (used when pixel maps to an area greater than one texture element):

  • HK_SAMPLER_FILTER_NEAREST: Nearest manhattan distance value to the center of the textured pixel.

  • HK_SAMPLER_FILTER_LINEAR : Weighted average of the four elements thats are closest to the center of the textured pixel.

hk_sampler_filter_e mag_filter

Texture magnification flag (used when pixel maps to an area less than or equal to one texture element):

  • HK_SAMPLER_FILTER_NEAREST: Nearest manhattan distance value to the center of the textured pixel.

  • HK_SAMPLER_FILTER_LINEAR : Weighted average of the four elements thats are closest to the center of the textured pixel.

hk_sampler_filter_e mipmap_mode

Mipmapping filter mode:

  • HK_SAMPLER_FILTER_NEAREST: chose the closest mipmap and samples the pixel value.

  • HK_SAMPLER_FILTER_LINEAR : choses the two closest mipmaps and averages the two values for the textured pixel.

struct hk_gfx_sampler_desc::sampler_wrap_mode_s wrap
hk_sampler_border_e border

Sets the texture border color.

float mip_bias

Add a bias to the level-of-detail values.

float min_lod

Sets the minimum level-of-detail for mipmapping.

float max_lod

Sets the maximum level-of-detail for mipmapping.

bool anisotropy

Enables anisotropy

bool compare
struct sampler_wrap_mode_s

Texture wrapping mode

Public Members

hk_sampler_wrap_mode_e u

Sampler wrapping mode on u/s coordinate.

hk_sampler_wrap_mode_e v

Sampler wrapping mode on v/t coordinate.

hk_sampler_wrap_mode_e w

Sampler wrapping mode on w/p coordinate.

hk_sampler_t hkgfx_sampler_create(hk_device_t *device, const hk_gfx_sampler_desc *desc)

Creates a gpu sampler object.

void hkgfx_sampler_destroy(hk_device_t *device, hk_sampler_t sampler)

Destroys a gpu sampler object.