class
GpuDevice
Provides access to a particular GPU device.
Public
Methods
~GpuDevice
Initialize
Initializes the GpuDevice.
Should be called after construction but before any other operations.
GetCapabilities
GetVideoModeInfo
Returns information about available output devices and their video modes.
IsGpuProgramLanguageSupported
Query if a GPU program language is supported (for example "hlsl", "glsl").
Thread safe.
GetQueueCount
Returns the number of queues supported for the specific usage.
GetQueue
Retrieves a queue with the specified usage and index.
SubmitCommandBuffer
Submits the command buffer for execution on an automatically retrieved queue.
This mask is only relevant if your command buffers are executing on different queues, and are dependent. If they are executing on the same queue then they will execute sequentially in the order they are submitted. Otherwise, if there is a dependency you must make state it explicitly here.
- commandBuffer
- Command buffer to submit. Usage of the command buffer determines the queue to execute on.
- syncMask
- Optional synchronization mask that determines if the submitted command buffer depends on any other command buffers submitted on other queues.
- queueIndex
- In case there are multiple queues supported with the command buffer's usage, this determines which one to execute on.
PresentRenderWindow
Presents the back-buffer image from the provided window onto the window, using the appropriate queue that supports present operations.
- renderWindow
- Window whose back-buffer to present.
- syncMask
- Optional synchronization mask that determines if the present operation depends on command buffers submitted on other queues.
WaitUntilIdle
Blocks the calling thread until all operations on the device finish.
BeginFrame
EndFrame
Notifies the device the rendering for the current frame has ended.
See BeginFrame().
GetOrCreateTransferCommandBuffer
Retrieves or creates a transfer command buffer for the current thread.
The returned command buffer will be automatically submitted during EndFrame() or when SubmitTransferCommandBuffer() is called.
SubmitTransferCommandBuffers
Submits the transfer command buffer for the current thread.
Optionally waits until the GPU is done processing it.
- wait
- If true, blocks until the GPU has finished executing the transfer command buffer.
CompileGpuProgramBytecode
Compiles the GPU program to an intermediate bytecode format.
The bytecode can be cached and used for quicker compilation/creation of GPU programs.
CreateGpuCommandBufferPool
Creates a command buffer pool that may be used for allocating command buffers.
CreateTexture
Creates a new GPU texture.
- createInformation
- Object describing the texture to create.
- flags
- Creation flags.
CreateGpuBuffer
Creates a new GPU buffer.
- createInformation
- Object describing the buffer to create.
- flags
- Creation flags.
FindOrCreateSamplerState
Creates a new sampler state, or returns an existing one if one with the same create information was already created.
- createInformation
- Object describing the sampler state to create.
CreateSamplerState
Creates a sampler state.
- createInformation
- Object describing the sampler state to create.
- flags
- Creation flags.
CreateQueryPool
Creates a new query pool.
- createInformation
- Object describing the query pool to create.
CreateGpuProgram
Creates a new GPU program using the provided source code.
If compilation fails or program is not supported GpuProgram::IsCompiled() will return false, and you will be able to retrieve the error message via GpuProgram::GetCompileErrorMessage().
- createInformation
- Object describing the program to create.
- flags
- Creation flags.
CreateGpuGraphicsPipelineState
Creates a graphics pipeline.
- createInformation
- Object describing the pipeline to create.
- flags
- Creation flags.
CreateGpuComputePipelineState
Creates a compute pipeline.
- createInformation
- Object describing the pipeline to create.
- flags
- Creation flags.
CreateGpuPipelineParameterLayout
Creates a pipeline layout from a set of GPU program parameter descriptions.
- createInformation
- Object describing the layout to create.
CreateGpuPipelineParameterSetLayout
Creates a single GPU pipeline parameter set layout from a parameter description.
- parameterDescription
- Description of parameters in the set.
Returns: The created set layout.
CreateParameterSetPool
Creates a parameter set pool for allocating GPU parameter sets.
- createInformation
- Pool configuration including mode and capacity limits.
Returns: Created parameter set pool.
ConvertProjectionMatrix
Contains a default matrix into a matrix suitable for use by this specific render system.
GenerateUniformBufferInformation
Generates a uniform buffer description and calculates per-uniform offsets for the provided buffer members.
The generated offsets are GPU backend specific.
- name
- Name to assign the uniform block.
- inOutUniforms
- List of members in the uniform buffer. Only name, type and array size fields need to be populated, the rest will be populated when the method returns. If a parameter is a struct then the elementSize field needs to be populated with the size of the struct in bytes.
Returns: Descriptor for the uniform buffer holding the provided parameters as laid out by the active GPU backend's layout.
ConvertTimestampToMilliseconds
Converts a GPU timestamp into a time in milliseconds.
- timestamp
- Timestamp as the one retrieved from timestamp GPU query.
Returns: Time in milliseconds.