the IDirect3DVertexBuffer9 has that methods
STDMETHOD(Lock)(THIS_ UINT OffsetToLock,UINT SizeToLock,void** ppbData,DWORD Flags) PURE
STDMETHOD(Unlock)(THIS) PURE
I don't know the internal implementation of these functions. I do expect next.
-
The 'Lock' method maps a VertexBuffer's video memory to ppbData. it gains much fater performance.
-
The 'Lock' method is allocs a system-mem and make ppbData to point it. And the 'UnLock' method is copy that memory to real video memory. this approach by placing a abstraction layer in hardware eliminates differences.
i guess that : in 'D3DPOOL_SYSTEMMEM' mode, it implemented by way 2. in 'D3DPOOL_DEFAULT' mode, it implemented by way 1.
/* Pool types */
typedef enum _D3DPOOL {
D3DPOOL_DEFAULT = 0,
D3DPOOL_MANAGED = 1,
D3DPOOL_SYSTEMMEM = 2,
D3DPOOL_SCRATCH = 3,
D3DPOOL_FORCE_DWORD = 0x7fffffff
} D3DPOOL;
but i don't know how implemented in every D3DPOOL mode. help me~~
Direct3D Vertex Buffer Pooling

探讨了Direct3D中不同D3DPOOL模式下VertexBufferLock()和Unlock()方法的实现方式,包括D3DPOOL_DEFAULT、D3DPOOL_MANAGED、D3DPOOL_SYSTEMMEM等模式的特点及对性能的影响。

1322

被折叠的 条评论
为什么被折叠?



