Sign in to follow this  
yk_cadcg

[dx10] int2 pos: POSITION gets precision loss

Recommended Posts

yk_cadcg    100
Hi, for gpgpu, you can never imagine how crazy we are to do things. For example, i tested out that "storing data in texture and do Vertex Texture Fetch" is slower than "packing data in vertex buffer and no texture fetch". Thus I did such:
	const D3D10_INPUT_ELEMENT_DESC layout[] =
	{
		{ "POSITION", 0, DXGI_FORMAT_R32G32_SINT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0 },  
	};
//in vertex shader:
VS_OUT vs(in int2 vert : POSITION) {...}
As a result, for pre-input data <2,2>, i got vert as <2,3>. Huge precision loss! I don't know the reason, since i thought VB is merely a pass-through. Thanks for reading, good night:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this