Andrew Cox http://ahcox.com Getting excited about computer graphics, GPUs, Vulkan, and gamedev Tue, 16 Apr 2019 15:36:53 +0000 en-GB hourly 1 https://wordpress.org/?v=5.1.1 C++ Compilers Generating Rotate Instructions http://ahcox.com/cpp/c-compilers-generating-rotate-instructions/ http://ahcox.com/cpp/c-compilers-generating-rotate-instructions/#respond Tue, 20 Feb 2018 16:07:12 +0000 http://ahcox.com/?p=819 I just did a quick test in Compiler explorer and it was nice to see both GCC and Clang generating single rotate instructions from these equivalent sequences of operations. inline uint32_t uint32_rol(uint32_t _a, int _sa) { return ( _a << _sa) | (_a >> (32-_sa)...

The post C++ Compilers Generating Rotate Instructions appeared first on Andrew Cox.

]]>
I just did a quick test in Compiler explorer and it was nice to see both GCC and Clang generating single rotate instructions from these equivalent sequences of operations.

inline uint32_t uint32_rol(uint32_t _a, int _sa)
{
    return ( _a << _sa) | (_a >> (32-_sa) );
}

inline uint32_t uint32_ror(uint32_t _a, int _sa)
{
    return ( _a >> _sa) | (_a << (32-_sa) );
}

E.g., for Clang on x64:

uint32_do_ror(unsigned int, int):
    mov     ecx, esi
    ror     edi, cl
    mov     eax, edi
    ret

uint32_do_rol(unsigned int, int):
    mov     ecx, esi
    rol     edi, cl
    mov     eax, edi
    ret

When inlined into a loop, the rotate was not generated by clang, although it was by gcc. I presume that’s because some other optimisation pass had moved code around enough to stop the rotate pattern being matched. The full example is here on Godbolt. Code courtesy of Mike Acton’s uint32_t header.

The post C++ Compilers Generating Rotate Instructions appeared first on Andrew Cox.

]]>
http://ahcox.com/cpp/c-compilers-generating-rotate-instructions/feed/ 0
Vulkan 1.0 Released http://ahcox.com/vulkan/vulkan-news/vulkan-1-0-released/ http://ahcox.com/vulkan/vulkan-news/vulkan-1-0-released/#respond Tue, 16 Feb 2016 19:42:26 +0000 http://ahcox.com/?p=696 Get it here: https://www.khronos.org/vulkan/

The post Vulkan 1.0 Released appeared first on Andrew Cox.

]]>
Get it here: https://www.khronos.org/vulkan/

The post Vulkan 1.0 Released appeared first on Andrew Cox.

]]>
http://ahcox.com/vulkan/vulkan-news/vulkan-1-0-released/feed/ 0
Game Development Resources http://ahcox.com/game-development/game-development-resources/ http://ahcox.com/game-development/game-development-resources/#respond Wed, 18 Nov 2015 16:08:03 +0000 http://ahcox.com/?p=679 The post Game Development Resources appeared first on Andrew Cox.

]]>
The post Game Development Resources appeared first on Andrew Cox.

]]>
http://ahcox.com/game-development/game-development-resources/feed/ 0
Official SPIR-V assembler, binary module parser, disassembler, and validator released on GitHub http://ahcox.com/vulkan/shader-tools/official-spir-v-assembler-binary-module-parser-disassembler-and-validator-released-on-github/ http://ahcox.com/vulkan/shader-tools/official-spir-v-assembler-binary-module-parser-disassembler-and-validator-released-on-github/#respond Mon, 16 Nov 2015 16:36:44 +0000 http://ahcox.com/?p=674 SPIR-V (no relation to any previous SPIR-whatever) is the binary intermediate format for shaders in Vulkan. The officials tools for going from the textual form of it to the binary one and back again have been released as an open source project on GitHub here....

The post Official SPIR-V assembler, binary module parser, disassembler, and validator released on GitHub appeared first on Andrew Cox.

]]>
SPIR-V (no relation to any previous SPIR-whatever) is the binary intermediate format for shaders in Vulkan. The officials tools for going from the textual form of it to the binary one and back again have been released as an open source project on GitHub here. These were developed by the Scottish GPU compiler powerhouse Codeplay by people like @KMBenzie.

The post Official SPIR-V assembler, binary module parser, disassembler, and validator released on GitHub appeared first on Andrew Cox.

]]>
http://ahcox.com/vulkan/shader-tools/official-spir-v-assembler-binary-module-parser-disassembler-and-validator-released-on-github/feed/ 0
Vulkan Window System Integration Talk at SIGGRAPH 2015 http://ahcox.com/vulkan/wsi/vulkan-window-system-integration-talk-at-siggraph-2015/ http://ahcox.com/vulkan/wsi/vulkan-window-system-integration-talk-at-siggraph-2015/#respond Mon, 19 Oct 2015 20:38:51 +0000 http://ahcox.com/?p=548 Alon Or-bach of Samsung gave this presentation on the Vulkan Window System Integration at SIGGRAPH 2015. WSI is the mechanism by which images rendered with Vulkan appear on a screen. We can get a fair bit of information about how the system works from this...

The post Vulkan Window System Integration Talk at SIGGRAPH 2015 appeared first on Andrew Cox.

]]>

Alon Or-bach of Samsung gave this presentation on the Vulkan Window System Integration at SIGGRAPH 2015. WSI is the mechanism by which images rendered with Vulkan appear on a screen. We can get a fair bit of information about how the system works from this talk. I am posting it a bit late but it is the latest WSI information available and I have added my notes on it below.

Vulkan WSI has a notion of a platform, and the intention of it is to abstract you from the particular operating system or windowing system your app is running on. Vulkan physical devices advertise properties of their queues, and with the WSI extension, a property of those queues is the ability to present images to the presentation engine. The presentation engine is an abstraction for the system compositor or whatever process gets rendered pixels to a screen. A presentable image is a standard VkImage from the point of view of a Vulkan app, but created by the platform (probably by the presentation engine). Being presentable means that it can be fed into the presentation engine via WSI to eventually be displayed, as well as being a target for rendering within a Vulkan app. A set of presentable images is formed into a swapchain for reuse, where each image in the chain is either under control of the app or the presentation engine at any given moment, with explicit synchronization via a semaphore to control the handover of images between app and WSI.

Allocation of presentable VkImages is done up-front ahead of time. The system thus knows all the images which can ever be presented to it. The application asks for a minimum number of images and the presentation engine will return at least that number. There is also a mechanism to tell the application that it needs to recreate a swap chain. This comes into effect when the window is resized for example.

Presentable images are either under the control of the presentation engine or of the application and it is an error for the application to attempt to draw to an image that is being displayed. Acquiring the next image from the presentation engine for the application to rendered into and presenting a complete image from the application to the presentation engine are two separate operations. This separation allows the acquire to occur at the point in the app’s render loop after it has done side work like dynamic command buffer generation and just before it wants to submit its first drawing commands, and allows the present to be at the end of it. This separation should allow the CPU to do other useful things after a present before it has to enter a potentially blocking acquire during the next iteration of its display loop.

Update 2015-10-29:

Tobias Hector of Imagination has spoken about this a little in a newer video.

The post Vulkan Window System Integration Talk at SIGGRAPH 2015 appeared first on Andrew Cox.

]]>
http://ahcox.com/vulkan/wsi/vulkan-window-system-integration-talk-at-siggraph-2015/feed/ 0
Imagination to Deliver 5 Webinars on Vulkan http://ahcox.com/vulkan/imagination-to-deliver-5-webinars-on-vulkan/ http://ahcox.com/vulkan/imagination-to-deliver-5-webinars-on-vulkan/#respond Mon, 19 Oct 2015 20:04:42 +0000 http://ahcox.com/?p=531 Imagination Technologies is incrementally releasing five YouTube videos on Vulkan with accompanying blog posts in the run-up to the end of 2015. All five are embedded below and will be playable as they are released. Read more on their website, and track the blog posts there too....

The post Imagination to Deliver 5 Webinars on Vulkan appeared first on Andrew Cox.

]]>
Imagination Technologies is incrementally releasing five YouTube videos on Vulkan with accompanying blog posts in the run-up to the end of 2015. All five are embedded below and will be playable as they are released. Read more on their website, and track the blog posts there too.

Video  1, One API for all platforms

Video 2, High efficiency on mobile

Video 3, Scaling to multiple threads

Video 4, Explicit operation and consistent frame times

Video 5, Architecture positive: how the Vulkan API works for PowerVR GPUs

 

 

 

 

 

 

 

The post Imagination to Deliver 5 Webinars on Vulkan appeared first on Andrew Cox.

]]>
http://ahcox.com/vulkan/imagination-to-deliver-5-webinars-on-vulkan/feed/ 0
Tobias Hector of Imagination Technology Writes About Capabilities, Limits, Extensions, and Profiles for Vulkan http://ahcox.com/vulkan/vulkan-news/tobias-hector-of-imagination-technology-writes-about-capabilities-limits-extensions-and-profiles-for-vulkan/ http://ahcox.com/vulkan/vulkan-news/tobias-hector-of-imagination-technology-writes-about-capabilities-limits-extensions-and-profiles-for-vulkan/#respond Mon, 19 Oct 2015 19:51:30 +0000 http://ahcox.com/?p=532     Tobias, who is one of the key figures in the Vulkan efforts at Imagination (you may have seen him previously talking about their gnomes demo), has written about the mechanisms in Vulkan to account for the differences between implementations of the API on...

The post Tobias Hector of Imagination Technology Writes About Capabilities, Limits, Extensions, and Profiles for Vulkan appeared first on Andrew Cox.

]]>

Tobias Hector

This week I’ll begin by talking about what it means for Vulkan to be one API designed for all platforms

 

 

Tobias, who is one of the key figures in the Vulkan efforts at Imagination (you may have seen him previously talking about their gnomes demo), has written about the mechanisms in Vulkan to account for the differences between implementations of the API on the wide variety of hardware and platforms. It is a quick read, so check it out here.

He also has a video on the same topic:

 

The post Tobias Hector of Imagination Technology Writes About Capabilities, Limits, Extensions, and Profiles for Vulkan appeared first on Andrew Cox.

]]>
http://ahcox.com/vulkan/vulkan-news/tobias-hector-of-imagination-technology-writes-about-capabilities-limits-extensions-and-profiles-for-vulkan/feed/ 0
Showing the Size of a Class in the C++ Compiler Output http://ahcox.com/cpp/showing-the-size-of-a-class-in-the-c-compiler-output/ http://ahcox.com/cpp/showing-the-size-of-a-class-in-the-c-compiler-output/#respond Thu, 03 Sep 2015 09:20:32 +0000 http://ahcox.com/?p=449 Paste your own class in place of TestStruct in the snippet here to test it out.

The post Showing the Size of a Class in the C++ Compiler Output appeared first on Andrew Cox.

]]>
Paste your own class in place of TestStruct in the snippet here to test it out.
enter image description here

The post Showing the Size of a Class in the C++ Compiler Output appeared first on Andrew Cox.

]]>
http://ahcox.com/cpp/showing-the-size-of-a-class-in-the-c-compiler-output/feed/ 0
Vulkan SDK From LunarG http://ahcox.com/vulkan/vulkan-sdk-from-lunarg/ http://ahcox.com/vulkan/vulkan-sdk-from-lunarg/#respond Fri, 21 Aug 2015 12:32:35 +0000 http://ahcox.com/?p=400 LunarG are preparing a Vulkan driver and tools as part of a SDK sponsored by Valve. They advertise Linux, Android, and windows support in the video above. Sign up for updates here.

The post Vulkan SDK From LunarG appeared first on Andrew Cox.

]]>

LunarG are preparing a Vulkan driver and tools as part of a SDK sponsored by Valve. They advertise Linux, Android, and windows support in the video above. Sign up for updates here.

The post Vulkan SDK From LunarG appeared first on Andrew Cox.

]]>
http://ahcox.com/vulkan/vulkan-sdk-from-lunarg/feed/ 0
Vulkan Overview and Demos at GDC 2015 [Video] http://ahcox.com/vulkan/vulkan-news/vulkan-overview-demos-gdc-2015-video/ http://ahcox.com/vulkan/vulkan-news/vulkan-overview-demos-gdc-2015-video/#respond Sat, 07 Mar 2015 00:24:36 +0000 http://ahcox.com/?p=332 Highlights 0:015:00 Graham Sellers does a walk-through of a complete application, explaining bits of Vulkan API along the way. 0:35:45 John Kessenich Goes through the SPIR-V shader and kernel binary intermediate representation. If you have some suggestions of highlights and key points, let me know...

The post Vulkan Overview and Demos at GDC 2015 [Video] appeared first on Andrew Cox.

]]>

Highlights

  • 0:015:00 Graham Sellers does a walk-through of a complete application, explaining bits of Vulkan API along the way.
  • 0:35:45 John Kessenich Goes through the SPIR-V shader and kernel binary intermediate representation.

If you have some suggestions of highlights and key points, let me know in the comments below.

Vulkan, Khronos, Valve, GDC, Nvidia, Imagination, LunarG, ARM

The post Vulkan Overview and Demos at GDC 2015 [Video] appeared first on Andrew Cox.

]]>
http://ahcox.com/vulkan/vulkan-news/vulkan-overview-demos-gdc-2015-video/feed/ 0