Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzu_gpu_resource.h File Reference

GPU resource. More...

Enumerations

enum  KzuGPUResourceDeploymentStrategy { KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_DEFAULT, KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_MANUAL, KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_KEEP, KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_ON_DEMAND }
 GPU resource deployment strategy. More...
 

Functions

struct KzuResourcekzuGPUResourceToResource (const struct KzuGPUResource *gpuResource)
 Convert GPU resource to resource. More...
 
struct KzuGPUResourcekzuGPUResourceFromResource (const struct KzuResource *resource)
 Convert resource to GPU resource. More...
 
kzBool kzuResourceIsGPUResource (const struct KzuResource *resource)
 Checks if the given resource is a GPU resource. More...
 
kzsError kzuGPUResourceDeploy (struct KzuGPUResource *gpuResource)
 Tells the GPU resource to deploy the data to GPU if it has not yet been deployed or has been undeployed. More...
 
kzsError kzuGPUResourceUndeploy (struct KzuGPUResource *gpuResource)
 Tells the GPU resource to undeploy the data from GPU. More...
 
kzBool kzuGPUResourceIsDeployed (const struct KzuGPUResource *gpuResource)
 Checks if the given GPU resource has been deployed and is still in GPU memory. More...
 
kzsError kzuGPUResourceInvalidate (struct KzuGPUResource *gpuResource)
 Tells the GPU resource to invalidate the GPU state back to undeployed state without actually undeploying. More...
 
enum
KzuGPUResourceDeploymentStrategy 
kzuGPUResourceGetDeploymentStrategy (const struct KzuGPUResource *gpuResource)
 Returns the deployment strategy of the GPU resource. More...
 
void kzuGPUResourceSetDeploymentStrategy (struct KzuGPUResource *gpuResource, enum KzuGPUResourceDeploymentStrategy deploymentStrategy)
 Sets the deployment strategy of the GPU resource. More...
 
kzUint kzuGPUResourceGetGPUMemoryUsage (const struct KzuGPUResource *gpuResource)
 Returns GPU memory usage of the resource. More...
 

Variables

const KzuResourceType KZU_RESOURCE_TYPE_GPU_RESOURCE
 Resource type identifier for GPU resources. More...
 

Detailed Description

GPU resource.

Copyright 2008-2019 by Rightware. All rights reserved.

Enumeration Type Documentation

GPU resource deployment strategy.

This specifies when the resource will be deployed and undeployed.

Enumerator
KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_DEFAULT 

Default strategy.

This guarantees that the GPU resource will be deployed before it is needed by the engine. The actual strategy can depend on the platform or application.

KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_MANUAL 

Manual deployment strategy.

The GPU resource will never be deployed or undeployed automatically by the engine. Application must call kzuGPUResourceDeploy manually.

KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_KEEP 

This deployment strategy keeps the GPU resource in GPU memory all the time unless manually undeployed.

KZU_GPU_RESOURCE_DEPLOYMENT_STRATEGY_ON_DEMAND 

This deployment strategy deploys the GPU resource when it is actually needed and undeploys when it is not.

This strategy is not yet supported.

Function Documentation

struct KzuResource* kzuGPUResourceToResource ( const struct KzuGPUResource gpuResource)

Convert GPU resource to resource.

struct KzuGPUResource* kzuGPUResourceFromResource ( const struct KzuResource resource)

Convert resource to GPU resource.

kzBool kzuResourceIsGPUResource ( const struct KzuResource resource)

Checks if the given resource is a GPU resource.

kzsError kzuGPUResourceDeploy ( struct KzuGPUResource gpuResource)

Tells the GPU resource to deploy the data to GPU if it has not yet been deployed or has been undeployed.

kzsError kzuGPUResourceUndeploy ( struct KzuGPUResource gpuResource)

Tells the GPU resource to undeploy the data from GPU.

kzBool kzuGPUResourceIsDeployed ( const struct KzuGPUResource gpuResource)

Checks if the given GPU resource has been deployed and is still in GPU memory.

kzsError kzuGPUResourceInvalidate ( struct KzuGPUResource gpuResource)

Tells the GPU resource to invalidate the GPU state back to undeployed state without actually undeploying.

This is needed e.g. when the GL context is recreated.

enum KzuGPUResourceDeploymentStrategy kzuGPUResourceGetDeploymentStrategy ( const struct KzuGPUResource gpuResource)

Returns the deployment strategy of the GPU resource.

void kzuGPUResourceSetDeploymentStrategy ( struct KzuGPUResource gpuResource,
enum KzuGPUResourceDeploymentStrategy  deploymentStrategy 
)

Sets the deployment strategy of the GPU resource.

kzUint kzuGPUResourceGetGPUMemoryUsage ( const struct KzuGPUResource gpuResource)

Returns GPU memory usage of the resource.

Variable Documentation

const KzuResourceType KZU_RESOURCE_TYPE_GPU_RESOURCE

Resource type identifier for GPU resources.