What does vk::DeviceQueueCreateFlags() actually do?What is the difference between #include <filename> and #include “filename”?What are the differences between a pointer variable and a reference variable in C++?What does the explicit keyword mean?What is the “-->” operator in C++?What is this weird colon-member (“ : ”) syntax in the constructor?What is move semantics?What is the copy-and-swap idiom?What is The Rule of Three?What are the basic rules and idioms for operator overloading?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?

Extracting data from Plot

Rail-to-rail op-amp only reaches 90% of VCC, works sometimes, not everytime

What do you call the action of "describing events as they happen" like sports anchors do?

How make a table fit inside the margins?

Grep Match and extract

How to befriend someone who doesn't like to talk?

Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?

A Salute to Poetry

Why do radiation hardened IC packages often have long leads?

Diatonic chords of a pentatonic vs blues scale?

Was planting UN flag on Moon ever discussed?

Do empty drive bays need to be filled?

As easy as Three, Two, One... How fast can you go from Five to Four?

noalign caused by multirow and colors

Do you have to have figures when playing D&D?

How and why do references in academic papers work?

Is it a acceptable way to write a loss function in this form?

Wizard clothing for warm weather

Make Gimbap cutter

Does the Nuka-Cola bottler actually generate nuka cola?

What should I be wary of when insurer is taking a lot of time to decide whether car is repairable or a total loss?

Was Self-modifying-code possible just using BASIC?

Why are MBA programs closing in the United States?

Is Dumbledore a human lie detector?



What does vk::DeviceQueueCreateFlags() actually do?


What is the difference between #include <filename> and #include “filename”?What are the differences between a pointer variable and a reference variable in C++?What does the explicit keyword mean?What is the “-->” operator in C++?What is this weird colon-member (“ : ”) syntax in the constructor?What is move semantics?What is the copy-and-swap idiom?What is The Rule of Three?What are the basic rules and idioms for operator overloading?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















The C like way to initialize this structure is:



VkDeviceQueueCreateInfo queueCreateInfo = ;
queueCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
queueCreateInfo.queueFamilyIndex = queueFamily;
queueCreateInfo.queueCount = 1;
queueCreateInfo.pQueuePriorities = &queuePriority;


The C++ way, using and abusing the vulkan.hpp header, is:



vk::DeviceQueueCreateInfo deviceQueueCreateInfo(vk::DeviceQueueCreateFlags(), static_cast<uint32_t>(graphicsQueueFamilyIndex), 1, &queuePriority);


It seems that a lot of work is encapsulated in the function vk::DeviceQueueCreateFlags().



However looking through the source with my editor is not revealing anything useful. I was hoping someone with more experience could provide some information as to what the function is doing.










share|improve this question



















  • 2





    since vk::DeviceQueueCreateInfo ctor always take the flags type as the first field, you can reduce boilerplate by expressing an empty set of flags as rather than something like vk::DeviceQueueCreateFlags()

    – Jherico
    Mar 24 at 23:34

















1















The C like way to initialize this structure is:



VkDeviceQueueCreateInfo queueCreateInfo = ;
queueCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
queueCreateInfo.queueFamilyIndex = queueFamily;
queueCreateInfo.queueCount = 1;
queueCreateInfo.pQueuePriorities = &queuePriority;


The C++ way, using and abusing the vulkan.hpp header, is:



vk::DeviceQueueCreateInfo deviceQueueCreateInfo(vk::DeviceQueueCreateFlags(), static_cast<uint32_t>(graphicsQueueFamilyIndex), 1, &queuePriority);


It seems that a lot of work is encapsulated in the function vk::DeviceQueueCreateFlags().



However looking through the source with my editor is not revealing anything useful. I was hoping someone with more experience could provide some information as to what the function is doing.










share|improve this question



















  • 2





    since vk::DeviceQueueCreateInfo ctor always take the flags type as the first field, you can reduce boilerplate by expressing an empty set of flags as rather than something like vk::DeviceQueueCreateFlags()

    – Jherico
    Mar 24 at 23:34













1












1








1








The C like way to initialize this structure is:



VkDeviceQueueCreateInfo queueCreateInfo = ;
queueCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
queueCreateInfo.queueFamilyIndex = queueFamily;
queueCreateInfo.queueCount = 1;
queueCreateInfo.pQueuePriorities = &queuePriority;


The C++ way, using and abusing the vulkan.hpp header, is:



vk::DeviceQueueCreateInfo deviceQueueCreateInfo(vk::DeviceQueueCreateFlags(), static_cast<uint32_t>(graphicsQueueFamilyIndex), 1, &queuePriority);


It seems that a lot of work is encapsulated in the function vk::DeviceQueueCreateFlags().



However looking through the source with my editor is not revealing anything useful. I was hoping someone with more experience could provide some information as to what the function is doing.










share|improve this question
















The C like way to initialize this structure is:



VkDeviceQueueCreateInfo queueCreateInfo = ;
queueCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
queueCreateInfo.queueFamilyIndex = queueFamily;
queueCreateInfo.queueCount = 1;
queueCreateInfo.pQueuePriorities = &queuePriority;


The C++ way, using and abusing the vulkan.hpp header, is:



vk::DeviceQueueCreateInfo deviceQueueCreateInfo(vk::DeviceQueueCreateFlags(), static_cast<uint32_t>(graphicsQueueFamilyIndex), 1, &queuePriority);


It seems that a lot of work is encapsulated in the function vk::DeviceQueueCreateFlags().



However looking through the source with my editor is not revealing anything useful. I was hoping someone with more experience could provide some information as to what the function is doing.







c++ graphics gpu vulkan






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 23:11







Makogan

















asked Mar 24 at 21:54









MakoganMakogan

1,9942933




1,9942933







  • 2





    since vk::DeviceQueueCreateInfo ctor always take the flags type as the first field, you can reduce boilerplate by expressing an empty set of flags as rather than something like vk::DeviceQueueCreateFlags()

    – Jherico
    Mar 24 at 23:34












  • 2





    since vk::DeviceQueueCreateInfo ctor always take the flags type as the first field, you can reduce boilerplate by expressing an empty set of flags as rather than something like vk::DeviceQueueCreateFlags()

    – Jherico
    Mar 24 at 23:34







2




2





since vk::DeviceQueueCreateInfo ctor always take the flags type as the first field, you can reduce boilerplate by expressing an empty set of flags as rather than something like vk::DeviceQueueCreateFlags()

– Jherico
Mar 24 at 23:34





since vk::DeviceQueueCreateInfo ctor always take the flags type as the first field, you can reduce boilerplate by expressing an empty set of flags as rather than something like vk::DeviceQueueCreateFlags()

– Jherico
Mar 24 at 23:34












1 Answer
1






active

oldest

votes


















4














It's an alias for vk::Flags, which is a template for dealing with Vulkan bitfields in a type-safe manor.



You want enumerations to be type-safe; you don't want implicit conversions to/from integers. So in C++, you do this by defining the enumeration to be an enum class.



That's fine for regular enumerations. But bitfields are special; they're combinations of enumerators from a specific enumeration. The typical post-C++11 solution is to just give the enumeration type overloaded operators, so that you can apply & and | to the enumeration type itself.



Personally, this solution always rubbed me the wrong way. To me, a strong enumeration type should hold one of the enum values, not several of them. So using operator overloading to effectively allow an enumeration value to lie didn't sit well with me.



Apparently I'm not alone in that, because the writers of vulkan.hpp opted for a different solution. They created a template class vk::Flags, which takes two template parameters. One of them is the enumeration that contains all of the valid bitflags. The second parameter is the "enumeration" that represents the concatenation of multiple flags. Which is something that the vulkan.xml specification file actually understands: the difference between the field containing the possible bits and the field which is an aggregation of bits.



vk::Flags can be given bits from the bitfield, and you can manipulate it with bits from that bitfield via some of the bitwise operators. And it is implicitly convertible to the type that represents the aggregation of bits.



So DeviceQueueCreateInfo is just an alias for Flags<DeviceQueueCreateFlagBits, VkDeviceQueueCreateFlags>, which is a bitfield that takes device creation bits and aggregates them into the flags aggregate.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328943%2fwhat-does-vkdevicequeuecreateflags-actually-do%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    It's an alias for vk::Flags, which is a template for dealing with Vulkan bitfields in a type-safe manor.



    You want enumerations to be type-safe; you don't want implicit conversions to/from integers. So in C++, you do this by defining the enumeration to be an enum class.



    That's fine for regular enumerations. But bitfields are special; they're combinations of enumerators from a specific enumeration. The typical post-C++11 solution is to just give the enumeration type overloaded operators, so that you can apply & and | to the enumeration type itself.



    Personally, this solution always rubbed me the wrong way. To me, a strong enumeration type should hold one of the enum values, not several of them. So using operator overloading to effectively allow an enumeration value to lie didn't sit well with me.



    Apparently I'm not alone in that, because the writers of vulkan.hpp opted for a different solution. They created a template class vk::Flags, which takes two template parameters. One of them is the enumeration that contains all of the valid bitflags. The second parameter is the "enumeration" that represents the concatenation of multiple flags. Which is something that the vulkan.xml specification file actually understands: the difference between the field containing the possible bits and the field which is an aggregation of bits.



    vk::Flags can be given bits from the bitfield, and you can manipulate it with bits from that bitfield via some of the bitwise operators. And it is implicitly convertible to the type that represents the aggregation of bits.



    So DeviceQueueCreateInfo is just an alias for Flags<DeviceQueueCreateFlagBits, VkDeviceQueueCreateFlags>, which is a bitfield that takes device creation bits and aggregates them into the flags aggregate.






    share|improve this answer



























      4














      It's an alias for vk::Flags, which is a template for dealing with Vulkan bitfields in a type-safe manor.



      You want enumerations to be type-safe; you don't want implicit conversions to/from integers. So in C++, you do this by defining the enumeration to be an enum class.



      That's fine for regular enumerations. But bitfields are special; they're combinations of enumerators from a specific enumeration. The typical post-C++11 solution is to just give the enumeration type overloaded operators, so that you can apply & and | to the enumeration type itself.



      Personally, this solution always rubbed me the wrong way. To me, a strong enumeration type should hold one of the enum values, not several of them. So using operator overloading to effectively allow an enumeration value to lie didn't sit well with me.



      Apparently I'm not alone in that, because the writers of vulkan.hpp opted for a different solution. They created a template class vk::Flags, which takes two template parameters. One of them is the enumeration that contains all of the valid bitflags. The second parameter is the "enumeration" that represents the concatenation of multiple flags. Which is something that the vulkan.xml specification file actually understands: the difference between the field containing the possible bits and the field which is an aggregation of bits.



      vk::Flags can be given bits from the bitfield, and you can manipulate it with bits from that bitfield via some of the bitwise operators. And it is implicitly convertible to the type that represents the aggregation of bits.



      So DeviceQueueCreateInfo is just an alias for Flags<DeviceQueueCreateFlagBits, VkDeviceQueueCreateFlags>, which is a bitfield that takes device creation bits and aggregates them into the flags aggregate.






      share|improve this answer

























        4












        4








        4







        It's an alias for vk::Flags, which is a template for dealing with Vulkan bitfields in a type-safe manor.



        You want enumerations to be type-safe; you don't want implicit conversions to/from integers. So in C++, you do this by defining the enumeration to be an enum class.



        That's fine for regular enumerations. But bitfields are special; they're combinations of enumerators from a specific enumeration. The typical post-C++11 solution is to just give the enumeration type overloaded operators, so that you can apply & and | to the enumeration type itself.



        Personally, this solution always rubbed me the wrong way. To me, a strong enumeration type should hold one of the enum values, not several of them. So using operator overloading to effectively allow an enumeration value to lie didn't sit well with me.



        Apparently I'm not alone in that, because the writers of vulkan.hpp opted for a different solution. They created a template class vk::Flags, which takes two template parameters. One of them is the enumeration that contains all of the valid bitflags. The second parameter is the "enumeration" that represents the concatenation of multiple flags. Which is something that the vulkan.xml specification file actually understands: the difference between the field containing the possible bits and the field which is an aggregation of bits.



        vk::Flags can be given bits from the bitfield, and you can manipulate it with bits from that bitfield via some of the bitwise operators. And it is implicitly convertible to the type that represents the aggregation of bits.



        So DeviceQueueCreateInfo is just an alias for Flags<DeviceQueueCreateFlagBits, VkDeviceQueueCreateFlags>, which is a bitfield that takes device creation bits and aggregates them into the flags aggregate.






        share|improve this answer













        It's an alias for vk::Flags, which is a template for dealing with Vulkan bitfields in a type-safe manor.



        You want enumerations to be type-safe; you don't want implicit conversions to/from integers. So in C++, you do this by defining the enumeration to be an enum class.



        That's fine for regular enumerations. But bitfields are special; they're combinations of enumerators from a specific enumeration. The typical post-C++11 solution is to just give the enumeration type overloaded operators, so that you can apply & and | to the enumeration type itself.



        Personally, this solution always rubbed me the wrong way. To me, a strong enumeration type should hold one of the enum values, not several of them. So using operator overloading to effectively allow an enumeration value to lie didn't sit well with me.



        Apparently I'm not alone in that, because the writers of vulkan.hpp opted for a different solution. They created a template class vk::Flags, which takes two template parameters. One of them is the enumeration that contains all of the valid bitflags. The second parameter is the "enumeration" that represents the concatenation of multiple flags. Which is something that the vulkan.xml specification file actually understands: the difference between the field containing the possible bits and the field which is an aggregation of bits.



        vk::Flags can be given bits from the bitfield, and you can manipulate it with bits from that bitfield via some of the bitwise operators. And it is implicitly convertible to the type that represents the aggregation of bits.



        So DeviceQueueCreateInfo is just an alias for Flags<DeviceQueueCreateFlagBits, VkDeviceQueueCreateFlags>, which is a bitfield that takes device creation bits and aggregates them into the flags aggregate.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 23:00









        Nicol BolasNicol Bolas

        298k35497673




        298k35497673





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328943%2fwhat-does-vkdevicequeuecreateflags-actually-do%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript