Functions
mk_pbr_active_extension_maskfunction
uint32_t mk_pbr_active_extension_mask(const mk_pbr_desc *desc)
Compute the exact compile-time extension-code mask for a descriptor.
| Parameter | Type | Description |
|---|
desc | const mk_pbr_desc * | Configuration descriptor. |
Returns The resulting value.
mk_pbr_coveragefunction
float mk_pbr_coverage(mk_pbr_blend blend, float evaluated_alpha, float alpha_cutoff, bool *discarded)
Return coverage for the glTF alpha mode.
| Parameter | Type | Description |
|---|
blend | mk_pbr_blend | Value for blend. |
evaluated_alpha | float | Value for evaluated alpha. |
alpha_cutoff | float | Value for alpha cutoff. |
discarded | bool * | Value for discarded. |
Returns The resulting value.
mk_pbr_debug_channel_namefunction
const char * mk_pbr_debug_channel_name(mk_pbr_debug_channel channel)
Perform the PBR debug channel name operation.
| Parameter | Type | Description |
|---|
channel | mk_pbr_debug_channel | Value for channel. |
Returns A borrowed pointer, or NULL when unavailable.
mk_pbr_desc_defaultfunction
mk_pbr_desc mk_pbr_desc_default(void)
Perform the PBR desc default operation.
Returns The resulting value.
mk_pbr_desc_validatefunction
mk_result mk_pbr_desc_validate(const mk_pbr_desc *desc)
Validate dependencies and the supported UV-set range without touching GPU state.
| Parameter | Type | Description |
|---|
desc | const mk_pbr_desc * | Configuration descriptor. |
Returns MK_SUCCESS or an error result.
mk_pbr_last_resultfunction
mk_result mk_pbr_last_result(void)
Last PBR creation/validation result on the calling thread.
Returns MK_SUCCESS or an error result.
mk_pbr_materialfunction
mk_material_t mk_pbr_material(const mk_pbr_desc *desc)
Perform the PBR material operation.
| Parameter | Type | Description |
|---|
desc | const mk_pbr_desc * | Configuration descriptor. |
Returns The resulting handle or value.
mk_pbr_material_record_packfunction
mk_result mk_pbr_material_record_pack(const mk_pbr_desc *desc, mk_pbr_material_record *out)
Serialize a descriptor into the documented 14-texel deferred record.
| Parameter | Type | Description |
|---|
desc | const mk_pbr_desc * | Configuration descriptor. |
out | mk_pbr_material_record * | Value for out. |
Returns MK_SUCCESS or an error result.
mk_pbr_material_table_layout_makefunction
mk_result mk_pbr_material_table_layout_make(uint32_t max_texture_size, mk_pbr_material_table_layout *out)
Compute the material-table shape for a device maxTextureSize.
| Parameter | Type | Description |
|---|
max_texture_size | uint32_t | Max texture size in bytes. |
out | mk_pbr_material_table_layout * | Value for out. |
Returns MK_SUCCESS or an error result.
mk_pbr_material_texel_addressfunction
mk_result mk_pbr_material_texel_address(const mk_pbr_material_table_layout *layout, uint32_t material_row, uint32_t field, uint32_t *x, uint32_t *y)
Translate one material row/field into a nearest-fetch material-table texel.
| Parameter | Type | Description |
|---|
layout | const mk_pbr_material_table_layout * | Value for layout. |
material_row | uint32_t | Value for material row. |
field | uint32_t | Value for field. |
x | uint32_t * | Value for x. |
y | uint32_t * | Value for y. |
Returns MK_SUCCESS or an error result.
mk_pbr_sampler_budget_validatefunction
mk_result mk_pbr_sampler_budget_validate(const mk_pbr_sampler_budget *budget, uint32_t *required_samplers)
Count every renderer-owned sampler consumed by an evaluation/resolve pass.
| Parameter | Type | Description |
|---|
budget | const mk_pbr_sampler_budget * | Value for budget. |
required_samplers | uint32_t * | Value for required samplers. |
Returns MK_SUCCESS or an error result.
mk_pbr_surface_entry_packfunction
mk_result mk_pbr_surface_entry_pack(const mk_pbr_surface_entry *entry, float out_rgba[4])
Serialize/deserialize the exact-float 256x256 surface table entry.
| Parameter | Type | Description |
|---|
entry | const mk_pbr_surface_entry * | Value for entry. |
out_rgba | float | Receives the RGBA. |
Returns MK_SUCCESS or an error result.
mk_pbr_surface_entry_unpackfunction
mk_result mk_pbr_surface_entry_unpack(const float rgba[4], mk_pbr_surface_entry *out)
Perform the PBR surface entry unpack operation.
| Parameter | Type | Description |
|---|
rgba | const float | Value for RGBA. |
out | mk_pbr_surface_entry * | Value for out. |
Returns MK_SUCCESS or an error result.
mk_pbr_surface_id_decodefunction
mk_result mk_pbr_surface_id_decode(const float rgba[4], uint32_t *surface_id)
Decode PBR surface ID.
| Parameter | Type | Description |
|---|
rgba | const float | Value for RGBA. |
surface_id | uint32_t * | Value for surface ID. |
Returns MK_SUCCESS or an error result.
mk_pbr_surface_id_encodefunction
mk_result mk_pbr_surface_id_encode(uint32_t surface_id, float out_rgba[4])
Byte-normalized ownership encoding used by the core attachment.
| Parameter | Type | Description |
|---|
surface_id | uint32_t | Value for surface ID. |
out_rgba | float | Receives the RGBA. |
Returns MK_SUCCESS or an error result.
mk_pbr_surface_id_range_validatefunction
mk_result mk_pbr_surface_id_range_validate(uint32_t base_surface_id, uint32_t instance_count, bool stencil_available)
Validate a contiguous surface-ID allocation for the stencil capability.
| Parameter | Type | Description |
|---|
base_surface_id | uint32_t | Value for base surface ID. |
instance_count | uint32_t | Number of instance entries. |
stencil_available | bool | Value for stencil available. |
Returns MK_SUCCESS or an error result.
mk_pbr_surface_texel_addressfunction
void mk_pbr_surface_texel_address(uint32_t surface_id, uint32_t *x, uint32_t *y)
Perform the PBR surface texel address operation.
| Parameter | Type | Description |
|---|
surface_id | uint32_t | Value for surface ID. |
x | uint32_t * | Value for x. |
y | uint32_t * | Value for y. |
mk_pbr_transmission_capturefunction
void mk_pbr_transmission_capture(mk_texture_t opaque_color)
Perform the PBR transmission capture operation.
| Parameter | Type | Description |
|---|
opaque_color | mk_texture_t | Value for opaque color. |
mk_pbr_variant_atfunction
bool mk_pbr_variant_at(uint32_t index, mk_pbr_variant_info *out_info)
Perform the PBR variant at operation.
| Parameter | Type | Description |
|---|
index | uint32_t | Zero-based index. |
out_info | mk_pbr_variant_info * | Receives the info. |
Returns True when the operation succeeds.
mk_pbr_variant_countfunction
uint32_t mk_pbr_variant_count(void)
Inspect the manifest-generated variant registry.
Returns The resulting value.
mk_pbr_variant_findfunction
bool mk_pbr_variant_find(uint32_t extension_mask, mk_pbr_variant_family family, mk_pbr_variant_info *out_info)
Find PBR variant.
| Parameter | Type | Description |
|---|
extension_mask | uint32_t | Value for extension mask. |
family | mk_pbr_variant_family | Value for family. |
out_info | mk_pbr_variant_info * | Receives the info. |
Returns True when the operation succeeds.
Typedefs
mk_pbr_blendtypedef
typedef enum mk_pbr_blend mk_pbr_blend
Values for PBR blend.
mk_pbr_debug_channeltypedef
typedef enum mk_pbr_debug_channel mk_pbr_debug_channel
Values for PBR debug channel.
mk_pbr_desctypedef
typedef struct mk_pbr_desc mk_pbr_desc
Data for PBR desc.
mk_pbr_material_recordtypedef
typedef struct mk_pbr_material_record mk_pbr_material_record
One material record ready for an RGBA32F texture upload.
mk_pbr_material_table_layouttypedef
typedef struct mk_pbr_material_table_layout mk_pbr_material_table_layout
Data for PBR material table layout.
mk_pbr_material_texeltypedef
typedef enum mk_pbr_material_texel mk_pbr_material_texel
Values for PBR material texel.
mk_pbr_sampler_budgettypedef
typedef struct mk_pbr_sampler_budget mk_pbr_sampler_budget
Data for PBR sampler budget.
mk_pbr_surface_entrytypedef
typedef struct mk_pbr_surface_entry mk_pbr_surface_entry
Data for PBR surface entry.
mk_pbr_texture_downgradetypedef
typedef enum mk_pbr_texture_downgrade mk_pbr_texture_downgrade
Values for PBR texture downgrade.
mk_pbr_texture_viewtypedef
typedef struct mk_pbr_texture_view mk_pbr_texture_view
One glTF textureInfo/normalTextureInfo/occlusionTextureInfo binding.
mk_pbr_variant_familytypedef
typedef enum mk_pbr_variant_family mk_pbr_variant_family
Values for PBR variant family.
mk_pbr_variant_infotypedef
typedef struct mk_pbr_variant_info mk_pbr_variant_info
Data for PBR variant info.
mk_pbr_workflowtypedef
typedef enum mk_pbr_workflow mk_pbr_workflow
The two glTF material workflows accepted by the importer.
Macros
MK_PBR_DESC_INITdefine
Constant for PBR desc init.
MK_PBR_FEATURE_ANISOTROPYdefine
MK_PBR_FEATURE_ANISOTROPY
Constant for PBR feature anisotropy.
MK_PBR_FEATURE_CLEARCOATdefine
Constant for PBR feature clearcoat.
MK_PBR_FEATURE_DIFFUSE_TRANSMISSIONdefine
MK_PBR_FEATURE_DIFFUSE_TRANSMISSION
Constant for PBR feature diffuse transmission.
MK_PBR_FEATURE_DISPERSIONdefine
MK_PBR_FEATURE_DISPERSION
Constant for PBR feature dispersion.
MK_PBR_FEATURE_IRIDESCENCEdefine
MK_PBR_FEATURE_IRIDESCENCE
Constant for PBR feature iridescence.
MK_PBR_FEATURE_LEGACY_SPEC_GLOSSdefine
MK_PBR_FEATURE_LEGACY_SPEC_GLOSS
Constant for PBR feature legacy spec gloss.
MK_PBR_FEATURE_SHEENdefine
Constant for PBR feature sheen.
MK_PBR_FEATURE_SPECULARdefine
Constant for PBR feature specular.
MK_PBR_FEATURE_TRANSMISSIONdefine
MK_PBR_FEATURE_TRANSMISSION
Constant for PBR feature transmission.
MK_PBR_FEATURE_UNLITdefine
Constant for PBR feature unlit.
MK_PBR_FEATURE_VOLUMEdefine
Constant for PBR feature volume.
MK_PBR_MATERIAL_TEXELSdefine
Constant for PBR material texels.
MK_PBR_MAX_SURFACESdefine
Maximum supported PBR surfaces.
MK_PBR_SURFACE_RESOLVE_UNLITdefine
MK_PBR_SURFACE_RESOLVE_UNLIT
Constant for PBR surface resolve unlit.
MK_PBR_SURFACE_TABLE_HEIGHTdefine
MK_PBR_SURFACE_TABLE_HEIGHT
Constant for PBR surface table height.
MK_PBR_SURFACE_TABLE_WIDTHdefine
MK_PBR_SURFACE_TABLE_WIDTH
Constant for PBR surface table width.
MK_PBR_TEXTURE_VIEW_INITdefine
Constant for PBR texture view init.