Jump to content
  • Advertisement

Search the Community

Showing results for tags 'DX12' in content posted in Graphics and GPU Programming.

The search index is currently processing. Current results may not be complete.


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Art Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum
  • Unreal Engine Users's Unreal Engine Group Forum
  • Unity Developers's Forum
  • Unity Developers's Asset Share

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 295 results

  1. The latest release of Diligent Engine combines a number of recent updates (Vulkan on iOS, GLTF2.0 support, shadows), significantly improves performance of OpenGL backend, updates API, adds integration with Dear Imgui and implements new samples and tutorials. Some of the new features in this release: GLTF2.0 support (loader, PBR renderer and sample viewer) Shadowing Component and Shadows Sample Integration with Dear Imgui library and Dear Imgui demo Tutorial13 - Shadow Map Tutorial14 - Compute Shader Tutorial15 - Multiple Windows Check it out on GitHub.
  2. Hello! I need some guidance on CommandQueue/CommandAllocator/CommandList management. In my current project I have a few "systems" that need to execute graphical commands, such as rendering terrain, rendering water, rendering particles etc. Right now my project is very simple so I'm not even using command lists during initialization. However, that's starting to be required. Currently I'm just using a single command queue with a ring buffer of 2 command allocators that get recorded by a single command list. Each time I render the scene, a command allocator and a command list is being reset and then recorded. After all commands has been recorded, the list is executed and the swap chain is flipped. Here's some pseudo-code: void Initialize() { [...] device->CreateCommandQueue(...); device->CreateCommandAllocator(...); // commandAllocator[0] device->CreateCommandAllocator(...); // commandAllocator[1] device->CreateCommandList(...); commandList->Close(); [...] } void Render() { WaitForPreviousFrame(); commandAllocator[i]->Reset(); // i = swapChain->GetCurrentBackBufferIndex() commandList->Reset(...); RecordAllCommands(); commandList->Close(); commandQueue->ExecuteCommandLists(...); Signal(...); swapChain->Present(...); } The issue with this is that I cannot record commands during initialization, and with this design it's also quite cumbersome to execute command lists multiple times during one frame since the command allocator ring buffer is tied together with the swap chain buffer index. So I started to think about how I should redesign this, preferably also with future support for threading. And I've thought about it for quite some time now and can't come up with a good solution. One idea is that each system should have their own command list with a ring buffer of 2 command allocators, and then record it and just use a global command queue to execute the list. This works well from a parallel point of view, but the issue is that now each system need to check individually if the GPU is done with the commands before resetting the command allocator. This feels like a huge CPU waste. Another idea is that there is only one global command list, that is aviable already during initialization of other systems, and after the initialization this command list gets executed, before entering the game loop. During the game loop, the global command list gets executed once per frame as I do it now. However, there are 2 issues with this. First of all, some systems might want to execute their commands earlier than at the end of each frame. Secondly, if multiple threads record into the same command list, then we might get a situation like this: commandList->SetPipelineState(pipelineState1); // Thread 1 wants pipelineState1. commandList->SetPipelineState(pipelineState2); // Thread 2 wants pipelineState2. [...] commandList->DrawInstanced(...); // Thread 1 expects pipelineState1 to be set... I'm out of ideas of how to implement this in a simple and elegant way. Or maybe I'm doing this entirely wrong. Basically what I need is: Systems should be able to record commands already during initialization. Atleast during initialization, it should be possible to execute commands in multiple steps and even wait for the GPU to complete them. When rendering the scene, it would be nice if multiple threads could record commands in parallel. Does any of you have a good solution to this problem? What is the AAA game engine way of dealing with this?
  3. Here is my code snip: ID3D12DescriptorHeap* DescHeaps[] = { SRVHeapCache.GetDescriptorHeap() };// I want to bind Different RTV to this heap cache between Draw Calls CommandList->SetDescriptorHeaps(1, DescHeaps); CommandList->SetGraphicsRootSignature(RootSignature.Get()); CommandList->SetGraphicsRootConstantBufferView(2, PerPassConstants.GetResource()->GetGPUVirtualAddress()); CommandList->SetGraphicsRootConstantBufferView(1, PerObjectConstants.GetResource()->GetGPUVirtualAddress()); CommandList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); for (auto Actor : TheScene.Actors) { CommandList->SetGraphicsRootDescriptorTable(0, SRVHeapCache.GetGPUHandleStart()); Actor->Draw(D3dDevice.Get(), CommandList.Get(), SRVHeapCache.GetDescriptorHeap()); } And in Actor's Draw, I use CopyDescriptorsSimple: Device->CopyDescriptorsSimple(1, hDescriptor, Mgr->Textures[DiffTextureID].Texture.GetCPUHandle(), D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); But this doesn't work. The content of HeapCache seems to never change in the runtime.
  4. Good day. I am find for information on how to create texture arrays in d3d12. In d3d11, I calmly figured out how to create a texture array from several textures: I upload several dds - textures of the same resolution in the engine I create ID3D11Texture2D* and map date into it all loaded textures in shader I use texture2darray in pixel shader: Texture2DArray textures : register(t0); Now I am looking for something like that for d3d12. For load the textures, I use DDSTextureLoader.h/.cpp from microsoft. So I'm loading a few textures. How can I create a texture array from them and pass it to a pixel shader? I will be glad to some example. Thank. PS: I searched the forum, but I didn’t find anything.
  5. Hello, I should say I'm new to DX12 and I have the following use case. I'm making a "simple" font rendering library that caches glyphs from DirectWrite into 2D textures/atlases as they're being requested by the user on the fly. I create multiple textures with fixed sizes so that I don't have to resize them if there's not enough space for a font's glyphs. A new texture is created if there's not enough space. Now, the problem is that there can be a command list being executed that is sampling these textures (because of a previous text render) while I need to insert some glyph to the atlas(es) (write to a texture region). Obviously, it is guaranteed that the texture data read by the previous render will not be modified since the glyph insert process only writes to free space. So my question is, is it possible to write to a texture while it's being read in this case, and how? If not, what's the best way to do what I want (or some good alternatives)? And another question: using this method I might end up having to use multiple textures for a draw call. How do I make the shader choose which texture to sample from depending on input data? There can be a dynamic number of textures in this case, but they're all the same size. Or is it better to split this into multiple draw calls and change resources between them?
  6. By looking at Microsoft's working code samples and people's posts on forums, it seems that people are doing double buffering in the following way: fence 0 frame 0: | submit command | execute command ..................................................... | frame 1: | submit command | execute command .....|......................................... It seems that, people tend to submit and execute their commands for the current frame first, _then_ fence and wait for previous frame to finish. This seems counter-intuitive to me, since this potential overlap means duplicating temporary per-frame data. My question is why not just do it this way instead: fence 0 frame 0: | submit command | execute command ..........................................| frame 1: | submit command | execute command .....|......................................... This way, CPU work still overlaps with GPU work, but no duplication needs to happen. Yes, de-overlapping frame 0 and frame 1 seems to be bad for performance, but can it be that bad? I feel like if frames are finished on time, this overlap should never occur in the first place? So I'm wondering why the majority prefers the first approach to the second approach, even though the second approach is simpler and seems more natural to me. Thanks.
  7. Hello! I am trying to implement the d3d12 window resizing function. First, I delete all the buffers referenced by SwapChain, and then run SwapChain :: ResizeBuffers. At this point I get the error: This is the code of the procedure for changing sizes of window: I put together a minimal self sufficient example for modeling the problem that described above: Tell me how to fix this problem. P.S.: I set my RTV names and text error replace: RTV number is always random.
  8. Hello, I am working on a DX12 renderer which is utilizing multiple threads to build command lists. I am currently trying to figure out a proper way to handle fencing and synchronization between the threads. My problem is that for some reason my waits seem to be passing through even if the fence hasn't yet been signaled. This is my structure: Render Thread: Supplies render data from scene and launches several render tasks on worker threads. Lastly uses GPU&CPU waits to check if all tasks are ready before executing Present. Worker threads: Builds command list for specified task. Uses cpu-waits if there are dependencies. Queues itself into Queue-thread for GPU-submission. Queue-thread: Runs continously, checking if any cmd list has been queued. Inserts gpu-waits if needed. Executes the cmd list and lastly signals fence. As noted, the fences seem to act as if they are signaled when Render thread reaches present. Am I missing something trivial? /Baemz
  9. I am running an Nvidia 1080 Ti with the latest drivers, and it seems as though even if I make a barebones application (creates a swapchain and just clears and fences between two frames), I have a perpetual, linear rise in memory usage when I use the DX Debug layer. Without the debug layer, I'm stable for hours at the same amount of memory used. Does anyone else see anything like this?
  10. Hey guys, My battle with DXR still goes one 🙂 This time I am trying to render three triangles and encounter flickering artifacts on two of them. For the sake of the test, each triangle represents a separate mesh. Their vertex and index data are stored in a global vertex and index buffers. For each of the meshes, I create a dedicated D3D12_RAYTRACING_GEOMETRY_DESC, specifying corresponding offsets in the vertex and index buffers. D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS BLASBuildInputs; BLASBuildInputs.Type = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL; BLASBuildInputs.Flags = D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE; BLASBuildInputs.DescsLayout = D3D12_ELEMENTS_LAYOUT_ARRAY; BLASBuildInputs.NumDescs = (UINT)geometryDescs.size(); // 3 descs BLASBuildInputs.pGeometryDescs = geometryDescs.data(); If I specify only one geometry desc on D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS, it works fine for all of them. That is, BLASBuildInputs.NumDescs = 1; BLASBuildInputs.pGeometryDescs = &geometryDescs[0]; // works also with 1 and 2 But will not work, if I use three of them. My closest hit shader interpolates vertex colors and outputs the result in the payload. I also tried to output hardcoded "red" color to exclude interpolation issue, but did not help. Any ideas what could be upsetting it so much? 🙂 Thanks!
  11. Hey guys, I am working on my very first DXR "hello triangle" and hitting "DXGI_ERROR_DEVICE_HUNG: The Device took an unreasonable amount of time to execute its commands, or the hardware crashed/hung" in Present call. My program consists of ray generation, closest hit and miss shaders. I noticed that if I remove TraceRay call and write the result to output texture it works OK. I have checked twice all the setup and everything seems to be OK and debug layer does not complain. I have no more ideas what I could check. I am on GTX 1070 with the latest driver version. Any suggestions? Thanks!
  12. Hi, I have more of a broad abstraction design question that probably won't have one ultimate answer. In many D3D12 samples (also in UE4), a buffer/texture is usually wrapped by a class that contains data about the width, height, stride, element count, .... and when the resource is created, a set of descriptors (SRV, UAV per mip, CBV, ...) are usually created depending on how the resource is going to be used (Rendertarget, Shader resource, Unordered Access, ...) and these descriptors are owned by that class. To give an example of the pattern that you usually come across (pseudo-code) class Texture { void CreateTexture(int width, int height, int mipLevels) { CreateResource(width, height, ....); m_Uav = AllocateDescriptors(mipLevels) for each mip: CreateUAV(m_Uav.offset(i)); CreateSRV(); CreateRTV(); .... } int Width, Height, more properties ... D3D12_CPU_DESCRIPTOR_HANDLE m_Rtv = {}; D3D12_CPU_DESCRIPTOR_HANDLE m_Uav = {}; D3D12_CPU_DESCRIPTOR_HANDLE m_Srv = {}; }; However, I find myself in a situation where I need different types of views for the resource and there is not a catch-all solution for it. For example, I create a TextureCube and a SRV for it. You could create a TextureCube SRV a Texture2DArray SRV Several Texture2D SRVs This all depends on use and more than one view could be needed for the same resource. Same for a depth buffer, if you want a depth buffer to be used for both writing and read_only, you need 2 separate descriptors (one with a READ_ONLY flag set). I believe what makes views/descriptors so powerful, is that they provide you with different ways to interpret read the same data. Having this "class wrapper" pretty much breaks this flexibility because all descriptors are created the same for the different types of resources you define in your abstraction and it is impossible to cover all uses. Obviously, the solution would be to decouple the resource from the view but I wonder, how is this usually done? Is a solution creating these descriptors on-the-fly, possibly even every single frame? I suppose this is not specific to DirectX 12 and pretty much applies to any Graphics API Thanks, Simon
  13. Diligent Engine now implements some shadow rendering BKMs: - Cascaded shadow maps with cascade stabilization - PCF - Variance shadow maps - Two and four-component exponential variance shadow maps - Optimized fixed-size or world-sized filter kernels - Best cascade search based on projection into light space - Filtering across cascades - Various artifact removal techniques The main goal is to create a plug-and-play shadowing component that can be easily integrated into applications. The component consists of a shadow map manager and few shader functions. A Shadows sample demonstrates how to integrate Diligent shadows into an application. Check it out on GitHub: https://github.com/DiligentGraphics/DiligentEngine#high-level-rendering-components-1 I am planning to add exponential shadow maps and moment shadow maps later. Are there any state-of-the-art shadowing techniques that I should also take a look at? Credits: Variance Shadow Maps Shadow sample update by MJP Shadow Explorer sample from Intel Cascaded Shadow Maps technical article by Microsoft
  14. Hello, I have come across a strange problem in D3D12. I am creating a render target with the start state in CreateCommittedResource as D3D12_RESOURCE_STATE_RENDER_TARGET. After that, I create an SRV for the render target and use that as the source handle in a CopyDescriptors call. This is all done during initialization. When doing the first draw call, I get this validation error. This happens only during the first frame. This makes me think, CopyDescriptors is doing an implicit state transition because I create the resource in D3D12_RESOURCE_STATE_RENDER_TARGET and after that, the only time it is used before the draw call is in the CopyDescriptors call.
  15. Hey guys, I would like to check with you about D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION in relation to hit groups. In the list of exports for the association are you supposed to specify the hit group name? Are you allowed to list a shader from the hit group instead of the whole group? I am going through Introduction to DirectX Raytracing chapter from Ray Tracing Gems book and the authors seem to use always the compete hit group in the export list. Thank you!
  16. Hi, I have been busy for long time so I couldn't play around with Dx12. Well, I got a very simple and basic question. I have read the API references ,did googling but didn't get much information. It is about this API, ID3D12DescriptorHeap::GetCPUDescriptorHandleForHeapStart(). And , ID3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart() I'm confusing. What Get"CPU" and Get"GPU" means? 1) Is it means that one is a handle for CPU and the other a handle for GPU against the same virtual address or something? [ same address ] ---> for CPU handle [ same address ] ---> for GPU handle or 2) It means that there are 2 different addresses and those handles are representing respectively? [ system memory address ] ---> for CPU handle [ GPU memory address ] ---> for GPU handle Those 2 API returns 2 different values(addresses) so I guess 2 is the answer but I want to sure.
  17. Hi Is there any way to examine content of ID3D12DescriptorHeap (created with D3D12_DESCRIPTOR_HEAP_FLAG_NONE (CPU Visible heap), it that helps). I have some ugly bug in my descriptors manager, that manifest itself every few 100's of frames, when under particular D3D12_CPU_DESCRIPTOR_HANDLE there is some different resource that it should be. (eg. my map of resources on the CPU side states that there should be textureA, while in reality at the end of frame GPU sees there textureB) I want to examine/validate the whole heap content to see if it matches the one that my resource map holds, but sadly I could not see any way to fetch D3D12_SHADER_RESOURCE_VIEW_DESC/D3D12_UNORDERED_ACCESS_VIEW_DESC out of given handle/heap I'v looked into all PIX tabs, and I do not see it either there (well all I want is to get ID3D12Resource asociated with descriptor
  18. I'm trying to clamp my NaNs and infs to 0 and I implemented as float3 tmp = ...; // float3 value that need to clamp bool colorsNan = any(isnan(tmp)); bool colorsInf = any(isinf(tmp)); tmp = (colorsNan||colorsInf) ? float3(0, 0, 0) : tmp; However, after the clamping, there are still inf values. Is there anything wrong? BTW, isnan() is working, so is it because the way isnan() works is different from isinf()?
  19. Funkymunky

    DX12 Sharing shaders between PSOs