Skip to main content
added 85 characters in body
Source Link

I found a way to do this and I thought I will post it here since it will help others. In order to pass in a UINT4 into an HLSL, you must have the following:

1. InputLayout

{ "UINT""UINT4_", 0, DXGI_FORMAT_R32G32B32A32_UINT, 0, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 }

2. InputVertex

 uint4 valuesUnsigned: UINT0;UINT4_0;   

3. Input Data Structure

struct UINT4__
    {
        unsigned int a1;
        unsigned int a2;
        unsigned int a3;
        unsigned int a4;

        UINT4__(){};

        UINT4__(unsigned int x, unsigned int y, unsigned int z, unsigned int w)
        {
            a1 = x;
            a2 = y;
            a3 = z;
            a4 = w;
        }
    };

EDIT: Added what NathanReed has said in one of his comments on this question.

I found a way to do this and I thought I will post it here since it will help others. In order to pass in a UINT4 into an HLSL, you must have the following:

1. InputLayout

{ "UINT", 0, DXGI_FORMAT_R32G32B32A32_UINT, 0, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 }

2. InputVertex

 uint4 valuesUnsigned: UINT0;   

3. Input Data Structure

struct UINT4__
    {
        unsigned int a1;
        unsigned int a2;
        unsigned int a3;
        unsigned int a4;

        UINT4__(){};

        UINT4__(unsigned int x, unsigned int y, unsigned int z, unsigned int w)
        {
            a1 = x;
            a2 = y;
            a3 = z;
            a4 = w;
        }
    };

I found a way to do this and I thought I will post it here since it will help others. In order to pass in a UINT4 into an HLSL, you must have the following:

1. InputLayout

{ "UINT4_", 0, DXGI_FORMAT_R32G32B32A32_UINT, 0, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 }

2. InputVertex

 uint4 valuesUnsigned: UINT4_0;   

3. Input Data Structure

struct UINT4__
    {
        unsigned int a1;
        unsigned int a2;
        unsigned int a3;
        unsigned int a4;

        UINT4__(){};

        UINT4__(unsigned int x, unsigned int y, unsigned int z, unsigned int w)
        {
            a1 = x;
            a2 = y;
            a3 = z;
            a4 = w;
        }
    };

EDIT: Added what NathanReed has said in one of his comments on this question.

Source Link

I found a way to do this and I thought I will post it here since it will help others. In order to pass in a UINT4 into an HLSL, you must have the following:

1. InputLayout

{ "UINT", 0, DXGI_FORMAT_R32G32B32A32_UINT, 0, D3D10_APPEND_ALIGNED_ELEMENT, D3D10_INPUT_PER_VERTEX_DATA, 0 }

2. InputVertex

 uint4 valuesUnsigned: UINT0;   

3. Input Data Structure

struct UINT4__
    {
        unsigned int a1;
        unsigned int a2;
        unsigned int a3;
        unsigned int a4;

        UINT4__(){};

        UINT4__(unsigned int x, unsigned int y, unsigned int z, unsigned int w)
        {
            a1 = x;
            a2 = y;
            a3 = z;
            a4 = w;
        }
    };