Jump to content

  • Log In with Google      Sign In   
  • Create Account

XNAMATH unsigned integer vector type?


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
4 replies to this topic

#1 Hornsj3   Members   -  Reputation: 191

Like
0Likes
Like

Posted 25 March 2012 - 08:17 PM

I'm struggling with the documentation for XNAMATH, trying to use some form of vector of 4 unsigned integers in my constant buffer.

Below is an example of using a 4 component vector of floats, but I want to use unsigned integers.

ConstantBuffer cb1;
cb1.threadGroupDims = XMFLOAT4(destDim, 0, 0, 0);
m_pContext->UpdateSubresource(m_pConstantBuffer, 0, NULL, &cb1, 0, 0);


Does anyone know the typename?

Thanks.

Sponsor:

#2 Slig Commando   Members   -  Reputation: 334

Like
0Likes
Like

Posted 25 March 2012 - 08:40 PM

I don't use XNA, but you could just make your own data type with 4 unsigned ints.

#3 Washu   Senior Moderators   -  Reputation: 5189

Like
0Likes
Like

Posted 25 March 2012 - 08:43 PM

I don't use XNA, but you could just make your own data type with 4 unsigned ints.

Its not XNA, its DirectXMath (formerly XNAMath). Which is a library provided with the DirectX SDK.

I'm struggling with the documentation for XNAMATH, trying to use some form of vector of 4 unsigned integers in my constant buffer.

Below is an example of using a 4 component vector of floats, but I want to use unsigned integers.

ConstantBuffer cb1;
cb1.threadGroupDims = XMFLOAT4(destDim, 0, 0, 0);
m_pContext->UpdateSubresource(m_pConstantBuffer, 0, NULL, &cb1, 0, 0);


Does anyone know the typename?

Thanks.

XMVECTORU32 is probably the type you want...
http://msdn.microsof...7(v=vs.85).aspx

Alternatively you can use XMVectorSetInt http://msdn.microsof...2(v=vs.85).aspx

And lastly you can use XMUINT4... http://msdn.microsof...4(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xmuint4(v=vs.85).aspx

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
ScapeCode - Blog | SlimDX


#4 Hornsj3   Members   -  Reputation: 191

Like
0Likes
Like

Posted 26 March 2012 - 07:29 AM

And lastly you can use XMUINT4... http://msdn.microsof...4(v=vs.85).aspx http://msdn.microsof...4(v=vs.85).aspx


Thanks. Have you tried XMUINT4? It was not recognized as a type. I am including "xnamath.h".


Edit: Oh I see, it references DirectXMath.h. I will try that.

#5 Hornsj3   Members   -  Reputation: 191

Like
0Likes
Like

Posted 26 March 2012 - 07:35 AM

OK I believe I ran into this problem before. I am on Windows 7 and do not know where to get DirectXMath for a non-Windows 8 platform.




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.



PARTNERS