An opaque handle representing a texture.
More...
◆ GPUTexture() [1/2]
constexpr SDL::GPUTexture::GPUTexture |
( |
GPUTextureRaw |
gPUTexture = {} | ) |
|
|
inlineconstexpr |
- Parameters
-
gPUTexture | the value to be wrapped |
◆ GPUTexture() [2/2]
The contents of this texture are undefined until data is written to the texture.
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 GPUTextureCreateInfo's props
. These are the supported properties:
prop::GPUTexture.CREATE_D3D12_CLEAR_R_FLOAT
: (Direct3D 12 only) if the texture usage is GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this red intensity. Defaults to zero.
prop::GPUTexture.CREATE_D3D12_CLEAR_G_FLOAT
: (Direct3D 12 only) if the texture usage is GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this green intensity. Defaults to zero.
prop::GPUTexture.CREATE_D3D12_CLEAR_B_FLOAT
: (Direct3D 12 only) if the texture usage is GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this blue intensity. Defaults to zero.
prop::GPUTexture.CREATE_D3D12_CLEAR_A_FLOAT
: (Direct3D 12 only) if the texture usage is GPU_TEXTUREUSAGE_COLOR_TARGET, clear the texture to a color with this alpha intensity. Defaults to zero.
prop::GPUTexture.CREATE_D3D12_CLEAR_DEPTH_FLOAT
: (Direct3D 12 only) if the texture usage is GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a depth of this value. Defaults to zero.
prop::GPUTexture.CREATE_D3D12_CLEAR_STENCIL_NUMBER
: (Direct3D 12 only) if the texture usage is GPU_TEXTUREUSAGE_DEPTH_STENCIL_TARGET, clear the texture to a stencil of this Uint8 value. Defaults to zero.
prop::GPUTexture.CREATE_NAME_STRING
: a name that can be displayed in debugging tools.
- Parameters
-
device | a GPU Context. |
createinfo | a struct describing the state of the texture to create. |
- Postcondition
- a texture object on success.
- Exceptions
-
- Since
- This function is available since SDL 3.2.0.
- See also
- GPUCopyPass.UploadToTexture
-
GPUCopyPass.DownloadFromTexture
-
GPURenderPass.BindVertexSamplers
-
GPURenderPass.BindVertexStorageTextures
-
GPURenderPass.BindFragmentSamplers
-
GPURenderPass.BindFragmentStorageTextures
-
GPUComputePass.BindStorageTextures
-
GPUCommandBuffer.BlitTexture
-
GPUDevice.ReleaseTexture
-
GPUDevice.TextureSupportsFormat
◆ operator GPUTextureRaw()
- Returns
- the underlying GPUTextureRaw.
The documentation for this class was generated from the following file: