(sweet!) New Vulkan features just released!

Started by
5 comments, last by Sik_the_hedgehog 8 years, 1 month ago
Kronos Group released a new version of Vulkan (v1.1rc). You can find more details on the Vulkan homepage.

I don't understand everything they're talking about - some of it is just over my head, but one thing really caught my attention:
To reduce even more driver overhead, and to better compete against DirectX 12, they added a new way to set and store model state in optimized memory locations on the GPU.

Supposedly this speeds up matrix-based transformation operations by as much as 12%, which is important since we transform tens of millions of vertices a frame. Fillrate is still the main bottleneck, but still this is a great improvement and might save you a few milliseconds per frame on the GPU's side.

AMD was giving a video example of it behind closed doors today, but the video is behind a paywall and required me to sign a NDA. If you can't access it, in the video they showed this example code:

[rollup="AMD example code"]
vkBegin(); //Begins a series of Vulkan commands.

     vkPushMatrix(VK_MODELVIEW); //Pushes a new matrix, so the videocard keeps it in memory for the future operations.

        vkPushVertex3f(1.0f, 1.0f, 0.0f, nullptr); //Pushes a vertex as part of a 3D model. Always pass 'nullptr' into the fourth parameter,
        vkPushVertex3f(0.0f, 0.5f, 0.0f, nullptr); //because it's just there for future extensibility. Though if you currently have a VK_PROJECTION matrix bound,
        vkPushVertex3f(0.0f, 0.5f, 0.0f, nullptr); //you have to cast a boolean 'true' value to a void* and pass that in, or nothing will draw.
    
     vkPopMatrix();
 
vkEnd(AMD_extension_optimize_for_specific_driver_version_223242114a); //Ends the series of Vulkan commands, or else crashes.
[/rollup]

I'm rather excited to get a chance to try this out, but the drivers won't be released until 2019, and will only support one chipset. DirectX 12 is pretty much dead.
Advertisement

I was about to report this to moderators so they could move it to a better suited forum. Shame on you!

Hello to all my stalkers.

Well...

Everybody knows that the fixed function pipeline performs better than using any modern graphics programming techniques, especially when you OOP the !@#$ out of your design. Drawing a set of quads? That’ll be 350 system calls per quad, please.

That's some seriously cutting edge stuff. Given the naming semantics, they're obviously using a stack (or several), and everyone knows doing stuff on the stack is faster.

I hope this is a joke, since this remembers my bad ol' days when i started OpenGL 1... :unsure: Damn fixed function pipeline!!! :angry:

Hey, have a look at my Telegram channel about programming: www.telegram.me/theprogrammingart

Could've waited the extra two weeks for April 1st :P :lol:


void FillRect(float x1, float y1, float x2, float y2, unsigned color)
{
   float r = (color >> 24 & 0xFF) / 255.0f;
   float g = (color >> 16 & 0xFF) / 255.0f;
   float b = (color >> 8 & 0xFF) / 255.0f;
   float a = (color & 0xFF) / 255.0f;
   
   vkBegin();
   vkPushMatrix(VK_MODELVIEW);
   vkPushColor4f(r, g, b, a, nullptr);
   vkPushVertex3f(x1, y1, 0.0f, nullptr);
   vkPushVertex3f(x1, y2, 0.0f, nullptr);
   vkPushVertex3f(x2, y2, 0.0f, nullptr);
   vkPushVertex3f(x1, y1, 0.0f, nullptr);
   vkPushVertex3f(x2, y2, 0.0f, nullptr);
   vkPushVertex3f(x2, y1, 0.0f, nullptr);
   vkPopMatrix();
   vkEnd(AMD_extension_optimize_for_specific_driver_version_223242114a);
}

For the record, while immediate mode is indeed slow by today's standards =P I wonder how much performance was lost in OpenGL simply by developers insisting on taking control over everything. To me it was pretty obvious the idea was for the driver to figure out the best way to do things (not as hard as it sounds since the driver is specific to the hardware in question anyway, so it can safely make lots of assumptions), but bad implementations certainly hampered that as well =/ Sucks since the driver is the one that knows best, especially on platforms without fixed hardware specs (PCs, anyone?).

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

This topic is closed to new replies.

Advertisement