Sign in to follow this  

DX11 Reading/writing 16 bit unsigned integers from/to buffer

Recommended Posts

_void_    864

Hi guys,

I would like to double-check with you if I am correct.


I have a buffer of unsigned integers of format DXGI_FORMAT_R16_UINT, which I would like to read from the shader.

Since there is no dedicated HLSL 16 bit unsigned int type, I guess we should go with HLSL uint (32 bit) type.

Buffer<uint> g_InputBuffer : register(t0); // DXGI_FORMAT_R16_UINT

In this case, will each element of the input buffer be automatically converted into a corresponding uint (32 bit) element?


And vice versa, if I want to output to buffer of type DXGI_FORMAT_R16_UINT, I guess HLSL uint will be automatically converted to 16 bit unsigned?

RWBuffer<uint> g_OutputBuffer : register(u0); // DXGI_FORMAT_R16_UINT

uint value = ...

g_OutputBuffer[outIndex] = value;



Edited by _void_

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  

  • Similar Content

    • By ilovegames
      Beat Spirit is a fun game in the Side-Scroller genre with elements of RPG. You'll have to fight the undead in different locations and under varying conditions. The playroom is generated, so you will always have to wait for something new and different. Earn gold and discover new things! The game is quite hardcore and unusual. Try something new

    • By ilovegames
      You are a US Army soldier, and one day an unknown enemy attacked your base. Now your task is to survive and protect the base. There are a lot of weapons in your arsenal. Survive this nightmare at any cost. 

    • By ilovegames
      Hold out as long as possible in the "Arena of Death." Only your skill and the correct tactics of combat will help you survive in the Arena. Nine types of weapons are at your disposal, but remember that cartridges are limited and they need to be spent wisely. You must prioritize the position and the type of weapons in order to achieve victory.   Awaiting you:   - 9 types of weapons - Dynamic gameplay - Different types of opponents, with their own characteristics and weaknesses - Increasing complexity   Download

    • By Waldemar Umaniz

      Dawn of a Soul
      a mathematical puzzle game starring chains and combos.
      The main mechanics of the game are chains and combos. The rules are simpel (i hope :D), the player has to build chains of specific colors and combine them to get multiplier and to be able to build more chains and expand the combo. The multiplier are importand to get the highest possible score. In some puzzles the player has to alter the gamefiled, within limited number of moves and discover visual and mathematical pattern. But she/he need to keep them adaptable to new challenges and only then it will be possible to beat all 64 Puzzles.
      It will be released at 2. Okt. 2017 for Windows and Mac on Steam and

    • By Playniax
      Hi guys,

      This will be the place where I will keep you up to date you on the latest Playniax game templates and assets.
      Most of it you can find on also.
      Some of our assets are free, some of them are not.
      For starters, I just released the game template 'keep-mining'

      After purchase you can reskin the game, change the title, design levels, change the music and monetize it anyway you like!
      And 'fair usage' support from us!
      Final builds should work on Android, iOS, HTML5, Windows and OSX!

      Play demo here:
  • Popular Now