Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actuallomateron

Posted 20 March 2013 - 01:10 PM

I want to save a complete texture that is in GPU memory in a file.

So i am doing this:

 

D3D10_MAPPED_TEXTURE2D ddMap;

BallsTexACPU->Map(0, D3D10_MAP_READ, 0, &ddMap);
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );       //(res*res) the number of pixels in the texture, 16 bytes in each pixel
BallsTexACPU->Unmap(0);

 

 
BallsTexACPU is a ( ID3D10Texture2D* ) it has D3D10_USAGE_STAGING, D3D10_CPU_ACCESS_READ
 
I just want to know if
BallsTexACPU->Map(0, D3D10_MAP_READ, 0, &ddMap);
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );
is correct

#3lomateron

Posted 20 March 2013 - 11:06 AM

I want to save a complete texture that is in GPU memory in a file.

So i am doing this:

 

 

D3D10_MAPPED_TEXTURE2D ddMap;
 
BallsTexACPU->Map(0, D3D10_MAP_READ, 0, &ddMap);
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );       //(res*res) the number of pixels in the texture, 16 bytes in each pixel
BallsTexACPU->Unmap(0);

 

 

 
BallsTexACPU is a ( ID3D10Texture2D* ) it has D3D10_USAGE_STAGING, D3D10_CPU_ACCESS_READ
 
I just want to know if
BallsTexACPU->Map(0, D3D10_MAP_READ, 0, &ddMap);
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );

 

 

is correct

#2lomateron

Posted 20 March 2013 - 11:04 AM

I want to save a complete texture that is in GPU memory in a file.

So i am doing this:

 

 

D3D10_MAPPED_TEXTURE2D ddMap;
 
BallsTexACPU->Map(0, D3D10_MAP_READ, 0, &ddMap);
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );       //(res*res) the number of pixels in the texture, 16 bytes in each pixel
BallsTexACPU->Unmap(0);
 
BallsTexACPU is a ( ID3D10Texture2D* ) it has D3D10_USAGE_STAGING, D3D10_CPU_ACCESS_READ
 
I just want to know if
BallsTexACPU->Map(0, D3D10_MAP_READ, 0, &ddMap);
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );
is correct

#1lomateron

Posted 20 March 2013 - 10:51 AM

I want to save a complete texture that is in GPU memory in a file.

So i am doing this:

 

 

D3D10_MAPPED_TEXTURE2D ddMap;
 
BallsTexACPU->Map(0, D3D10_MAP_READ, 0, &ddMap);
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );       //(res*res) the number of pixels in the texture, 16 bytes in each pixel
BallsTexACPU->Unmap(0);
 
BallsTexACPU is a ( ID3D10Texture2D* ) it has D3D10_USAGE_STAGING, D3D10_CPU_ACCESS_READ
 
I just want to know if
fwrite (ddMap.pData , 16*res*res , 1 , SaveStructFile );
is correct
 

PARTNERS