|
TachyonUI 1.1.0
High-performance UI for building tools.
|
#include <gui_core/graphics/sdlgpu/sdlgpu_device.h>
Classes | |
| struct | TextureCopy |
| A whole image's pixels, or rows rows from firstRow written into one already up (UpdateImageRows); 0 rows is the whole image. More... | |
| struct | BufferCopy |
| struct | CopyScratch |
| RecordCopies' working lists, kept between frames for their storage. More... | |
| struct | Resident |
| struct | Scene |
| What RenderScene keeps for a key: its color texture (in the image set) and depth, both in liveImages. More... | |
| struct | SceneRequest |
| struct | ImageTarget |
Public Member Functions | |
| uint32_t | AddBuffer (SDL_GPUBuffer *buffer) |
| void | RemoveBuffer (uint32_t entry) |
| SDL_GPUBuffer * | Buffer (uint32_t entry) const |
| SDL_GPUBuffer * | CreateBuffer (SDL_GPUBufferUsageFlags usage, const void *data, uint32_t bytes) |
| A GPU buffer of usage and a transfer buffer holding data, copied at the next window frame's start. | |
| void | ReleaseBuffer (SDL_GPUBuffer *&buffer) |
| Lets go of a buffer: its pending copy, if any, isn't made. | |
| void | RecordCopies (SDL_GPUCopyPass *pass) |
| Records the queued copies; resident buffers they make are Ready after. | |
| RHI::ResidentBufferId | CreateResident (std::span< const RHI::UploadRequest > requests, std::span< DeviceAddress > addresses) |
| RHI::ResidentState | ResidentState (RHI::ResidentBufferId id) const |
| void | ReleaseResident (RHI::ResidentBufferId id) |
| SDL_GPUSampler * | SamplerFor (tachyon::Sampler sampler) const |
| bool | EnsureQuadIndices (uint32_t quads) |
| Grows the quads' index buffer to hold quads (copied with the window frame's copies). | |
| void | RecordScenes (SDL_GPUCommandBuffer *cmd, ID window) |
| Clears and records the scenes asked for in window this frame, before its UI's render pass and outside any pass. | |
| SDLGPUImage * | CreateTargetImage (uint2 size, SDL_GPUTextureFormat format, SDL_GPUTextureUsageFlags usage, Sampler sampler) |
| A texture the GPU draws into (a scene's), in liveImages so DestroyImageAtEnd frees it; null on failure. | |
Public Attributes | |
| DebugConfig | debug |
| std::string | driverAsked |
| SetDriver; empty, SDL's choice. | |
| bool | lowPower = false |
| WindowResolver | resolveWindow = nullptr |
| uint32_t | imageSlots = 4096 |
| SDL_GPUDevice * | device = nullptr |
| SDL_GPUDevice * | externalDevice = nullptr |
| the host's (SetExternalDevice): not destroyed at Cleanup | |
| SDL_GPUShaderFormat | shaderFormat = SDL_GPU_SHADERFORMAT_INVALID |
| the one the GUI's shaders are taken in | |
| std::string | driver |
| the one in use | |
| std::string | deviceName |
| SDL_LogOutputFunction | previousLog = nullptr |
| SDL's log output while the debug callback takes SDL GPU's messages. | |
| void * | previousLogData = nullptr |
| bool | logHooked = false |
| std::vector< SDL_GPUBuffer * > | buffers { nullptr } |
| entry 0 is none | |
| std::vector< uint32_t > | freeBuffers |
| std::mutex | copyMutex |
| images are made and let go on any thread | |
| std::vector< TextureCopy > | textureCopies |
| std::vector< BufferCopy > | bufferCopies |
| std::vector< SDLGPUImage * > | releasedImages |
| Images let go of (DestroyImageAtEnd, on any thread), freed by RecordCopies on the frame's thread after the copies it took: one may be among them. | |
| struct tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::CopyScratch | copyScratch |
| std::unordered_map< RHI::ResidentBufferId, Resident > | residents |
| std::vector< RHI::ResidentBufferId > | pendingResidents |
| Made and not copied yet, oldest first; one let go of meanwhile is no longer in residents and is passed over. | |
| RHI::ResidentBufferId | nextResident = 1 |
| std::unordered_set< SDLGPUImage * > | liveImages |
| Every image made and not let go for a frame: Cleanup frees what's left. | |
| SDLGPUImageSet | imageSet |
| std::array< SDL_GPUSampler *, 3 > | samplers {} |
| nearest repeat, linear repeat, linear clamp | |
| SDL_GPUTexture * | blankImage = nullptr |
| bound where a draw has fewer images | |
| std::array< SDL_GPUGraphicsPipeline *, kPrimitiveKindCount > | pipelineObjects {} |
| PipelineSet | pipelines {} |
| pipeline: the object; layout: the kind | |
| SDL_GPUBuffer * | blankBuffer = nullptr |
| bound to the storage slots a draw doesn't use | |
| SDL_GPUBuffer * | quadIndices = nullptr |
| p * 4 + { 0, 1, 3, 0, 3, 2 } for each quad p | |
| uint32_t | quadCapacity = 0 |
| SDL_GPUBuffer * | boxStyles = nullptr |
| SDL_GPUBuffer * | colorStyles = nullptr |
| std::vector< ImageIndex > | gradientPages |
| each gradient page's index in the image set | |
| ImageBatcher | batcher |
| float | elapsedTime = 0.0f |
| StyleManager * | lastStyles = nullptr |
| PrepareFrame's, for a live resize's redraw. | |
| GradientManager * | lastGradients = nullptr |
| std::unordered_map< ID, Scene > | scenes |
| std::vector< SceneRequest > | sceneRequests |
| uint64_t | sceneFrame = 0 |
| std::unordered_map< uint32_t, std::unique_ptr< SDLGPUImage > > | externalImages |
| By image slot index: the host's texture, which the GUI never releases. | |
| std::unordered_map< ID, ImageTarget > | imageTargets |
Static Public Attributes | |
| static constexpr SDL_GPUTextureFormat | kSceneColorFormat = SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM |
| static constexpr uint64_t | kSceneKeepFrames = 4 |
| a scene not asked for this long goes | |
| uint32_t tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::AddBuffer | ( | SDL_GPUBuffer * | buffer | ) |
| void tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::RemoveBuffer | ( | uint32_t | entry | ) |
|
inline |
| SDL_GPUBuffer * tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::CreateBuffer | ( | SDL_GPUBufferUsageFlags | usage, |
| const void * | data, | ||
| uint32_t | bytes ) |
A GPU buffer of usage and a transfer buffer holding data, copied at the next window frame's start.
Null on failure.
| void tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::ReleaseBuffer | ( | SDL_GPUBuffer *& | buffer | ) |
Lets go of a buffer: its pending copy, if any, isn't made.
| void tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::RecordCopies | ( | SDL_GPUCopyPass * | pass | ) |
Records the queued copies; resident buffers they make are Ready after.
| RHI::ResidentBufferId tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::CreateResident | ( | std::span< const RHI::UploadRequest > | requests, |
| std::span< DeviceAddress > | addresses ) |
| RHI::ResidentState tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::ResidentState | ( | RHI::ResidentBufferId | id | ) | const |
| void tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::ReleaseResident | ( | RHI::ResidentBufferId | id | ) |
| SDL_GPUSampler * tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::SamplerFor | ( | tachyon::Sampler | sampler | ) | const |
| bool tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::EnsureQuadIndices | ( | uint32_t | quads | ) |
Grows the quads' index buffer to hold quads (copied with the window frame's copies).
| void tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::RecordScenes | ( | SDL_GPUCommandBuffer * | cmd, |
| ID | window ) |
Clears and records the scenes asked for in window this frame, before its UI's render pass and outside any pass.
| SDLGPUImage * tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::CreateTargetImage | ( | uint2 | size, |
| SDL_GPUTextureFormat | format, | ||
| SDL_GPUTextureUsageFlags | usage, | ||
| Sampler | sampler ) |
A texture the GPU draws into (a scene's), in liveImages so DestroyImageAtEnd frees it; null on failure.
| DebugConfig tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::debug |
| std::string tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::driverAsked |
SetDriver; empty, SDL's choice.
| bool tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::lowPower = false |
| WindowResolver tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::resolveWindow = nullptr |
| uint32_t tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::imageSlots = 4096 |
| SDL_GPUDevice* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::device = nullptr |
| SDL_GPUDevice* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::externalDevice = nullptr |
the host's (SetExternalDevice): not destroyed at Cleanup
| SDL_GPUShaderFormat tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::shaderFormat = SDL_GPU_SHADERFORMAT_INVALID |
the one the GUI's shaders are taken in
| std::string tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::driver |
the one in use
| std::string tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::deviceName |
| SDL_LogOutputFunction tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::previousLog = nullptr |
SDL's log output while the debug callback takes SDL GPU's messages.
| void* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::previousLogData = nullptr |
| bool tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::logHooked = false |
| std::vector<SDL_GPUBuffer*> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::buffers { nullptr } |
entry 0 is none
| std::vector<uint32_t> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::freeBuffers |
| std::mutex tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::copyMutex |
images are made and let go on any thread
| std::vector<TextureCopy> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::textureCopies |
| std::vector<BufferCopy> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::bufferCopies |
| std::vector<SDLGPUImage*> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::releasedImages |
Images let go of (DestroyImageAtEnd, on any thread), freed by RecordCopies on the frame's thread after the copies it took: one may be among them.
| struct tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::CopyScratch tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::copyScratch |
| std::unordered_map<RHI::ResidentBufferId, Resident> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::residents |
| std::vector<RHI::ResidentBufferId> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::pendingResidents |
Made and not copied yet, oldest first; one let go of meanwhile is no longer in residents and is passed over.
Ids are never handed out twice.
| RHI::ResidentBufferId tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::nextResident = 1 |
| std::unordered_set<SDLGPUImage*> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::liveImages |
Every image made and not let go for a frame: Cleanup frees what's left.
| SDLGPUImageSet tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::imageSet |
| std::array<SDL_GPUSampler*, 3> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::samplers {} |
nearest repeat, linear repeat, linear clamp
| SDL_GPUTexture* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::blankImage = nullptr |
bound where a draw has fewer images
| std::array<SDL_GPUGraphicsPipeline*, kPrimitiveKindCount> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::pipelineObjects {} |
| PipelineSet tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::pipelines {} |
pipeline: the object; layout: the kind
| SDL_GPUBuffer* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::blankBuffer = nullptr |
bound to the storage slots a draw doesn't use
| SDL_GPUBuffer* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::quadIndices = nullptr |
p * 4 + { 0, 1, 3, 0, 3, 2 } for each quad p
| uint32_t tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::quadCapacity = 0 |
| SDL_GPUBuffer* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::boxStyles = nullptr |
| SDL_GPUBuffer* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::colorStyles = nullptr |
| std::vector<ImageIndex> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::gradientPages |
each gradient page's index in the image set
| ImageBatcher tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::batcher |
| float tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::elapsedTime = 0.0f |
| StyleManager* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::lastStyles = nullptr |
PrepareFrame's, for a live resize's redraw.
| GradientManager* tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::lastGradients = nullptr |
|
staticconstexpr |
|
staticconstexpr |
a scene not asked for this long goes
| std::vector<SceneRequest> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::sceneRequests |
| uint64_t tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::sceneFrame = 0 |
| std::unordered_map<uint32_t, std::unique_ptr<SDLGPUImage> > tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::externalImages |
By image slot index: the host's texture, which the GUI never releases.
| std::unordered_map<ID, ImageTarget> tachyon::sdlgpu::SDLGPUGraphicsContext::Impl::imageTargets |