[solved][dx10] Who could point to some R2VB samples?

Started by
6 comments, last by yk_cadcg 16 years, 7 months ago
Hi, att, a rendertarget wants to be a pointlist, who could help him? thanks for pointers/references to any sample codes or function hints! //bow [Edited by - yk_cadcg on October 8, 2007 1:20:59 AM]
Advertisement
You could use stream out. But if you want to use the output of a pixel shader I guess you could declare the resource as D3D10_BIND_VERTEX_BUFFER and D3D10_BIND_RENDER_TARGET and handle it with different views. You probably need to declare it as a TYPELESS format.

[edit] Another thing that might work is to have two resources one texture and one vertex buffer. First render to the the texture and then copy its contents to the buffer with ID3D10Device::CopyResource.
CopyResource does not work with different resource types.
Thanks! but below don't work:
	//texS1: int2	D3D10_TEXTURE2D_DESC descTexS1;	descTexS1.Width = _winW;	descTexS1.Height = _winH;	descTexS1.MipLevels = 1;	descTexS1.ArraySize = 1;	descTexS1.SampleDesc.Count = 1;	descTexS1.SampleDesc.Quality = 0;	descTexS1.MiscFlags = 0;	descTexS1.Format = DXGI_FORMAT_R32G32_TYPELESS; //SINT;	descTexS1.Usage = D3D10_USAGE_DEFAULT;	descTexS1.BindFlags = D3D10_BIND_RENDER_TARGET| D3D10_BIND_VERTEX_BUFFER;	descTexS1.CPUAccessFlags = 0;	V(g_pd3dDevice->CreateTexture2D(&descTexS1, NULL, &pTexS1));

Only if i remove D3D10_BIND_VERTEX_BUFFER. Thanks.

Quote:Original post by 51mon
You could use stream out. But if you want to use the output of a pixel shader I guess you could declare the resource as D3D10_BIND_VERTEX_BUFFER and D3D10_BIND_RENDER_TARGET and handle it with different views. You probably need to declare it as a TYPELESS format.

[edit] Another thing that might work is to have two resources one texture and one vertex buffer. First render to the the texture and then copy its contents to the buffer with ID3D10Device::CopyResource.


A texture can’t bound as vertex buffer. You need to create a buffer and bound this buffer as render target.
Thanks Demirug!
i can't create Buffer and render to it, since I need pingpong rendering it with another texture. it's a workflow.
Thus i have to copy the texture into vertex.
The slides "Everything about particle effects" at GDC07: http://www.2ld.de/gdc2007/EverythingAboutParticleEffectsSlides.pdf
Page 21 says we can copy texture to vertex buffer under DX10, I'm just needing it.
But CopyResource can't do it, do you know what func could do that? Thanks a lot!

Quote:Original post by Demirug
CopyResource does not work with different resource types.


I can think of one thing that will work if nothing else do. If the texture / buffer is less than 1024 in size you could stream it out manually in one invocation of GS. But there might be faster to create a vertex buffer containing nothing more than uv's, the complete set of the texture. Then you stream out the data into the buffer by using vertex texturing. In the second method you don't use any GS.
thanks! i'm trying to draw pointlist without buffer at all, gen tex coord by VertexID. seems not working currently, debugging.
Quote:Original post by 51mon
I can think of one thing that will work if nothing else do. If the texture / buffer is less than 1024 in size you could stream it out manually in one invocation of GS. But there might be faster to create a vertex buffer containing nothing more than uv's, the complete set of the texture. Then you stream out the data into the buffer by using vertex texturing. In the second method you don't use any GS.


This topic is closed to new replies.

Advertisement