Jump to content
  • Advertisement
Sebastian Werema

DX11 Papers for data structures in hlsl without CUDA

Recommended Posts

Do you know any papers that cover custom data structures like lists or binary trees implemented in hlsl without CUDA that work perfectly fine no matter how many threads try to use them at any given time?

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)
20 hours ago, Sebastian Werema said:

Do you know any papers that cover custom data structures like lists or binary trees implemented in hlsl without CUDA that work perfectly fine no matter how many threads try to use them at any given time?

HLSL is not a great fit for general purpose solutions for such containers. But if you are looking for a specific technique, then it has great tools to implement a custom fit solution. Lists can be efficiently created using atomics and wave intrinsics, and I also heard of octrees being implemented. Maybe ask if you have anything specific in mind and more people could help? :)

Edited by turanszkij

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

  • Advertisement
  • Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Luca Falco
      https://www.youtube.com/watch?v=UMoc52DEoC8     ABOUT THE GAME: Room54 is a first-person Horror/adventure  Videogame for pc,mac and linux users. the game is currently under development by a very small team, we put so much effort in this project and we are keep doing our best for that we are going to launch a kickstarter campaing in order to reach our ideal budget to complete the project, we hope the GameDev community can help us a lot                      STORY:   Daniel is a family father like many other, one day he decide with your wife and his daughter  to spend her winter holidays at their mountain house that they have recently buy in  mountain ,a  wonderful place surrounded by the nature of the woods,  Completely far away from the caotic city life. During their holidays Daniel and his family will understand that they are not welcome there and they will discover an  hided and disturbing part of the valley that they have never seen before                       GAMEPLAY:   You will play as Daniel, a father that will try to save his family, your gameplay will be focused on discovering secrets places around valley,investigating and trying to survive, you will find object that will help you solve enigma and to stay alive. The immersive audio and  environment will make you feel constantly follow by an high anxiety dose  during the game.                         SOCIAL PAGES:     Follow us to get the latest development news and insights     IndieDB:     http://www.indiedb.com/games/room54   Twitter:       https://twitter.com/Room54Thegame   facebook:   https://www.facebook.com/Room54/
    • By SickTwistGames
      Ok, firstly, Hi.
       
      This is my first post on this forum. I am an Indie Dev making my first game so bear with me when I say dumb stuff, I'm on a huge learning curve.
       
      My first question is about inventory systems for unity. I am trying to make a survival type game with crafting. I have purchased Inventory manager pro by devdog from the unity asset store and it seems like a pretty powerful assett but for an intermediate coder its a little tough to use.  I'm beginning to wonder if it was the right purchase.
      So my question is.... does anyone have any experience of inventory plugins / systems for unity and can anyone reccomend a system to me?
      It needs to have the following: Loot system, crafting system, character sheet, blueprint system,  character stats system. Ideally with as little coding as possible.
       
      Thanks
    • By Gnollrunner
      Hi again,  After some looking around I have decided to base my game directly on Direct X rather than using an existing game engine.  Because of the nature of the stuff I'm doing it just didn't seem to fit very well and I kept running into road blocks.  At this point I have a big blob of code for doing fractal world generation and some collision code,  and I'm trying to put it into some form that resembles a game engine.  Since I've never used one before It's a bit alien to me ..... so can someone direct me to a book, website, article, whatever... that covers this?  I'm mainly looking for stuff that covers C++ library design. I'm not adverse to using 3rd party tools for stuff I can used them for.
    • By chiffre
      Introduction:
      In general my questions pertain to the differences between floating- and fixed-point data. Additionally I would like to understand when it can be advantageous to prefer fixed-point representation over floating-point representation in the context of vertex data and how the hardware deals with the different data-types. I believe I should be able to reduce the amount of data (bytes) necessary per vertex by choosing the most opportune representations for my vertex attributes. Thanks ahead of time if you, the reader, are considering the effort of reading this and helping me.
      I found an old topic that shows this is possible in principal, but I am not sure I understand what the pitfalls are when using fixed-point representation and whether there are any hardware-based performance advantages/disadvantages.
      (TLDR at bottom)
      The Actual Post:
      To my understanding HLSL/D3D11 offers not just the traditional floating point model in half-,single-, and double-precision, but also the fixed-point model in form of signed/unsigned normalized integers in 8-,10-,16-,24-, and 32-bit variants. Both models offer a finite sequence of "grid-points". The obvious difference between the two models is that the fixed-point model offers a constant spacing between values in the normalized range of [0,1] or [-1,1], while the floating point model allows for smaller "deltas" as you get closer to 0, and larger "deltas" the further you are away from 0.
      To add some context, let me define a struct as an example:
      struct VertexData { float[3] position; //3x32-bits float[2] texCoord; //2x32-bits float[3] normals; //3x32-bits } //Total of 32 bytes Every vertex gets a position, a coordinate on my texture, and a normal to do some light calculations. In this case we have 8x32=256bits per vertex. Since the texture coordinates lie in the interval [0,1] and the normal vector components are in the interval [-1,1] it would seem useful to use normalized representation as suggested in the topic linked at the top of the post. The texture coordinates might as well be represented in a fixed-point model, because it seems most useful to be able to sample the texture in a uniform manner, as the pixels don't get any "denser" as we get closer to 0. In other words the "delta" does not need to become any smaller as the texture coordinates approach (0,0). A similar argument can be made for the normal-vector, as a normal vector should be normalized anyway, and we want as many points as possible on the sphere around (0,0,0) with a radius of 1, and we don't care about precision around the origin. Even if we have large textures such as 4k by 4k (or the maximum allowed by D3D11, 16k by 16k) we only need as many grid-points on one axis, as there are pixels on one axis. An unsigned normalized 14 bit integer would be ideal, but because it is both unsupported and impractical, we will stick to an unsigned normalized 16 bit integer. The same type should take care of the normal vector coordinates, and might even be a bit overkill.
      struct VertexData { float[3] position; //3x32-bits uint16_t[2] texCoord; //2x16bits uint16_t[3] normals; //3x16bits } //Total of 22 bytes Seems like a good start, and we might even be able to take it further, but before we pursue that path, here is my first question: can the GPU even work with the data in this format, or is all I have accomplished minimizing CPU-side RAM usage? Does the GPU have to convert the texture coordinates back to a floating-point model when I hand them over to the sampler in my pixel shader? I have looked up the data types for HLSL and I am not sure I even comprehend how to declare the vertex input type in HLSL. Would the following work?
      struct VertexInputType { float3 pos; //this one is obvious unorm half2 tex; //half corresponds to a 16-bit float, so I assume this is wrong, but this the only 16-bit type I found on the linked MSDN site snorm half3 normal; //same as above } I assume this is possible somehow, as I have found input element formats such as: DXGI_FORMAT_R16G16B16A16_SNORM and DXGI_FORMAT_R16G16B16A16_UNORM (also available with a different number of components, as well as different component lengths). I might have to avoid 3-component vectors because there is no 3-component 16-bit input element format, but that is the least of my worries. The next question would be: what happens with my normals if I try to do lighting calculations with them in such a normalized-fixed-point format? Is there no issue as long as I take care not to mix floating- and fixed-point data? Or would that work as well? In general this gives rise to the question: how does the GPU handle fixed-point arithmetic? Is it the same as integer-arithmetic, and/or is it faster/slower than floating-point arithmetic?
      Assuming that we still have a valid and useful VertexData format, how far could I take this while remaining on the sensible side of what could be called optimization? Theoretically I could use the an input element format such as DXGI_FORMAT_R10G10B10A2_UNORM to pack my normal coordinates into a 10-bit fixed-point format, and my verticies (in object space) might even be representable in a 16-bit unsigned normalized fixed-point format. That way I could end up with something like the following struct:
      struct VertexData { uint16_t[3] pos; //3x16bits uint16_t[2] texCoord; //2x16bits uint32_t packedNormals; //10+10+10+2bits } //Total of 14 bytes Could I use a vertex structure like this without too much performance-loss on the GPU-side? If the GPU has to execute some sort of unpacking algorithm in the background I might as well let it be. In the end I have a functioning deferred renderer, but I would like to reduce the memory footprint of the huge amount of vertecies involved in rendering my landscape. 
      TLDR: I have a lot of vertices that I need to render and I want to reduce the RAM-usage without introducing crazy compression/decompression algorithms to the CPU or GPU. I am hoping to find a solution by involving fixed-point data-types, but I am not exactly sure how how that would work.
    • By tones31
      Hello. I am looking for an unpaid, hobbiest game developer to help me continue to work on a fully functional game prototype built in PlayCanvas that I have built as a hobby. I intend to release and monetize the game once it is complete.
      About the Game
      The game is entitled "Battle Runes."  It is some strange mixture of scrabble and word search, but instead of English letters it uses Viking runes. Each rune represents an English letter. The game takes place on a board, which is a grid of any size (4x4 for example). Not all squares on the grid are required to exist (there can be holes) but there can never be an incomplete path from one square to the other. The game starts with all squares on the board populated by random Runes. The player clicks and drags Runes around the board from one square to the other, costing them "moves" in the process. Runes can also be stacked vertically if they are the same, which adds both literal and figurative depth to the game. The main point-scoring mechanic is to create English words (like "war", "hello", "sky", etc...) using the viking Runes. Words are automatically found by the game using any of the 8 cardinal directions, just like a word search. Points are rewarded to the player for each word they create, and they get bonus points if a word has extra Runes stack on top.
      History
      The current PlayCanvas prototype is actually the third revision of this game, but it is the one that has made the most progress. The first two revisions were in Unity, and were actually multiplayer games. I abandoned Unity when I found PlayCanvas and ended up rewriting the entire thing in a few weeks versus the few months it took me with Unity. Obviously the advantage was Javascript.
      Who Am I
      I am a full time software developer with a job at an engineering firm. I code daily in C, C++, Javascript, and PHP. I am a full stack developer, creating UI, and backends on Linux, Windows, and even embedded devices (hence the C and C++). I had no idea how to program 5 years ago, and have been learning every language I can get my hands on since. I have worked my way up in my company from a software tester to my current full stack position. 

      I went to game design school about 10 years go to be an artist, so I also have a lot of 3D and 2D experience. But I rarely do that anymore, hence the amazing artwork you will see in the below screenshots. Eventually I will find an artist to replace all prototype assets.

      Why I Need You
      The game concept came from a good friend of mine who, at some point, was heavily involved in the design of the game. He has since floated away from the picture. As I enjoy focusing on programming mechanics, I need someone to help me continue to define the game, including at least a few major modifications. Currently, the game is functional. You can actually win in Adventure Mode or play "forever" in Arcade Mode. The problem is.. the game isn't really that fun. I played a lot of Farm Hero and Juice Jam, and these games kept me coming back because of the challenge and allure. Currently, the game is challenging, but mostly out of bad design. It also feels like the game is really missing some core mechanics. 
      Thus, I am looking for someone who wants to spend time playing the game and figuring out some new mechanics, major or minor, to implement. This must be more than "you should make it like this game.." I am looking for someone who really wants to develop a fun game.
      You Are a Good Fit If...
      1. You really enjoy the design aspect of game development
      2. You have original ideas, but know how to borrow existing mechanics from good games
      3. You have 2-5 hours per week to analyze the game, discuss ideas via voice chat, and create a technical document for the game mechanics
      4. You have strong writing skills (technically) 
      Bonuses
      Strong story writing skills for Adventure Mode
      Private PlayCanvas account
      Screenshots
      I always hesitate to share the game outright, because literally all the source code can be stolen when using PlayCanvas. I currently have a private account on PlayCanvas to protect this, but will share a temporary public version for those interested by PM only. So here are some screenshots (please enjoy the prototype models and art :] )

      Screenshot 1
      Level 1 starts out with an easy board. Currently, the player is trying to create the word "air" as represented by the secondary word board. Lots of "i"s available. One "a". But no "r"s. In order to get an "r", the player will have to start stacking similar Runes on top of each other to free up space. New Runes fall from the sky to fill empty squares!


      Screenshot 2
      As an example of the main mechanic, dragging and dropping Runes around, the player has clicked the "s" and has swapped it with the "i" (for no real reason..!). Without committing the move, the game has given the player a preview of what would happen if they swapped the "s" and "i".


      Screenshot 3
      In this screenshot, you can see Rune stacking in effect. The player has stacked a bunch of "i"s on top of each other... there's no limit, and it can get pretty funny when you stack lots of runes (queue gravity!).


      Screenshot 4
      Arcade Mode produces completely random boards, but ensures that there are no unreachable squares, thanks to a really amazing JS pathfinding library. You can actually see the pathfinding library in action (follow the blue highlights). Currently the player has swapped the "g" (looks like  <>) and the "b". The pathfinding highlights all the moves the player would have to make if they could only move a Rune one square at a time. This swap will cost 6 moves. Thankfully the pathfinding library finds the shortest path!!

       
      Thank you for reading this far. Please PM or reply here if you would like more information.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!