建立串流資源Creating streaming resources

串流資源的建立方式是在建立資源時指定旗標,表示資源是串流資源。Streaming resources are created by specifying a flag when you create a resource, indicating that the resource is a streaming resource.

串流資源建立參數內詳述您可將資源建立為串流資源之時機的限制。Restrictions on when you can create a resource as a streaming resource are described in Streaming resource creation parameters.

非串流資源的儲存空間在建立資源時於圖形系統中配置,例如為 2D 紋理陣列進行的配置。A non-streaming resource's storage is allocated in the graphics system when the resource is created, such as allocation for an array of 2D textures.

建立串流資源時,圖形系統不會為資源內容配置儲存空間,When a streaming resource is created, the graphics system doesn't allocate the storage for the resource contents. 而是在應用程式建立串流資源時,圖形系統僅會為並排表面的區域保留位址空間,並允許應用程式控制磚的對應。Instead, when an application creates a streaming resource, the graphics system makes an address space reservation for the tiled surface's area only, and then allows the mapping of the tiles to be controlled by the application. 磚的「對應」僅為資源中的邏輯磚在記憶體中所指向的實體位置 (若是對應磚則為 NULL)。The "mapping" of a tile is simply the physical location in memory that a logical tile in a resource points to (or NULL for an unmapped tile).

請勿將此概念與為 CPU 存取對應 Direct3D 資源的概念混淆,其名稱雖相同但卻是完全獨立的概念。Don't confuse this concept with the notion of mapping a Direct3D resource for CPU access, which despite using the same name is completely independent. 您將可視需要個別為每個磚定義並變更對應,並知悉無須一次為一個表面對應所有磚,因此可有效率地使用可用的記憶體量。You will be able to define and change the mapping of each tile individually as needed, knowing that all tiles for a surface don't need to be mapped at a time, thereby making effective use of the amount of memory available.

本節內容In this section

主題Topic 描述Description

對應是到並排顯示集區Mappings are into a tile pool

將資源建立為串流資源時,組成資源的磚來自指向磚集區中的位置。When a resource is created as a streaming resource, the tiles that make up the resource come from pointing at locations in a tile pool. 磚集區是記憶體的集區 (由一或多個配置於幕後備份 - 應用程式中看不見)。A tile pool is a pool of memory (backed by one or more allocations behind the scenes - unseen by the application).

資料流的資源建立參數Streaming resource creation parameters

可以建立為串流資源的 Direct3D 資源類型上有一些限制。There are some constraints on the type of Direct3D resources that you can create as a streaming resource.

並排顯示集區的建立參數Tile pool creation parameters

使用本節的參數,在建立緩衝區時定義磚集區。Use the parameters in this section to define tile pools when creating a buffer.

資料流資源的跨處理序及裝置共用Streaming resource cross-process and device sharing

磚集區可以與其他處理序共用,就像傳統資源一樣。Tile pools can be shared with other processes just like traditional resources. 參考磚集區的串流資源無法跨裝置和處理序共用。Streaming resources that reference tile pools can't be shared across devices and processes.

資料流資源可用的作業Operations available on streaming resources

這個區段列出您可以在串流資源上執行的作業。This section lists operations that you can perform on streaming resources.

在圖格的集區上可用的作業Operations available on tile pools

磚集區的作業包括調整磚集區的大小、提供資源 (為整個磚集區暫時將記憶體讓給系統使用) 以及回收資源。Operations on tile pools include resizing a tile pool, offering resources (yielding memory temporarily to the system for the entire tile pool), and reclaiming resources.

資料流資源的區域會並排顯示方式How a streaming resource's area is tiled

建立串流資源時,維度、格式項目大小及 Mipmap 數目和/或陣列配量 (如適用) 決定了備份整個表面區域所需的磚數目。When you create a streaming resource, the dimensions, format element size, and number of mipmaps and/or array slices (if applicable) determine the number of tiles that are required to back the entire surface area.

 

相關主題Related topics

串流資源Streaming resources