Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

CloneMesh()

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1 Jeason   Members   

96
Like
0Likes
Like

Posted 24 February 2012 - 04:18 AM

I load a mesh from Xfile using CDXUTXfileMesh::Create. Then i clone the mesh using CloneMesh( D3DXMESH_WRITEONLY ).

Which memory pool does the new mesh resides, POOL_MANAGED or POOL_DEFAULT?Posted Image

#2 Tom KQT   Members   

1704
Like
0Likes
Like

Posted 24 February 2012 - 07:07 AM

You can specify the memory pool in the first parameter, you can write for example:
CloneMesh(D3DXMESH_MANAGED | D3DXMESH_WRITEONLY, blablabla....)

#3 programci_84   Members   

336
Like
1Likes
Like

Posted 25 February 2012 - 01:18 AM

D3DXMESH_MANAGED means D3DPOOL_MANAGED for vertex and index buffer of the mesh. Like this one, D3DXMESH_WRITEONLY means D3DUSAGE_WRITEONLY for both vertex and index bufferof the mesh.

So, you can check DX docs for D3DUSAGE and D3DPOOL. Docs say about D3DUSAGE_WRITEONLY: "Buffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY might suffer a severe performance penalty."
There's no "hard", and "the impossible" takes just a little time.

#4 Jeason   Members   

96
Like
0Likes
Like

Posted 27 February 2012 - 01:58 AM

Thank you, TomKQT and programci_84.

I know how to specify memory pool. But don't know if not specify memory pool, just giving only D3DUSAGE_WRITEONLY, which memory pool it resides.

I had found the sentence---"Buffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY might suffer a severe performance penalty.".
But I don't understand it well, does it mean if specify D3DUSAGE_WRITEONLY, the memory pool is D3DPOOL_DEFAULT?

maybe that's it meaning.Posted Image

#5 programci_84   Members   

336
Like
1Likes
Like

Posted 27 February 2012 - 04:33 AM

I know how to specify memory pool. But don't know if not specify memory pool, just giving only D3DUSAGE_WRITEONLY, which memory pool it resides.

You've 2 memory pool parameters for D3DX Mesh functions: D3DXMESH_MANAGED and D3DXMESH_SYSTEMMEM. If you don't specify one of'em, the function will choose D3DPOOL_DEFAULT for both vertex and index buffer of the mesh. So, if you specify only D3DXMESH_WRITEONLY, buffers will reside default memory pool.

I had found the sentence---"Buffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY might suffer a severe performance penalty.".
But I don't understand it well, does it mean if specify D3DUSAGE_WRITEONLY, the memory pool is D3DPOOL_DEFAULT?

maybe that's it meaning.Posted Image

As far as I understand, the sentence says: "Unless you specify D3DUSAGE_WRITEONLY, D3DPOOL_DEFAULT is a bad choice for memory pool. i.e. D3DPOOL_DEFAULT works well with only D3DUSAGE_WRITEONLY".

hth.
-R
There's no "hard", and "the impossible" takes just a little time.

#6 Jeason   Members   

96
Like
0Likes
Like

Posted 28 February 2012 - 07:55 PM

Thank you, programci_84!

You have given a good lesson to me.Posted Image




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.