d3d:d3d12:texture
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
d3d:d3d12:texture [2015/09/20 20:28] – [例] oga | d3d:d3d12:texture [2015/09/20 20:45] (現在) – [例] oga | ||
---|---|---|---|
行 48: | 行 48: | ||
Footprint 取得。 | Footprint 取得。 | ||
- | < | + | < |
D3D12_PLACED_SUBRESOURCE_FOOTPRINT | D3D12_PLACED_SUBRESOURCE_FOOTPRINT | ||
UINT64 | UINT64 | ||
行 75: | 行 75: | ||
</ | </ | ||
+ | Upload Buffer への書き込み。 | ||
+ | <code cpp> | ||
+ | void* ptr= nullptr; | ||
+ | iUploadBuffer-> | ||
+ | memcpy( reinterpret_cast< | ||
+ | </ | ||
+ | |||
+ | Copy コマンド作成 | ||
+ | |||
+ | <code cpp> | ||
+ | D3D12_TEXTURE_COPY_LOCATION | ||
+ | memset( &dest, 0, sizeof(dest) ); | ||
+ | dest.pResource= iTexture; | ||
+ | dest.Type= D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; | ||
+ | dest.SubresourceIndex= 0; | ||
+ | |||
+ | D3D12_TEXTURE_COPY_LOCATION | ||
+ | memset( &src, 0, sizeof(src) ); | ||
+ | src.pResource= iUploadBuffer; | ||
+ | src.Type= D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; | ||
+ | src.PlacedFootprint= footprint; | ||
+ | |||
+ | ID3D12GraphicsCommandList* | ||
+ | iCommandList-> | ||
+ | </ | ||
+ | |||
+ | ResourceBarrier 挿入 | ||
+ | |||
+ | <code cpp> | ||
+ | D3D12_RESOURCE_BARRIER | ||
+ | memset( & | ||
+ | barrier.Type= D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; | ||
+ | barrier.Transition.pResource= iTexture; | ||
+ | barrier.Transition.Subresource= D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES; | ||
+ | barrier.Transition.StateBefore= D3D12_RESOURCE_STATE_COPY_DEST; | ||
+ | barrier.Transition.StateAfter= D3D12_RESOURCE_STATE_GENERIC_READ; | ||
+ | |||
+ | iCommandList-> | ||
+ | </ | ||
+ | |||
+ | Command 実行 | ||
+ | |||
+ | <code cpp> | ||
+ | iCommandList-> | ||
+ | ID3D12CommandList* | ||
+ | iCommandQueue-> | ||
+ | |||
+ | FenceCount++; | ||
+ | iCommandQueue-> | ||
+ | </ | ||
+ | |||
+ | ResourceView の作成 | ||
+ | |||
+ | <code cpp> | ||
+ | D3D12_SHADER_RESOURCE_VIEW_DESC | ||
+ | memset( &desc, 0, sizeof(desc) ); | ||
+ | desc.Format= DXGI_FORMAT_R8G8B8A8_UNORM; | ||
+ | desc.ViewDimension= D3D12_SRV_DIMENSION_TEXTURE2D; | ||
+ | desc.Shader4ComponentMapping= D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; | ||
+ | desc.Texture2D.MipLevels= 1; | ||
+ | |||
+ | D3D12_CPU_DESCRIPTOR_HANDLE | ||
+ | iD3DDevice-> | ||
+ | </ | ||
d3d/d3d12/texture.1442748525.txt.gz · 最終更新: 2015/09/20 20:28 by oga