| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Gpu
Contents
Description
The GPU API offers a cross-platform way for apps to talk to modern graphics hardware. It offers both 3D graphics and compute support, in the style of Metal, Vulkan, and Direct3D 12.
A basic workflow might be something like this:
The app creates a GPU device with , and assigns it to a window with createGPUDevice although strictly speaking you can render offscreen entirely, perhaps for image processing, and not use a window at all.claimWindowForGPUDevice
Next, the app prepares static data (things that are created once and used over and over). For example:
- Shaders (programs that run on the GPU): use
.createGPUShader - Vertex buffers (arrays of geometry data) and other rendering data: use
andcreateGPUBuffer.uploadToGPUBuffer - Textures (images): use
andcreateGPUTexture.uploadToGPUTexture - Samplers (how textures should be read from): use
.createGPUSampler - Render pipelines (precalculated rendering state): use
createGPUGraphicsPipeline
To render, the app creates one or more command buffers, with . Command buffers collect rendering instructions that will be submitted to the GPU in batch. Complex scenes can use multiple command buffers, maybe configured across multiple threads in parallel, as long as they are submitted in the correct order, but many apps will just need one command buffer per frame.acquireGPUCommandBuffer
Rendering can happen to a texture (what other APIs call a "render target") or it can happen to the swapchain texture (which is just a special texture that represents a window's contents). The app can use to render to the window.waitAndAcquireGPUSwapchainTexture
Rendering actually happens in a Render Pass, which is encoded into a command buffer. One can encode multiple render passes (or alternate between render and compute passes) in a single command buffer, but many apps might simply need a single render pass in a single command buffer. Render Passes can render to up to four color textures and one depth texture simultaneously. If the set of textures being rendered to needs to change, the Render Pass must be ended and a new one must be begun.
The app calls . Then it sets states it needs for each draw:beginGPURenderPass
Then, make the actual draw commands with these states:
After all the drawing commands for a pass are complete, the app should call . Once a render pass ends all render-related state is reset.endGPURenderPass
The app can begin new Render Passes and make new draws in the same command buffer until the entire scene is rendered.
Once all of the render commands for the scene are complete, the app calls to send it to the GPU for processing.submitGPUCommandBuffer
If the app needs to read back data from texture or buffers, the API has an efficient way of doing this, provided that the app is willing to tolerate some latency. When the app uses or downloadFromGPUTexture, submitting the command buffer with downloadFromGPUBuffer will return a fence handle that the app can poll or wait on in a thread. Once the fence indicates that the command buffer is done processing, it is safe to read the downloaded data. Make sure to call submitGPUCommandBufferAndAcquireFence when done with the fence.releaseGPUFence
The API also has "compute" support. The app calls with compute-writeable textures and/or buffers, which can be written to in a compute shader. Then it sets states it needs for the compute dispatches:beginGPUComputePass
Then, dispatch compute work:
For advanced users, this opens up powerful GPU-driven workflows.
Graphics and compute pipelines require the use of shaders, which as mentioned above are small programs executed on the GPU. Each backend (Vulkan, Metal, D3D12) requires a different shader format. When the app creates the GPU device, the app lets the device know which shader formats the app can provide. It will then select the appropriate backend depending on the available shader formats and the backends available on the platform. When creating shaders, the app must provide the correct shader format for the selected backend. If you would like to learn more about why the API works this way, there is a detailed blog post explaining this situation.
It is optimal for apps to pre-compile the shader formats they might use, but for ease of use SDL provides a separate project, SDL_shadercross, for performing runtime shader cross-compilation. It also has a CLI interface for offline precompilation as well.
This is an extremely quick overview that leaves out several important details. Already, though, one can see that GPU programming can be quite complex! If you just need simple 2D graphics, the Render API is much easier to use but still hardware-accelerated. That said, even for 2D applications the performance benefits and expressiveness of the GPU API are significant.
The GPU API targets a feature set with a wide range of hardware support and ease of portability. It is designed so that the app won't have to branch itself by querying feature support. If you need cutting-edge features with limited hardware support, this API is probably not for you.
Examples demonstrating proper usage of this API can be found here
Performance considerations
Here are some basic tips for maximizing your rendering performance.
- Beginning a new render pass is relatively expensive. Use as few render passes as you can.
- Minimize the amount of state changes. For example, binding a pipeline is relatively cheap, but doing it hundreds of times when you don't need to will slow the performance significantly.
- Perform your data uploads as early as possible in the frame.
- Don't churn resources. Creating and releasing resources is expensive. It's better to create what you need up front and cache it.
- Don't use uniform buffers for large amounts of data (more than a matrix or so). Use a storage buffer instead.
- Use cycling correctly. There is a detailed explanation of cycling further below.
- Use culling techniques to minimize pixel writes. The less writing the GPU has to do the better. Culling can be a very advanced topic but even simple culling techniques can boost performance significantly.
In general try to remember the golden rule of performance: doing things is more expensive than not doing things. Don't Touch The Driver!
FAQ
Question: When are you adding more advanced features, like ray tracing or mesh shaders?
Answer: We don't have immediate plans to add more bleeding-edge features, but we certainly might in the future, when these features prove worthwhile, and reasonable to implement across several platforms and underlying APIs. So while these things are not in the "never" category, they are definitely not "near future" items either.
Question: Why is my shader not working?
Answer: A common oversight when using shaders is not properly laying out the shader resources/registers correctly. The GPU API is very strict with how it wants resources to be laid out and it's difficult for the API to automatically validate shaders to see if they have a compatible layout. See the documentation for and createGPUShader for information on the expected layout.createGPUComputePipeline
Another common issue is not setting the correct number of samplers, textures, and buffers in SDL_GPUShaderCreateInfo. If possible use shader reflection to extract the required information from the shader automatically instead of manually filling in the struct's values.
Question: My application isn't performing very well. Is this the GPU API's fault?
Answer: No. Long answer: The GPU API is a relatively thin layer over the underlying graphics API. While it's possible that we have done something inefficiently, it's very unlikely especially if you are relatively inexperienced with GPU rendering. Please see the performance tips above and make sure you are following them. Additionally, tools like RenderDoc can be very helpful for diagnosing incorrect behavior and performance issues.
System Requirements
Vulkan
SDL driver name: "vulkan" (for use in and SDL_PROP_GPU_DEVICE_CREATE_NAME_STRING)createGPUDevice
Supported on Windows, Linux, Nintendo Switch, and certain Android devices. Requires Vulkan 1.0 with the following extensions and device features:
VK_KHR_swapchain
VK_KHR_maintenance1
independentBlend
imageCubeArray
depthClamp
shaderClipDistance
drawIndirectFirstInstance
sampleRateShading
You can remove some of these requirements to increase compatibility with Android devices by using these properties when creating the GPU device with :createGPUDeviceWithProperties
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_CLIP_DISTANCE_BOOLEAN
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEAN
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_INDIRECT_DRAW_FIRST_INSTANCE_BOOLEAN
- SDL_PROP_GPU_DEVICE_CREATE_FEATURE_ANISOTROPY_BOOLEAN
D3D12
SDL driver name: "direct3d12"
Supported on Windows 10 or newer, Xbox One (GDK), and Xbox Series X|S (GDK). Requires a GPU that supports DirectX 12 Feature Level 11_0 and Resource Binding Tier 2 or above.
You can remove the Tier 2 resource binding requirement to support Intel Haswell and Broadwell GPUs by using this property when creating the GPU device with :createGPUDeviceWithProperties
- SDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN
Metal
SDL driver name: "metal"
Supported on macOS 10.14+ and iOS/tvOS 13.0+. Hardware requirements vary by operating system:
- macOS requires an Apple Silicon or Intel Mac2 family GPU
- iOS/tvOS requires an A9 GPU or newer
- iOS Simulator and tvOS Simulator are unsupported
Coordinate System
The GPU API uses a left-handed coordinate system, following the convention of D3D12 and Metal. Specifically:
- Normalized Device Coordinates: The lower-left corner has an x,y coordinate of
(-1.0, -1.0). The upper-right corner is(1.0, 1.0). Z values range from[0.0, 1.0]where 0 is the near plane. - Viewport Coordinates: The top-left corner has an x,y coordinate of
(0, 0)and extends to the bottom-right corner at(viewportWidth, viewportHeight). +Y is down. - Texture Coordinates: The top-left corner has an x,y coordinate of
(0, 0)and extends to the bottom-right corner at(1.0, 1.0). +Y is down.
If the backend driver differs from this convention (e.g. Vulkan, which has an NDC that assumes +Y is down), SDL will automatically convert the coordinate system behind the scenes, so you don't need to perform any coordinate flipping logic in your shaders.
Uniform Data
Uniforms are for passing data to shaders. The uniform data will be constant across all executions of the shader.
There are 4 available uniform slots per shader stage (where the stages are vertex, fragment, and compute). Uniform data pushed to a slot on a stage keeps its value throughout the command buffer until you call the relevant Push function on that slot again.
For example, you could write your vertex shaders to read a camera matrix from uniform binding slot 0, push the camera matrix at the start of the command buffer, and that data will be used for every subsequent draw call.
It is valid to push uniform data during a render or compute pass.
Uniforms are best for pushing small amounts of data. If you are pushing more than a matrix or two per call you should consider using a storage buffer instead.
A Note On Cycling
When using a command buffer, operations do not occur immediately - they occur some time after the command buffer is submitted.
When a resource is used in a pending or active command buffer, it is considered to be "bound". When a resource is no longer used in any pending or active command buffers, it is considered to be "unbound".
If data resources are bound, it is unspecified when that data will be unbound unless you acquire a fence when submitting the command buffer and wait on it. However, this doesn't mean you need to track resource usage manually.
All of the functions and structs that involve writing to a resource have a "cycle" bool. SDL_GPUTransferBuffer, SDL_GPUBuffer, and SDL_GPUTexture all effectively function as ring buffers on internal resources. When cycle is true, if the resource is bound, the cycle rotates to the next unbound internal resource, or if none are available, a new one is created. This means you don't have to worry about complex state tracking and synchronization as long as cycling is correctly employed.
For example: you can call , write texture data, mapGPUTransferBuffer, and then unmapGPUTransferBuffer. The next time you write texture data to the transfer buffer, if you set the cycle param to true, you don't have to worry about overwriting any data that is not yet uploaded.uploadToGPUTexture
Another example: If you are using a texture in a render pass every frame, this can cause a data dependency between frames. If you set cycle to true in the SDL_GPUColorTargetInfo struct, you can prevent this data dependency.
Cycling will never undefine already bound data. When cycling, all data in the resource is considered to be undefined for subsequent commands until that data is written again. You must take care not to read undefined data.
Note that when cycling a texture, the entire texture will be cycled, even if only part of the texture is used in the call, so you must consider the entire texture to contain undefined data after cycling.
You must also take care not to overwrite a section of data that has been referenced in a command without cycling first. It is OK to overwrite unreferenced data in a bound resource without cycling, but overwriting a section of data that has already been referenced will produce unexpected results.
Debugging
At some point of your GPU journey, you will probably encounter issues that are not traceable with regular debugger - for example, your code compiles but you get an empty screen, or your shader fails in runtime.
For debugging such cases, there are tools that allow visually inspecting the whole GPU frame, every drawcall, every bound resource, memory buffers, etc. They are the following, per platform:
- For Windows/Linux, use RenderDoc
- For MacOS (Metal), use Xcode built-in debugger (Open XCode, go to Debug > Debug Executable..., select your application, set "GPU Frame Capture" to "Metal" in scheme "Options" window, run your app, and click the small Metal icon on the bottom to capture a frame)
Aside from that, you may want to enable additional debug layers to receive more detailed error messages, based on your GPU backend:
- For D3D12, the debug layer is an optional feature that can be installed via "Windows Settings -> System -> Optional features" and adding the "Graphics Tools" optional feature.
- For Vulkan, you will need to install Vulkan SDK on Windows, and on Linux, you usually have some sort of
vulkan-validation-layerssystem package that should be installed. - For Metal, it should be enough just to run the application from XCode to receive detailed errors or warnings in the output.
Don't hesitate to use tools as RenderDoc when encountering runtime issues or unexpected output on screen, quick GPU frame inspection can usually help you fix the majority of such problems. An opaque handle representing the SDL_GPU context.
FFI conventions
Unsuffixed aliases are unsafe foreign imports; aliases suffixed Safe are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under SDL3.Sys.Bindgen.Gpu.Unsafe); functions curated unsafe-only export only the unsuffixed one. Each alias's documentation records its flavor and rationale.
Full conventions: SDL3.Sys.
Since: 3.2.0
Synopsis
- module SDL3.Sys.Bindgen.Gpu
- pattern SDL_GPU_BUFFERUSAGE_VERTEX :: SDL_GPUBufferUsageFlags
- pattern SDL_GPU_BUFFERUSAGE_INDEX :: SDL_GPUBufferUsageFlags
- pattern SDL_GPU_BUFFERUSAGE_INDIRECT :: SDL_GPUBufferUsageFlags
- pattern SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ :: SDL_GPUBufferUsageFlags
- pattern SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ :: SDL_GPUBufferUsageFlags
- pattern SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE :: SDL_GPUBufferUsageFlags
- pattern SDL_GPU_COLORCOMPONENT_R :: SDL_GPUColorComponentFlags
- pattern SDL_GPU_COLORCOMPONENT_G :: SDL_GPUColorComponentFlags
- pattern SDL_GPU_COLORCOMPONENT_B :: SDL_GPUColorComponentFlags
- pattern SDL_GPU_COLORCOMPONENT_A :: SDL_GPUColorComponentFlags
- pattern SDL_GPU_SHADERFORMAT_INVALID :: SDL_GPUShaderFormat
- pattern SDL_GPU_SHADERFORMAT_PRIVATE :: SDL_GPUShaderFormat
- pattern SDL_GPU_SHADERFORMAT_SPIRV :: SDL_GPUShaderFormat
- pattern SDL_GPU_SHADERFORMAT_DXBC :: SDL_GPUShaderFormat
- pattern SDL_GPU_SHADERFORMAT_DXIL :: SDL_GPUShaderFormat
- pattern SDL_GPU_SHADERFORMAT_MSL :: SDL_GPUShaderFormat
- pattern SDL_GPU_SHADERFORMAT_METALLIB :: SDL_GPUShaderFormat
- pattern SDL_GPU_TEXTUREUSAGE_SAMPLER :: SDL_GPUTextureUsageFlags
- pattern SDL_GPU_TEXTUREUSAGE_COLOR_TARGET :: SDL_GPUTextureUsageFlags
- pattern SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET :: SDL_GPUTextureUsageFlags
- pattern SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ :: SDL_GPUTextureUsageFlags
- pattern SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ :: SDL_GPUTextureUsageFlags
- pattern SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE :: SDL_GPUTextureUsageFlags
- pattern SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE :: SDL_GPUTextureUsageFlags
- gpuSupportsShaderFormats :: SDL_GPUShaderFormat -> PtrConst CChar -> IO Bool
- gpuSupportsShaderFormatsSafe :: SDL_GPUShaderFormat -> PtrConst CChar -> IO Bool
- gpuSupportsProperties :: SDL_PropertiesID -> IO Bool
- gpuSupportsPropertiesSafe :: SDL_PropertiesID -> IO Bool
- createGPUDevice :: SDL_GPUShaderFormat -> Bool -> PtrConst CChar -> IO (Ptr SDL_GPUDevice)
- createGPUDeviceSafe :: SDL_GPUShaderFormat -> Bool -> PtrConst CChar -> IO (Ptr SDL_GPUDevice)
- createGPUDeviceWithProperties :: SDL_PropertiesID -> IO (Ptr SDL_GPUDevice)
- createGPUDeviceWithPropertiesSafe :: SDL_PropertiesID -> IO (Ptr SDL_GPUDevice)
- destroyGPUDevice :: Ptr SDL_GPUDevice -> IO ()
- destroyGPUDeviceSafe :: Ptr SDL_GPUDevice -> IO ()
- getNumGPUDrivers :: IO Int32
- getNumGPUDriversSafe :: IO Int32
- getGPUDriver :: Int32 -> IO (PtrConst CChar)
- getGPUDriverSafe :: Int32 -> IO (PtrConst CChar)
- getGPUDeviceDriver :: Ptr SDL_GPUDevice -> IO (PtrConst CChar)
- getGPUDeviceDriverSafe :: Ptr SDL_GPUDevice -> IO (PtrConst CChar)
- getGPUShaderFormats :: Ptr SDL_GPUDevice -> IO SDL_GPUShaderFormat
- getGPUShaderFormatsSafe :: Ptr SDL_GPUDevice -> IO SDL_GPUShaderFormat
- getGPUDeviceProperties :: Ptr SDL_GPUDevice -> IO SDL_PropertiesID
- getGPUDevicePropertiesSafe :: Ptr SDL_GPUDevice -> IO SDL_PropertiesID
- createGPUComputePipeline :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUComputePipelineCreateInfo -> IO (Ptr SDL_GPUComputePipeline)
- createGPUComputePipelineSafe :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUComputePipelineCreateInfo -> IO (Ptr SDL_GPUComputePipeline)
- createGPUGraphicsPipeline :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUGraphicsPipelineCreateInfo -> IO (Ptr SDL_GPUGraphicsPipeline)
- createGPUGraphicsPipelineSafe :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUGraphicsPipelineCreateInfo -> IO (Ptr SDL_GPUGraphicsPipeline)
- createGPUSampler :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUSamplerCreateInfo -> IO (Ptr SDL_GPUSampler)
- createGPUSamplerSafe :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUSamplerCreateInfo -> IO (Ptr SDL_GPUSampler)
- createGPUShader :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUShaderCreateInfo -> IO (Ptr SDL_GPUShader)
- createGPUShaderSafe :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUShaderCreateInfo -> IO (Ptr SDL_GPUShader)
- createGPUTexture :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUTextureCreateInfo -> IO (Ptr SDL_GPUTexture)
- createGPUTextureSafe :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUTextureCreateInfo -> IO (Ptr SDL_GPUTexture)
- createGPUBuffer :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUBufferCreateInfo -> IO (Ptr SDL_GPUBuffer)
- createGPUBufferSafe :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUBufferCreateInfo -> IO (Ptr SDL_GPUBuffer)
- createGPUTransferBuffer :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUTransferBufferCreateInfo -> IO (Ptr SDL_GPUTransferBuffer)
- createGPUTransferBufferSafe :: Ptr SDL_GPUDevice -> PtrConst SDL_GPUTransferBufferCreateInfo -> IO (Ptr SDL_GPUTransferBuffer)
- setGPUBufferName :: Ptr SDL_GPUDevice -> Ptr SDL_GPUBuffer -> PtrConst CChar -> IO ()
- setGPUBufferNameSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUBuffer -> PtrConst CChar -> IO ()
- setGPUTextureName :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTexture -> PtrConst CChar -> IO ()
- setGPUTextureNameSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTexture -> PtrConst CChar -> IO ()
- insertGPUDebugLabel :: Ptr SDL_GPUCommandBuffer -> PtrConst CChar -> IO ()
- insertGPUDebugLabelSafe :: Ptr SDL_GPUCommandBuffer -> PtrConst CChar -> IO ()
- pushGPUDebugGroup :: Ptr SDL_GPUCommandBuffer -> PtrConst CChar -> IO ()
- pushGPUDebugGroupSafe :: Ptr SDL_GPUCommandBuffer -> PtrConst CChar -> IO ()
- popGPUDebugGroup :: Ptr SDL_GPUCommandBuffer -> IO ()
- popGPUDebugGroupSafe :: Ptr SDL_GPUCommandBuffer -> IO ()
- releaseGPUTexture :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTexture -> IO ()
- releaseGPUTextureSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTexture -> IO ()
- releaseGPUSampler :: Ptr SDL_GPUDevice -> Ptr SDL_GPUSampler -> IO ()
- releaseGPUSamplerSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUSampler -> IO ()
- releaseGPUBuffer :: Ptr SDL_GPUDevice -> Ptr SDL_GPUBuffer -> IO ()
- releaseGPUBufferSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUBuffer -> IO ()
- releaseGPUTransferBuffer :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTransferBuffer -> IO ()
- releaseGPUTransferBufferSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTransferBuffer -> IO ()
- releaseGPUComputePipeline :: Ptr SDL_GPUDevice -> Ptr SDL_GPUComputePipeline -> IO ()
- releaseGPUComputePipelineSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUComputePipeline -> IO ()
- releaseGPUShader :: Ptr SDL_GPUDevice -> Ptr SDL_GPUShader -> IO ()
- releaseGPUShaderSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUShader -> IO ()
- releaseGPUGraphicsPipeline :: Ptr SDL_GPUDevice -> Ptr SDL_GPUGraphicsPipeline -> IO ()
- releaseGPUGraphicsPipelineSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUGraphicsPipeline -> IO ()
- acquireGPUCommandBuffer :: Ptr SDL_GPUDevice -> IO (Ptr SDL_GPUCommandBuffer)
- acquireGPUCommandBufferSafe :: Ptr SDL_GPUDevice -> IO (Ptr SDL_GPUCommandBuffer)
- pushGPUVertexUniformData :: Ptr SDL_GPUCommandBuffer -> Word32 -> PtrConst Void -> Word32 -> IO ()
- pushGPUVertexUniformDataSafe :: Ptr SDL_GPUCommandBuffer -> Word32 -> PtrConst Void -> Word32 -> IO ()
- pushGPUFragmentUniformData :: Ptr SDL_GPUCommandBuffer -> Word32 -> PtrConst Void -> Word32 -> IO ()
- pushGPUFragmentUniformDataSafe :: Ptr SDL_GPUCommandBuffer -> Word32 -> PtrConst Void -> Word32 -> IO ()
- pushGPUComputeUniformData :: Ptr SDL_GPUCommandBuffer -> Word32 -> PtrConst Void -> Word32 -> IO ()
- pushGPUComputeUniformDataSafe :: Ptr SDL_GPUCommandBuffer -> Word32 -> PtrConst Void -> Word32 -> IO ()
- beginGPURenderPass :: Ptr SDL_GPUCommandBuffer -> PtrConst SDL_GPUColorTargetInfo -> Word32 -> PtrConst SDL_GPUDepthStencilTargetInfo -> IO (Ptr SDL_GPURenderPass)
- beginGPURenderPassSafe :: Ptr SDL_GPUCommandBuffer -> PtrConst SDL_GPUColorTargetInfo -> Word32 -> PtrConst SDL_GPUDepthStencilTargetInfo -> IO (Ptr SDL_GPURenderPass)
- bindGPUGraphicsPipeline :: Ptr SDL_GPURenderPass -> Ptr SDL_GPUGraphicsPipeline -> IO ()
- bindGPUGraphicsPipelineSafe :: Ptr SDL_GPURenderPass -> Ptr SDL_GPUGraphicsPipeline -> IO ()
- setGPUViewport :: Ptr SDL_GPURenderPass -> PtrConst SDL_GPUViewport -> IO ()
- setGPUViewportSafe :: Ptr SDL_GPURenderPass -> PtrConst SDL_GPUViewport -> IO ()
- setGPUScissor :: Ptr SDL_GPURenderPass -> PtrConst SDL_Rect -> IO ()
- setGPUScissorSafe :: Ptr SDL_GPURenderPass -> PtrConst SDL_Rect -> IO ()
- setGPUBlendConstants :: Ptr SDL_GPURenderPass -> SDL_FColor -> IO ()
- setGPUBlendConstantsSafe :: Ptr SDL_GPURenderPass -> SDL_FColor -> IO ()
- setGPUStencilReference :: Ptr SDL_GPURenderPass -> Word8 -> IO ()
- setGPUStencilReferenceSafe :: Ptr SDL_GPURenderPass -> Word8 -> IO ()
- bindGPUVertexBuffers :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst SDL_GPUBufferBinding -> Word32 -> IO ()
- bindGPUVertexBuffersSafe :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst SDL_GPUBufferBinding -> Word32 -> IO ()
- bindGPUIndexBuffer :: Ptr SDL_GPURenderPass -> PtrConst SDL_GPUBufferBinding -> SDL_GPUIndexElementSize -> IO ()
- bindGPUIndexBufferSafe :: Ptr SDL_GPURenderPass -> PtrConst SDL_GPUBufferBinding -> SDL_GPUIndexElementSize -> IO ()
- bindGPUVertexSamplers :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst SDL_GPUTextureSamplerBinding -> Word32 -> IO ()
- bindGPUVertexSamplersSafe :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst SDL_GPUTextureSamplerBinding -> Word32 -> IO ()
- bindGPUVertexStorageTextures :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUTexture) -> Word32 -> IO ()
- bindGPUVertexStorageTexturesSafe :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUTexture) -> Word32 -> IO ()
- bindGPUVertexStorageBuffers :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUBuffer) -> Word32 -> IO ()
- bindGPUVertexStorageBuffersSafe :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUBuffer) -> Word32 -> IO ()
- bindGPUFragmentSamplers :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst SDL_GPUTextureSamplerBinding -> Word32 -> IO ()
- bindGPUFragmentSamplersSafe :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst SDL_GPUTextureSamplerBinding -> Word32 -> IO ()
- bindGPUFragmentStorageTextures :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUTexture) -> Word32 -> IO ()
- bindGPUFragmentStorageTexturesSafe :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUTexture) -> Word32 -> IO ()
- bindGPUFragmentStorageBuffers :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUBuffer) -> Word32 -> IO ()
- bindGPUFragmentStorageBuffersSafe :: Ptr SDL_GPURenderPass -> Word32 -> PtrConst (Ptr SDL_GPUBuffer) -> Word32 -> IO ()
- drawGPUIndexedPrimitives :: Ptr SDL_GPURenderPass -> Word32 -> Word32 -> Word32 -> Int32 -> Word32 -> IO ()
- drawGPUIndexedPrimitivesSafe :: Ptr SDL_GPURenderPass -> Word32 -> Word32 -> Word32 -> Int32 -> Word32 -> IO ()
- drawGPUPrimitives :: Ptr SDL_GPURenderPass -> Word32 -> Word32 -> Word32 -> Word32 -> IO ()
- drawGPUPrimitivesSafe :: Ptr SDL_GPURenderPass -> Word32 -> Word32 -> Word32 -> Word32 -> IO ()
- drawGPUPrimitivesIndirect :: Ptr SDL_GPURenderPass -> Ptr SDL_GPUBuffer -> Word32 -> Word32 -> IO ()
- drawGPUPrimitivesIndirectSafe :: Ptr SDL_GPURenderPass -> Ptr SDL_GPUBuffer -> Word32 -> Word32 -> IO ()
- drawGPUIndexedPrimitivesIndirect :: Ptr SDL_GPURenderPass -> Ptr SDL_GPUBuffer -> Word32 -> Word32 -> IO ()
- drawGPUIndexedPrimitivesIndirectSafe :: Ptr SDL_GPURenderPass -> Ptr SDL_GPUBuffer -> Word32 -> Word32 -> IO ()
- endGPURenderPass :: Ptr SDL_GPURenderPass -> IO ()
- endGPURenderPassSafe :: Ptr SDL_GPURenderPass -> IO ()
- beginGPUComputePass :: Ptr SDL_GPUCommandBuffer -> PtrConst SDL_GPUStorageTextureReadWriteBinding -> Word32 -> PtrConst SDL_GPUStorageBufferReadWriteBinding -> Word32 -> IO (Ptr SDL_GPUComputePass)
- beginGPUComputePassSafe :: Ptr SDL_GPUCommandBuffer -> PtrConst SDL_GPUStorageTextureReadWriteBinding -> Word32 -> PtrConst SDL_GPUStorageBufferReadWriteBinding -> Word32 -> IO (Ptr SDL_GPUComputePass)
- bindGPUComputePipeline :: Ptr SDL_GPUComputePass -> Ptr SDL_GPUComputePipeline -> IO ()
- bindGPUComputePipelineSafe :: Ptr SDL_GPUComputePass -> Ptr SDL_GPUComputePipeline -> IO ()
- bindGPUComputeSamplers :: Ptr SDL_GPUComputePass -> Word32 -> PtrConst SDL_GPUTextureSamplerBinding -> Word32 -> IO ()
- bindGPUComputeSamplersSafe :: Ptr SDL_GPUComputePass -> Word32 -> PtrConst SDL_GPUTextureSamplerBinding -> Word32 -> IO ()
- bindGPUComputeStorageTextures :: Ptr SDL_GPUComputePass -> Word32 -> PtrConst (Ptr SDL_GPUTexture) -> Word32 -> IO ()
- bindGPUComputeStorageTexturesSafe :: Ptr SDL_GPUComputePass -> Word32 -> PtrConst (Ptr SDL_GPUTexture) -> Word32 -> IO ()
- bindGPUComputeStorageBuffers :: Ptr SDL_GPUComputePass -> Word32 -> PtrConst (Ptr SDL_GPUBuffer) -> Word32 -> IO ()
- bindGPUComputeStorageBuffersSafe :: Ptr SDL_GPUComputePass -> Word32 -> PtrConst (Ptr SDL_GPUBuffer) -> Word32 -> IO ()
- dispatchGPUCompute :: Ptr SDL_GPUComputePass -> Word32 -> Word32 -> Word32 -> IO ()
- dispatchGPUComputeSafe :: Ptr SDL_GPUComputePass -> Word32 -> Word32 -> Word32 -> IO ()
- dispatchGPUComputeIndirect :: Ptr SDL_GPUComputePass -> Ptr SDL_GPUBuffer -> Word32 -> IO ()
- dispatchGPUComputeIndirectSafe :: Ptr SDL_GPUComputePass -> Ptr SDL_GPUBuffer -> Word32 -> IO ()
- endGPUComputePass :: Ptr SDL_GPUComputePass -> IO ()
- endGPUComputePassSafe :: Ptr SDL_GPUComputePass -> IO ()
- mapGPUTransferBuffer :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTransferBuffer -> Bool -> IO (Ptr Void)
- mapGPUTransferBufferSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTransferBuffer -> Bool -> IO (Ptr Void)
- unmapGPUTransferBuffer :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTransferBuffer -> IO ()
- unmapGPUTransferBufferSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUTransferBuffer -> IO ()
- beginGPUCopyPass :: Ptr SDL_GPUCommandBuffer -> IO (Ptr SDL_GPUCopyPass)
- beginGPUCopyPassSafe :: Ptr SDL_GPUCommandBuffer -> IO (Ptr SDL_GPUCopyPass)
- uploadToGPUTexture :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTextureTransferInfo -> PtrConst SDL_GPUTextureRegion -> Bool -> IO ()
- uploadToGPUTextureSafe :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTextureTransferInfo -> PtrConst SDL_GPUTextureRegion -> Bool -> IO ()
- uploadToGPUBuffer :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTransferBufferLocation -> PtrConst SDL_GPUBufferRegion -> Bool -> IO ()
- uploadToGPUBufferSafe :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTransferBufferLocation -> PtrConst SDL_GPUBufferRegion -> Bool -> IO ()
- copyGPUTextureToTexture :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTextureLocation -> PtrConst SDL_GPUTextureLocation -> Word32 -> Word32 -> Word32 -> Bool -> IO ()
- copyGPUTextureToTextureSafe :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTextureLocation -> PtrConst SDL_GPUTextureLocation -> Word32 -> Word32 -> Word32 -> Bool -> IO ()
- copyGPUBufferToBuffer :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUBufferLocation -> PtrConst SDL_GPUBufferLocation -> Word32 -> Bool -> IO ()
- copyGPUBufferToBufferSafe :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUBufferLocation -> PtrConst SDL_GPUBufferLocation -> Word32 -> Bool -> IO ()
- downloadFromGPUTexture :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTextureRegion -> PtrConst SDL_GPUTextureTransferInfo -> IO ()
- downloadFromGPUTextureSafe :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUTextureRegion -> PtrConst SDL_GPUTextureTransferInfo -> IO ()
- downloadFromGPUBuffer :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUBufferRegion -> PtrConst SDL_GPUTransferBufferLocation -> IO ()
- downloadFromGPUBufferSafe :: Ptr SDL_GPUCopyPass -> PtrConst SDL_GPUBufferRegion -> PtrConst SDL_GPUTransferBufferLocation -> IO ()
- endGPUCopyPass :: Ptr SDL_GPUCopyPass -> IO ()
- endGPUCopyPassSafe :: Ptr SDL_GPUCopyPass -> IO ()
- generateMipmapsForGPUTexture :: Ptr SDL_GPUCommandBuffer -> Ptr SDL_GPUTexture -> IO ()
- generateMipmapsForGPUTextureSafe :: Ptr SDL_GPUCommandBuffer -> Ptr SDL_GPUTexture -> IO ()
- blitGPUTexture :: Ptr SDL_GPUCommandBuffer -> PtrConst SDL_GPUBlitInfo -> IO ()
- blitGPUTextureSafe :: Ptr SDL_GPUCommandBuffer -> PtrConst SDL_GPUBlitInfo -> IO ()
- windowSupportsGPUSwapchainComposition :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> SDL_GPUSwapchainComposition -> IO Bool
- windowSupportsGPUSwapchainCompositionSafe :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> SDL_GPUSwapchainComposition -> IO Bool
- windowSupportsGPUPresentMode :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> SDL_GPUPresentMode -> IO Bool
- windowSupportsGPUPresentModeSafe :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> SDL_GPUPresentMode -> IO Bool
- claimWindowForGPUDevice :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO Bool
- claimWindowForGPUDeviceSafe :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO Bool
- releaseWindowFromGPUDevice :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO ()
- releaseWindowFromGPUDeviceSafe :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO ()
- setGPUSwapchainParameters :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> SDL_GPUSwapchainComposition -> SDL_GPUPresentMode -> IO Bool
- setGPUSwapchainParametersSafe :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> SDL_GPUSwapchainComposition -> SDL_GPUPresentMode -> IO Bool
- setGPUAllowedFramesInFlight :: Ptr SDL_GPUDevice -> Word32 -> IO Bool
- setGPUAllowedFramesInFlightSafe :: Ptr SDL_GPUDevice -> Word32 -> IO Bool
- getGPUSwapchainTextureFormat :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO SDL_GPUTextureFormat
- getGPUSwapchainTextureFormatSafe :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO SDL_GPUTextureFormat
- acquireGPUSwapchainTexture :: Ptr SDL_GPUCommandBuffer -> Ptr SDL_Window -> Ptr (Ptr SDL_GPUTexture) -> Ptr Uint32 -> Ptr Uint32 -> IO Bool
- acquireGPUSwapchainTextureSafe :: Ptr SDL_GPUCommandBuffer -> Ptr SDL_Window -> Ptr (Ptr SDL_GPUTexture) -> Ptr Uint32 -> Ptr Uint32 -> IO Bool
- waitForGPUSwapchain :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO Bool
- waitForGPUSwapchainSafe :: Ptr SDL_GPUDevice -> Ptr SDL_Window -> IO Bool
- waitAndAcquireGPUSwapchainTexture :: Ptr SDL_GPUCommandBuffer -> Ptr SDL_Window -> Ptr (Ptr SDL_GPUTexture) -> Ptr Uint32 -> Ptr Uint32 -> IO Bool
- waitAndAcquireGPUSwapchainTextureSafe :: Ptr SDL_GPUCommandBuffer -> Ptr SDL_Window -> Ptr (Ptr SDL_GPUTexture) -> Ptr Uint32 -> Ptr Uint32 -> IO Bool
- submitGPUCommandBuffer :: Ptr SDL_GPUCommandBuffer -> IO Bool
- submitGPUCommandBufferSafe :: Ptr SDL_GPUCommandBuffer -> IO Bool
- submitGPUCommandBufferAndAcquireFence :: Ptr SDL_GPUCommandBuffer -> IO (Ptr SDL_GPUFence)
- submitGPUCommandBufferAndAcquireFenceSafe :: Ptr SDL_GPUCommandBuffer -> IO (Ptr SDL_GPUFence)
- cancelGPUCommandBuffer :: Ptr SDL_GPUCommandBuffer -> IO Bool
- cancelGPUCommandBufferSafe :: Ptr SDL_GPUCommandBuffer -> IO Bool
- waitForGPUIdle :: Ptr SDL_GPUDevice -> IO Bool
- waitForGPUIdleSafe :: Ptr SDL_GPUDevice -> IO Bool
- waitForGPUFences :: Ptr SDL_GPUDevice -> Bool -> PtrConst (Ptr SDL_GPUFence) -> Word32 -> IO Bool
- waitForGPUFencesSafe :: Ptr SDL_GPUDevice -> Bool -> PtrConst (Ptr SDL_GPUFence) -> Word32 -> IO Bool
- queryGPUFence :: Ptr SDL_GPUDevice -> Ptr SDL_GPUFence -> IO Bool
- queryGPUFenceSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUFence -> IO Bool
- releaseGPUFence :: Ptr SDL_GPUDevice -> Ptr SDL_GPUFence -> IO ()
- releaseGPUFenceSafe :: Ptr SDL_GPUDevice -> Ptr SDL_GPUFence -> IO ()
- gpuTextureFormatTexelBlockSize :: SDL_GPUTextureFormat -> IO Word32
- gpuTextureFormatTexelBlockSizeSafe :: SDL_GPUTextureFormat -> IO Word32
- gpuTextureSupportsFormat :: Ptr SDL_GPUDevice -> SDL_GPUTextureFormat -> SDL_GPUTextureType -> SDL_GPUTextureUsageFlags -> IO Bool
- gpuTextureSupportsFormatSafe :: Ptr SDL_GPUDevice -> SDL_GPUTextureFormat -> SDL_GPUTextureType -> SDL_GPUTextureUsageFlags -> IO Bool
- gpuTextureSupportsSampleCount :: Ptr SDL_GPUDevice -> SDL_GPUTextureFormat -> SDL_GPUSampleCount -> IO Bool
- gpuTextureSupportsSampleCountSafe :: Ptr SDL_GPUDevice -> SDL_GPUTextureFormat -> SDL_GPUSampleCount -> IO Bool
- calculateGPUTextureFormatSize :: SDL_GPUTextureFormat -> Word32 -> Word32 -> Word32 -> IO Word32
- calculateGPUTextureFormatSizeSafe :: SDL_GPUTextureFormat -> Word32 -> Word32 -> Word32 -> IO Word32
- getPixelFormatFromGPUTextureFormat :: SDL_GPUTextureFormat -> IO SDL_PixelFormat
- getPixelFormatFromGPUTextureFormatSafe :: SDL_GPUTextureFormat -> IO SDL_PixelFormat
- getGPUTextureFormatFromPixelFormat :: SDL_PixelFormat -> IO SDL_GPUTextureFormat
- getGPUTextureFormatFromPixelFormatSafe :: SDL_PixelFormat -> IO SDL_GPUTextureFormat
Documentation
module SDL3.Sys.Bindgen.Gpu
Typed constants
pattern SDL_GPU_BUFFERUSAGE_VERTEX :: SDL_GPUBufferUsageFlags Source #
Typed constant for macro SDL_GPU_BUFFERUSAGE_VERTEX. Combine with .|. from Data.Bits.
pattern SDL_GPU_BUFFERUSAGE_INDEX :: SDL_GPUBufferUsageFlags Source #
Typed constant for macro SDL_GPU_BUFFERUSAGE_INDEX. Combine with .|. from Data.Bits.
pattern SDL_GPU_BUFFERUSAGE_INDIRECT :: SDL_GPUBufferUsageFlags Source #
Typed constant for macro SDL_GPU_BUFFERUSAGE_INDIRECT. Combine with .|. from Data.Bits.
pattern SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ :: SDL_GPUBufferUsageFlags Source #
Typed constant for macro SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ. Combine with .|. from Data.Bits.
pattern SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ :: SDL_GPUBufferUsageFlags Source #
Typed constant for macro SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ. Combine with .|. from Data.Bits.
pattern SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE :: SDL_GPUBufferUsageFlags Source #
Typed constant for macro SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_WRITE. Combine with .|. from Data.Bits.
pattern SDL_GPU_COLORCOMPONENT_R :: SDL_GPUColorComponentFlags Source #
Typed constant for macro SDL_GPU_COLORCOMPONENT_R. Combine with .|. from Data.Bits.
pattern SDL_GPU_COLORCOMPONENT_G :: SDL_GPUColorComponentFlags Source #
Typed constant for macro SDL_GPU_COLORCOMPONENT_G. Combine with .|. from Data.Bits.
pattern SDL_GPU_COLORCOMPONENT_B :: SDL_GPUColorComponentFlags Source #
Typed constant for macro SDL_GPU_COLORCOMPONENT_B. Combine with .|. from Data.Bits.
pattern SDL_GPU_COLORCOMPONENT_A :: SDL_GPUColorComponentFlags Source #
Typed constant for macro SDL_GPU_COLORCOMPONENT_A. Combine with .|. from Data.Bits.
pattern SDL_GPU_SHADERFORMAT_INVALID :: SDL_GPUShaderFormat Source #
Typed constant for macro SDL_GPU_SHADERFORMAT_INVALID. Combine with .|. from Data.Bits.
pattern SDL_GPU_SHADERFORMAT_PRIVATE :: SDL_GPUShaderFormat Source #
Typed constant for macro SDL_GPU_SHADERFORMAT_PRIVATE. Combine with .|. from Data.Bits.
pattern SDL_GPU_SHADERFORMAT_SPIRV :: SDL_GPUShaderFormat Source #
Typed constant for macro SDL_GPU_SHADERFORMAT_SPIRV. Combine with .|. from Data.Bits.
pattern SDL_GPU_SHADERFORMAT_DXBC :: SDL_GPUShaderFormat Source #
Typed constant for macro SDL_GPU_SHADERFORMAT_DXBC. Combine with .|. from Data.Bits.
pattern SDL_GPU_SHADERFORMAT_DXIL :: SDL_GPUShaderFormat Source #
Typed constant for macro SDL_GPU_SHADERFORMAT_DXIL. Combine with .|. from Data.Bits.
pattern SDL_GPU_SHADERFORMAT_MSL :: SDL_GPUShaderFormat Source #
Typed constant for macro SDL_GPU_SHADERFORMAT_MSL. Combine with .|. from Data.Bits.
pattern SDL_GPU_SHADERFORMAT_METALLIB :: SDL_GPUShaderFormat Source #
Typed constant for macro SDL_GPU_SHADERFORMAT_METALLIB. Combine with .|. from Data.Bits.
pattern SDL_GPU_TEXTUREUSAGE_SAMPLER :: SDL_GPUTextureUsageFlags Source #
Typed constant for macro SDL_GPU_TEXTUREUSAGE_SAMPLER. Combine with .|. from Data.Bits.
pattern SDL_GPU_TEXTUREUSAGE_COLOR_TARGET :: SDL_GPUTextureUsageFlags Source #
Typed constant for macro SDL_GPU_TEXTUREUSAGE_COLOR_TARGET. Combine with .|. from Data.Bits.
pattern SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET :: SDL_GPUTextureUsageFlags Source #
Typed constant for macro SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET. Combine with .|. from Data.Bits.
pattern SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ :: SDL_GPUTextureUsageFlags Source #
Typed constant for macro SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ. Combine with .|. from Data.Bits.
pattern SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ :: SDL_GPUTextureUsageFlags Source #
Typed constant for macro SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ. Combine with .|. from Data.Bits.
pattern SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE :: SDL_GPUTextureUsageFlags Source #
Typed constant for macro SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE. Combine with .|. from Data.Bits.
pattern SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE :: SDL_GPUTextureUsageFlags Source #
Typed constant for macro SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE. Combine with .|. from Data.Bits.
Function aliases
gpuSupportsShaderFormats Source #
Arguments
| :: SDL_GPUShaderFormat |
|
| -> PtrConst CChar |
|
| -> IO Bool |
Checks for GPU runtime support.
- Returns
- true if supported, false otherwise.
- See also
createGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GPUSupportsShaderFormats. The safe flavor isgpuSupportsShaderFormatsSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUSupportsShaderFormats, defined atSDL3/SDL_gpu.h 2213:34
Since: 3.2.0
gpuSupportsShaderFormatsSafe Source #
Arguments
| :: SDL_GPUShaderFormat |
|
| -> PtrConst CChar |
|
| -> IO Bool |
Checks for GPU runtime support.
- Returns
- true if supported, false otherwise.
- See also
createGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GPUSupportsShaderFormats. The unsafe flavor isgpuSupportsShaderFormats. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUSupportsShaderFormats, defined atSDL3/SDL_gpu.h 2213:34
Since: 3.2.0
gpuSupportsProperties Source #
Arguments
| :: SDL_PropertiesID |
|
| -> IO Bool |
Checks for GPU runtime support.
- Returns
- true if supported, false otherwise.
- See also
createGPUDeviceWithProperties
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GPUSupportsProperties. The safe flavor isgpuSupportsPropertiesSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUSupportsProperties, defined atSDL3/SDL_gpu.h 2227:34
Since: 3.2.0
gpuSupportsPropertiesSafe Source #
Arguments
| :: SDL_PropertiesID |
|
| -> IO Bool |
Checks for GPU runtime support.
- Returns
- true if supported, false otherwise.
- See also
createGPUDeviceWithProperties
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GPUSupportsProperties. The unsafe flavor isgpuSupportsProperties. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUSupportsProperties, defined atSDL3/SDL_gpu.h 2227:34
Since: 3.2.0
Arguments
| :: SDL_GPUShaderFormat |
|
| -> Bool |
|
| -> PtrConst CChar |
|
| -> IO (Ptr SDL_GPUDevice) |
Creates a GPU context.
The GPU driver name can be one of the following:
- Returns
- a GPU context on success or NULL on failure; call
getErrorfor more information. - See also
createGPUDeviceWithProperties,getGPUShaderFormats,getGPUDeviceDriver,destroyGPUDevice,gpuSupportsShaderFormats
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUDevice. The safe flavor iscreateGPUDeviceSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CreateGPUDevice, defined atSDL3/SDL_gpu.h 2256:45
Since: 3.2.0
Arguments
| :: SDL_GPUShaderFormat |
|
| -> Bool |
|
| -> PtrConst CChar |
|
| -> IO (Ptr SDL_GPUDevice) |
Creates a GPU context.
The GPU driver name can be one of the following:
- Returns
- a GPU context on success or NULL on failure; call
getErrorfor more information. - See also
createGPUDeviceWithProperties,getGPUShaderFormats,getGPUDeviceDriver,destroyGPUDevice,gpuSupportsShaderFormats
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUDevice. The unsafe flavor iscreateGPUDevice. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CreateGPUDevice, defined atSDL3/SDL_gpu.h 2256:45
Since: 3.2.0
createGPUDeviceWithProperties Source #
Arguments
| :: SDL_PropertiesID |
|
| -> IO (Ptr SDL_GPUDevice) |
Creates a GPU context.
These are the supported properties:
: enable debug mode properties and validations, defaults to true.sDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN: enable to prefer energy efficiency over maximum GPU performance, defaults to false.sDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN: enable to automatically log useful debug information on device creation, defaults to true.sDL_PROP_GPU_DEVICE_CREATE_VERBOSE_BOOLEAN: the name of the GPU driver to use, if a specific one is desired.sDL_PROP_GPU_DEVICE_CREATE_NAME_STRING: Enable Vulkan device feature shaderClipDistance. If disabled, clip distances are not supported in shader code: gl_ClipDistance[] built-ins of GLSL, SV_ClipDistance0/1 semantics of HLSL and [[clip_distance]] attribute of Metal. Disabling optional features allows the application to run on some older Android devices. Defaults to true.sDL_PROP_GPU_DEVICE_CREATE_FEATURE_CLIP_DISTANCE_BOOLEAN: Enable Vulkan device feature depthClamp. If disabled, there is no depth clamp support and enable_depth_clip insDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEANSDL_GPURasterizerStatemust always be set to true. Disabling optional features allows the application to run on some older Android devices. Defaults to true.: Enable Vulkan device feature drawIndirectFirstInstance. If disabled, the argument first_instance ofsDL_PROP_GPU_DEVICE_CREATE_FEATURE_INDIRECT_DRAW_FIRST_INSTANCE_BOOLEANSDL_GPUIndirectDrawCommandmust be set to zero. Disabling optional features allows the application to run on some older Android devices. Defaults to true.: Enable Vulkan device feature samplerAnisotropy. If disabled, enable_anisotropy ofsDL_PROP_GPU_DEVICE_CREATE_FEATURE_ANISOTROPY_BOOLEANSDL_GPUSamplerCreateInfomust be set to false. Disabling optional features allows the application to run on some older Android devices. Defaults to true.
These are the current shader format properties:
: The app is able to provide shaders for an NDA platform.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN: The app is able to provide SPIR-V shaders if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN: The app is able to provide DXBC shaders if applicablesDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN: The app is able to provide DXIL shaders if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN: The app is able to provide MSL shaders if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN: The app is able to provide Metal shader libraries if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN
With the D3D12 backend:
: the prefix to use for all vertex semantics, default is "TEXCOORD".sDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING: By default, Resourcing Binding Tier 2 is required for D3D12 support. However, an application can set this property to true to enable Tier 1 support, if (and only if) the application uses 8 or fewer storage resources across all shader stages. As of writing, this property is useful for targeting Intel Haswell and Broadwell GPUs; other hardware either supports Tier 2 Resource Binding or does not support D3D12 in any capacity. Defaults to false.sDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN: Certain feature checks are only possible on Windows 11 by default. By setting this alongsidesDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBERand vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make those feature checks possible on older platforms. The version you provide must match the one given in the DLL.sDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING: Certain feature checks are only possible on Windows 11 by default. By setting this alongsidesDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRINGand vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make those feature checks possible on older platforms. The path you provide must be relative to the executable path of your app. Be sure not to put the DLL in the same directory as the exe; Microsoft strongly advises against this!sDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER
With the Vulkan backend:
: By default, Vulkan device enumeration includes drivers of all types, including software renderers (for example, the Lavapipe Mesa driver). This can be useful if your application requires SDL_GPU, but if you can provide your own fallback renderer (for example, an OpenGL renderer) this property can be set to true. Defaults to false.sDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN: a pointer to ansDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTERSDL_GPUVulkanOptionsstructure to be processed during device creation. This allows configuring a variety of Vulkan-specific options such as increasing the API version and opting into extensions aside from the minimal set SDL requires.
With the Metal backend: - : By default, macOS support requires what Apple calls "MTLGPUFamilyMac2" hardware or newer. However, an application can set this property to true to enable support for "MTLGPUFamilyMac1" hardware, if (and only if) the application does not write to sRGB textures. (For history's sake: MacFamily1 also does not support indirect command buffers, MSAA depth resolve, and stencil resolve/feedback, but these are not exposed features in SDL_GPU.)sDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1_BOOLEAN
- Returns
- a GPU context on success or NULL on failure; call
getErrorfor more information. - See also
getGPUShaderFormats,getGPUDeviceDriver,destroyGPUDevice,gpuSupportsProperties
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUDeviceWithProperties. The safe flavor iscreateGPUDeviceWithPropertiesSafe. - C declaration
SDL_CreateGPUDeviceWithProperties, defined atSDL3/SDL_gpu.h 2373:45
Since: 3.2.0
createGPUDeviceWithPropertiesSafe Source #
Arguments
| :: SDL_PropertiesID |
|
| -> IO (Ptr SDL_GPUDevice) |
Creates a GPU context.
These are the supported properties:
: enable debug mode properties and validations, defaults to true.sDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN: enable to prefer energy efficiency over maximum GPU performance, defaults to false.sDL_PROP_GPU_DEVICE_CREATE_PREFERLOWPOWER_BOOLEAN: enable to automatically log useful debug information on device creation, defaults to true.sDL_PROP_GPU_DEVICE_CREATE_VERBOSE_BOOLEAN: the name of the GPU driver to use, if a specific one is desired.sDL_PROP_GPU_DEVICE_CREATE_NAME_STRING: Enable Vulkan device feature shaderClipDistance. If disabled, clip distances are not supported in shader code: gl_ClipDistance[] built-ins of GLSL, SV_ClipDistance0/1 semantics of HLSL and [[clip_distance]] attribute of Metal. Disabling optional features allows the application to run on some older Android devices. Defaults to true.sDL_PROP_GPU_DEVICE_CREATE_FEATURE_CLIP_DISTANCE_BOOLEAN: Enable Vulkan device feature depthClamp. If disabled, there is no depth clamp support and enable_depth_clip insDL_PROP_GPU_DEVICE_CREATE_FEATURE_DEPTH_CLAMPING_BOOLEANSDL_GPURasterizerStatemust always be set to true. Disabling optional features allows the application to run on some older Android devices. Defaults to true.: Enable Vulkan device feature drawIndirectFirstInstance. If disabled, the argument first_instance ofsDL_PROP_GPU_DEVICE_CREATE_FEATURE_INDIRECT_DRAW_FIRST_INSTANCE_BOOLEANSDL_GPUIndirectDrawCommandmust be set to zero. Disabling optional features allows the application to run on some older Android devices. Defaults to true.: Enable Vulkan device feature samplerAnisotropy. If disabled, enable_anisotropy ofsDL_PROP_GPU_DEVICE_CREATE_FEATURE_ANISOTROPY_BOOLEANSDL_GPUSamplerCreateInfomust be set to false. Disabling optional features allows the application to run on some older Android devices. Defaults to true.
These are the current shader format properties:
: The app is able to provide shaders for an NDA platform.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_PRIVATE_BOOLEAN: The app is able to provide SPIR-V shaders if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_SPIRV_BOOLEAN: The app is able to provide DXBC shaders if applicablesDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXBC_BOOLEAN: The app is able to provide DXIL shaders if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_DXIL_BOOLEAN: The app is able to provide MSL shaders if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_MSL_BOOLEAN: The app is able to provide Metal shader libraries if applicable.sDL_PROP_GPU_DEVICE_CREATE_SHADERS_METALLIB_BOOLEAN
With the D3D12 backend:
: the prefix to use for all vertex semantics, default is "TEXCOORD".sDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING: By default, Resourcing Binding Tier 2 is required for D3D12 support. However, an application can set this property to true to enable Tier 1 support, if (and only if) the application uses 8 or fewer storage resources across all shader stages. As of writing, this property is useful for targeting Intel Haswell and Broadwell GPUs; other hardware either supports Tier 2 Resource Binding or does not support D3D12 in any capacity. Defaults to false.sDL_PROP_GPU_DEVICE_CREATE_D3D12_ALLOW_FEWER_RESOURCE_SLOTS_BOOLEAN: Certain feature checks are only possible on Windows 11 by default. By setting this alongsidesDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBERand vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make those feature checks possible on older platforms. The version you provide must match the one given in the DLL.sDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRING: Certain feature checks are only possible on Windows 11 by default. By setting this alongsidesDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_PATH_STRINGand vendoring D3D12Core.dll from the D3D12 Agility SDK, you can make those feature checks possible on older platforms. The path you provide must be relative to the executable path of your app. Be sure not to put the DLL in the same directory as the exe; Microsoft strongly advises against this!sDL_PROP_GPU_DEVICE_CREATE_D3D12_AGILITY_SDK_VERSION_NUMBER
With the Vulkan backend:
: By default, Vulkan device enumeration includes drivers of all types, including software renderers (for example, the Lavapipe Mesa driver). This can be useful if your application requires SDL_GPU, but if you can provide your own fallback renderer (for example, an OpenGL renderer) this property can be set to true. Defaults to false.sDL_PROP_GPU_DEVICE_CREATE_VULKAN_REQUIRE_HARDWARE_ACCELERATION_BOOLEAN: a pointer to ansDL_PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTERSDL_GPUVulkanOptionsstructure to be processed during device creation. This allows configuring a variety of Vulkan-specific options such as increasing the API version and opting into extensions aside from the minimal set SDL requires.
With the Metal backend: - : By default, macOS support requires what Apple calls "MTLGPUFamilyMac2" hardware or newer. However, an application can set this property to true to enable support for "MTLGPUFamilyMac1" hardware, if (and only if) the application does not write to sRGB textures. (For history's sake: MacFamily1 also does not support indirect command buffers, MSAA depth resolve, and stencil resolve/feedback, but these are not exposed features in SDL_GPU.)sDL_PROP_GPU_DEVICE_CREATE_METAL_ALLOW_MACFAMILY1_BOOLEAN
- Returns
- a GPU context on success or NULL on failure; call
getErrorfor more information. - See also
getGPUShaderFormats,getGPUDeviceDriver,destroyGPUDevice,gpuSupportsProperties
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUDeviceWithProperties. The unsafe flavor iscreateGPUDeviceWithProperties. - C declaration
SDL_CreateGPUDeviceWithProperties, defined atSDL3/SDL_gpu.h 2373:45
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO () |
Destroys a GPU context previously returned by createGPUDevice.
- See also
createGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DestroyGPUDevice. The safe flavor isdestroyGPUDeviceSafe. - C declaration
SDL_DestroyGPUDevice, defined atSDL3/SDL_gpu.h 2435:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO () |
Destroys a GPU context previously returned by createGPUDevice.
- See also
createGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DestroyGPUDevice. The unsafe flavor isdestroyGPUDevice. - C declaration
SDL_DestroyGPUDevice, defined atSDL3/SDL_gpu.h 2435:34
Since: 3.2.0
getNumGPUDrivers :: IO Int32 Source #
Get the number of GPU drivers compiled into SDL.
- Returns
- the number of built in GPU drivers.
- See also
getGPUDriver
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetNumGPUDrivers. The safe flavor isgetNumGPUDriversSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumGPUDrivers, defined atSDL3/SDL_gpu.h 2446:33
Since: 3.2.0
getNumGPUDriversSafe :: IO Int32 Source #
Get the number of GPU drivers compiled into SDL.
- Returns
- the number of built in GPU drivers.
- See also
getGPUDriver
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetNumGPUDrivers. The unsafe flavor isgetNumGPUDrivers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetNumGPUDrivers, defined atSDL3/SDL_gpu.h 2446:33
Since: 3.2.0
Get the name of a built in GPU driver.
The GPU drivers are presented in the order in which they are normally checked during initialization.
The names of drivers are all simple, low-ASCII identifiers, like "vulkan", "metal" or "direct3d12". These never have Unicode characters, and are not meant to be proper names.
- Returns
- the name of the GPU driver with the given index.
- See also
getNumGPUDrivers
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetGPUDriver. The safe flavor isgetGPUDriverSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetGPUDriver, defined atSDL3/SDL_gpu.h 2465:42
Since: 3.2.0
Get the name of a built in GPU driver.
The GPU drivers are presented in the order in which they are normally checked during initialization.
The names of drivers are all simple, low-ASCII identifiers, like "vulkan", "metal" or "direct3d12". These never have Unicode characters, and are not meant to be proper names.
- Returns
- the name of the GPU driver with the given index.
- See also
getNumGPUDrivers
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetGPUDriver. The unsafe flavor isgetGPUDriver. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GetGPUDriver, defined atSDL3/SDL_gpu.h 2465:42
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO (PtrConst CChar) |
Returns the name of the backend used to create this GPU context.
- Returns
- the name of the device's driver, or NULL on error.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetGPUDeviceDriver. The safe flavor isgetGPUDeviceDriverSafe. - C declaration
SDL_GetGPUDeviceDriver, defined atSDL3/SDL_gpu.h 2475:42
Since: 3.2.0
getGPUDeviceDriverSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO (PtrConst CChar) |
Returns the name of the backend used to create this GPU context.
- Returns
- the name of the device's driver, or NULL on error.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetGPUDeviceDriver. The unsafe flavor isgetGPUDeviceDriver. - C declaration
SDL_GetGPUDeviceDriver, defined atSDL3/SDL_gpu.h 2475:42
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO SDL_GPUShaderFormat |
Returns the supported shader formats for this GPU context.
- Returns
- a bitflag indicating which shader formats the driver is able to consume.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetGPUShaderFormats. The safe flavor isgetGPUShaderFormatsSafe. - C declaration
SDL_GetGPUShaderFormats, defined atSDL3/SDL_gpu.h 2486:49
Since: 3.2.0
getGPUShaderFormatsSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO SDL_GPUShaderFormat |
Returns the supported shader formats for this GPU context.
- Returns
- a bitflag indicating which shader formats the driver is able to consume.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetGPUShaderFormats. The unsafe flavor isgetGPUShaderFormats. - C declaration
SDL_GetGPUShaderFormats, defined atSDL3/SDL_gpu.h 2486:49
Since: 3.2.0
getGPUDeviceProperties Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO SDL_PropertiesID |
Get the properties associated with a GPU device.
All properties are optional and may differ between GPU backends and SDL versions.
The following properties are provided by SDL:
: Contains the name of the underlying device as reported by the system driver. This string has no standardized format, is highly inconsistent between hardware devices and drivers, and is able to change at any time. Do not attempt to parse this string as it is bound to fail at some point in the future when system drivers are updated, new hardware devices are introduced, or when SDL adds new GPU backends or modifies existing ones.sDL_PROP_GPU_DEVICE_NAME_STRING
Strings that have been found in the wild include:
- GTX 970
- GeForce GTX 970
- NVIDIA GeForce GTX 970
- Microsoft Direct3D12 (NVIDIA GeForce GTX 970)
- NVIDIA Graphics Device
- GeForce GPU
- P106-100
- AMD 15D8:C9
- AMD Custom GPU 0405
- AMD Radeon (TM) Graphics
- ASUS Radeon RX 470 Series
- Intel(R) Arc(tm) A380 Graphics (DG2)
- Virtio-GPU Venus (NVIDIA TITAN V)
- SwiftShader Device (LLVM 16.0.0)
- llvmpipe (LLVM 15.0.4, 256 bits)
- Microsoft Basic Render Driver
- unknown device
The above list shows that the same device can have different formats, the vendor name may or may not appear in the string, the included vendor name may not be the vendor of the chipset on the device, some manufacturers include pseudo-legal marks while others don't, some devices may not use a marketing name in the string, the device string may be wrapped by the name of a translation interface, the device may be emulated in software, or the string may contain generic text that does not identify the device at all.
: Contains the self-reported name of the underlying system driver.sDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING
Strings that have been found in the wild include:
- Intel Corporation
- Intel open-source Mesa driver
- Qualcomm Technologies Inc. Adreno Vulkan Driver
- MoltenVK
- Mali-G715
- venus
: Contains the self-reported version of the underlying system driver. This is a relatively short version string in an unspecified format. If SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING is available then that property should be preferred over this one as it may contain additional information that is useful for identifying the exact driver version used.sDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING
Strings that have been found in the wild include:
- 53.0.0
- 0.405.2463
- 32.0.15.6614
: Contains the detailed version information of the underlying system driver as reported by the driver. This is an arbitrary string with no standardized format and it may contain newlines. This property should be preferred over SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING if it is available as it usually contains the same information but in a format that is easier to read.sDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING
Strings that have been found in the wild include:
- 101.6559
- 1.2.11
- Mesa 21.2.2 (LLVM 12.0.1)
- Mesa 22.2.0-devel (git-f226222 2022-04-14 impish-oibaf-ppa)
- v1.r53p0-00eac0.824c4f31403fb1fbf8ee1042422c2129
This string has also been observed to be a multiline string (which has a trailing newline):
Driver Build: 85da404, I46ff5fc46f, 1606794520
Date: 11/30/20
Compiler Version: EV031.31.04.01
Driver Branch: promo490_3_Google
- Returns
- a valid property ID on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetGPUDeviceProperties. The safe flavor isgetGPUDevicePropertiesSafe. - C declaration
SDL_GetGPUDeviceProperties, defined atSDL3/SDL_gpu.h 2590:46
Since: 3.4.0
getGPUDevicePropertiesSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO SDL_PropertiesID |
Get the properties associated with a GPU device.
All properties are optional and may differ between GPU backends and SDL versions.
The following properties are provided by SDL:
: Contains the name of the underlying device as reported by the system driver. This string has no standardized format, is highly inconsistent between hardware devices and drivers, and is able to change at any time. Do not attempt to parse this string as it is bound to fail at some point in the future when system drivers are updated, new hardware devices are introduced, or when SDL adds new GPU backends or modifies existing ones.sDL_PROP_GPU_DEVICE_NAME_STRING
Strings that have been found in the wild include:
- GTX 970
- GeForce GTX 970
- NVIDIA GeForce GTX 970
- Microsoft Direct3D12 (NVIDIA GeForce GTX 970)
- NVIDIA Graphics Device
- GeForce GPU
- P106-100
- AMD 15D8:C9
- AMD Custom GPU 0405
- AMD Radeon (TM) Graphics
- ASUS Radeon RX 470 Series
- Intel(R) Arc(tm) A380 Graphics (DG2)
- Virtio-GPU Venus (NVIDIA TITAN V)
- SwiftShader Device (LLVM 16.0.0)
- llvmpipe (LLVM 15.0.4, 256 bits)
- Microsoft Basic Render Driver
- unknown device
The above list shows that the same device can have different formats, the vendor name may or may not appear in the string, the included vendor name may not be the vendor of the chipset on the device, some manufacturers include pseudo-legal marks while others don't, some devices may not use a marketing name in the string, the device string may be wrapped by the name of a translation interface, the device may be emulated in software, or the string may contain generic text that does not identify the device at all.
: Contains the self-reported name of the underlying system driver.sDL_PROP_GPU_DEVICE_DRIVER_NAME_STRING
Strings that have been found in the wild include:
- Intel Corporation
- Intel open-source Mesa driver
- Qualcomm Technologies Inc. Adreno Vulkan Driver
- MoltenVK
- Mali-G715
- venus
: Contains the self-reported version of the underlying system driver. This is a relatively short version string in an unspecified format. If SDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING is available then that property should be preferred over this one as it may contain additional information that is useful for identifying the exact driver version used.sDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING
Strings that have been found in the wild include:
- 53.0.0
- 0.405.2463
- 32.0.15.6614
: Contains the detailed version information of the underlying system driver as reported by the driver. This is an arbitrary string with no standardized format and it may contain newlines. This property should be preferred over SDL_PROP_GPU_DEVICE_DRIVER_VERSION_STRING if it is available as it usually contains the same information but in a format that is easier to read.sDL_PROP_GPU_DEVICE_DRIVER_INFO_STRING
Strings that have been found in the wild include:
- 101.6559
- 1.2.11
- Mesa 21.2.2 (LLVM 12.0.1)
- Mesa 22.2.0-devel (git-f226222 2022-04-14 impish-oibaf-ppa)
- v1.r53p0-00eac0.824c4f31403fb1fbf8ee1042422c2129
This string has also been observed to be a multiline string (which has a trailing newline):
Driver Build: 85da404, I46ff5fc46f, 1606794520
Date: 11/30/20
Compiler Version: EV031.31.04.01
Driver Branch: promo490_3_Google
- Returns
- a valid property ID on success or 0 on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetGPUDeviceProperties. The unsafe flavor isgetGPUDeviceProperties. - C declaration
SDL_GetGPUDeviceProperties, defined atSDL3/SDL_gpu.h 2590:46
Since: 3.4.0
createGPUComputePipeline Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUComputePipelineCreateInfo |
|
| -> IO (Ptr SDL_GPUComputePipeline) |
Creates a pipeline object to be used in a compute workflow.
Shader resource bindings must be authored to follow a particular order depending on the shader format.
For SPIR-V shaders, use the following resource sets:
- 0: Sampled textures, followed by read-only storage textures, followed by read-only storage buffers
- 1: Read-write storage textures, followed by read-write storage buffers
- 2: Uniform buffers
For DXBC and DXIL shaders, use the following register order:
- (t[n], space0): Sampled textures, followed by read-only storage textures, followed by read-only storage buffers
- (u[n], space1): Read-write storage textures, followed by read-write storage buffers
- (b[n], space2): Uniform buffers
For MSL/metallib, use the following order:
- [[buffer]]: Uniform buffers, followed by read-only storage buffers, followed by read-write storage buffers
- [[texture]]: Sampled textures, followed by read-only storage textures, followed by read-write storage textures
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING
- Returns
- a compute pipeline object on success, or NULL on failure; call
getErrorfor more information. - See also
bindGPUComputePipeline,releaseGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUComputePipeline. The safe flavor iscreateGPUComputePipelineSafe. - C declaration
SDL_CreateGPUComputePipeline, defined atSDL3/SDL_gpu.h 2645:54
Since: 3.2.0
createGPUComputePipelineSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUComputePipelineCreateInfo |
|
| -> IO (Ptr SDL_GPUComputePipeline) |
Creates a pipeline object to be used in a compute workflow.
Shader resource bindings must be authored to follow a particular order depending on the shader format.
For SPIR-V shaders, use the following resource sets:
- 0: Sampled textures, followed by read-only storage textures, followed by read-only storage buffers
- 1: Read-write storage textures, followed by read-write storage buffers
- 2: Uniform buffers
For DXBC and DXIL shaders, use the following register order:
- (t[n], space0): Sampled textures, followed by read-only storage textures, followed by read-only storage buffers
- (u[n], space1): Read-write storage textures, followed by read-write storage buffers
- (b[n], space2): Uniform buffers
For MSL/metallib, use the following order:
- [[buffer]]: Uniform buffers, followed by read-only storage buffers, followed by read-write storage buffers
- [[texture]]: Sampled textures, followed by read-only storage textures, followed by read-write storage textures
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_COMPUTEPIPELINE_CREATE_NAME_STRING
- Returns
- a compute pipeline object on success, or NULL on failure; call
getErrorfor more information. - See also
bindGPUComputePipeline,releaseGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUComputePipeline. The unsafe flavor iscreateGPUComputePipeline. - C declaration
SDL_CreateGPUComputePipeline, defined atSDL3/SDL_gpu.h 2645:54
Since: 3.2.0
createGPUGraphicsPipeline Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUGraphicsPipelineCreateInfo |
|
| -> IO (Ptr SDL_GPUGraphicsPipeline) |
Creates a pipeline object to be used in a graphics workflow.
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING
- Returns
- a graphics pipeline object on success, or NULL on failure; call
getErrorfor more information. - See also
createGPUShader,bindGPUGraphicsPipeline,releaseGPUGraphicsPipeline
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUGraphicsPipeline. The safe flavor iscreateGPUGraphicsPipelineSafe. - C declaration
SDL_CreateGPUGraphicsPipeline, defined atSDL3/SDL_gpu.h 2672:55
Since: 3.2.0
createGPUGraphicsPipelineSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUGraphicsPipelineCreateInfo |
|
| -> IO (Ptr SDL_GPUGraphicsPipeline) |
Creates a pipeline object to be used in a graphics workflow.
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_GRAPHICSPIPELINE_CREATE_NAME_STRING
- Returns
- a graphics pipeline object on success, or NULL on failure; call
getErrorfor more information. - See also
createGPUShader,bindGPUGraphicsPipeline,releaseGPUGraphicsPipeline
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUGraphicsPipeline. The unsafe flavor iscreateGPUGraphicsPipeline. - C declaration
SDL_CreateGPUGraphicsPipeline, defined atSDL3/SDL_gpu.h 2672:55
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUSamplerCreateInfo |
|
| -> IO (Ptr SDL_GPUSampler) |
Creates a sampler object to be used when binding textures in a graphics workflow.
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING
- Returns
- a sampler object on success, or NULL on failure; call
getErrorfor more information. - See also
bindGPUVertexSamplers,bindGPUFragmentSamplers,releaseGPUSampler
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUSampler. The safe flavor iscreateGPUSamplerSafe. - C declaration
SDL_CreateGPUSampler, defined atSDL3/SDL_gpu.h 2699:46
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUSamplerCreateInfo |
|
| -> IO (Ptr SDL_GPUSampler) |
Creates a sampler object to be used when binding textures in a graphics workflow.
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_SAMPLER_CREATE_NAME_STRING
- Returns
- a sampler object on success, or NULL on failure; call
getErrorfor more information. - See also
bindGPUVertexSamplers,bindGPUFragmentSamplers,releaseGPUSampler
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUSampler. The unsafe flavor iscreateGPUSampler. - C declaration
SDL_CreateGPUSampler, defined atSDL3/SDL_gpu.h 2699:46
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUShaderCreateInfo |
|
| -> IO (Ptr SDL_GPUShader) |
Creates a shader to be used when creating a graphics pipeline.
Shader resource bindings must be authored to follow a particular order depending on the shader format.
For SPIR-V shaders, use the following resource sets:
For vertex shaders:
- 0: Sampled textures, followed by storage textures, followed by storage buffers
- 1: Uniform buffers
For fragment shaders:
- 2: Sampled textures, followed by storage textures, followed by storage buffers
- 3: Uniform buffers
For DXBC and DXIL shaders, use the following register order:
For vertex shaders:
- (t[n], space0): Sampled textures, followed by storage textures, followed by storage buffers
- (s[n], space0): Samplers with indices corresponding to the sampled textures
- (b[n], space1): Uniform buffers
For pixel shaders:
- (t[n], space2): Sampled textures, followed by storage textures, followed by storage buffers
- (s[n], space2): Samplers with indices corresponding to the sampled textures
- (b[n], space3): Uniform buffers
For MSL/metallib, use the following order:
- [[texture]]: Sampled textures, followed by storage textures
- [[sampler]]: Samplers with indices corresponding to the sampled textures
- [[buffer]]: Uniform buffers, followed by storage buffers. Vertex buffer 0 is bound at [[buffer(14)]], vertex buffer 1 at [[buffer(15)]], and so on. Rather than manually authoring vertex buffer indices, use the [[stage_in]] attribute which will automatically use the vertex input information from the
SDL_GPUGraphicsPipeline.
Shader semantics other than system-value semantics do not matter in D3D12 and for ease of use the SDL implementation assumes that non system-value semantics will all be TEXCOORD. If you are using HLSL as the shader source language, your vertex semantics should start at TEXCOORD0 and increment like so: TEXCOORD1, TEXCOORD2, etc. If you wish to change the semantic prefix to something other than TEXCOORD you can use SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING with .createGPUDeviceWithProperties
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_SHADER_CREATE_NAME_STRING
- Returns
- a shader object on success, or NULL on failure; call
getErrorfor more information. - See also
createGPUGraphicsPipeline,releaseGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUShader. The safe flavor iscreateGPUShaderSafe. - C declaration
SDL_CreateGPUShader, defined atSDL3/SDL_gpu.h 2778:45
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUShaderCreateInfo |
|
| -> IO (Ptr SDL_GPUShader) |
Creates a shader to be used when creating a graphics pipeline.
Shader resource bindings must be authored to follow a particular order depending on the shader format.
For SPIR-V shaders, use the following resource sets:
For vertex shaders:
- 0: Sampled textures, followed by storage textures, followed by storage buffers
- 1: Uniform buffers
For fragment shaders:
- 2: Sampled textures, followed by storage textures, followed by storage buffers
- 3: Uniform buffers
For DXBC and DXIL shaders, use the following register order:
For vertex shaders:
- (t[n], space0): Sampled textures, followed by storage textures, followed by storage buffers
- (s[n], space0): Samplers with indices corresponding to the sampled textures
- (b[n], space1): Uniform buffers
For pixel shaders:
- (t[n], space2): Sampled textures, followed by storage textures, followed by storage buffers
- (s[n], space2): Samplers with indices corresponding to the sampled textures
- (b[n], space3): Uniform buffers
For MSL/metallib, use the following order:
- [[texture]]: Sampled textures, followed by storage textures
- [[sampler]]: Samplers with indices corresponding to the sampled textures
- [[buffer]]: Uniform buffers, followed by storage buffers. Vertex buffer 0 is bound at [[buffer(14)]], vertex buffer 1 at [[buffer(15)]], and so on. Rather than manually authoring vertex buffer indices, use the [[stage_in]] attribute which will automatically use the vertex input information from the
SDL_GPUGraphicsPipeline.
Shader semantics other than system-value semantics do not matter in D3D12 and for ease of use the SDL implementation assumes that non system-value semantics will all be TEXCOORD. If you are using HLSL as the shader source language, your vertex semantics should start at TEXCOORD0 and increment like so: TEXCOORD1, TEXCOORD2, etc. If you wish to change the semantic prefix to something other than TEXCOORD you can use SDL_PROP_GPU_DEVICE_CREATE_D3D12_SEMANTIC_NAME_STRING with .createGPUDeviceWithProperties
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_SHADER_CREATE_NAME_STRING
- Returns
- a shader object on success, or NULL on failure; call
getErrorfor more information. - See also
createGPUGraphicsPipeline,releaseGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUShader. The unsafe flavor iscreateGPUShader. - C declaration
SDL_CreateGPUShader, defined atSDL3/SDL_gpu.h 2778:45
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUTextureCreateInfo |
|
| -> IO (Ptr SDL_GPUTexture) |
Creates a texture object to be used in graphics or compute workflows.
The contents of this texture are undefined until data is written to the texture, either via uploadToGPUTexture or by performing a render or compute pass with this texture as a target.
Note that certain combinations of usage flags are invalid. For example, a texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags.
If you request a sample count higher than the hardware supports, the implementation will automatically fall back to the highest available sample count.
There are optional properties that can be provided through SDL_GPUTextureCreateInfo 's props. These are the supported properties:
: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this red intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this green intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this blue intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this alpha intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a depth of this value. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a stencil of this Uint8 value. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER: a name that can be displayed in debugging tools.sDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING
- Returns
- a texture object on success, or NULL on failure; call
getErrorfor more information. - See also
uploadToGPUTexture,downloadFromGPUTexture,beginGPURenderPass,beginGPUComputePass,bindGPUVertexSamplers,bindGPUVertexStorageTextures,bindGPUFragmentSamplers,bindGPUFragmentStorageTextures,bindGPUComputeStorageTextures,blitGPUTexture,releaseGPUTexture,gpuTextureSupportsFormat
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUTexture. The safe flavor iscreateGPUTextureSafe. - C declaration
SDL_CreateGPUTexture, defined atSDL3/SDL_gpu.h 2842:46
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUTextureCreateInfo |
|
| -> IO (Ptr SDL_GPUTexture) |
Creates a texture object to be used in graphics or compute workflows.
The contents of this texture are undefined until data is written to the texture, either via uploadToGPUTexture or by performing a render or compute pass with this texture as a target.
Note that certain combinations of usage flags are invalid. For example, a texture cannot have both the SAMPLER and GRAPHICS_STORAGE_READ flags.
If you request a sample count higher than the hardware supports, the implementation will automatically fall back to the highest available sample count.
There are optional properties that can be provided through SDL_GPUTextureCreateInfo 's props. These are the supported properties:
: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this red intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_R_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this green intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_G_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this blue intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_B_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this alpha intensity. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_A_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a depth of this value. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_DEPTH_FLOAT: (Direct3D 12 only) if the texture usage is SDL_GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a stencil of this Uint8 value. Defaults to zero.sDL_PROP_GPU_TEXTURE_CREATE_D3D12_CLEAR_STENCIL_NUMBER: a name that can be displayed in debugging tools.sDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING
- Returns
- a texture object on success, or NULL on failure; call
getErrorfor more information. - See also
uploadToGPUTexture,downloadFromGPUTexture,beginGPURenderPass,beginGPUComputePass,bindGPUVertexSamplers,bindGPUVertexStorageTextures,bindGPUFragmentSamplers,bindGPUFragmentStorageTextures,bindGPUComputeStorageTextures,blitGPUTexture,releaseGPUTexture,gpuTextureSupportsFormat
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUTexture. The unsafe flavor iscreateGPUTexture. - C declaration
SDL_CreateGPUTexture, defined atSDL3/SDL_gpu.h 2842:46
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUBufferCreateInfo |
|
| -> IO (Ptr SDL_GPUBuffer) |
Creates a buffer object to be used in graphics or compute workflows.
The contents of this buffer are undefined until data is written to the buffer.
Note that certain combinations of usage flags are invalid. For example, a buffer cannot have both the VERTEX and INDEX flags.
If you use a STORAGE flag, the data in the buffer must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
For better understanding of underlying concepts and memory management with SDL GPU API, you may refer this blog post There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_BUFFER_CREATE_NAME_STRING
- Returns
- a buffer object on success, or NULL on failure; call
getErrorfor more information. - See also
uploadToGPUBuffer,downloadFromGPUBuffer,copyGPUBufferToBuffer,bindGPUVertexBuffers,bindGPUIndexBuffer,bindGPUVertexStorageBuffers,bindGPUFragmentStorageBuffers,drawGPUPrimitivesIndirect,drawGPUIndexedPrimitivesIndirect,bindGPUComputeStorageBuffers,dispatchGPUComputeIndirect,releaseGPUBuffer
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUBuffer. The safe flavor iscreateGPUBufferSafe. - C declaration
SDL_CreateGPUBuffer, defined atSDL3/SDL_gpu.h 2898:45
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUBufferCreateInfo |
|
| -> IO (Ptr SDL_GPUBuffer) |
Creates a buffer object to be used in graphics or compute workflows.
The contents of this buffer are undefined until data is written to the buffer.
Note that certain combinations of usage flags are invalid. For example, a buffer cannot have both the VERTEX and INDEX flags.
If you use a STORAGE flag, the data in the buffer must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
For better understanding of underlying concepts and memory management with SDL GPU API, you may refer this blog post There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_BUFFER_CREATE_NAME_STRING
- Returns
- a buffer object on success, or NULL on failure; call
getErrorfor more information. - See also
uploadToGPUBuffer,downloadFromGPUBuffer,copyGPUBufferToBuffer,bindGPUVertexBuffers,bindGPUIndexBuffer,bindGPUVertexStorageBuffers,bindGPUFragmentStorageBuffers,drawGPUPrimitivesIndirect,drawGPUIndexedPrimitivesIndirect,bindGPUComputeStorageBuffers,dispatchGPUComputeIndirect,releaseGPUBuffer
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUBuffer. The unsafe flavor iscreateGPUBuffer. - C declaration
SDL_CreateGPUBuffer, defined atSDL3/SDL_gpu.h 2898:45
Since: 3.2.0
createGPUTransferBuffer Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUTransferBufferCreateInfo |
|
| -> IO (Ptr SDL_GPUTransferBuffer) |
Creates a transfer buffer to be used when uploading to or downloading from graphics resources.
Download buffers can be particularly expensive to create, so it is good practice to reuse them if data will be downloaded regularly.
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING
- Returns
- a transfer buffer on success, or NULL on failure; call
getErrorfor more information. - See also
uploadToGPUBuffer,downloadFromGPUBuffer,uploadToGPUTexture,downloadFromGPUTexture,releaseGPUTransferBuffer
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CreateGPUTransferBuffer. The safe flavor iscreateGPUTransferBufferSafe. - C declaration
SDL_CreateGPUTransferBuffer, defined atSDL3/SDL_gpu.h 2931:53
Since: 3.2.0
createGPUTransferBufferSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> PtrConst SDL_GPUTransferBufferCreateInfo |
|
| -> IO (Ptr SDL_GPUTransferBuffer) |
Creates a transfer buffer to be used when uploading to or downloading from graphics resources.
Download buffers can be particularly expensive to create, so it is good practice to reuse them if data will be downloaded regularly.
There are optional properties that can be provided through props. These are the supported properties:
: a name that can be displayed in debugging tools.sDL_PROP_GPU_TRANSFERBUFFER_CREATE_NAME_STRING
- Returns
- a transfer buffer on success, or NULL on failure; call
getErrorfor more information. - See also
uploadToGPUBuffer,downloadFromGPUBuffer,uploadToGPUTexture,downloadFromGPUTexture,releaseGPUTransferBuffer
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CreateGPUTransferBuffer. The unsafe flavor iscreateGPUTransferBuffer. - C declaration
SDL_CreateGPUTransferBuffer, defined atSDL3/SDL_gpu.h 2931:53
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUBuffer |
|
| -> PtrConst CChar |
|
| -> IO () |
Sets an arbitrary string constant to label a buffer.
You should use SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING with createGPUBuffer instead of this function to avoid thread safety issues.
- Thread safety
- This function is not thread safe, you must make sure the buffer is not simultaneously used by any other thread.
- See also
createGPUBuffer
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUBufferName. The safe flavor issetGPUBufferNameSafe. - C declaration
SDL_SetGPUBufferName, defined atSDL3/SDL_gpu.h 2956:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUBuffer |
|
| -> PtrConst CChar |
|
| -> IO () |
Sets an arbitrary string constant to label a buffer.
You should use SDL_PROP_GPU_BUFFER_CREATE_NAME_STRING with createGPUBuffer instead of this function to avoid thread safety issues.
- Thread safety
- This function is not thread safe, you must make sure the buffer is not simultaneously used by any other thread.
- See also
createGPUBuffer
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUBufferName. The unsafe flavor issetGPUBufferName. - C declaration
SDL_SetGPUBufferName, defined atSDL3/SDL_gpu.h 2956:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTexture |
|
| -> PtrConst CChar |
|
| -> IO () |
Sets an arbitrary string constant to label a texture.
You should use SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING with createGPUTexture instead of this function to avoid thread safety issues.
- Thread safety
- This function is not thread safe, you must make sure the texture is not simultaneously used by any other thread.
- See also
createGPUTexture
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUTextureName. The safe flavor issetGPUTextureNameSafe. - C declaration
SDL_SetGPUTextureName, defined atSDL3/SDL_gpu.h 2979:34
Since: 3.2.0
setGPUTextureNameSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTexture |
|
| -> PtrConst CChar |
|
| -> IO () |
Sets an arbitrary string constant to label a texture.
You should use SDL_PROP_GPU_TEXTURE_CREATE_NAME_STRING with createGPUTexture instead of this function to avoid thread safety issues.
- Thread safety
- This function is not thread safe, you must make sure the texture is not simultaneously used by any other thread.
- See also
createGPUTexture
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUTextureName. The unsafe flavor issetGPUTextureName. - C declaration
SDL_SetGPUTextureName, defined atSDL3/SDL_gpu.h 2979:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst CChar |
|
| -> IO () |
Inserts an arbitrary string label into the command buffer callstream.
Useful for debugging.
On Direct3D 12, using insertGPUDebugLabel requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable. See here for instructions on how to obtain it.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_InsertGPUDebugLabel. The safe flavor isinsertGPUDebugLabelSafe. - C declaration
SDL_InsertGPUDebugLabel, defined atSDL3/SDL_gpu.h 3000:34
Since: 3.2.0
insertGPUDebugLabelSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst CChar |
|
| -> IO () |
Inserts an arbitrary string label into the command buffer callstream.
Useful for debugging.
On Direct3D 12, using insertGPUDebugLabel requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable. See here for instructions on how to obtain it.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_InsertGPUDebugLabel. The unsafe flavor isinsertGPUDebugLabel. - C declaration
SDL_InsertGPUDebugLabel, defined atSDL3/SDL_gpu.h 3000:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst CChar |
|
| -> IO () |
Begins a debug group with an arbitrary name.
Used for denoting groups of calls when viewing the command buffer callstream in a graphics debugging tool.
Each call to pushGPUDebugGroup must have a corresponding call to popGPUDebugGroup.
On Direct3D 12, using pushGPUDebugGroup requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable. See here for instructions on how to obtain it.
On some backends (e.g. Metal), pushing a debug group during a render/blit/compute pass will create a group that is scoped to the native pass rather than the command buffer. For best results, if you push a debug group during a pass, always pop it in the same pass.
- See also
popGPUDebugGroup
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_PushGPUDebugGroup. The safe flavor ispushGPUDebugGroupSafe. - C declaration
SDL_PushGPUDebugGroup, defined atSDL3/SDL_gpu.h 3030:34
Since: 3.2.0
pushGPUDebugGroupSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst CChar |
|
| -> IO () |
Begins a debug group with an arbitrary name.
Used for denoting groups of calls when viewing the command buffer callstream in a graphics debugging tool.
Each call to pushGPUDebugGroup must have a corresponding call to popGPUDebugGroup.
On Direct3D 12, using pushGPUDebugGroup requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable. See here for instructions on how to obtain it.
On some backends (e.g. Metal), pushing a debug group during a render/blit/compute pass will create a group that is scoped to the native pass rather than the command buffer. For best results, if you push a debug group during a pass, always pop it in the same pass.
- See also
popGPUDebugGroup
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_PushGPUDebugGroup. The unsafe flavor ispushGPUDebugGroup. - C declaration
SDL_PushGPUDebugGroup, defined atSDL3/SDL_gpu.h 3030:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO () |
Ends the most-recently pushed debug group.
On Direct3D 12, using popGPUDebugGroup requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable. See here for instructions on how to obtain it.
- See also
pushGPUDebugGroup
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_PopGPUDebugGroup. The safe flavor ispopGPUDebugGroupSafe. - C declaration
SDL_PopGPUDebugGroup, defined atSDL3/SDL_gpu.h 3048:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO () |
Ends the most-recently pushed debug group.
On Direct3D 12, using popGPUDebugGroup requires WinPixEventRuntime.dll to be in your PATH or in the same directory as your executable. See here for instructions on how to obtain it.
- See also
pushGPUDebugGroup
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_PopGPUDebugGroup. The unsafe flavor ispopGPUDebugGroup. - C declaration
SDL_PopGPUDebugGroup, defined atSDL3/SDL_gpu.h 3048:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTexture |
|
| -> IO () |
Frees the given texture as soon as it is safe to do so.
You must not reference the texture after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUTexture. The safe flavor isreleaseGPUTextureSafe. - C declaration
SDL_ReleaseGPUTexture, defined atSDL3/SDL_gpu.h 3063:34
Since: 3.2.0
releaseGPUTextureSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTexture |
|
| -> IO () |
Frees the given texture as soon as it is safe to do so.
You must not reference the texture after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUTexture. The unsafe flavor isreleaseGPUTexture. - C declaration
SDL_ReleaseGPUTexture, defined atSDL3/SDL_gpu.h 3063:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUSampler |
|
| -> IO () |
Frees the given sampler as soon as it is safe to do so.
You must not reference the sampler after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUSampler. The safe flavor isreleaseGPUSamplerSafe. - C declaration
SDL_ReleaseGPUSampler, defined atSDL3/SDL_gpu.h 3077:34
Since: 3.2.0
releaseGPUSamplerSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUSampler |
|
| -> IO () |
Frees the given sampler as soon as it is safe to do so.
You must not reference the sampler after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUSampler. The unsafe flavor isreleaseGPUSampler. - C declaration
SDL_ReleaseGPUSampler, defined atSDL3/SDL_gpu.h 3077:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUBuffer |
|
| -> IO () |
Frees the given buffer as soon as it is safe to do so.
You must not reference the buffer after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUBuffer. The safe flavor isreleaseGPUBufferSafe. - C declaration
SDL_ReleaseGPUBuffer, defined atSDL3/SDL_gpu.h 3091:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUBuffer |
|
| -> IO () |
Frees the given buffer as soon as it is safe to do so.
You must not reference the buffer after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUBuffer. The unsafe flavor isreleaseGPUBuffer. - C declaration
SDL_ReleaseGPUBuffer, defined atSDL3/SDL_gpu.h 3091:34
Since: 3.2.0
releaseGPUTransferBuffer Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTransferBuffer |
|
| -> IO () |
Frees the given transfer buffer as soon as it is safe to do so.
You must not reference the transfer buffer after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUTransferBuffer. The safe flavor isreleaseGPUTransferBufferSafe. - C declaration
SDL_ReleaseGPUTransferBuffer, defined atSDL3/SDL_gpu.h 3105:34
Since: 3.2.0
releaseGPUTransferBufferSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTransferBuffer |
|
| -> IO () |
Frees the given transfer buffer as soon as it is safe to do so.
You must not reference the transfer buffer after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUTransferBuffer. The unsafe flavor isreleaseGPUTransferBuffer. - C declaration
SDL_ReleaseGPUTransferBuffer, defined atSDL3/SDL_gpu.h 3105:34
Since: 3.2.0
releaseGPUComputePipeline Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUComputePipeline |
|
| -> IO () |
Frees the given compute pipeline as soon as it is safe to do so.
You must not reference the compute pipeline after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUComputePipeline. The safe flavor isreleaseGPUComputePipelineSafe. - C declaration
SDL_ReleaseGPUComputePipeline, defined atSDL3/SDL_gpu.h 3119:34
Since: 3.2.0
releaseGPUComputePipelineSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUComputePipeline |
|
| -> IO () |
Frees the given compute pipeline as soon as it is safe to do so.
You must not reference the compute pipeline after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUComputePipeline. The unsafe flavor isreleaseGPUComputePipeline. - C declaration
SDL_ReleaseGPUComputePipeline, defined atSDL3/SDL_gpu.h 3119:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUShader |
|
| -> IO () |
Frees the given shader as soon as it is safe to do so.
You must not reference the shader after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUShader. The safe flavor isreleaseGPUShaderSafe. - C declaration
SDL_ReleaseGPUShader, defined atSDL3/SDL_gpu.h 3133:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUShader |
|
| -> IO () |
Frees the given shader as soon as it is safe to do so.
You must not reference the shader after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUShader. The unsafe flavor isreleaseGPUShader. - C declaration
SDL_ReleaseGPUShader, defined atSDL3/SDL_gpu.h 3133:34
Since: 3.2.0
releaseGPUGraphicsPipeline Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUGraphicsPipeline |
|
| -> IO () |
Frees the given graphics pipeline as soon as it is safe to do so.
You must not reference the graphics pipeline after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUGraphicsPipeline. The safe flavor isreleaseGPUGraphicsPipelineSafe. - C declaration
SDL_ReleaseGPUGraphicsPipeline, defined atSDL3/SDL_gpu.h 3147:34
Since: 3.2.0
releaseGPUGraphicsPipelineSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUGraphicsPipeline |
|
| -> IO () |
Frees the given graphics pipeline as soon as it is safe to do so.
You must not reference the graphics pipeline after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUGraphicsPipeline. The unsafe flavor isreleaseGPUGraphicsPipeline. - C declaration
SDL_ReleaseGPUGraphicsPipeline, defined atSDL3/SDL_gpu.h 3147:34
Since: 3.2.0
acquireGPUCommandBuffer Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO (Ptr SDL_GPUCommandBuffer) |
Acquire a command buffer.
This command buffer is managed by the implementation and should not be freed by the user. The command buffer may only be used on the thread it was acquired on. The command buffer should be submitted on the thread it was acquired on.
It is valid to acquire multiple command buffers on the same thread at once. In fact a common design pattern is to acquire two command buffers per frame where one is dedicated to render and compute passes and the other is dedicated to copy passes and other preparatory work such as generating mipmaps. Interleaving commands between the two command buffers reduces the total amount of passes overall which improves rendering performance.
- Returns
- a command buffer, or NULL on failure; call
getErrorfor more information. - See also
submitGPUCommandBuffer,submitGPUCommandBufferAndAcquireFence
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_AcquireGPUCommandBuffer. The safe flavor isacquireGPUCommandBufferSafe. - C declaration
SDL_AcquireGPUCommandBuffer, defined atSDL3/SDL_gpu.h 3175:52
Since: 3.2.0
acquireGPUCommandBufferSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO (Ptr SDL_GPUCommandBuffer) |
Acquire a command buffer.
This command buffer is managed by the implementation and should not be freed by the user. The command buffer may only be used on the thread it was acquired on. The command buffer should be submitted on the thread it was acquired on.
It is valid to acquire multiple command buffers on the same thread at once. In fact a common design pattern is to acquire two command buffers per frame where one is dedicated to render and compute passes and the other is dedicated to copy passes and other preparatory work such as generating mipmaps. Interleaving commands between the two command buffers reduces the total amount of passes overall which improves rendering performance.
- Returns
- a command buffer, or NULL on failure; call
getErrorfor more information. - See also
submitGPUCommandBuffer,submitGPUCommandBufferAndAcquireFence
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_AcquireGPUCommandBuffer. The unsafe flavor isacquireGPUCommandBuffer. - C declaration
SDL_AcquireGPUCommandBuffer, defined atSDL3/SDL_gpu.h 3175:52
Since: 3.2.0
pushGPUVertexUniformData Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Word32 |
|
| -> PtrConst Void |
|
| -> Word32 |
|
| -> IO () |
Pushes data to a vertex uniform slot on the command buffer.
Subsequent draw calls in this command buffer will use this uniform data.
The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
For detailed information about accessing uniform data from a shader, please refer to createGPUShader.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_PushGPUVertexUniformData. The safe flavor ispushGPUVertexUniformDataSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_PushGPUVertexUniformData, defined atSDL3/SDL_gpu.h 3199:34
Since: 3.2.0
pushGPUVertexUniformDataSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Word32 |
|
| -> PtrConst Void |
|
| -> Word32 |
|
| -> IO () |
Pushes data to a vertex uniform slot on the command buffer.
Subsequent draw calls in this command buffer will use this uniform data.
The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
For detailed information about accessing uniform data from a shader, please refer to createGPUShader.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_PushGPUVertexUniformData. The unsafe flavor ispushGPUVertexUniformData. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_PushGPUVertexUniformData, defined atSDL3/SDL_gpu.h 3199:34
Since: 3.2.0
pushGPUFragmentUniformData Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Word32 |
|
| -> PtrConst Void |
|
| -> Word32 |
|
| -> IO () |
Pushes data to a fragment uniform slot on the command buffer.
Subsequent draw calls in this command buffer will use this uniform data.
The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_PushGPUFragmentUniformData. The safe flavor ispushGPUFragmentUniformDataSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_PushGPUFragmentUniformData, defined atSDL3/SDL_gpu.h 3221:34
Since: 3.2.0
pushGPUFragmentUniformDataSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Word32 |
|
| -> PtrConst Void |
|
| -> Word32 |
|
| -> IO () |
Pushes data to a fragment uniform slot on the command buffer.
Subsequent draw calls in this command buffer will use this uniform data.
The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_PushGPUFragmentUniformData. The unsafe flavor ispushGPUFragmentUniformData. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_PushGPUFragmentUniformData, defined atSDL3/SDL_gpu.h 3221:34
Since: 3.2.0
pushGPUComputeUniformData Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Word32 |
|
| -> PtrConst Void |
|
| -> Word32 |
|
| -> IO () |
Pushes data to a uniform slot on the command buffer.
Subsequent draw calls in this command buffer will use this uniform data.
The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_PushGPUComputeUniformData. The safe flavor ispushGPUComputeUniformDataSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_PushGPUComputeUniformData, defined atSDL3/SDL_gpu.h 3243:34
Since: 3.2.0
pushGPUComputeUniformDataSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Word32 |
|
| -> PtrConst Void |
|
| -> Word32 |
|
| -> IO () |
Pushes data to a uniform slot on the command buffer.
Subsequent draw calls in this command buffer will use this uniform data.
The data being pushed must respect std140 layout conventions. In practical terms this means you must ensure that vec3 and vec4 fields are 16-byte aligned.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_PushGPUComputeUniformData. The unsafe flavor ispushGPUComputeUniformData. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_PushGPUComputeUniformData, defined atSDL3/SDL_gpu.h 3243:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst SDL_GPUColorTargetInfo |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUDepthStencilTargetInfo |
|
| -> IO (Ptr SDL_GPURenderPass) |
Begins a render pass on a command buffer.
A render pass consists of a set of texture subresources (or depth slices in the 3D texture case) which will be rendered to during the render pass, along with corresponding clear values and load/store operations. All operations related to graphics pipelines must take place inside of a render pass. A default viewport and scissor state are automatically set when this is called. You cannot begin another render pass, or begin a compute pass or copy pass until you have ended the render pass.
Using SDL_GPU_LOADOP_LOAD before any contents have been written to the texture subresource will result in undefined behavior. SDL_GPU_LOADOP_CLEAR will set the contents of the texture subresource to a single value before any rendering is performed. It's fine to do an empty render pass using SDL_GPU_STOREOP_STORE to clear a texture, but in general it's better to think of clearing not as an independent operation but as something that's done as the beginning of a render pass.
- Returns
- a render pass handle.
- See also
endGPURenderPass
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BeginGPURenderPass. The safe flavor isbeginGPURenderPassSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BeginGPURenderPass, defined atSDL3/SDL_gpu.h 3284:49
Since: 3.2.0
beginGPURenderPassSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst SDL_GPUColorTargetInfo |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUDepthStencilTargetInfo |
|
| -> IO (Ptr SDL_GPURenderPass) |
Begins a render pass on a command buffer.
A render pass consists of a set of texture subresources (or depth slices in the 3D texture case) which will be rendered to during the render pass, along with corresponding clear values and load/store operations. All operations related to graphics pipelines must take place inside of a render pass. A default viewport and scissor state are automatically set when this is called. You cannot begin another render pass, or begin a compute pass or copy pass until you have ended the render pass.
Using SDL_GPU_LOADOP_LOAD before any contents have been written to the texture subresource will result in undefined behavior. SDL_GPU_LOADOP_CLEAR will set the contents of the texture subresource to a single value before any rendering is performed. It's fine to do an empty render pass using SDL_GPU_STOREOP_STORE to clear a texture, but in general it's better to think of clearing not as an independent operation but as something that's done as the beginning of a render pass.
- Returns
- a render pass handle.
- See also
endGPURenderPass
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BeginGPURenderPass. The unsafe flavor isbeginGPURenderPass. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BeginGPURenderPass, defined atSDL3/SDL_gpu.h 3284:49
Since: 3.2.0
bindGPUGraphicsPipeline Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Ptr SDL_GPUGraphicsPipeline |
|
| -> IO () |
Binds a graphics pipeline on a render pass to be used in rendering.
A graphics pipeline must be bound before making any draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUGraphicsPipeline. The safe flavor isbindGPUGraphicsPipelineSafe. - C declaration
SDL_BindGPUGraphicsPipeline, defined atSDL3/SDL_gpu.h 3300:34
Since: 3.2.0
bindGPUGraphicsPipelineSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Ptr SDL_GPUGraphicsPipeline |
|
| -> IO () |
Binds a graphics pipeline on a render pass to be used in rendering.
A graphics pipeline must be bound before making any draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUGraphicsPipeline. The unsafe flavor isbindGPUGraphicsPipeline. - C declaration
SDL_BindGPUGraphicsPipeline, defined atSDL3/SDL_gpu.h 3300:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> PtrConst SDL_GPUViewport |
|
| -> IO () |
Sets the current viewport state on a command buffer.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUViewport. The safe flavor issetGPUViewportSafe. - C declaration
SDL_SetGPUViewport, defined atSDL3/SDL_gpu.h 3312:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> PtrConst SDL_GPUViewport |
|
| -> IO () |
Sets the current viewport state on a command buffer.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUViewport. The unsafe flavor issetGPUViewport. - C declaration
SDL_SetGPUViewport, defined atSDL3/SDL_gpu.h 3312:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> PtrConst SDL_Rect |
|
| -> IO () |
Sets the current scissor state on a command buffer.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUScissor. The safe flavor issetGPUScissorSafe. - C declaration
SDL_SetGPUScissor, defined atSDL3/SDL_gpu.h 3324:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> PtrConst SDL_Rect |
|
| -> IO () |
Sets the current scissor state on a command buffer.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUScissor. The unsafe flavor issetGPUScissor. - C declaration
SDL_SetGPUScissor, defined atSDL3/SDL_gpu.h 3324:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> SDL_FColor |
|
| -> IO () |
Sets the current blend constants on a command buffer.
- See also
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR,SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUBlendConstants. The safe flavor issetGPUBlendConstantsSafe. - C declaration
SDL_SetGPUBlendConstants, defined atSDL3/SDL_gpu.h 3339:34
Since: 3.2.0
setGPUBlendConstantsSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> SDL_FColor |
|
| -> IO () |
Sets the current blend constants on a command buffer.
- See also
SDL_GPU_BLENDFACTOR_CONSTANT_COLOR,SDL_GPU_BLENDFACTOR_ONE_MINUS_CONSTANT_COLOR
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUBlendConstants. The unsafe flavor issetGPUBlendConstants. - C declaration
SDL_SetGPUBlendConstants, defined atSDL3/SDL_gpu.h 3339:34
Since: 3.2.0
setGPUStencilReference Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word8 |
|
| -> IO () |
Sets the current stencil reference value on a command buffer.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUStencilReference. The safe flavor issetGPUStencilReferenceSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetGPUStencilReference, defined atSDL3/SDL_gpu.h 3351:34
Since: 3.2.0
setGPUStencilReferenceSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word8 |
|
| -> IO () |
Sets the current stencil reference value on a command buffer.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUStencilReference. The unsafe flavor issetGPUStencilReference. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetGPUStencilReference, defined atSDL3/SDL_gpu.h 3351:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUBufferBinding |
|
| -> Word32 |
|
| -> IO () |
Binds vertex buffers on a command buffer for use with subsequent draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUVertexBuffers. The safe flavor isbindGPUVertexBuffersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexBuffers, defined atSDL3/SDL_gpu.h 3367:34
Since: 3.2.0
bindGPUVertexBuffersSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUBufferBinding |
|
| -> Word32 |
|
| -> IO () |
Binds vertex buffers on a command buffer for use with subsequent draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUVertexBuffers. The unsafe flavor isbindGPUVertexBuffers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexBuffers, defined atSDL3/SDL_gpu.h 3367:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> PtrConst SDL_GPUBufferBinding |
|
| -> SDL_GPUIndexElementSize |
|
| -> IO () |
Binds an index buffer on a command buffer for use with subsequent draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUIndexBuffer. The safe flavor isbindGPUIndexBufferSafe. - C declaration
SDL_BindGPUIndexBuffer, defined atSDL3/SDL_gpu.h 3384:34
Since: 3.2.0
bindGPUIndexBufferSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> PtrConst SDL_GPUBufferBinding |
|
| -> SDL_GPUIndexElementSize |
|
| -> IO () |
Binds an index buffer on a command buffer for use with subsequent draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUIndexBuffer. The unsafe flavor isbindGPUIndexBuffer. - C declaration
SDL_BindGPUIndexBuffer, defined atSDL3/SDL_gpu.h 3384:34
Since: 3.2.0
bindGPUVertexSamplers Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUTextureSamplerBinding |
|
| -> Word32 |
|
| -> IO () |
Binds texture-sampler pairs for use on the vertex shader.
The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). Multisample textures are not allowed.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUVertexSamplers. The safe flavor isbindGPUVertexSamplersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexSamplers, defined atSDL3/SDL_gpu.h 3411:34
Since: 3.2.0
bindGPUVertexSamplersSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUTextureSamplerBinding |
|
| -> Word32 |
|
| -> IO () |
Binds texture-sampler pairs for use on the vertex shader.
The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). Multisample textures are not allowed.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUVertexSamplers. The unsafe flavor isbindGPUVertexSamplers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexSamplers, defined atSDL3/SDL_gpu.h 3411:34
Since: 3.2.0
bindGPUVertexStorageTextures Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUTexture) |
|
| -> Word32 |
|
| -> IO () |
Binds storage textures for use on the vertex shader.
These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
The textures being bound must have a matching type declared in the shader (2D, 3D, 2DMS, etc.)
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUVertexStorageTextures. The safe flavor isbindGPUVertexStorageTexturesSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexStorageTextures, defined atSDL3/SDL_gpu.h 3438:34
Since: 3.2.0
bindGPUVertexStorageTexturesSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUTexture) |
|
| -> Word32 |
|
| -> IO () |
Binds storage textures for use on the vertex shader.
These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
The textures being bound must have a matching type declared in the shader (2D, 3D, 2DMS, etc.)
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUVertexStorageTextures. The unsafe flavor isbindGPUVertexStorageTextures. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexStorageTextures, defined atSDL3/SDL_gpu.h 3438:34
Since: 3.2.0
bindGPUVertexStorageBuffers Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUBuffer) |
|
| -> Word32 |
|
| -> IO () |
Binds storage buffers for use on the vertex shader.
These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUVertexStorageBuffers. The safe flavor isbindGPUVertexStorageBuffersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexStorageBuffers, defined atSDL3/SDL_gpu.h 3462:34
Since: 3.2.0
bindGPUVertexStorageBuffersSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUBuffer) |
|
| -> Word32 |
|
| -> IO () |
Binds storage buffers for use on the vertex shader.
These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUVertexStorageBuffers. The unsafe flavor isbindGPUVertexStorageBuffers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUVertexStorageBuffers, defined atSDL3/SDL_gpu.h 3462:34
Since: 3.2.0
bindGPUFragmentSamplers Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUTextureSamplerBinding |
|
| -> Word32 |
|
| -> IO () |
Binds texture-sampler pairs for use on the fragment shader.
The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). Multisample textures are not allowed.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUFragmentSamplers. The safe flavor isbindGPUFragmentSamplersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUFragmentSamplers, defined atSDL3/SDL_gpu.h 3490:34
Since: 3.2.0
bindGPUFragmentSamplersSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUTextureSamplerBinding |
|
| -> Word32 |
|
| -> IO () |
Binds texture-sampler pairs for use on the fragment shader.
The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). Multisample textures are not allowed.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUFragmentSamplers. The unsafe flavor isbindGPUFragmentSamplers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUFragmentSamplers, defined atSDL3/SDL_gpu.h 3490:34
Since: 3.2.0
bindGPUFragmentStorageTextures Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUTexture) |
|
| -> Word32 |
|
| -> IO () |
Binds storage textures for use on the fragment shader.
These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
The textures being bound must have a matching type declared in the shader (2D, 3D, 2DMS, etc.)
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUFragmentStorageTextures. The safe flavor isbindGPUFragmentStorageTexturesSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUFragmentStorageTextures, defined atSDL3/SDL_gpu.h 3517:34
Since: 3.2.0
bindGPUFragmentStorageTexturesSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUTexture) |
|
| -> Word32 |
|
| -> IO () |
Binds storage textures for use on the fragment shader.
These textures must have been created with SDL_GPU_TEXTUREUSAGE_GRAPHICS_STORAGE_READ.
The textures being bound must have a matching type declared in the shader (2D, 3D, 2DMS, etc.)
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUFragmentStorageTextures. The unsafe flavor isbindGPUFragmentStorageTextures. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUFragmentStorageTextures, defined atSDL3/SDL_gpu.h 3517:34
Since: 3.2.0
bindGPUFragmentStorageBuffers Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUBuffer) |
|
| -> Word32 |
|
| -> IO () |
Binds storage buffers for use on the fragment shader.
These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUFragmentStorageBuffers. The safe flavor isbindGPUFragmentStorageBuffersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUFragmentStorageBuffers, defined atSDL3/SDL_gpu.h 3541:34
Since: 3.2.0
bindGPUFragmentStorageBuffersSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUBuffer) |
|
| -> Word32 |
|
| -> IO () |
Binds storage buffers for use on the fragment shader.
These buffers must have been created with SDL_GPU_BUFFERUSAGE_GRAPHICS_STORAGE_READ.
Be sure your shader is set up according to the requirements documented in .createGPUShader
- See also
createGPUShader
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUFragmentStorageBuffers. The unsafe flavor isbindGPUFragmentStorageBuffers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUFragmentStorageBuffers, defined atSDL3/SDL_gpu.h 3541:34
Since: 3.2.0
drawGPUIndexedPrimitives Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Int32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state with an index buffer and instancing enabled.
You must not call this function before binding a graphics pipeline.
Note that the first_vertex and first_instance parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID); GPU APIs and shader languages do not define these built-in variables consistently, so if your shader depends on them, the only way to keep behavior consistent and portable is to always pass 0 for the correlating parameter in the draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DrawGPUIndexedPrimitives. The safe flavor isdrawGPUIndexedPrimitivesSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUIndexedPrimitives, defined atSDL3/SDL_gpu.h 3572:34
Since: 3.2.0
drawGPUIndexedPrimitivesSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Int32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state with an index buffer and instancing enabled.
You must not call this function before binding a graphics pipeline.
Note that the first_vertex and first_instance parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID); GPU APIs and shader languages do not define these built-in variables consistently, so if your shader depends on them, the only way to keep behavior consistent and portable is to always pass 0 for the correlating parameter in the draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DrawGPUIndexedPrimitives. The unsafe flavor isdrawGPUIndexedPrimitives. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUIndexedPrimitives, defined atSDL3/SDL_gpu.h 3572:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state.
You must not call this function before binding a graphics pipeline.
Note that the first_vertex and first_instance parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID); GPU APIs and shader languages do not define these built-in variables consistently, so if your shader depends on them, the only way to keep behavior consistent and portable is to always pass 0 for the correlating parameter in the draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DrawGPUPrimitives. The safe flavor isdrawGPUPrimitivesSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUPrimitives, defined atSDL3/SDL_gpu.h 3600:34
Since: 3.2.0
drawGPUPrimitivesSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state.
You must not call this function before binding a graphics pipeline.
Note that the first_vertex and first_instance parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID); GPU APIs and shader languages do not define these built-in variables consistently, so if your shader depends on them, the only way to keep behavior consistent and portable is to always pass 0 for the correlating parameter in the draw calls.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DrawGPUPrimitives. The unsafe flavor isdrawGPUPrimitives. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUPrimitives, defined atSDL3/SDL_gpu.h 3600:34
Since: 3.2.0
drawGPUPrimitivesIndirect Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Ptr SDL_GPUBuffer |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state and with draw parameters set from a buffer.
The buffer must consist of tightly-packed draw parameter sets that each match the layout of SDL_GPUIndirectDrawCommand. You must not call this function before binding a graphics pipeline.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DrawGPUPrimitivesIndirect. The safe flavor isdrawGPUPrimitivesIndirectSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUPrimitivesIndirect, defined atSDL3/SDL_gpu.h 3623:34
Since: 3.2.0
drawGPUPrimitivesIndirectSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Ptr SDL_GPUBuffer |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state and with draw parameters set from a buffer.
The buffer must consist of tightly-packed draw parameter sets that each match the layout of SDL_GPUIndirectDrawCommand. You must not call this function before binding a graphics pipeline.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DrawGPUPrimitivesIndirect. The unsafe flavor isdrawGPUPrimitivesIndirect. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUPrimitivesIndirect, defined atSDL3/SDL_gpu.h 3623:34
Since: 3.2.0
drawGPUIndexedPrimitivesIndirect Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Ptr SDL_GPUBuffer |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state with an index buffer enabled and with draw parameters set from a buffer.
The buffer must consist of tightly-packed draw parameter sets that each match the layout of SDL_GPUIndexedIndirectDrawCommand. You must not call this function before binding a graphics pipeline.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DrawGPUIndexedPrimitivesIndirect. The safe flavor isdrawGPUIndexedPrimitivesIndirectSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUIndexedPrimitivesIndirect, defined atSDL3/SDL_gpu.h 3645:34
Since: 3.2.0
drawGPUIndexedPrimitivesIndirectSafe Source #
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> Ptr SDL_GPUBuffer |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Draws data using bound graphics state with an index buffer enabled and with draw parameters set from a buffer.
The buffer must consist of tightly-packed draw parameter sets that each match the layout of SDL_GPUIndexedIndirectDrawCommand. You must not call this function before binding a graphics pipeline.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DrawGPUIndexedPrimitivesIndirect. The unsafe flavor isdrawGPUIndexedPrimitivesIndirect. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DrawGPUIndexedPrimitivesIndirect, defined atSDL3/SDL_gpu.h 3645:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> IO () |
Ends the given render pass.
All bound graphics state on the render pass command buffer is unset. The render pass handle is now invalid.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_EndGPURenderPass. The safe flavor isendGPURenderPassSafe. - C declaration
SDL_EndGPURenderPass, defined atSDL3/SDL_gpu.h 3661:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPURenderPass |
|
| -> IO () |
Ends the given render pass.
All bound graphics state on the render pass command buffer is unset. The render pass handle is now invalid.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_EndGPURenderPass. The unsafe flavor isendGPURenderPass. - C declaration
SDL_EndGPURenderPass, defined atSDL3/SDL_gpu.h 3661:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst SDL_GPUStorageTextureReadWriteBinding |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUStorageBufferReadWriteBinding |
|
| -> Word32 |
|
| -> IO (Ptr SDL_GPUComputePass) |
Begins a compute pass on a command buffer.
A compute pass is defined by a set of texture subresources and buffers that may be written to by compute pipelines. These textures and buffers must have been created with the COMPUTE_STORAGE_WRITE bit or the COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE bit. If you do not create a texture with COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE, you must not read from the texture in the compute pass. All operations related to compute pipelines must take place inside of a compute pass. You must not begin another compute pass, or a render pass or copy pass before ending the compute pass.
A VERY IMPORTANT NOTE - Reads and writes in compute passes are NOT implicitly synchronized. This means you may cause data races by both reading and writing a resource region in a compute pass, or by writing multiple times to a resource region. If your compute work depends on reading the completed output from a previous dispatch, you MUST end the current compute pass and begin a new one before you can safely access the data. Otherwise you will receive unexpected results. Reading and writing a texture in the same compute pass is only supported by specific texture formats. Make sure you check the format support!
- Returns
- a compute pass handle.
- See also
endGPUComputePass
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BeginGPUComputePass. The safe flavor isbeginGPUComputePassSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BeginGPUComputePass, defined atSDL3/SDL_gpu.h 3703:50
Since: 3.2.0
beginGPUComputePassSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst SDL_GPUStorageTextureReadWriteBinding |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUStorageBufferReadWriteBinding |
|
| -> Word32 |
|
| -> IO (Ptr SDL_GPUComputePass) |
Begins a compute pass on a command buffer.
A compute pass is defined by a set of texture subresources and buffers that may be written to by compute pipelines. These textures and buffers must have been created with the COMPUTE_STORAGE_WRITE bit or the COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE bit. If you do not create a texture with COMPUTE_STORAGE_SIMULTANEOUS_READ_WRITE, you must not read from the texture in the compute pass. All operations related to compute pipelines must take place inside of a compute pass. You must not begin another compute pass, or a render pass or copy pass before ending the compute pass.
A VERY IMPORTANT NOTE - Reads and writes in compute passes are NOT implicitly synchronized. This means you may cause data races by both reading and writing a resource region in a compute pass, or by writing multiple times to a resource region. If your compute work depends on reading the completed output from a previous dispatch, you MUST end the current compute pass and begin a new one before you can safely access the data. Otherwise you will receive unexpected results. Reading and writing a texture in the same compute pass is only supported by specific texture formats. Make sure you check the format support!
- Returns
- a compute pass handle.
- See also
endGPUComputePass
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BeginGPUComputePass. The unsafe flavor isbeginGPUComputePass. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BeginGPUComputePass, defined atSDL3/SDL_gpu.h 3703:50
Since: 3.2.0
bindGPUComputePipeline Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Ptr SDL_GPUComputePipeline |
|
| -> IO () |
Binds a compute pipeline on a command buffer for use in compute dispatch.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUComputePipeline. The safe flavor isbindGPUComputePipelineSafe. - C declaration
SDL_BindGPUComputePipeline, defined atSDL3/SDL_gpu.h 3718:34
Since: 3.2.0
bindGPUComputePipelineSafe Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Ptr SDL_GPUComputePipeline |
|
| -> IO () |
Binds a compute pipeline on a command buffer for use in compute dispatch.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUComputePipeline. The unsafe flavor isbindGPUComputePipeline. - C declaration
SDL_BindGPUComputePipeline, defined atSDL3/SDL_gpu.h 3718:34
Since: 3.2.0
bindGPUComputeSamplers Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUTextureSamplerBinding |
|
| -> Word32 |
|
| -> IO () |
Binds texture-sampler pairs for use on the compute shader.
The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). Multisample textures are not allowed.
Be sure your shader is set up according to the requirements documented in .createGPUComputePipeline
- See also
createGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUComputeSamplers. The safe flavor isbindGPUComputeSamplersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUComputeSamplers, defined atSDL3/SDL_gpu.h 3744:34
Since: 3.2.0
bindGPUComputeSamplersSafe Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> PtrConst SDL_GPUTextureSamplerBinding |
|
| -> Word32 |
|
| -> IO () |
Binds texture-sampler pairs for use on the compute shader.
The textures must have been created with SDL_GPU_TEXTUREUSAGE_SAMPLER.
The textures being bound must have a matching type declared in the shader (2D, 3D, etc.). Multisample textures are not allowed.
Be sure your shader is set up according to the requirements documented in .createGPUComputePipeline
- See also
createGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUComputeSamplers. The unsafe flavor isbindGPUComputeSamplers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUComputeSamplers, defined atSDL3/SDL_gpu.h 3744:34
Since: 3.2.0
bindGPUComputeStorageTextures Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUTexture) |
|
| -> Word32 |
|
| -> IO () |
Binds storage textures as readonly for use on the compute pipeline.
These textures must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ.
The textures being bound must have a matching type declared in the shader (2D, 3D, 2DMS, etc.)
Be sure your shader is set up according to the requirements documented in .createGPUComputePipeline
- See also
createGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUComputeStorageTextures. The safe flavor isbindGPUComputeStorageTexturesSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUComputeStorageTextures, defined atSDL3/SDL_gpu.h 3771:34
Since: 3.2.0
bindGPUComputeStorageTexturesSafe Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUTexture) |
|
| -> Word32 |
|
| -> IO () |
Binds storage textures as readonly for use on the compute pipeline.
These textures must have been created with SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_READ.
The textures being bound must have a matching type declared in the shader (2D, 3D, 2DMS, etc.)
Be sure your shader is set up according to the requirements documented in .createGPUComputePipeline
- See also
createGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUComputeStorageTextures. The unsafe flavor isbindGPUComputeStorageTextures. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUComputeStorageTextures, defined atSDL3/SDL_gpu.h 3771:34
Since: 3.2.0
bindGPUComputeStorageBuffers Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUBuffer) |
|
| -> Word32 |
|
| -> IO () |
Binds storage buffers as readonly for use on the compute pipeline.
These buffers must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ.
Be sure your shader is set up according to the requirements documented in .createGPUComputePipeline
- See also
createGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BindGPUComputeStorageBuffers. The safe flavor isbindGPUComputeStorageBuffersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUComputeStorageBuffers, defined atSDL3/SDL_gpu.h 3795:34
Since: 3.2.0
bindGPUComputeStorageBuffersSafe Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> PtrConst (Ptr SDL_GPUBuffer) |
|
| -> Word32 |
|
| -> IO () |
Binds storage buffers as readonly for use on the compute pipeline.
These buffers must have been created with SDL_GPU_BUFFERUSAGE_COMPUTE_STORAGE_READ.
Be sure your shader is set up according to the requirements documented in .createGPUComputePipeline
- See also
createGPUComputePipeline
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BindGPUComputeStorageBuffers. The unsafe flavor isbindGPUComputeStorageBuffers. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_BindGPUComputeStorageBuffers, defined atSDL3/SDL_gpu.h 3795:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Dispatches compute work.
You must not call this function before binding a compute pipeline.
A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DispatchGPUCompute. The safe flavor isdispatchGPUComputeSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DispatchGPUCompute, defined atSDL3/SDL_gpu.h 3821:34
Since: 3.2.0
dispatchGPUComputeSafe Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO () |
Dispatches compute work.
You must not call this function before binding a compute pipeline.
A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DispatchGPUCompute. The unsafe flavor isdispatchGPUCompute. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DispatchGPUCompute, defined atSDL3/SDL_gpu.h 3821:34
Since: 3.2.0
dispatchGPUComputeIndirect Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Ptr SDL_GPUBuffer |
|
| -> Word32 |
|
| -> IO () |
Dispatches compute work with parameters set from a buffer.
The buffer layout should match the layout of SDL_GPUIndirectDispatchCommand. You must not call this function before binding a compute pipeline.
A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DispatchGPUComputeIndirect. The safe flavor isdispatchGPUComputeIndirectSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DispatchGPUComputeIndirect, defined atSDL3/SDL_gpu.h 3845:34
Since: 3.2.0
dispatchGPUComputeIndirectSafe Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> Ptr SDL_GPUBuffer |
|
| -> Word32 |
|
| -> IO () |
Dispatches compute work with parameters set from a buffer.
The buffer layout should match the layout of SDL_GPUIndirectDispatchCommand. You must not call this function before binding a compute pipeline.
A VERY IMPORTANT NOTE If you dispatch multiple times in a compute pass, and the dispatches write to the same resource region as each other, there is no guarantee of which order the writes will occur. If the write order matters, you MUST end the compute pass and begin another one.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DispatchGPUComputeIndirect. The unsafe flavor isdispatchGPUComputeIndirect. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_DispatchGPUComputeIndirect, defined atSDL3/SDL_gpu.h 3845:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> IO () |
Ends the current compute pass.
All bound compute state on the command buffer is unset. The compute pass handle is now invalid.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_EndGPUComputePass. The safe flavor isendGPUComputePassSafe. - C declaration
SDL_EndGPUComputePass, defined atSDL3/SDL_gpu.h 3860:34
Since: 3.2.0
endGPUComputePassSafe Source #
Arguments
| :: Ptr SDL_GPUComputePass |
|
| -> IO () |
Ends the current compute pass.
All bound compute state on the command buffer is unset. The compute pass handle is now invalid.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_EndGPUComputePass. The unsafe flavor isendGPUComputePass. - C declaration
SDL_EndGPUComputePass, defined atSDL3/SDL_gpu.h 3860:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTransferBuffer |
|
| -> Bool |
|
| -> IO (Ptr Void) |
Maps a transfer buffer into application address space.
You must unmap the transfer buffer before encoding upload commands. The memory is owned by the graphics driver - do NOT call free on the returned pointer.
- Returns
- the address of the mapped transfer buffer memory, or NULL on failure; call
getErrorfor more information.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_MapGPUTransferBuffer. The safe flavor ismapGPUTransferBufferSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_MapGPUTransferBuffer, defined atSDL3/SDL_gpu.h 3880:36
Since: 3.2.0
mapGPUTransferBufferSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTransferBuffer |
|
| -> Bool |
|
| -> IO (Ptr Void) |
Maps a transfer buffer into application address space.
You must unmap the transfer buffer before encoding upload commands. The memory is owned by the graphics driver - do NOT call free on the returned pointer.
- Returns
- the address of the mapped transfer buffer memory, or NULL on failure; call
getErrorfor more information.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_MapGPUTransferBuffer. The unsafe flavor ismapGPUTransferBuffer. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_MapGPUTransferBuffer, defined atSDL3/SDL_gpu.h 3880:36
Since: 3.2.0
unmapGPUTransferBuffer Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTransferBuffer |
|
| -> IO () |
Unmaps a previously mapped transfer buffer.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_UnmapGPUTransferBuffer. The safe flavor isunmapGPUTransferBufferSafe. - C declaration
SDL_UnmapGPUTransferBuffer, defined atSDL3/SDL_gpu.h 3893:34
Since: 3.2.0
unmapGPUTransferBufferSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUTransferBuffer |
|
| -> IO () |
Unmaps a previously mapped transfer buffer.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_UnmapGPUTransferBuffer. The unsafe flavor isunmapGPUTransferBuffer. - C declaration
SDL_UnmapGPUTransferBuffer, defined atSDL3/SDL_gpu.h 3893:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO (Ptr SDL_GPUCopyPass) |
Begins a copy pass on a command buffer.
All operations related to copying to or from buffers or textures take place inside a copy pass. You must not begin another copy pass, or a render pass or compute pass before ending the copy pass.
- Returns
- a copy pass handle.
- See also
endGPUCopyPass
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BeginGPUCopyPass. The safe flavor isbeginGPUCopyPassSafe. - C declaration
SDL_BeginGPUCopyPass, defined atSDL3/SDL_gpu.h 3913:47
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO (Ptr SDL_GPUCopyPass) |
Begins a copy pass on a command buffer.
All operations related to copying to or from buffers or textures take place inside a copy pass. You must not begin another copy pass, or a render pass or compute pass before ending the copy pass.
- Returns
- a copy pass handle.
- See also
endGPUCopyPass
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BeginGPUCopyPass. The unsafe flavor isbeginGPUCopyPass. - C declaration
SDL_BeginGPUCopyPass, defined atSDL3/SDL_gpu.h 3913:47
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTextureTransferInfo |
|
| -> PtrConst SDL_GPUTextureRegion |
|
| -> Bool |
|
| -> IO () |
Uploads data from a transfer buffer to a texture.
The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.
You must align the data in the transfer buffer to a multiple of the texel size of the texture format.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_UploadToGPUTexture. The safe flavor isuploadToGPUTextureSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_UploadToGPUTexture, defined atSDL3/SDL_gpu.h 3933:34
Since: 3.2.0
uploadToGPUTextureSafe Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTextureTransferInfo |
|
| -> PtrConst SDL_GPUTextureRegion |
|
| -> Bool |
|
| -> IO () |
Uploads data from a transfer buffer to a texture.
The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.
You must align the data in the transfer buffer to a multiple of the texel size of the texture format.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_UploadToGPUTexture. The unsafe flavor isuploadToGPUTexture. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_UploadToGPUTexture, defined atSDL3/SDL_gpu.h 3933:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTransferBufferLocation |
|
| -> PtrConst SDL_GPUBufferRegion |
|
| -> Bool |
|
| -> IO () |
Uploads data from a transfer buffer to a buffer.
The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_UploadToGPUBuffer. The safe flavor isuploadToGPUBufferSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_UploadToGPUBuffer, defined atSDL3/SDL_gpu.h 3953:34
Since: 3.2.0
uploadToGPUBufferSafe Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTransferBufferLocation |
|
| -> PtrConst SDL_GPUBufferRegion |
|
| -> Bool |
|
| -> IO () |
Uploads data from a transfer buffer to a buffer.
The upload occurs on the GPU timeline. You may assume that the upload has finished in subsequent commands.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_UploadToGPUBuffer. The unsafe flavor isuploadToGPUBuffer. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_UploadToGPUBuffer, defined atSDL3/SDL_gpu.h 3953:34
Since: 3.2.0
copyGPUTextureToTexture Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTextureLocation |
|
| -> PtrConst SDL_GPUTextureLocation |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Bool |
|
| -> IO () |
Performs a texture-to-texture copy.
This copy occurs on the GPU timeline. You may assume the copy has finished in subsequent commands.
This function does not support copying between depth and color textures. For those, copy the texture to a buffer and then to the destination texture.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CopyGPUTextureToTexture. The safe flavor iscopyGPUTextureToTextureSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CopyGPUTextureToTexture, defined atSDL3/SDL_gpu.h 3980:34
Since: 3.2.0
copyGPUTextureToTextureSafe Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTextureLocation |
|
| -> PtrConst SDL_GPUTextureLocation |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Bool |
|
| -> IO () |
Performs a texture-to-texture copy.
This copy occurs on the GPU timeline. You may assume the copy has finished in subsequent commands.
This function does not support copying between depth and color textures. For those, copy the texture to a buffer and then to the destination texture.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CopyGPUTextureToTexture. The unsafe flavor iscopyGPUTextureToTexture. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CopyGPUTextureToTexture, defined atSDL3/SDL_gpu.h 3980:34
Since: 3.2.0
copyGPUBufferToBuffer Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUBufferLocation |
|
| -> PtrConst SDL_GPUBufferLocation |
|
| -> Word32 |
|
| -> Bool |
|
| -> IO () |
Performs a buffer-to-buffer copy.
This copy occurs on the GPU timeline. You may assume the copy has finished in subsequent commands.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CopyGPUBufferToBuffer. The safe flavor iscopyGPUBufferToBufferSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CopyGPUBufferToBuffer, defined atSDL3/SDL_gpu.h 4004:34
Since: 3.2.0
copyGPUBufferToBufferSafe Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUBufferLocation |
|
| -> PtrConst SDL_GPUBufferLocation |
|
| -> Word32 |
|
| -> Bool |
|
| -> IO () |
Performs a buffer-to-buffer copy.
This copy occurs on the GPU timeline. You may assume the copy has finished in subsequent commands.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CopyGPUBufferToBuffer. The unsafe flavor iscopyGPUBufferToBuffer. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CopyGPUBufferToBuffer, defined atSDL3/SDL_gpu.h 4004:34
Since: 3.2.0
downloadFromGPUTexture Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTextureRegion |
|
| -> PtrConst SDL_GPUTextureTransferInfo |
|
| -> IO () |
Copies data from a texture to a transfer buffer on the GPU timeline.
This data is not guaranteed to be copied until the command buffer fence is signaled.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DownloadFromGPUTexture. The safe flavor isdownloadFromGPUTextureSafe. - C declaration
SDL_DownloadFromGPUTexture, defined atSDL3/SDL_gpu.h 4024:34
Since: 3.2.0
downloadFromGPUTextureSafe Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUTextureRegion |
|
| -> PtrConst SDL_GPUTextureTransferInfo |
|
| -> IO () |
Copies data from a texture to a transfer buffer on the GPU timeline.
This data is not guaranteed to be copied until the command buffer fence is signaled.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DownloadFromGPUTexture. The unsafe flavor isdownloadFromGPUTexture. - C declaration
SDL_DownloadFromGPUTexture, defined atSDL3/SDL_gpu.h 4024:34
Since: 3.2.0
downloadFromGPUBuffer Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUBufferRegion |
|
| -> PtrConst SDL_GPUTransferBufferLocation |
|
| -> IO () |
Copies data from a buffer to a transfer buffer on the GPU timeline.
This data is not guaranteed to be copied until the command buffer fence is signaled.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_DownloadFromGPUBuffer. The safe flavor isdownloadFromGPUBufferSafe. - C declaration
SDL_DownloadFromGPUBuffer, defined atSDL3/SDL_gpu.h 4041:34
Since: 3.2.0
downloadFromGPUBufferSafe Source #
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> PtrConst SDL_GPUBufferRegion |
|
| -> PtrConst SDL_GPUTransferBufferLocation |
|
| -> IO () |
Copies data from a buffer to a transfer buffer on the GPU timeline.
This data is not guaranteed to be copied until the command buffer fence is signaled.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_DownloadFromGPUBuffer. The unsafe flavor isdownloadFromGPUBuffer. - C declaration
SDL_DownloadFromGPUBuffer, defined atSDL3/SDL_gpu.h 4041:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> IO () |
Ends the current copy pass.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_EndGPUCopyPass. The safe flavor isendGPUCopyPassSafe. - C declaration
SDL_EndGPUCopyPass, defined atSDL3/SDL_gpu.h 4053:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCopyPass |
|
| -> IO () |
Ends the current copy pass.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_EndGPUCopyPass. The unsafe flavor isendGPUCopyPass. - C declaration
SDL_EndGPUCopyPass, defined atSDL3/SDL_gpu.h 4053:34
Since: 3.2.0
generateMipmapsForGPUTexture Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Ptr SDL_GPUTexture |
|
| -> IO () |
Generates mipmaps for the given texture.
This function must not be called inside of any pass.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GenerateMipmapsForGPUTexture. The safe flavor isgenerateMipmapsForGPUTextureSafe. - C declaration
SDL_GenerateMipmapsForGPUTexture, defined atSDL3/SDL_gpu.h 4066:34
Since: 3.2.0
generateMipmapsForGPUTextureSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Ptr SDL_GPUTexture |
|
| -> IO () |
Generates mipmaps for the given texture.
This function must not be called inside of any pass.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GenerateMipmapsForGPUTexture. The unsafe flavor isgenerateMipmapsForGPUTexture. - C declaration
SDL_GenerateMipmapsForGPUTexture, defined atSDL3/SDL_gpu.h 4066:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst SDL_GPUBlitInfo |
|
| -> IO () |
Blits from a source texture region to a destination texture region.
This function must not be called inside of any pass.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_BlitGPUTexture. The safe flavor isblitGPUTextureSafe. - C declaration
SDL_BlitGPUTexture, defined atSDL3/SDL_gpu.h 4080:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> PtrConst SDL_GPUBlitInfo |
|
| -> IO () |
Blits from a source texture region to a destination texture region.
This function must not be called inside of any pass.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_BlitGPUTexture. The unsafe flavor isblitGPUTexture. - C declaration
SDL_BlitGPUTexture, defined atSDL3/SDL_gpu.h 4080:34
Since: 3.2.0
windowSupportsGPUSwapchainComposition Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> SDL_GPUSwapchainComposition |
|
| -> IO Bool |
Determines whether a swapchain composition is supported by the window.
The window must be claimed before calling this function.
- Returns
- true if supported, false if unsupported.
- See also
claimWindowForGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_WindowSupportsGPUSwapchainComposition. The safe flavor iswindowSupportsGPUSwapchainCompositionSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WindowSupportsGPUSwapchainComposition, defined atSDL3/SDL_gpu.h 4100:34
Since: 3.2.0
windowSupportsGPUSwapchainCompositionSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> SDL_GPUSwapchainComposition |
|
| -> IO Bool |
Determines whether a swapchain composition is supported by the window.
The window must be claimed before calling this function.
- Returns
- true if supported, false if unsupported.
- See also
claimWindowForGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_WindowSupportsGPUSwapchainComposition. The unsafe flavor iswindowSupportsGPUSwapchainComposition. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WindowSupportsGPUSwapchainComposition, defined atSDL3/SDL_gpu.h 4100:34
Since: 3.2.0
windowSupportsGPUPresentMode Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> SDL_GPUPresentMode |
|
| -> IO Bool |
Determines whether a presentation mode is supported by the window.
The window must be claimed before calling this function.
- Returns
- true if supported, false if unsupported.
- See also
claimWindowForGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_WindowSupportsGPUPresentMode. The safe flavor iswindowSupportsGPUPresentModeSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WindowSupportsGPUPresentMode, defined atSDL3/SDL_gpu.h 4119:34
Since: 3.2.0
windowSupportsGPUPresentModeSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> SDL_GPUPresentMode |
|
| -> IO Bool |
Determines whether a presentation mode is supported by the window.
The window must be claimed before calling this function.
- Returns
- true if supported, false if unsupported.
- See also
claimWindowForGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_WindowSupportsGPUPresentMode. The unsafe flavor iswindowSupportsGPUPresentMode. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WindowSupportsGPUPresentMode, defined atSDL3/SDL_gpu.h 4119:34
Since: 3.2.0
claimWindowForGPUDevice Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO Bool |
Claims a window, creating a swapchain structure for it.
This must be called before acquireGPUSwapchainTexture is called using the window. You should only call this function from the thread that created the window.
The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain parameters, you must call setGPUSwapchainParameters after claiming the window.
- Returns
- true on success, or false on failure; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
waitAndAcquireGPUSwapchainTexture,releaseWindowFromGPUDevice,windowSupportsGPUPresentMode,windowSupportsGPUSwapchainComposition
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ClaimWindowForGPUDevice. The safe flavor isclaimWindowForGPUDeviceSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_ClaimWindowForGPUDevice, defined atSDL3/SDL_gpu.h 4151:34
Since: 3.2.0
claimWindowForGPUDeviceSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO Bool |
Claims a window, creating a swapchain structure for it.
This must be called before acquireGPUSwapchainTexture is called using the window. You should only call this function from the thread that created the window.
The swapchain will be created with SDL_GPU_SWAPCHAINCOMPOSITION_SDR and SDL_GPU_PRESENTMODE_VSYNC. If you want to have different swapchain parameters, you must call setGPUSwapchainParameters after claiming the window.
- Returns
- true on success, or false on failure; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
waitAndAcquireGPUSwapchainTexture,releaseWindowFromGPUDevice,windowSupportsGPUPresentMode,windowSupportsGPUSwapchainComposition
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ClaimWindowForGPUDevice. The unsafe flavor isclaimWindowForGPUDevice. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_ClaimWindowForGPUDevice, defined atSDL3/SDL_gpu.h 4151:34
Since: 3.2.0
releaseWindowFromGPUDevice Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO () |
Unclaims a window, destroying its swapchain structure.
- See also
claimWindowForGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseWindowFromGPUDevice. The safe flavor isreleaseWindowFromGPUDeviceSafe. - C declaration
SDL_ReleaseWindowFromGPUDevice, defined atSDL3/SDL_gpu.h 4165:34
Since: 3.2.0
releaseWindowFromGPUDeviceSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO () |
Unclaims a window, destroying its swapchain structure.
- See also
claimWindowForGPUDevice
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseWindowFromGPUDevice. The unsafe flavor isreleaseWindowFromGPUDevice. - C declaration
SDL_ReleaseWindowFromGPUDevice, defined atSDL3/SDL_gpu.h 4165:34
Since: 3.2.0
setGPUSwapchainParameters Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> SDL_GPUSwapchainComposition |
|
| -> SDL_GPUPresentMode |
|
| -> IO Bool |
Changes the swapchain parameters for the given claimed window.
This function will fail if the requested present mode or swapchain composition are unsupported by the device. Check if the parameters are supported via windowSupportsGPUPresentMode / windowSupportsGPUSwapchainComposition prior to calling this function.
SDL_GPU_PRESENTMODE_VSYNC with SDL_GPU_SWAPCHAINCOMPOSITION_SDR is always supported.
- Returns
- true if successful, false on error; call
getErrorfor more information. - See also
windowSupportsGPUPresentMode,windowSupportsGPUSwapchainComposition
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUSwapchainParameters. The safe flavor issetGPUSwapchainParametersSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetGPUSwapchainParameters, defined atSDL3/SDL_gpu.h 4192:34
Since: 3.2.0
setGPUSwapchainParametersSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> SDL_GPUSwapchainComposition |
|
| -> SDL_GPUPresentMode |
|
| -> IO Bool |
Changes the swapchain parameters for the given claimed window.
This function will fail if the requested present mode or swapchain composition are unsupported by the device. Check if the parameters are supported via windowSupportsGPUPresentMode / windowSupportsGPUSwapchainComposition prior to calling this function.
SDL_GPU_PRESENTMODE_VSYNC with SDL_GPU_SWAPCHAINCOMPOSITION_SDR is always supported.
- Returns
- true if successful, false on error; call
getErrorfor more information. - See also
windowSupportsGPUPresentMode,windowSupportsGPUSwapchainComposition
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUSwapchainParameters. The unsafe flavor issetGPUSwapchainParameters. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetGPUSwapchainParameters, defined atSDL3/SDL_gpu.h 4192:34
Since: 3.2.0
setGPUAllowedFramesInFlight Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Word32 |
|
| -> IO Bool |
Configures the maximum allowed number of frames in flight.
The default value when the device is created is 2. This means that after you have submitted 2 frames for presentation, if the GPU has not finished working on the first frame, will fill the swapchain texture pointer with NULL, and acquireGPUSwapchainTexture will block.waitAndAcquireGPUSwapchainTexture
Higher values increase throughput at the expense of visual latency. Lower values decrease visual latency at the expense of throughput.
Note that calling this function will stall and flush the command queue to prevent synchronization issues.
The minimum value of allowed frames in flight is 1, and the maximum is 3.
- Returns
- true if successful, false on error; call
getErrorfor more information.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetGPUAllowedFramesInFlight. The safe flavor issetGPUAllowedFramesInFlightSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetGPUAllowedFramesInFlight, defined atSDL3/SDL_gpu.h 4223:34
Since: 3.2.0
setGPUAllowedFramesInFlightSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Word32 |
|
| -> IO Bool |
Configures the maximum allowed number of frames in flight.
The default value when the device is created is 2. This means that after you have submitted 2 frames for presentation, if the GPU has not finished working on the first frame, will fill the swapchain texture pointer with NULL, and acquireGPUSwapchainTexture will block.waitAndAcquireGPUSwapchainTexture
Higher values increase throughput at the expense of visual latency. Lower values decrease visual latency at the expense of throughput.
Note that calling this function will stall and flush the command queue to prevent synchronization issues.
The minimum value of allowed frames in flight is 1, and the maximum is 3.
- Returns
- true if successful, false on error; call
getErrorfor more information.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetGPUAllowedFramesInFlight. The unsafe flavor issetGPUAllowedFramesInFlight. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SetGPUAllowedFramesInFlight, defined atSDL3/SDL_gpu.h 4223:34
Since: 3.2.0
getGPUSwapchainTextureFormat Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO SDL_GPUTextureFormat |
Obtains the texture format of the swapchain for the given window.
Note that this format can change if the swapchain parameters change.
- Returns
- the texture format of the swapchain.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetGPUSwapchainTextureFormat. The safe flavor isgetGPUSwapchainTextureFormatSafe. - C declaration
SDL_GetGPUSwapchainTextureFormat, defined atSDL3/SDL_gpu.h 4238:50
Since: 3.2.0
getGPUSwapchainTextureFormatSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO SDL_GPUTextureFormat |
Obtains the texture format of the swapchain for the given window.
Note that this format can change if the swapchain parameters change.
- Returns
- the texture format of the swapchain.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetGPUSwapchainTextureFormat. The unsafe flavor isgetGPUSwapchainTextureFormat. - C declaration
SDL_GetGPUSwapchainTextureFormat, defined atSDL3/SDL_gpu.h 4238:50
Since: 3.2.0
acquireGPUSwapchainTexture Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Ptr SDL_Window |
|
| -> Ptr (Ptr SDL_GPUTexture) |
|
| -> Ptr Uint32 |
|
| -> Ptr Uint32 |
|
| -> IO Bool |
Acquire a texture to use in presentation.
When a swapchain texture is acquired on a command buffer, it will automatically be submitted for presentation when the command buffer is submitted. The swapchain texture should only be referenced by the command buffer used to acquire it.
This function will fill the swapchain texture handle with NULL if too many frames are in flight. This is not an error. This NULL pointer should not be passed back into SDL. Instead, it should be considered as an indication to wait until the swapchain is available.
If you use this function, it is possible to create a situation where many command buffers are allocated while the rendering context waits for the GPU to catch up, which will cause memory usage to grow. You should use unless you know what you are doing with timing.waitAndAcquireGPUSwapchainTexture
The swapchain texture is managed by the implementation and must not be freed by the user. You MUST NOT call this function from any thread other than the one that created the window.
- Returns
- true on success, false on error; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
claimWindowForGPUDevice,submitGPUCommandBuffer,submitGPUCommandBufferAndAcquireFence,cancelGPUCommandBuffer,getWindowSizeInPixels,waitForGPUSwapchain,waitAndAcquireGPUSwapchainTexture,setGPUAllowedFramesInFlight
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_AcquireGPUSwapchainTexture. The safe flavor isacquireGPUSwapchainTextureSafe: can block on swapchain availability. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_AcquireGPUSwapchainTexture, defined atSDL3/SDL_gpu.h 4290:34
Since: 3.2.0
acquireGPUSwapchainTextureSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Ptr SDL_Window |
|
| -> Ptr (Ptr SDL_GPUTexture) |
|
| -> Ptr Uint32 |
|
| -> Ptr Uint32 |
|
| -> IO Bool |
Acquire a texture to use in presentation.
When a swapchain texture is acquired on a command buffer, it will automatically be submitted for presentation when the command buffer is submitted. The swapchain texture should only be referenced by the command buffer used to acquire it.
This function will fill the swapchain texture handle with NULL if too many frames are in flight. This is not an error. This NULL pointer should not be passed back into SDL. Instead, it should be considered as an indication to wait until the swapchain is available.
If you use this function, it is possible to create a situation where many command buffers are allocated while the rendering context waits for the GPU to catch up, which will cause memory usage to grow. You should use unless you know what you are doing with timing.waitAndAcquireGPUSwapchainTexture
The swapchain texture is managed by the implementation and must not be freed by the user. You MUST NOT call this function from any thread other than the one that created the window.
- Returns
- true on success, false on error; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
claimWindowForGPUDevice,submitGPUCommandBuffer,submitGPUCommandBufferAndAcquireFence,cancelGPUCommandBuffer,getWindowSizeInPixels,waitForGPUSwapchain,waitAndAcquireGPUSwapchainTexture,setGPUAllowedFramesInFlight
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_AcquireGPUSwapchainTexture. The unsafe flavor isacquireGPUSwapchainTexture: can block on swapchain availability. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_AcquireGPUSwapchainTexture, defined atSDL3/SDL_gpu.h 4290:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO Bool |
Blocks the thread until a swapchain texture is available to be acquired.
- Returns
- true on success, false on failure; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
acquireGPUSwapchainTexture,waitAndAcquireGPUSwapchainTexture,setGPUAllowedFramesInFlight
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_WaitForGPUSwapchain. The safe flavor iswaitForGPUSwapchainSafe: blocks until the swapchain is available. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitForGPUSwapchain, defined atSDL3/SDL_gpu.h 4314:34
Since: 3.2.0
waitForGPUSwapchainSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_Window |
|
| -> IO Bool |
Blocks the thread until a swapchain texture is available to be acquired.
- Returns
- true on success, false on failure; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
acquireGPUSwapchainTexture,waitAndAcquireGPUSwapchainTexture,setGPUAllowedFramesInFlight
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_WaitForGPUSwapchain. The unsafe flavor iswaitForGPUSwapchain: blocks until the swapchain is available. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitForGPUSwapchain, defined atSDL3/SDL_gpu.h 4314:34
Since: 3.2.0
waitAndAcquireGPUSwapchainTexture Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Ptr SDL_Window |
|
| -> Ptr (Ptr SDL_GPUTexture) |
|
| -> Ptr Uint32 |
|
| -> Ptr Uint32 |
|
| -> IO Bool |
Blocks the thread until a swapchain texture is available to be acquired, and then acquires it.
When a swapchain texture is acquired on a command buffer, it will automatically be submitted for presentation when the command buffer is submitted. The swapchain texture should only be referenced by the command buffer used to acquire it. It is an error to call after a swapchain texture is acquired.cancelGPUCommandBuffer
This function can fill the swapchain texture handle with NULL in certain cases, for example if the window is minimized. This is not an error. You should always make sure to check whether the pointer is NULL before actually using it.
The swapchain texture is managed by the implementation and must not be freed by the user. You MUST NOT call this function from any thread other than the one that created the window.
The swapchain texture is write-only and cannot be used as a sampler or for another reading operation.
- Returns
- true on success, false on error; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
submitGPUCommandBuffer,submitGPUCommandBufferAndAcquireFence,acquireGPUSwapchainTexture
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_WaitAndAcquireGPUSwapchainTexture. The safe flavor iswaitAndAcquireGPUSwapchainTextureSafe: blocks until a swapchain texture is available. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitAndAcquireGPUSwapchainTexture, defined atSDL3/SDL_gpu.h 4360:34
Since: 3.2.0
waitAndAcquireGPUSwapchainTextureSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> Ptr SDL_Window |
|
| -> Ptr (Ptr SDL_GPUTexture) |
|
| -> Ptr Uint32 |
|
| -> Ptr Uint32 |
|
| -> IO Bool |
Blocks the thread until a swapchain texture is available to be acquired, and then acquires it.
When a swapchain texture is acquired on a command buffer, it will automatically be submitted for presentation when the command buffer is submitted. The swapchain texture should only be referenced by the command buffer used to acquire it. It is an error to call after a swapchain texture is acquired.cancelGPUCommandBuffer
This function can fill the swapchain texture handle with NULL in certain cases, for example if the window is minimized. This is not an error. You should always make sure to check whether the pointer is NULL before actually using it.
The swapchain texture is managed by the implementation and must not be freed by the user. You MUST NOT call this function from any thread other than the one that created the window.
The swapchain texture is write-only and cannot be used as a sampler or for another reading operation.
- Returns
- true on success, false on error; call
getErrorfor more information. - Thread safety
- This function should only be called from the thread that created the window.
- See also
submitGPUCommandBuffer,submitGPUCommandBufferAndAcquireFence,acquireGPUSwapchainTexture
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_WaitAndAcquireGPUSwapchainTexture. The unsafe flavor iswaitAndAcquireGPUSwapchainTexture: blocks until a swapchain texture is available. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitAndAcquireGPUSwapchainTexture, defined atSDL3/SDL_gpu.h 4360:34
Since: 3.2.0
submitGPUCommandBuffer Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO Bool |
Submits a command buffer so its commands can be processed on the GPU.
It is invalid to use the command buffer after this is called.
This must be called from the thread the command buffer was acquired on.
All commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing.
- Returns
- true on success, false on failure; call
getErrorfor more information. - See also
acquireGPUCommandBuffer,waitAndAcquireGPUSwapchainTexture,acquireGPUSwapchainTexture,submitGPUCommandBufferAndAcquireFence
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SubmitGPUCommandBuffer. The safe flavor issubmitGPUCommandBufferSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SubmitGPUCommandBuffer, defined atSDL3/SDL_gpu.h 4388:34
Since: 3.2.0
submitGPUCommandBufferSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO Bool |
Submits a command buffer so its commands can be processed on the GPU.
It is invalid to use the command buffer after this is called.
This must be called from the thread the command buffer was acquired on.
All commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing.
- Returns
- true on success, false on failure; call
getErrorfor more information. - See also
acquireGPUCommandBuffer,waitAndAcquireGPUSwapchainTexture,acquireGPUSwapchainTexture,submitGPUCommandBufferAndAcquireFence
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SubmitGPUCommandBuffer. The unsafe flavor issubmitGPUCommandBuffer. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_SubmitGPUCommandBuffer, defined atSDL3/SDL_gpu.h 4388:34
Since: 3.2.0
submitGPUCommandBufferAndAcquireFence Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO (Ptr SDL_GPUFence) |
Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated with the command buffer.
You must release this fence when it is no longer needed or it will cause a leak. It is invalid to use the command buffer after this is called.
This must be called from the thread the command buffer was acquired on.
All commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing.
- Returns
- a fence associated with the command buffer, or NULL on failure; call
getErrorfor more information. - See also
acquireGPUCommandBuffer,waitAndAcquireGPUSwapchainTexture,acquireGPUSwapchainTexture,submitGPUCommandBuffer,releaseGPUFence
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SubmitGPUCommandBufferAndAcquireFence. The safe flavor issubmitGPUCommandBufferAndAcquireFenceSafe. - C declaration
SDL_SubmitGPUCommandBufferAndAcquireFence, defined atSDL3/SDL_gpu.h 4415:44
Since: 3.2.0
submitGPUCommandBufferAndAcquireFenceSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO (Ptr SDL_GPUFence) |
Submits a command buffer so its commands can be processed on the GPU, and acquires a fence associated with the command buffer.
You must release this fence when it is no longer needed or it will cause a leak. It is invalid to use the command buffer after this is called.
This must be called from the thread the command buffer was acquired on.
All commands in the submission are guaranteed to begin executing before any command in a subsequent submission begins executing.
- Returns
- a fence associated with the command buffer, or NULL on failure; call
getErrorfor more information. - See also
acquireGPUCommandBuffer,waitAndAcquireGPUSwapchainTexture,acquireGPUSwapchainTexture,submitGPUCommandBuffer,releaseGPUFence
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SubmitGPUCommandBufferAndAcquireFence. The unsafe flavor issubmitGPUCommandBufferAndAcquireFence. - C declaration
SDL_SubmitGPUCommandBufferAndAcquireFence, defined atSDL3/SDL_gpu.h 4415:44
Since: 3.2.0
cancelGPUCommandBuffer Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO Bool |
Cancels a command buffer.
None of the enqueued commands are executed.
It is an error to call this function after a swapchain texture has been acquired.
This must be called from the thread the command buffer was acquired on.
You must not reference the command buffer after calling this function.
- Returns
- true on success, false on error; call
getErrorfor more information. - See also
waitAndAcquireGPUSwapchainTexture,acquireGPUCommandBuffer,acquireGPUSwapchainTexture
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CancelGPUCommandBuffer. The safe flavor iscancelGPUCommandBufferSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CancelGPUCommandBuffer, defined atSDL3/SDL_gpu.h 4440:34
Since: 3.2.0
cancelGPUCommandBufferSafe Source #
Arguments
| :: Ptr SDL_GPUCommandBuffer |
|
| -> IO Bool |
Cancels a command buffer.
None of the enqueued commands are executed.
It is an error to call this function after a swapchain texture has been acquired.
This must be called from the thread the command buffer was acquired on.
You must not reference the command buffer after calling this function.
- Returns
- true on success, false on error; call
getErrorfor more information. - See also
waitAndAcquireGPUSwapchainTexture,acquireGPUCommandBuffer,acquireGPUSwapchainTexture
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CancelGPUCommandBuffer. The unsafe flavor iscancelGPUCommandBuffer. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CancelGPUCommandBuffer, defined atSDL3/SDL_gpu.h 4440:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO Bool |
Blocks the thread until the GPU is completely idle.
- Returns
- true on success, false on failure; call
getErrorfor more information. - See also
waitForGPUFences
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_WaitForGPUIdle. The safe flavor iswaitForGPUIdleSafe: blocks until the GPU is idle. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitForGPUIdle, defined atSDL3/SDL_gpu.h 4454:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> IO Bool |
Blocks the thread until the GPU is completely idle.
- Returns
- true on success, false on failure; call
getErrorfor more information. - See also
waitForGPUFences
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_WaitForGPUIdle. The unsafe flavor iswaitForGPUIdle: blocks until the GPU is idle. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitForGPUIdle, defined atSDL3/SDL_gpu.h 4454:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Bool |
|
| -> PtrConst (Ptr SDL_GPUFence) |
|
| -> Word32 |
|
| -> IO Bool |
Blocks the thread until the given fences are signaled.
- Returns
- true on success, false on failure; call
getErrorfor more information. - See also
submitGPUCommandBufferAndAcquireFence,waitForGPUIdle
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_WaitForGPUFences. The safe flavor iswaitForGPUFencesSafe: blocks on fences. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitForGPUFences, defined atSDL3/SDL_gpu.h 4473:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Bool |
|
| -> PtrConst (Ptr SDL_GPUFence) |
|
| -> Word32 |
|
| -> IO Bool |
Blocks the thread until the given fences are signaled.
- Returns
- true on success, false on failure; call
getErrorfor more information. - See also
submitGPUCommandBufferAndAcquireFence,waitForGPUIdle
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_WaitForGPUFences. The unsafe flavor iswaitForGPUFences: blocks on fences. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_WaitForGPUFences, defined atSDL3/SDL_gpu.h 4473:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUFence |
|
| -> IO Bool |
Checks the status of a fence.
- Returns
- true if the fence is signaled, false if it is not.
- See also
submitGPUCommandBufferAndAcquireFence
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_QueryGPUFence. The safe flavor isqueryGPUFenceSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_QueryGPUFence, defined atSDL3/SDL_gpu.h 4490:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUFence |
|
| -> IO Bool |
Checks the status of a fence.
- Returns
- true if the fence is signaled, false if it is not.
- See also
submitGPUCommandBufferAndAcquireFence
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_QueryGPUFence. The unsafe flavor isqueryGPUFence. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_QueryGPUFence, defined atSDL3/SDL_gpu.h 4490:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUFence |
|
| -> IO () |
Releases a fence obtained from submitGPUCommandBufferAndAcquireFence.
You must not reference the fence after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ReleaseGPUFence. The safe flavor isreleaseGPUFenceSafe. - C declaration
SDL_ReleaseGPUFence, defined atSDL3/SDL_gpu.h 4506:34
Since: 3.2.0
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> Ptr SDL_GPUFence |
|
| -> IO () |
Releases a fence obtained from submitGPUCommandBufferAndAcquireFence.
You must not reference the fence after calling this function.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ReleaseGPUFence. The unsafe flavor isreleaseGPUFence. - C declaration
SDL_ReleaseGPUFence, defined atSDL3/SDL_gpu.h 4506:34
Since: 3.2.0
gpuTextureFormatTexelBlockSize Source #
Arguments
| :: SDL_GPUTextureFormat |
|
| -> IO Word32 |
Obtains the texel block size for a texture format.
- Returns
- the texel block size of the texture format.
- See also
uploadToGPUTexture
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GPUTextureFormatTexelBlockSize. The safe flavor isgpuTextureFormatTexelBlockSizeSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUTextureFormatTexelBlockSize, defined atSDL3/SDL_gpu.h 4522:36
Since: 3.2.0
gpuTextureFormatTexelBlockSizeSafe Source #
Arguments
| :: SDL_GPUTextureFormat |
|
| -> IO Word32 |
Obtains the texel block size for a texture format.
- Returns
- the texel block size of the texture format.
- See also
uploadToGPUTexture
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GPUTextureFormatTexelBlockSize. The unsafe flavor isgpuTextureFormatTexelBlockSize. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUTextureFormatTexelBlockSize, defined atSDL3/SDL_gpu.h 4522:36
Since: 3.2.0
gpuTextureSupportsFormat Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> SDL_GPUTextureFormat |
|
| -> SDL_GPUTextureType |
|
| -> SDL_GPUTextureUsageFlags |
|
| -> IO Bool |
Determines whether a texture format is supported for a given type and usage.
- Returns
- whether the texture format is supported for this type and usage.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GPUTextureSupportsFormat. The safe flavor isgpuTextureSupportsFormatSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUTextureSupportsFormat, defined atSDL3/SDL_gpu.h 4537:34
Since: 3.2.0
gpuTextureSupportsFormatSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> SDL_GPUTextureFormat |
|
| -> SDL_GPUTextureType |
|
| -> SDL_GPUTextureUsageFlags |
|
| -> IO Bool |
Determines whether a texture format is supported for a given type and usage.
- Returns
- whether the texture format is supported for this type and usage.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GPUTextureSupportsFormat. The unsafe flavor isgpuTextureSupportsFormat. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUTextureSupportsFormat, defined atSDL3/SDL_gpu.h 4537:34
Since: 3.2.0
gpuTextureSupportsSampleCount Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> SDL_GPUTextureFormat |
|
| -> SDL_GPUSampleCount |
|
| -> IO Bool |
Determines if a sample count for a texture format is supported.
- Returns
- whether the sample count is supported for this texture format.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GPUTextureSupportsSampleCount. The safe flavor isgpuTextureSupportsSampleCountSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUTextureSupportsSampleCount, defined atSDL3/SDL_gpu.h 4553:34
Since: 3.2.0
gpuTextureSupportsSampleCountSafe Source #
Arguments
| :: Ptr SDL_GPUDevice |
|
| -> SDL_GPUTextureFormat |
|
| -> SDL_GPUSampleCount |
|
| -> IO Bool |
Determines if a sample count for a texture format is supported.
- Returns
- whether the sample count is supported for this texture format.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GPUTextureSupportsSampleCount. The unsafe flavor isgpuTextureSupportsSampleCount. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_GPUTextureSupportsSampleCount, defined atSDL3/SDL_gpu.h 4553:34
Since: 3.2.0
calculateGPUTextureFormatSize Source #
Arguments
| :: SDL_GPUTextureFormat |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO Word32 |
Calculate the size in bytes of a texture format with dimensions.
- Returns
- the size of a texture with this format and dimensions.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_CalculateGPUTextureFormatSize. The safe flavor iscalculateGPUTextureFormatSizeSafe. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CalculateGPUTextureFormatSize, defined atSDL3/SDL_gpu.h 4569:36
Since: 3.2.0
calculateGPUTextureFormatSizeSafe Source #
Arguments
| :: SDL_GPUTextureFormat |
|
| -> Word32 |
|
| -> Word32 |
|
| -> Word32 |
|
| -> IO Word32 |
Calculate the size in bytes of a texture format with dimensions.
- Returns
- the size of a texture with this format and dimensions.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_CalculateGPUTextureFormatSize. The unsafe flavor iscalculateGPUTextureFormatSize. - Scalars
- The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
- C declaration
SDL_CalculateGPUTextureFormatSize, defined atSDL3/SDL_gpu.h 4569:36
Since: 3.2.0
getPixelFormatFromGPUTextureFormat Source #
Arguments
| :: SDL_GPUTextureFormat |
|
| -> IO SDL_PixelFormat |
Get the SDL pixel format corresponding to a GPU texture format.
- Returns
- the corresponding pixel format, or SDL_PIXELFORMAT_UNKNOWN if there is no corresponding pixel format.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetPixelFormatFromGPUTextureFormat. The safe flavor isgetPixelFormatFromGPUTextureFormatSafe. - C declaration
SDL_GetPixelFormatFromGPUTextureFormat, defined atSDL3/SDL_gpu.h 4584:45
Since: 3.4.0
getPixelFormatFromGPUTextureFormatSafe Source #
Arguments
| :: SDL_GPUTextureFormat |
|
| -> IO SDL_PixelFormat |
Get the SDL pixel format corresponding to a GPU texture format.
- Returns
- the corresponding pixel format, or SDL_PIXELFORMAT_UNKNOWN if there is no corresponding pixel format.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetPixelFormatFromGPUTextureFormat. The unsafe flavor isgetPixelFormatFromGPUTextureFormat. - C declaration
SDL_GetPixelFormatFromGPUTextureFormat, defined atSDL3/SDL_gpu.h 4584:45
Since: 3.4.0
getGPUTextureFormatFromPixelFormat Source #
Arguments
| :: SDL_PixelFormat |
|
| -> IO SDL_GPUTextureFormat |
Get the GPU texture format corresponding to an SDL pixel format.
- Returns
- the corresponding GPU texture format, or SDL_GPU_TEXTUREFORMAT_INVALID if there is no corresponding GPU texture format.
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetGPUTextureFormatFromPixelFormat. The safe flavor isgetGPUTextureFormatFromPixelFormatSafe. - C declaration
SDL_GetGPUTextureFormatFromPixelFormat, defined atSDL3/SDL_gpu.h 4596:50
Since: 3.4.0
getGPUTextureFormatFromPixelFormatSafe Source #
Arguments
| :: SDL_PixelFormat |
|
| -> IO SDL_GPUTextureFormat |
Get the GPU texture format corresponding to an SDL pixel format.
- Returns
- the corresponding GPU texture format, or SDL_GPU_TEXTUREFORMAT_INVALID if there is no corresponding GPU texture format.
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetGPUTextureFormatFromPixelFormat. The unsafe flavor isgetGPUTextureFormatFromPixelFormat. - C declaration
SDL_GetGPUTextureFormatFromPixelFormat, defined atSDL3/SDL_gpu.h 4596:50
Since: 3.4.0