@@ -2801,29 +2801,29 @@ static void D3D11_BeginCopyPass(
2801
2801
2802
2802
static void D3D11_UploadToTexture (
2803
2803
SDL_GpuCommandBuffer * commandBuffer ,
2804
- SDL_GpuTransferBuffer * transferBuffer ,
2805
- SDL_GpuTextureRegion * textureRegion ,
2804
+ SDL_GpuTransferBuffer * source ,
2805
+ SDL_GpuTextureRegion * destination ,
2806
2806
SDL_GpuBufferImageCopy * copyParams ,
2807
2807
SDL_bool cycle )
2808
2808
{
2809
2809
D3D11CommandBuffer * d3d11CommandBuffer = (D3D11CommandBuffer * )commandBuffer ;
2810
2810
D3D11Renderer * renderer = (D3D11Renderer * )d3d11CommandBuffer -> renderer ;
2811
- D3D11TransferBufferContainer * transferContainer = (D3D11TransferBufferContainer * )transferBuffer ;
2811
+ D3D11TransferBufferContainer * transferContainer = (D3D11TransferBufferContainer * )source ;
2812
2812
D3D11TransferBuffer * d3d11TransferBuffer = transferContainer -> activeBuffer ;
2813
- D3D11TextureContainer * d3d11TextureContainer = (D3D11TextureContainer * )textureRegion -> textureSlice .texture ;
2813
+ D3D11TextureContainer * d3d11TextureContainer = (D3D11TextureContainer * )destination -> textureSlice .texture ;
2814
2814
Uint32 bufferStride = copyParams -> bufferStride ;
2815
2815
Uint32 bufferImageHeight = copyParams -> bufferImageHeight ;
2816
- Sint32 w = textureRegion -> w ;
2817
- Sint32 h = textureRegion -> h ;
2816
+ Sint32 w = destination -> w ;
2817
+ Sint32 h = destination -> h ;
2818
2818
D3D11Texture * stagingTexture ;
2819
2819
SDL_GpuTextureCreateInfo stagingTextureCreateInfo ;
2820
2820
D3D11_SUBRESOURCE_DATA initialData ;
2821
2821
2822
2822
D3D11TextureSubresource * textureSubresource = D3D11_INTERNAL_PrepareTextureSubresourceForWrite (
2823
2823
renderer ,
2824
2824
d3d11TextureContainer ,
2825
- textureRegion -> textureSlice .layer ,
2826
- textureRegion -> textureSlice .mipLevel ,
2825
+ destination -> textureSlice .layer ,
2826
+ destination -> textureSlice .mipLevel ,
2827
2827
cycle );
2828
2828
2829
2829
Sint32 blockSize = Texture_GetBlockSize (textureSubresource -> parent -> format );
@@ -2844,13 +2844,13 @@ static void D3D11_UploadToTexture(
2844
2844
2845
2845
stagingTextureCreateInfo .width = w ;
2846
2846
stagingTextureCreateInfo .height = h ;
2847
- stagingTextureCreateInfo .depth = textureRegion -> d ;
2847
+ stagingTextureCreateInfo .depth = destination -> d ;
2848
2848
stagingTextureCreateInfo .layerCount = 1 ;
2849
2849
stagingTextureCreateInfo .levelCount = 1 ;
2850
2850
stagingTextureCreateInfo .isCube = 0 ;
2851
2851
stagingTextureCreateInfo .usageFlags = 0 ;
2852
2852
stagingTextureCreateInfo .sampleCount = SDL_GPU_SAMPLECOUNT_1 ;
2853
- stagingTextureCreateInfo .format = ((D3D11TextureContainer * )textureRegion -> textureSlice .texture )-> createInfo .format ;
2853
+ stagingTextureCreateInfo .format = ((D3D11TextureContainer * )destination -> textureSlice .texture )-> createInfo .format ;
2854
2854
2855
2855
initialData .pSysMem = d3d11TransferBuffer -> data + copyParams -> bufferOffset ;
2856
2856
initialData .SysMemPitch = bufferStride ;
@@ -2871,9 +2871,9 @@ static void D3D11_UploadToTexture(
2871
2871
d3d11CommandBuffer -> context ,
2872
2872
textureSubresource -> parent -> handle ,
2873
2873
textureSubresource -> index ,
2874
- textureRegion -> x ,
2875
- textureRegion -> y ,
2876
- textureRegion -> z ,
2874
+ destination -> x ,
2875
+ destination -> y ,
2876
+ destination -> z ,
2877
2877
stagingTexture -> handle ,
2878
2878
0 ,
2879
2879
NULL ,
@@ -2888,16 +2888,16 @@ static void D3D11_UploadToTexture(
2888
2888
2889
2889
static void D3D11_UploadToBuffer (
2890
2890
SDL_GpuCommandBuffer * commandBuffer ,
2891
- SDL_GpuTransferBuffer * transferBuffer ,
2892
- SDL_GpuBuffer * buffer ,
2891
+ SDL_GpuTransferBuffer * source ,
2892
+ SDL_GpuBuffer * destination ,
2893
2893
SDL_GpuBufferCopy * copyParams ,
2894
2894
SDL_bool cycle )
2895
2895
{
2896
2896
D3D11CommandBuffer * d3d11CommandBuffer = (D3D11CommandBuffer * )commandBuffer ;
2897
2897
D3D11Renderer * renderer = (D3D11Renderer * )d3d11CommandBuffer -> renderer ;
2898
- D3D11TransferBufferContainer * transferContainer = (D3D11TransferBufferContainer * )transferBuffer ;
2898
+ D3D11TransferBufferContainer * transferContainer = (D3D11TransferBufferContainer * )source ;
2899
2899
D3D11TransferBuffer * d3d11TransferBuffer = transferContainer -> activeBuffer ;
2900
- D3D11BufferContainer * bufferContainer = (D3D11BufferContainer * )buffer ;
2900
+ D3D11BufferContainer * bufferContainer = (D3D11BufferContainer * )destination ;
2901
2901
D3D11Buffer * d3d11Buffer = D3D11_INTERNAL_PrepareBufferForWrite (
2902
2902
renderer ,
2903
2903
bufferContainer ,
@@ -2949,26 +2949,26 @@ static void D3D11_UploadToBuffer(
2949
2949
2950
2950
static void D3D11_DownloadFromTexture (
2951
2951
SDL_GpuCommandBuffer * commandBuffer ,
2952
- SDL_GpuTextureRegion * textureRegion ,
2953
- SDL_GpuTransferBuffer * transferBuffer ,
2952
+ SDL_GpuTextureRegion * source ,
2953
+ SDL_GpuTransferBuffer * destination ,
2954
2954
SDL_GpuBufferImageCopy * copyParams )
2955
2955
{
2956
2956
D3D11CommandBuffer * d3d11CommandBuffer = (D3D11CommandBuffer * )commandBuffer ;
2957
2957
D3D11Renderer * renderer = d3d11CommandBuffer -> renderer ;
2958
- D3D11TransferBufferContainer * container = (D3D11TransferBufferContainer * )transferBuffer ;
2958
+ D3D11TransferBufferContainer * container = (D3D11TransferBufferContainer * )destination ;
2959
2959
D3D11TransferBuffer * d3d11TransferBuffer = container -> activeBuffer ;
2960
- D3D11TextureContainer * d3d11TextureContainer = (D3D11TextureContainer * )textureRegion -> textureSlice .texture ;
2960
+ D3D11TextureContainer * d3d11TextureContainer = (D3D11TextureContainer * )source -> textureSlice .texture ;
2961
2961
D3D11_TEXTURE2D_DESC stagingDesc2D ;
2962
2962
D3D11_TEXTURE3D_DESC stagingDesc3D ;
2963
2963
D3D11TextureSubresource * textureSubresource = D3D11_INTERNAL_FetchTextureSubresource (
2964
2964
d3d11TextureContainer -> activeTexture ,
2965
- textureRegion -> textureSlice .layer ,
2966
- textureRegion -> textureSlice .mipLevel );
2965
+ source -> textureSlice .layer ,
2966
+ source -> textureSlice .mipLevel );
2967
2967
D3D11TextureDownload * textureDownload ;
2968
2968
Uint32 bufferStride = copyParams -> bufferStride ;
2969
2969
Uint32 bufferImageHeight = copyParams -> bufferImageHeight ;
2970
2970
Uint32 bytesPerRow , bytesPerDepthSlice ;
2971
- D3D11_BOX srcBox = { textureRegion -> x , textureRegion -> y , textureRegion -> z , textureRegion -> x + textureRegion -> w , textureRegion -> y + textureRegion -> h , 1 };
2971
+ D3D11_BOX srcBox = { source -> x , source -> y , source -> z , source -> x + source -> w , source -> y + source -> h , 1 };
2972
2972
HRESULT res ;
2973
2973
2974
2974
if (d3d11TransferBuffer -> textureDownloadCount >= d3d11TransferBuffer -> textureDownloadCapacity )
@@ -2983,16 +2983,16 @@ static void D3D11_DownloadFromTexture(
2983
2983
d3d11TransferBuffer -> textureDownloadCount += 1 ;
2984
2984
2985
2985
if (bufferStride == 0 || bufferImageHeight == 0 ) {
2986
- bufferStride = textureRegion -> w ;
2987
- bufferImageHeight = textureRegion -> h ;
2986
+ bufferStride = source -> w ;
2987
+ bufferImageHeight = source -> h ;
2988
2988
}
2989
2989
2990
2990
bytesPerRow = BytesPerRow (bufferStride , textureSubresource -> parent -> format );
2991
2991
bytesPerDepthSlice = bytesPerRow * bufferImageHeight ;
2992
2992
2993
- if (textureRegion -> d == 1 ) {
2994
- stagingDesc2D .Width = textureRegion -> w ;
2995
- stagingDesc2D .Height = textureRegion -> h ;
2993
+ if (source -> d == 1 ) {
2994
+ stagingDesc2D .Width = source -> w ;
2995
+ stagingDesc2D .Height = source -> h ;
2996
2996
stagingDesc2D .MipLevels = 1 ;
2997
2997
stagingDesc2D .ArraySize = 1 ;
2998
2998
stagingDesc2D .Format = SDLToD3D11_TextureFormat [textureSubresource -> parent -> format ];
@@ -3010,9 +3010,9 @@ static void D3D11_DownloadFromTexture(
3010
3010
(ID3D11Texture2D * * )& textureDownload -> stagingTexture );
3011
3011
ERROR_CHECK_RETURN ("Staging texture creation failed" , )
3012
3012
} else {
3013
- stagingDesc3D .Width = textureRegion -> w ;
3014
- stagingDesc3D .Height = textureRegion -> h ;
3015
- stagingDesc3D .Depth = textureRegion -> d ;
3013
+ stagingDesc3D .Width = source -> w ;
3014
+ stagingDesc3D .Height = source -> h ;
3015
+ stagingDesc3D .Depth = source -> d ;
3016
3016
stagingDesc3D .MipLevels = 1 ;
3017
3017
stagingDesc3D .Format = SDLToD3D11_TextureFormat [textureSubresource -> parent -> format ];
3018
3018
stagingDesc3D .Usage = D3D11_USAGE_STAGING ;
@@ -3027,9 +3027,9 @@ static void D3D11_DownloadFromTexture(
3027
3027
(ID3D11Texture3D * * )& textureDownload -> stagingTexture );
3028
3028
}
3029
3029
3030
- textureDownload -> width = textureRegion -> w ;
3031
- textureDownload -> height = textureRegion -> h ;
3032
- textureDownload -> depth = textureRegion -> d ;
3030
+ textureDownload -> width = source -> w ;
3031
+ textureDownload -> height = source -> h ;
3032
+ textureDownload -> depth = source -> d ;
3033
3033
textureDownload -> bufferOffset = copyParams -> bufferOffset ;
3034
3034
textureDownload -> bytesPerRow = bytesPerRow ;
3035
3035
textureDownload -> bytesPerDepthSlice = bytesPerDepthSlice ;
@@ -3052,15 +3052,15 @@ static void D3D11_DownloadFromTexture(
3052
3052
3053
3053
static void D3D11_DownloadFromBuffer (
3054
3054
SDL_GpuCommandBuffer * commandBuffer ,
3055
- SDL_GpuBuffer * buffer ,
3056
- SDL_GpuTransferBuffer * transferBuffer ,
3055
+ SDL_GpuBuffer * source ,
3056
+ SDL_GpuTransferBuffer * destination ,
3057
3057
SDL_GpuBufferCopy * copyParams )
3058
3058
{
3059
3059
D3D11CommandBuffer * d3d11CommandBuffer = (D3D11CommandBuffer * )commandBuffer ;
3060
3060
D3D11Renderer * renderer = d3d11CommandBuffer -> renderer ;
3061
- D3D11TransferBufferContainer * container = (D3D11TransferBufferContainer * )transferBuffer ;
3061
+ D3D11TransferBufferContainer * container = (D3D11TransferBufferContainer * )destination ;
3062
3062
D3D11TransferBuffer * d3d11TransferBuffer = container -> activeBuffer ;
3063
- D3D11BufferContainer * d3d11BufferContainer = (D3D11BufferContainer * )buffer ;
3063
+ D3D11BufferContainer * d3d11BufferContainer = (D3D11BufferContainer * )source ;
3064
3064
D3D11BufferDownload * bufferDownload ;
3065
3065
D3D11_BOX srcBox = { copyParams -> srcOffset , 0 , 0 , copyParams -> size , 1 , 1 };
3066
3066
D3D11_BUFFER_DESC stagingBufferDesc ;
0 commit comments