ユーザ用ツール

サイト用ツール


d3d:d3d12:texture

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
d3d:d3d12:texture [2015/09/20 20:27] – [例] ogad3d:d3d12:texture [2015/09/20 20:32] – [例] oga
行 23: 行 23:
  
 ===== 例 ===== ===== 例 =====
 +
 +Texture 用 Resource 作成。
  
 <code cpp> <code cpp>
行 42: 行 44:
  
 iD3DDevice->CreateCommitedResource( &heap, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&iTexture) ); iD3DDevice->CreateCommitedResource( &heap, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&iTexture) );
 +</code>
  
 +Footprint 取得。
 +
 +<code cpp>
 D3D12_PLACED_SUBRESOURCE_FOOTPRINT  footprint; D3D12_PLACED_SUBRESOURCE_FOOTPRINT  footprint;
 UINT64  total_bytes= 0; UINT64  total_bytes= 0;
 iD3DDevice->GetCopyableFootprints( &desc, 0, 1, 0, &footprint, nullptr, nullptr, &total_bytes ); iD3DDevice->GetCopyableFootprints( &desc, 0, 1, 0, &footprint, nullptr, nullptr, &total_bytes );
 </code> </code>
 +
 +Upload 用 Buffer 作成
  
 <code cpp> <code cpp>
行 67: 行 75:
 </code> </code>
  
 +Upload Buffer への書き込み。
  
 +<code cpp>
 +void*  ptr= nullptr;
 +iUploadBuffer->Map( 0, nullptr, &ptr );
 +memcpy( reinterpret_cast<unsigned char*>(ptr) + footprint.Offset, pixel_data, pixel_data_size );
 +</code>
  
 +
 +<code cpp>
 +</code>
  
  
d3d/d3d12/texture.txt · 最終更新: 2015/09/20 20:45 by oga

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki