Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | Friends | List of all members
GPU Class Reference

Provide utility functions to communicate with the driver and GPU. More...

#include <GPU.hpp>

Classes

struct  Metrics
 

Static Public Member Functions

static bool setup (const std::string &appName)
 
static bool setupWindow (Window *window)
 
static void createGraphicsProgram (Program &program, const std::string &vertexContent, const std::string &fragmentContent, const std::string &tessControlContent, const std::string &tessEvalContent, const std::string &debugInfos)
 
static void createComputeProgram (Program &program, const std::string &computeContent, const std::string &debugInfos)
 
static void bindProgram (const Program &program)
 
static void beginRender (const Load &depthOp, const Load &stencilOp, const Texture *depthStencil, const Load &colorOp, const Texture *color0=nullptr, const Texture *color1=nullptr, const Texture *color2=nullptr, const Texture *color3=nullptr)
 
static void beginRender (const Load &colorOp, const Texture *color0, const Texture *color1=nullptr, const Texture *color2=nullptr, const Texture *color3=nullptr)
 
static void beginRender (const Load &depthOp, const Load &stencilOp, const Texture *depthStencil)
 
static void beginRender (uint layer, uint mip, const Load &depthOp, const Load &stencilOp, const Texture *depthStencil, const Load &colorOp, const Texture *color0=nullptr, const Texture *color1=nullptr, const Texture *color2=nullptr, const Texture *color3=nullptr)
 
static void beginRender (uint layer, uint mip, const Load &colorOp, const Texture *color0, const Texture *color1=nullptr, const Texture *color2=nullptr, const Texture *color3=nullptr)
 
static void beginRender (uint layer, uint mip, const Load &depthOp, const Load &stencilOp, const Texture *depthStencil)
 
static void beginRender (const Window &window, const Load &depthOp=Load::Operation::DONTCARE, const Load &stencilOp=Load::Operation::DONTCARE, const Load &colorOp=Load::Operation::DONTCARE)
 
static void endRender ()
 
static void saveTexture (Texture &texture, const std::string &path, Image::Save options)
 
static void setupTexture (Texture &texture)
 
static void uploadTexture (const Texture &texture)
 
static void downloadTextureSync (Texture &texture)
 
static void downloadTextureSync (Texture &texture, int level)
 
static GPUAsyncTask downloadTextureAsync (const Texture &texture, const glm::uvec2 &offset, const glm::uvec2 &size, uint layerCount, std::function< void(const Texture &)> callback)
 
static void cancelAsyncOperation (const GPUAsyncTask &id)
 
static void generateMipMaps (const Texture &texture)
 
static void clearTexture (const Texture &texture, const glm::vec4 &color)
 
static void clearDepth (const Texture &texture, float depth)
 
static void setupBuffer (Buffer &buffer)
 
static void uploadBuffer (const Buffer &buffer, size_t size, uchar *data, size_t offset=0)
 
static void downloadBufferSync (const Buffer &buffer, size_t size, uchar *data, size_t offset=0)
 
static void flushBuffer (const Buffer &buffer, size_t size, size_t offset)
 
static void setupMesh (Mesh &mesh)
 
static void drawMesh (const Mesh &mesh)
 
static void drawTesselatedMesh (const Mesh &mesh, uint patchSize)
 
static void drawQuad ()
 
static void dispatch (uint width, uint height, uint depth)
 
static void flush ()
 
static void nextFrame ()
 
static void deviceInfos (std::string &vendor, std::string &renderer, std::string &version, std::string &shaderVersion)
 
static std::vector< std::string > supportedExtensions ()
 
static void setViewport (int x, int y, int w, int h)
 
static void setViewport (const Texture &tex)
 
static void setDepthState (bool test)
 
static void setDepthState (bool test, TestFunction function, bool write)
 
static void setStencilState (bool test, bool write)
 
static void setStencilState (bool test, TestFunction function, StencilOp fail, StencilOp pass, StencilOp depthFail, uchar value)
 
static void setBlendState (bool test)
 
static void setBlendState (bool test, BlendEquation equation, BlendFunction src, BlendFunction dst)
 
static void setCullState (bool cull)
 
static void setCullState (bool cull, Faces culledFaces)
 
static void setPolygonState (PolygonMode mode)
 
static void setColorState (bool writeRed, bool writeGreen, bool writeBlue, bool writeAlpha)
 
static void getState (GPUState &state)
 
static const MetricsgetMetrics ()
 
static void blitDepth (const Texture &src, const Texture &dst)
 
static void blit (const Texture &src, const Texture &dst, Filter filter)
 
static void blit (const Texture &src, const Texture &dst, size_t lSrc, size_t lDst, Filter filter)
 
static void blit (const Texture &src, const Texture &dst, size_t lSrc, size_t lDst, size_t mipSrc, size_t mipDst, Filter filter)
 
static GPUContextgetInternal ()
 
static void cleanup ()
 

Static Private Member Functions

static void bindAttachments (uint layer, uint mip, const Load &colorOp, const Load &depthOp, const Load &stencilOp, const Texture *depthStencil, const Texture *color0, const Texture *color1, const Texture *color2, const Texture *color3)
 
static void bindGraphicsPipelineIfNeeded ()
 
static void bindComputePipelineIfNeeded ()
 
static void endRenderingIfNeeded ()
 
static void beginFrameCommandBuffers ()
 
static void submitFrameCommandBuffers ()
 
static void clean (GPUTexture &tex)
 
static void clean (GPUMesh &mesh)
 
static void clean (GPUBuffer &buffer)
 
static void clean (Program &program)
 
static void processDestructionRequests ()
 
static void processAsyncTasks (bool forceAll=false)
 

Static Private Attributes

static GPUState _state
 Current GPU state.
 
static GPUState _lastState
 Previous draw call GPU state for caching.
 
static Metrics _metrics
 Internal metrics (draw count, state changes,...).
 
static Metrics _metricsPrevious
 Internal metrics for the last completed frame.
 
static Mesh _quad
 Screen-covering triangle.
 

Friends

class GPUTexture
 Access to deletion notifier for cached state update.
 
class GPUBuffer
 Access to deletion notifier for cached state update.
 
class GPUMesh
 Access to deletion notifier for cached state update.
 
class Program
 Access to metrics.
 
class Swapchain
 Access to command buffers.
 
class PipelineCache
 Access to metrics.
 

Detailed Description

Provide utility functions to communicate with the driver and GPU.

Member Function Documentation

◆ beginFrameCommandBuffers()

void GPU::beginFrameCommandBuffers ( )
staticprivate

Begin render and upload command buffers for this frame

◆ beginRender() [1/7]

void GPU::beginRender ( const Load colorOp,
const Texture color0,
const Texture color1 = nullptr,
const Texture color2 = nullptr,
const Texture color3 = nullptr 
)
static

Begin rendering to a set of textures set as attachments.

Parameters
colorOpthe operation to perform on the color attachments
color0the first color attachment
color1the second color attachment (optional)
color2the third color attachment (optional)
color3the fourth color attachment (optional)

◆ beginRender() [2/7]

void GPU::beginRender ( const Load depthOp,
const Load stencilOp,
const Texture depthStencil 
)
static

Begin rendering to a set of textures set as attachments.

Parameters
depthOpthe operation to perform on the depth attachment
stencilOpthe operation to perform on the stencil attachment
depthStencilthe depth/stencil attachment

◆ beginRender() [3/7]

void GPU::beginRender ( const Load depthOp,
const Load stencilOp,
const Texture depthStencil,
const Load colorOp,
const Texture color0 = nullptr,
const Texture color1 = nullptr,
const Texture color2 = nullptr,
const Texture color3 = nullptr 
)
static

Begin rendering to a set of textures set as attachments.

Parameters
depthOpthe operation to perform on the depth attachment
stencilOpthe operation to perform on the stencil attachment
depthStencilthe depth/stencil attachment (optional)
colorOpthe operation to perform on the color attachments
color0the first color attachment (optional)
color1the second color attachment (optional)
color2the third color attachment (optional)
color3the fourth color attachment (optional)

◆ beginRender() [4/7]

void GPU::beginRender ( const Window window,
const Load depthOp = Load::Operation::DONTCARE,
const Load stencilOp = Load::Operation::DONTCARE,
const Load colorOp = Load::Operation::DONTCARE 
)
static

Begin rendering to the swapchain backbuffer (convenience helper).

Parameters
windowthe window attached to the swapchain to render to
depthOpthe operation to perform on the depth attachment
stencilOpthe operation to perform on the stencil attachment
colorOpthe operation to perform on the color attachments

◆ beginRender() [5/7]

void GPU::beginRender ( uint  layer,
uint  mip,
const Load colorOp,
const Texture color0,
const Texture color1 = nullptr,
const Texture color2 = nullptr,
const Texture color3 = nullptr 
)
static

Begin rendering to a set of textures set as attachments.

Parameters
layerthe texture layer to bind
mipthe mip level to bind
colorOpthe operation to perform on the color attachments
color0the first color attachment
color1the second color attachment (optional)
color2the third color attachment (optional)
color3the fourth color attachment (optional)

◆ beginRender() [6/7]

void GPU::beginRender ( uint  layer,
uint  mip,
const Load depthOp,
const Load stencilOp,
const Texture depthStencil 
)
static

Begin rendering to a set of textures set as attachments.

Parameters
layerthe texture layer to bind
mipthe mip level to bind
depthOpthe operation to perform on the depth attachment
stencilOpthe operation to perform on the stencil attachment
depthStencilthe depth/stencil attachment

◆ beginRender() [7/7]

void GPU::beginRender ( uint  layer,
uint  mip,
const Load depthOp,
const Load stencilOp,
const Texture depthStencil,
const Load colorOp,
const Texture color0 = nullptr,
const Texture color1 = nullptr,
const Texture color2 = nullptr,
const Texture color3 = nullptr 
)
static

Begin rendering to a set of textures set as attachments.

Parameters
layerthe texture layer to bind
mipthe mip level to bind
depthOpthe operation to perform on the depth attachment
stencilOpthe operation to perform on the stencil attachment
depthStencilthe depth/stencil attachment (optional)
colorOpthe operation to perform on the color attachments
color0the first color attachment (optional)
color1the second color attachment (optional)
color2the third color attachment (optional)
color3the fourth color attachment (optional)

◆ bindAttachments()

void GPU::bindAttachments ( uint  layer,
uint  mip,
const Load colorOp,
const Load depthOp,
const Load stencilOp,
const Texture depthStencil,
const Texture color0,
const Texture color1,
const Texture color2,
const Texture color3 
)
staticprivate

Bind textures as a draw destination.

Parameters
layerthe texture layer to bind
mipthe mip level to bind
colorOpthe operation to perform on the color attachments
depthOpthe operation to perform on the depth attachment
stencilOpthe operation to perform on the stencil attachment
depthStencilthe depth/stencil attachment (optional)
color0the first color attachment (optional)
color1the second color attachment (optional)
color2the third color attachment (optional)
color3the fourth color attachment (optional)

◆ bindComputePipelineIfNeeded()

void GPU::bindComputePipelineIfNeeded ( )
staticprivate

If the GPU compute state has changed, retrieve and bind the pipeline corresponding to the new state.

◆ bindGraphicsPipelineIfNeeded()

void GPU::bindGraphicsPipelineIfNeeded ( )
staticprivate

If the GPU graphics state has changed, retrieve and bind the pipeline corresponding to the new state.

◆ bindProgram()

void GPU::bindProgram ( const Program program)
static

Bind a program to use for rendering

Parameters
programthe program to use

◆ blit() [1/3]

void GPU::blit ( const Texture src,
const Texture dst,
Filter  filter 
)
static

Blit the content of a texture into another one, resizing the content accordingly.

Parameters
srcthe source texture
dstthe destination texture
filterthe filtering to use for resizing

◆ blit() [2/3]

void GPU::blit ( const Texture src,
const Texture dst,
size_t  lSrc,
size_t  lDst,
Filter  filter 
)
static

Blit the content of a texture into another one, resizing the content accordingly.

Parameters
srcthe source texture
dstthe destination texture
lSrcthe src layer to copy
lDstthe dst layer to copy to
filterthe filtering to use for resizing

◆ blit() [3/3]

void GPU::blit ( const Texture src,
const Texture dst,
size_t  lSrc,
size_t  lDst,
size_t  mipSrc,
size_t  mipDst,
Filter  filter 
)
static

Blit the content of a texture into another one, resizing the content accordingly.

Parameters
srcthe source texture
dstthe destination texture
lSrcthe src layer to copy
lDstthe dst layer to copy to
mipSrcthe src mip level to copy
mipDstthe dst mip level to copy to
filterthe filtering to use for resizing

◆ blitDepth()

void GPU::blitDepth ( const Texture src,
const Texture dst 
)
static

Blit the content of a depth texture into another one.

Parameters
srcthe source texture
dstthe destination texture
Note
Depth is necessarily filtered using nearest neighbour.

◆ cancelAsyncOperation()

void GPU::cancelAsyncOperation ( const GPUAsyncTask &  id)
static

Cancel an asynchronous download operation.

Parameters
idthe ID of the task to cancel

◆ clean() [1/4]

void GPU::clean ( GPUBuffer buffer)
staticprivate

Clean a buffer GPU object.

Parameters
bufferthe object to delete

◆ clean() [2/4]

void GPU::clean ( GPUMesh mesh)
staticprivate

Clean a mesh GPU object.

Parameters
meshthe object to delete

◆ clean() [3/4]

void GPU::clean ( GPUTexture tex)
staticprivate

Clean a texture GPU object.

Parameters
texthe object to delete

◆ clean() [4/4]

void GPU::clean ( Program program)
staticprivate

Clean a shader program object.

Parameters
programthe object to delete

◆ cleanup()

void GPU::cleanup ( )
static

Clean all created GPU structures.

◆ clearDepth()

void GPU::clearDepth ( const Texture texture,
float  depth 
)
static

Clear a depth texture with a given depth.

Parameters
texturethe texture to clear/
depththe depth to use

◆ clearTexture()

void GPU::clearTexture ( const Texture texture,
const glm::vec4 &  color 
)
static

Clear a texture content with a given color.

Parameters
texturethe texture to clear
colorthe color to use

◆ createComputeProgram()

void GPU::createComputeProgram ( Program program,
const std::string &  computeContent,
const std::string &  debugInfos 
)
static

Create and link a compute program using the shader code contained in the given strings.

Parameters
programthe program to compile
computeContentthe compute shader string
debugInfosthe name of the program, or any custom debug infos that will be logged.

◆ createGraphicsProgram()

void GPU::createGraphicsProgram ( Program program,
const std::string &  vertexContent,
const std::string &  fragmentContent,
const std::string &  tessControlContent,
const std::string &  tessEvalContent,
const std::string &  debugInfos 
)
static

Create and link a graphics program using the shader code contained in the given strings.

Parameters
programthe program to compile
vertexContentthe vertex shader string
fragmentContentthe fragment shader string
tessControlContentthe optional tessellation control shader string
tessEvalContentthe optional tessellation evaluation shader string
debugInfosthe name of the program, or any custom debug infos that will be logged.

◆ deviceInfos()

void GPU::deviceInfos ( std::string &  vendor,
std::string &  renderer,
std::string &  version,
std::string &  shaderVersion 
)
static

Query the GPU driver and API infos.

Parameters
vendorwill contain the vendor name
rendererwill contain the renderer name
versionwill contain the driver API version
shaderVersionwill contain the shading language version

◆ dispatch()

void GPU::dispatch ( uint  width,
uint  height,
uint  depth 
)
static

Run a compute program by spawning computation threads.

Parameters
widththe number of threads to spawn on the X axis
heightthe number of threads to spawn on the Y axis
depththe number of threads to spawn on the Z axis
Note
The work group count will automatically be computed based on the program local size.

◆ downloadBufferSync()

void GPU::downloadBufferSync ( const Buffer buffer,
size_t  size,
uchar *  data,
size_t  offset = 0 
)
static

Download data from a buffer on the GPU. It's possible to download a subrange of the buffer data store.

Parameters
bufferthe buffer to download from
sizethe amount of data to download, in bytes
datapointer to the storage destination
offsetoptional offset in the buffer store

◆ downloadTextureAsync()

GPUAsyncTask GPU::downloadTextureAsync ( const Texture texture,
const glm::uvec2 &  offset,
const glm::uvec2 &  size,
uint  layerCount,
std::function< void(const Texture &)>  callback 
)
static

Copy a texture GPU data at this point of the frame command buffer, and download the copied data once the frame is complete.

Parameters
texturethe texture to download
offset(x,y) offset of the region in the texture to download, from the top-left corner
sizedimensions of the region to download
layerCountnumber of layers to download from
callbackfunction that will be called once the data has been download and stored in the images of the Texture parameter
Returns
an async task ID

◆ downloadTextureSync() [1/2]

void GPU::downloadTextureSync ( Texture texture)
static

Download a texture images current data from the GPU.

Parameters
texturethe texture to download
Warning
The CPU images of the texture will be overwritten.
Note
The download will be performed when this function is called, so the data might be coming from a previous frame.

◆ downloadTextureSync() [2/2]

void GPU::downloadTextureSync ( Texture texture,
int  level 
)
static

Download a texture images current data from the GPU.

Parameters
texturethe texture to download
levelthe specific mip level to download
Warning
The CPU images of the texture will be overwritten.
Note
The download will be performed when this function is called, so the data might be coming from a previous frame.

◆ drawMesh()

void GPU::drawMesh ( const Mesh mesh)
static

Draw indexed geometry.

Parameters
meshthe mesh to draw

◆ drawQuad()

void GPU::drawQuad ( )
static

Helper used to draw a fullscreen quad for texture processing.

Instead of story two-triangles geometry, it uses a single triangle covering the whole screen. For instance:

 2: (-1,3),(0,2)
     *
     | \
     |   \
     |     \
     |       \
     |         \
     *-----------*  1: (3,-1), (2,0)
 0: (-1,-1), (0,0)
See also
GPU::Vert::Passthrough
GPU::Frag::Passthrough, GPU::Frag::Passthrough_pixelperfect

◆ drawTesselatedMesh()

void GPU::drawTesselatedMesh ( const Mesh mesh,
uint  patchSize 
)
static

Draw tessellated geometry.

Parameters
meshthe mesh to tessellate and render
patchSizenumber of vertices to use in a patch

◆ endRender()

void GPU::endRender ( )
static

End a rendering pass, detach the current attached textures.

◆ endRenderingIfNeeded()

void GPU::endRenderingIfNeeded ( )
staticprivate

End the current render pass if one is started.

◆ flush()

void GPU::flush ( )
static

Flush current GPU commands and wait for all processing to be done.

◆ flushBuffer()

void GPU::flushBuffer ( const Buffer buffer,
size_t  size,
size_t  offset 
)
static

Ensure that a buffer region is visible from the CPU and up-to-date.

Parameters
bufferthe buffer to flush
sizesize of the region to flush
offsetstart of the region in the buffer

◆ generateMipMaps()

void GPU::generateMipMaps ( const Texture texture)
static

Generate a texture mipmaps on the GPU.

Parameters
texturethe texture to use

◆ getInternal()

GPUContext * GPU::getInternal ( )
static
Returns
the opaque internal GPU context.

◆ getMetrics()

const GPU::Metrics & GPU::getMetrics ( )
static
Returns
internal metrics for the current frame

◆ getState()

void GPU::getState ( GPUState state)
static

Query the current GPU state.

Parameters
statewill be populated with the current GPU settings

◆ nextFrame()

void GPU::nextFrame ( )
static

Prepare GPU for next frame.

◆ processAsyncTasks()

void GPU::processAsyncTasks ( bool  forceAll = false)
staticprivate

Process async download tasks for frames that are complete.

Parameters
forceAllprocess all pending requests, including for the current frame.
Warning
When forcing all requests to be processed, you have to guarantee that all commands have been completed on the GPU.

◆ processDestructionRequests()

void GPU::processDestructionRequests ( )
staticprivate

Process destruction requests for which we are sure that the resources are not used anymore.

◆ saveTexture()

void GPU::saveTexture ( Texture texture,
const std::string &  path,
Image::Save  options 
)
static

Save a given texture content to the disk.

Parameters
texturethe texture to save
paththe output image path
optionsoutput options (flip,...)
Note
The output image extension will be automatically added based on the texture type and format.
Warning
Export of small size float texture can create artifacts.

◆ setBlendState() [1/2]

void GPU::setBlendState ( bool  test)
static

Enable or disable blending.

Parameters
testshould blending be enabled

◆ setBlendState() [2/2]

void GPU::setBlendState ( bool  test,
BlendEquation  equation,
BlendFunction  src,
BlendFunction  dst 
)
static

Configure blending.

Parameters
testshould blending be enabled
equationthe blending equation
srcthe blending value to use for the source
dstthe blending value to use for the destination

◆ setColorState()

void GPU::setColorState ( bool  writeRed,
bool  writeGreen,
bool  writeBlue,
bool  writeAlpha 
)
static

Set the color write mask.

Parameters
writeRedallow writes to the red channel
writeGreenallow writes to the green channel
writeBlueallow writes to the blue channel
writeAlphaallow writes to the alpha channel

◆ setCullState() [1/2]

void GPU::setCullState ( bool  cull)
static

Enable or disable backface culling.

Parameters
cullshould backfaces be culled

◆ setCullState() [2/2]

void GPU::setCullState ( bool  cull,
Faces  culledFaces 
)
static

Configure backface culling.

Parameters
cullshould backfaces be culled
culledFacesthe set of faces to cull

◆ setDepthState() [1/2]

void GPU::setDepthState ( bool  test)
static

Enable or disable the depth test.

Parameters
testshould depth test be performed

◆ setDepthState() [2/2]

void GPU::setDepthState ( bool  test,
TestFunction  function,
bool  write 
)
static

Configure depth testing.

Parameters
testshould depth test be performed
functionthe test function
writeshould the depth be written to the depth buffer

◆ setPolygonState()

void GPU::setPolygonState ( PolygonMode  mode)
static

Set the polygon rasterization mode.

Parameters
modethe mode (filled, lines, points)

◆ setStencilState() [1/2]

void GPU::setStencilState ( bool  test,
bool  write 
)
static

Enable or disable the stencil test.

Parameters
testshould stencil test be performed
writeshould the stencil be written to the stencil buffer

◆ setStencilState() [2/2]

void GPU::setStencilState ( bool  test,
TestFunction  function,
StencilOp  fail,
StencilOp  pass,
StencilOp  depthFail,
uchar  value 
)
static

Configure stencil testing.

Parameters
testshould stencil test be performed
functionthe test function
failoperation to perform if the stencil test fails
passoperation to perform if the stencil and depth tests succeed, or if the stencil test is disabled
depthFailoperation to perform if the stencil test succeeds but not the depth test
valuereference value used for comparison
Warning
Stencil writing still happens even if testing is disabled.

◆ setup()

bool GPU::setup ( const std::string &  appName)
static

Setup the GPU device in its initial state.

Parameters
appNamethe name of the current executable
Returns
true if the setup was successful

◆ setupBuffer()

void GPU::setupBuffer ( Buffer buffer)
static

Create and allocate a GPU buffer.

Parameters
bufferthe buffer to setup on the GPU

◆ setupMesh()

void GPU::setupMesh ( Mesh mesh)
static

Mesh loading: send a mesh data to the GPU and set the input mesh GPU infos accordingly.

Parameters
meshthe mesh to upload
Note
The order of attribute locations is: position, normal, uvs, tangents, bitangents.

◆ setupTexture()

void GPU::setupTexture ( Texture texture)
static

Create a GPU texture with a given layout and allocate it.

Parameters
texturethe texture to setup on the GPU

◆ setupWindow()

bool GPU::setupWindow ( Window window)
static

Setup a window swapchain, creating backbuffers and resources.

Parameters
windowthe window to create a swapchain for
Returns
true if the setup was successful

◆ setViewport() [1/2]

void GPU::setViewport ( const Texture tex)
static

Set the current viewport based on a texture dimensions.

Parameters
texthe texture to use the dimensions

◆ setViewport() [2/2]

void GPU::setViewport ( int  x,
int  y,
int  w,
int  h 
)
static

Set the current viewport.

Parameters
xhorizontal coordinate
yvertical coordinate
wwidth
hheight

◆ submitFrameCommandBuffers()

void GPU::submitFrameCommandBuffers ( )
staticprivate

End and submit upload and render command buffers for this frame, guaranteeing sequential execution.

Note
This will wait for all queue work to be complete before returning.

◆ supportedExtensions()

std::vector< std::string > GPU::supportedExtensions ( )
static

Query the GPU supported extensions.

Returns
a list of extensions names

◆ uploadBuffer()

void GPU::uploadBuffer ( const Buffer buffer,
size_t  size,
uchar *  data,
size_t  offset = 0 
)
static

Upload data to a buffer on the GPU. It's possible to upload a subrange of the buffer data store.

Parameters
bufferthe buffer to upload to
sizethe amount of data to upload, in bytes
datapointer to the data to upload
offsetoptional offset in the buffer store

◆ uploadTexture()

void GPU::uploadTexture ( const Texture texture)
static

Upload a texture images data to the GPU.

Parameters
texturethe texture to upload

The documentation for this class was generated from the following files: