@@ -408,13 +408,42 @@ typedef struct SDL_GpuViewport
408
408
float maxDepth ;
409
409
} SDL_GpuViewport ;
410
410
411
+ typedef struct SDL_GpuTextureTransferInfo
412
+ {
413
+ SDL_GpuTransferBuffer * transferBuffer ;
414
+ Uint32 offset ; /* starting location of the image data */
415
+ Uint32 imagePitch ; /* number of pixels from one row to the next */
416
+ Uint32 imageHeight ; /* number of rows from one layer/depth-slice to the next */
417
+ } SDL_GpuTextureTransferInfo ;
418
+
419
+ typedef struct SDL_GpuTransferBufferLocation
420
+ {
421
+ SDL_GpuTransferBuffer * transferBuffer ;
422
+ Uint32 offset ;
423
+ } SDL_GpuTransferBufferLocation ;
424
+
425
+ typedef struct SDL_GpuTransferBufferRegion
426
+ {
427
+ SDL_GpuTransferBuffer * transferBuffer ;
428
+ Uint32 offset ;
429
+ Uint32 size ;
430
+ } SDL_GpuTransferBufferRegion ;
431
+
411
432
typedef struct SDL_GpuTextureSlice
412
433
{
413
434
SDL_GpuTexture * texture ;
414
435
Uint32 mipLevel ;
415
436
Uint32 layer ;
416
437
} SDL_GpuTextureSlice ;
417
438
439
+ typedef struct SDL_GpuTextureLocation
440
+ {
441
+ SDL_GpuTextureSlice textureSlice ;
442
+ Uint32 x ;
443
+ Uint32 y ;
444
+ Uint32 z ;
445
+ } SDL_GpuTextureLocation ;
446
+
418
447
typedef struct SDL_GpuTextureRegion
419
448
{
420
449
SDL_GpuTextureSlice textureSlice ;
@@ -426,19 +455,18 @@ typedef struct SDL_GpuTextureRegion
426
455
Uint32 d ;
427
456
} SDL_GpuTextureRegion ;
428
457
429
- typedef struct SDL_GpuBufferImageCopy
458
+ typedef struct SDL_GpuBufferLocation
430
459
{
431
- Uint32 bufferOffset ;
432
- Uint32 bufferStride ; /* number of pixels from one row to the next */
433
- Uint32 bufferImageHeight ; /* number of rows from one layer/depth-slice to the next */
434
- } SDL_GpuBufferImageCopy ;
460
+ SDL_GpuBuffer * buffer ;
461
+ Uint32 offset ;
462
+ } SDL_GpuBufferLocation ;
435
463
436
- typedef struct SDL_GpuBufferCopy
464
+ typedef struct SDL_GpuBufferRegion
437
465
{
438
- Uint32 srcOffset ;
439
- Uint32 dstOffset ;
466
+ SDL_GpuBuffer * buffer ;
467
+ Uint32 offset ;
440
468
Uint32 size ;
441
- } SDL_GpuBufferCopy ;
469
+ } SDL_GpuBufferRegion ;
442
470
443
471
typedef struct SDL_GpuIndirectDrawCommand
444
472
{
@@ -1634,35 +1662,31 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuUnmapTransferBuffer(
1634
1662
* Immediately copies data from a pointer to a transfer buffer.
1635
1663
*
1636
1664
* \param device a GPU context
1637
- * \param data a pointer to data to copy into the transfer buffer
1638
- * \param transferBuffer a transfer buffer
1639
- * \param copyParams a struct containing parameters specifying copy offsets and size
1665
+ * \param source a pointer to data to copy into the transfer buffer
1666
+ * \param destination a transfer buffer with offset and size
1640
1667
* \param cycle if SDL_TRUE, cycles the transfer buffer if it is bound, otherwise overwrites the data.
1641
1668
*
1642
1669
* \since This function is available since SDL 3.x.x
1643
1670
*/
1644
1671
extern SDL_DECLSPEC void SDLCALL SDL_GpuSetTransferData (
1645
1672
SDL_GpuDevice * device ,
1646
- const void * data ,
1647
- SDL_GpuTransferBuffer * transferBuffer ,
1648
- SDL_GpuBufferCopy * copyParams ,
1673
+ const void * source ,
1674
+ SDL_GpuTransferBufferRegion * destination ,
1649
1675
SDL_bool cycle );
1650
1676
1651
1677
/**
1652
1678
* Immediately copies data from a transfer buffer to a pointer.
1653
1679
*
1654
1680
* \param device a GPU context
1655
- * \param transferBuffer a transfer buffer
1656
- * \param data a data pointer
1657
- * \param copyParams a struct containing parameters specifying copy offsets and size
1681
+ * \param source a transfer buffer with offset and size
1682
+ * \param destination a data pointer
1658
1683
*
1659
1684
* \since This function is available since SDL 3.x.x
1660
1685
*/
1661
1686
extern SDL_DECLSPEC void SDLCALL SDL_GpuGetTransferData (
1662
1687
SDL_GpuDevice * device ,
1663
- SDL_GpuTransferBuffer * transferBuffer ,
1664
- void * data ,
1665
- SDL_GpuBufferCopy * copyParams );
1688
+ SDL_GpuTransferBufferRegion * source ,
1689
+ void * destination );
1666
1690
1667
1691
/* Copy Pass */
1668
1692
@@ -1689,18 +1713,16 @@ extern SDL_DECLSPEC SDL_GpuCopyPass *SDLCALL SDL_GpuBeginCopyPass(
1689
1713
* the texel size of the texture format.
1690
1714
*
1691
1715
* \param copyPass a copy pass handle
1692
- * \param source the source transfer buffer
1716
+ * \param source the source transfer buffer with image layout information
1693
1717
* \param destination the destination texture region
1694
- * \param copyParams buffer offset, stride, and height
1695
1718
* \param cycle if SDL_TRUE, cycles the texture if the texture slice is bound, otherwise overwrites the data.
1696
1719
*
1697
1720
* \since This function is available since SDL 3.x.x
1698
1721
*/
1699
1722
extern SDL_DECLSPEC void SDLCALL SDL_GpuUploadToTexture (
1700
1723
SDL_GpuCopyPass * copyPass ,
1701
- SDL_GpuTransferBuffer * source ,
1724
+ SDL_GpuTextureTransferInfo * source ,
1702
1725
SDL_GpuTextureRegion * destination ,
1703
- SDL_GpuBufferImageCopy * copyParams ,
1704
1726
SDL_bool cycle );
1705
1727
1706
1728
/* Uploads data from a TransferBuffer to a Buffer. */
@@ -1711,18 +1733,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuUploadToTexture(
1711
1733
* You may assume that the upload has finished in subsequent commands.
1712
1734
*
1713
1735
* \param copyPass a copy pass handle
1714
- * \param source the source transfer buffer
1715
- * \param destination the destination buffer
1716
- * \param copyParams buffer offsets and length
1736
+ * \param source the source transfer buffer with offset
1737
+ * \param destination the destination buffer with offset and size
1717
1738
* \param cycle if SDL_TRUE, cycles the buffer if it is bound, otherwise overwrites the data.
1718
1739
*
1719
1740
* \since This function is available since SDL 3.x.x
1720
1741
*/
1721
1742
extern SDL_DECLSPEC void SDLCALL SDL_GpuUploadToBuffer (
1722
1743
SDL_GpuCopyPass * copyPass ,
1723
- SDL_GpuTransferBuffer * source ,
1724
- SDL_GpuBuffer * destination ,
1725
- SDL_GpuBufferCopy * copyParams ,
1744
+ SDL_GpuTransferBufferLocation * source ,
1745
+ SDL_GpuBufferRegion * destination ,
1726
1746
SDL_bool cycle );
1727
1747
1728
1748
/**
@@ -1732,15 +1752,21 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuUploadToBuffer(
1732
1752
*
1733
1753
* \param copyPass a copy pass handle
1734
1754
* \param source a source texture region
1735
- * \param destination must be the same dimensions as the source region
1755
+ * \param destination a destination texture region
1756
+ * \param w the width of the region to copy
1757
+ * \param h the height of the region to copy
1758
+ * \param d the depth of the region to copy
1736
1759
* \param cycle if SDL_TRUE, cycles the destination texture if the destination texture slice is bound, otherwise overwrites the data.
1737
1760
*
1738
1761
* \since This function is available since SDL 3.x.x
1739
1762
*/
1740
1763
extern SDL_DECLSPEC void SDLCALL SDL_GpuCopyTextureToTexture (
1741
1764
SDL_GpuCopyPass * copyPass ,
1742
- SDL_GpuTextureRegion * source ,
1743
- SDL_GpuTextureRegion * destination ,
1765
+ SDL_GpuTextureLocation * source ,
1766
+ SDL_GpuTextureLocation * destination ,
1767
+ Uint32 w ,
1768
+ Uint32 h ,
1769
+ Uint32 d ,
1744
1770
SDL_bool cycle );
1745
1771
1746
1772
/* Copies data from a buffer to a buffer. */
@@ -1751,18 +1777,18 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuCopyTextureToTexture(
1751
1777
* You may assume the copy has finished in subsequent commands.
1752
1778
*
1753
1779
* \param copyPass a copy pass handle
1754
- * \param source the buffer to copy from
1755
- * \param destination the buffer to copy to
1756
- * \param copyParams a struct containing offset and length data
1780
+ * \param source the buffer and offset to copy from
1781
+ * \param destination the buffer and offset to copy to
1782
+ * \param size the length of the buffer to copy
1757
1783
* \param cycle if SDL_TRUE, cycles the destination buffer if it is bound, otherwise overwrites the data.
1758
1784
*
1759
1785
* \since This function is available since SDL 3.x.x
1760
1786
*/
1761
1787
extern SDL_DECLSPEC void SDLCALL SDL_GpuCopyBufferToBuffer (
1762
1788
SDL_GpuCopyPass * copyPass ,
1763
- SDL_GpuBuffer * source ,
1764
- SDL_GpuBuffer * destination ,
1765
- SDL_GpuBufferCopy * copyParams ,
1789
+ SDL_GpuBufferLocation * source ,
1790
+ SDL_GpuBufferLocation * destination ,
1791
+ Uint32 size ,
1766
1792
SDL_bool cycle );
1767
1793
1768
1794
/**
@@ -1783,33 +1809,29 @@ extern SDL_DECLSPEC void SDLCALL SDL_GpuGenerateMipmaps(
1783
1809
*
1784
1810
* \param copyPass a copy pass handle
1785
1811
* \param source the source texture region
1786
- * \param destination the destination transfer buffer
1787
- * \param copyParams a struct containing parameters specifying buffer offset, stride, and height
1812
+ * \param destination the destination transfer buffer with image layout information
1788
1813
*
1789
1814
* \since This function is available since SDL 3.x.x
1790
1815
*/
1791
1816
extern SDL_DECLSPEC void SDLCALL SDL_GpuDownloadFromTexture (
1792
1817
SDL_GpuCopyPass * copyPass ,
1793
1818
SDL_GpuTextureRegion * source ,
1794
- SDL_GpuTransferBuffer * destination ,
1795
- SDL_GpuBufferImageCopy * copyParams );
1819
+ SDL_GpuTextureTransferInfo * destination );
1796
1820
1797
1821
/**
1798
1822
* Copies data from a buffer to a transfer buffer on the GPU timeline.
1799
1823
* This data is not guaranteed to be copied until the command buffer fence is signaled.
1800
1824
*
1801
1825
* \param copyPass a copy pass handle
1802
- * \param source the source buffer
1803
- * \param destination the destination transfer buffer
1804
- * \param copyParams a struct containing offsets and length
1826
+ * \param source the source buffer with offset and size
1827
+ * \param destination the destination transfer buffer with offset
1805
1828
*
1806
1829
* \since This function is available since SDL 3.x.x
1807
1830
*/
1808
1831
extern SDL_DECLSPEC void SDLCALL SDL_GpuDownloadFromBuffer (
1809
1832
SDL_GpuCopyPass * copyPass ,
1810
- SDL_GpuBuffer * source ,
1811
- SDL_GpuTransferBuffer * destination ,
1812
- SDL_GpuBufferCopy * copyParams );
1833
+ SDL_GpuBufferRegion * source ,
1834
+ SDL_GpuTransferBufferLocation * destination );
1813
1835
1814
1836
/**
1815
1837
* Ends the current copy pass.
0 commit comments