• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
d3stnd

DirectX11 Swap Chain Format

5 posts in this topic

I was wondering if anyone could elaborate any further on something thats been bugging me.
 
In DirectX9 the main supported back buffer formats were
D3DFMT_X8R8B8G8 and D3DFMT_A8R8G8B8 (Both being BGRA in layout).
 
 
With the initial version of DirectX10 their was no support for BGRA and all the textbooks (On both DirectX10 and 11) and online tutorials recommend
 
DXGI_FORMAT_R8G8B8A8_UNORM (being RGBA in layout).
 
Now with DirectX11 BGRA is supported again and it seems as if microsoft recommends using a BGRA format as the back buffer format.
 
 
Is their any suggestions or are their performance implications of using one or the other.
 
(I assume not as obviously by specifying the format of the underlying resource the runtime will handle what bits your passing through and than infer how to utilise them based on the format).
 
Any feedback is appreciated.
 

 

0

Share this post


Link to post
Share on other sites

It has to do with the way your back-buffer gets to the screen. There's at least one copy involved(back-buffer=>screen), so if your back-buffer format matches the screen-format(BGRA8), then theoretically this copy operations should run faster. 

 

Read this for a better explanation on how present works, and differences between the Win8 flip-model to the Win7 blit-model.

1

Share this post


Link to post
Share on other sites
Thanks for the reply.

Ive read this article before And i noticed that it mentions you can still use the rgba format with flip and DWM will still compose the screen without a copy. So what about vista or windows 7 with directx 10/11 where flip sequential might not be available or using say discard as the presentation model?
0

Share this post


Link to post
Share on other sites


So what about vista or windows 7 with directx 10/11 where flip sequential might not be available or using say discard as the presentation model?

It will use an additional BitBlit() to copy the DX surface to an intermediate DWM surface, which is slower. But same principal holds - if the swap-chain format matches the screen-format, this operation will be faster. When using the BitBlit mode, you also have more options for swap-chain formats.

1

Share this post


Link to post
Share on other sites

 


So what about vista or windows 7 with directx 10/11 where flip sequential might not be available or using say discard as the presentation model?

It will use an additional BitBlit() to copy the DX surface to an intermediate DWM surface, which is slower. But same principal holds - if the swap-chain format matches the screen-format, this operation will be faster. When using the BitBlit mode, you also have more options for swap-chain formats.

 

This is not completely true for windows 7. As long your backbuffer matches your front buffer and you have your swap chain set to full screen. It will not bitblt, but swap the backbuffer with the front. The only time it bitblt is when the swapchain is in window mode or when the swap chain back buffer does not match the front buffer width/heigh and format.

1

Share this post


Link to post
Share on other sites

Hi Guys,

 

After doing my research (of which I already knew half cheers for the information about the flip presentation info btw).

Heres my findings:

 

Now when using the discard presentation in a Win32 app it passes the render target to DWM which then blits the target to the screen and when in full screen mode (provided you have resized your back buffer and refresh rate correctly) it will disable DWM and perform flips to render the scene.

Now with metro apps there's no such thing as full screen exclusive (as they are essentially borderless window). So they would blit all the time (the discard presentation model is actually not allowed for metro apps).

So you have to set the presentation model to flip in Win32 apps and metro apps(with this being your only option for metro :]). It will than pass your render target to DWM (I assume maybe it allows you access to its underlying target to draw into and uses dirty rectangles), and instead of blitting it will straight up flip/merge your target into the screen space it currently resides in and you get flip performance and in full screen it does the flip (assuming you resized buffers and refresh rate).

Now for some reason the windows default back buffer for the OS is BGR and if you use this as your back buffer format the flip is slightly faster as it doesn't have to swizzle or do whatever it does to merge/flip. But you can use either RGBA or BGRA.

Heres the msdn explaining the new presentation model: http://msdn.microsoft.com/en-us/library/windows/desktop/hh706346%28v=vs.85%29.aspx

And heres another msdn confirming the slightly faster flip with bgra:http://social.msdn.microsoft.com/Forums/windowsapps/en-US/f56e4449-f3e1-491e-9f64-e65e989a518a/best-swap-buffer-format-rgba-or-bgra-

1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0