Jump to content
  • Advertisement
Sign in to follow this  
BornToCode

DX12 DX12 Some structure have Int type which uses a specific enum.

This topic is 1044 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I do not know why microsoft would do this. I think it would have make things easier to know which parameter they took, especially when you have a enum define for something. Then in the structure instead of defining one of the attribute with that enum they pass an Int instead. A good example of that is

enum D3D12_COMMAND_QUEUE_PRIORITY
    {
        D3D12_COMMAND_QUEUE_PRIORITY_NORMAL    = 0,
        D3D12_COMMAND_QUEUE_PRIORITY_HIGH    = 100
    }     D3D12_COMMAND_QUEUE_PRIORITY;

typedef struct D3D12_COMMAND_QUEUE_DESC
    {
    D3D12_COMMAND_LIST_TYPE Type;
    INT Priority;
    D3D12_COMMAND_QUEUE_FLAGS Flags;
    UINT NodeMask;
    }   

 

The Priority flag is a D3D12_COMMAND_QUEUE_PRIOORITY why the heck would they pass an Int. I know at the end of the day an enum is just an Int, but it would have been more friendly and i would not need to look at the documentation to make sure that the correct Int values that can be passed are D3D12_COMMAND_QUEUE_PRIORITY. I am pretty  sure they have similar issues throughout the API.

Share this post


Link to post
Share on other sites
Advertisement

Looking more at the D3D12.h header it seems like this is the only place where they have that mistake. So i guess it is a typo on someones part.

Edited by BornToCode

Share this post


Link to post
Share on other sites

I suspect that in this case the API call actually really does use an int, specified in a 0..100 range, and that the enum just exists as a helper.  By this reasoning, intermediate priority values would also be valid.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!