• Advertisement

Search the Community

Showing results for tags 'DX12'.



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

  • News

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • GameDev Unboxed

Categories

  • Game Dev Loadout

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
    • Critique and Feedback
  • Topical
    • Virtual and Augmented Reality
    • News
  • Community
    • For Beginners
    • 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
  • 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

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.

Developers

Developers


Group


About Me


Website


Industry Role


Twitter


Github


Twitch


Steam

Found 269 results

  1. While working on a project using D3D12 I was getting an exception being thrown while trying to get a D3D12_CPU_DESCRIPTOR_HANDLE. The project is using plain C so it uses the COBJMACROS. The following application replicates the problem happening in the project. #define COBJMACROS #pragma warning(push, 3) #include <Windows.h> #include <d3d12.h> #include <dxgi1_4.h> #pragma warning(pop) IDXGIFactory4 *factory; ID3D12Device *device; ID3D12DescriptorHeap *rtv_heap; int WINAPI wWinMain(HINSTANCE hinst, HINSTANCE pinst, PWSTR cline, int cshow) { (hinst), (pinst), (cline), (cshow); HRESULT hr = CreateDXGIFactory1(&IID_IDXGIFactory4, (void **)&factory); hr = D3D12CreateDevice(0, D3D_FEATURE_LEVEL_11_0, &IID_ID3D12Device, &device); D3D12_DESCRIPTOR_HEAP_DESC desc; desc.NumDescriptors = 1; desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV; desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE; desc.NodeMask = 0; hr = ID3D12Device_CreateDescriptorHeap(device, &desc, &IID_ID3D12DescriptorHeap, (void **)&rtv_heap); D3D12_CPU_DESCRIPTOR_HANDLE rtv = ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(rtv_heap); (rtv); } The call to ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart throws an exception. Stepping into the disassembly for ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart show that the error occurs on the instruction mov qword ptr [rdx],rax which seems odd since rdx doesn't appear to be used. Any help would be greatly appreciated. Thank you.
  2. As far as I understand there is no real random or noise function in HLSL. I have a big water polygon, and I'd like to fake water wave normals in my pixel shader. I know it's not efficient and the standard way is really to use a pre-calculated noise texture, but anyway... Does anyone have any quick and dirty HLSL shader code that fakes water normals, and that doesn't look too repetitious?
  3. Hi, I finally managed to get the DX11 emulating Vulkan device working but everything is flipped vertically now because Vulkan has a different clipping space. What are the best practices out there to keep these implementation consistent? I tried using a vertically flipped viewport, and while it works on Nvidia 1050, the Vulkan debug layer is throwing error messages that this is not supported in the spec so it might not work on others. There is also the possibility to flip the clip scpace position Y coordinate before writing out with vertex shader, but that requires changing and recompiling every shader. I could also bake it into the camera projection matrices, though I want to avoid that because then I need to track down for the whole engine where I upload matrices... Any chance of an easy extension or something? If not, I will probably go with changing the vertex shaders.
  4. Some people say "discard" has not a positive effect on optimization. Other people say it will at least spare the fetches of textures. if (color.A < 0.1f) { //discard; clip(-1); } // tons of reads of textures following here // and loops too Some people say that "discard" will only mask out the output of the pixel shader, while still evaluates all the statements after the "discard" instruction. MSN> discard: Do not output the result of the current pixel. clip: Discards the current pixel.. <MSN As usual it is unclear, but it suggests that "clip" could discard the whole pixel(maybe stopping execution too) I think, that at least, because of termal and energy consuming reasons, GPU should not evaluate the statements after "discard", but some people on internet say that GPU computes the statements anyways. What I am more worried about, are the texture fetches after discard/clip. (what if after discard, I have an expensive branch decision that makes the approved cheap branch neighbor pixels stall for nothing? this is crazy)
  5. I have a problem. My shaders are huge, in the meaning that they have lot of code inside. Many of my pixels should be completely discarded. I could use in the very beginning of the shader a comparison and discard, But as far as I understand, discard statement does not save workload at all, as it has to stale until the long huge neighbor shaders complete. Initially I wanted to use stencil to discard pixels before the execution flow enters the shader. Even before the GPU distributes/allocates resources for this shader, avoiding stale of pixel shaders execution flow, because initially I assumed that Depth/Stencil discards pixels before the pixel shader, but I see now that it happens inside the very last Output Merger state. It seems extremely inefficient to render that way a little mirror in a scene with big viewport. Why they've put the stencil test in the output merger anyway? Handling of Stencil is so limited compared to other resources. Does people use Stencil functionality at all for games, or they prefer discard/clip? Will GPU stale the pixel if I issue a discard in the very beginning of the pixel shader, or GPU will already start using the freed up resources to render another pixel?!?!
  6. I'm wondering when upload buffers are copied into the GPU. Basically I want to pool buffers and want to know when I can reuse and write new data into the buffers.
  7. AMD forces me to use MipLevels in order to can read from a heap previously used as RTV. Intel's integrated GPU works fine with MipLevels = 1 inside the D3D12_RESOURCE_DESC. For AMD I have to set it to 0(or 2). MSDN says 0 means max levels. With MipLevels = 1, AMD is rendering fine to the RTV, but reading from the RTV it shows the image reordered. Is setting MipLevels to something other than 1 going to cost me too much memory or execution time during rendering to RTVs, because I really don't need mipmaps at all(not for the 99% of my app)? (I use the same 2D D3D12_RESOURCE_DESC for both the SRV and RTV sharing the same heap. Using 1 for MipLevels in that D3D12_RESOURCE_DESC gives me results like in the photos attached below. Using 0 or 2 makes AMD read fine from the RTV. I wish I could sort this somehow, but in the last two days I've tried almost anything to sort this problem, and this is the only way it works on my machine.)
  8. Can I extend a vertex buffer in DirectX 12 (actually SharpDX with DX12)? I am already set up and happily rendering along when I suddenly realise I need more vertices to render. I could of course scrap the vertex buffer and create a new, larger one, but the problem is that I have already discarded my vertex data on the CPU side, to save memory. So... I could create another vertex buffer instead and make sure to use both, one after the other, when rendering my frames. That would be OK, but what if I need to do this extension 1000 times? I would end up with 1001 vertex buffers, and I guess that would really kill performance. What if I could simply extend my vertex buffer? Is there a way? Let me guess the answer here. I'm guessing there isn't. But maybe there is a way to copy the older vertex buffer into a new larger one? I have already used an upload buffer and copied it to my vertex buffer. Can I simply use the same technique for copying my old vertex buffer into a new one? Does anyone have an example code where this is being done? Well, if I can't extend my vertex buffer in place, I guess this is what I will try instead. Have a great weekend!
  9. Hi guys, I am implementing parallel prefix sum on DirectCompute and using GPU Gems 3 article as a reference for CUDA implementation. In the article, the authors add logic to handle shared memory bank conflicts. Mark Harris, one of the authors, claimed later at Stack Overflow that you do not need to handle explicitly bank conflicts in CUDA any more. How about DirectCompute? Do you need to manage this yourself? Is there a difference between D3D10/D3D11/D3D12 versions? Thanks!
  10. D3D12_RESOURCE_DESC text_resource_desc = { D3D12_RESOURCE_DIMENSION_TEXTURE3D, 0, width, // 256 aligned height, // 512 aligned 32, 0, DXGI_FORMAT_R32_FLOAT, { // DXGI_SAMPLE_DESC 1, // Count 0 // Quality }, D3D12_TEXTURE_LAYOUT_UNKNOWN, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET }; D3D12_RESOURCE_ALLOCATION_INFO resalocInfo = device->GetResourceAllocationInfo( 0, // for single adapter(no sub-adapters) 1, // num of resource descriptors &text_resource_desc ); D3D12_HEAP_DESC heapDesc = {}; heapDesc.SizeInBytes = resalocInfo.SizeInBytes; heapDesc.Properties = device->GetCustomHeapProperties(1, D3D12_HEAP_TYPE_DEFAULT); heapDesc.Alignment = D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT; heapDesc.Flags = D3D12_HEAP_FLAG_NONE; Microsoft::WRL::ComPtr<ID3D12Heap> heap; if (FAILED(device->CreateHeap( &heapDesc, IID_PPV_ARGS(&heap) ))) { std::cout << "Failed to create 3D heap" << std::endl; // <-- } else { std::cout << "Successfully created 3D heap" << std::endl; };
  11. I have something wrong that loading fbx model using assimp some meshes are located in unusual place this is result about my renderer. (the face is off) but other programs (like 3dmax, assimp viewer, and etc...) the face is well attached. (this is assimp viewer image) I folloew the reading of vertex while debugging, and The x-coord of all vertices in the face mesh were added to 200 (this is return value about aiMesh.mVertices) my import setting is that. m_pScene = aiImportFile(fileName.c_str(), aiProcess_JoinIdenticalVertices | // join identical vertices/ optimize indexing aiProcess_ValidateDataStructure | // perform a full validation of the loader's output aiProcess_ImproveCacheLocality | // improve the cache locality of the output vertices aiProcess_RemoveRedundantMaterials | // remove redundant materials aiProcess_GenUVCoords | // convert spherical, cylindrical, box and planar mapping to proper UVs aiProcess_TransformUVCoords | // pre-process UV transformations (scaling, translation ...) //aiProcess_FindInstances | // search for instanced meshes and remove them by references to one master aiProcess_LimitBoneWeights | // limit bone weights to 4 per vertex aiProcess_OptimizeMeshes | // join small meshes, if possible; //aiProcess_PreTransformVertices | aiProcess_GenSmoothNormals | // generate smooth normal vectors if not existing aiProcess_SplitLargeMeshes | // split large, unrenderable meshes into sub-meshes aiProcess_Triangulate | // triangulate polygons with more than 3 edges aiProcess_ConvertToLeftHanded | // convert everything to D3D left handed space aiProcess_SortByPType); // make 'clean' meshes which consist of a single type of primitives); Note that if aiProcess_PreThransformVertices flag is used, The model is rendered perfactly! but this model has animation, so i can't use this flag and There is one thing that takes This model's face mesh is made up of rect polygons. (not triangle) Could this be a problem? Please please help me about this problem! If you want other codes, I'll gladly provide all the code Thanks!
  12. Hi all, I did a lot of work years ago with earlier DX9/10. I haven't touched code since and so I thought I might get up to speed with the DirectX 12 changes while I have a ton of spare time. So, I installed VS2017 CE and started following along with a YouTube lesson set. Win10 is fully updated and VS2017 is trying to build for 10.0.16299. The Graphic Tools FoD is also installed (many times). I'm sure this is my fault and probably a really dumb C++ 101 issue, but if anyone could help me provide relevant diagnosis information to get a solution, I would be very appreciative. Thanks! Matt
  13. Hey all, I'm looking into building a streaming system for mipped images. I'm referencing the DirectX sample for memory management here: https://github.com/Microsoft/DirectX-Graphics-Samples/tree/master/TechniqueDemos/D3D12MemoryManagement I have a couple related questions to this. I'm leaning towards also utilizing tiled resources for mips, mainly because it allows me to avoid invalidating my pre-cooked descriptor tables any time an image updates, since I would effectively have to create a new ID3D12Resource with more / fewer mip levels when a stream / trim event occurs, respectively. Has anyone had success using tiled resources or noticed any potential performance impact related to having the page table indirection? Also, I noticed that tiled resource tier 1 doesn't support mip clamping. Are there workarounds (in the shader, for example), or limiting the mip level in cases where we don't have a mip resident? Or am I required to create a new view mapped to the resident subset. This would also require that I rebake my descriptor tables, which I would like to avoid. My second question is how to handle the actual updates. I would like to utilize a copy queue to stream contents up to the GPU. I have a couple approaches here: Create a device-local staging image and run my async copy job to upload to it. This happens in parallel with the current frame using the existing image. At the beginning of the next frame (on the graphics queue) I blit from the staging memory to the newly resident mip, and then use the full mip chain for rendering. Utilize sub-resource transitions to put part of the image into an SRV state and the other part into a Copy Destination state. The async copy queue uploads to the more-detailed mip levels while the current frame renders using the SRV subresources. This approach seems a bit more complicated due to having to manage sub-resource transitions, but it avoids a copy in the process. My question here is whether I need to specify the D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS bit on my resource, even though the transitions and accesses are occurring between different sub-resources. If so, do you know what kind of performance repercussions I could expect from this? Would I still be able to store my images in BCn formats, for example? Thanks much, Zach.
  14. Finally the ray tracing geekyness starts: https://blogs.msdn.microsoft.com/directx/2018/03/19/announcing-microsoft-directx-raytracing/ lets collect some interesting articles, I start with: https://www.remedygames.com/experiments-with-directx-raytracing-in-remedys-northlight-engine/
  15. What is the best practice when you want to draw a surface (for instance a triangle strip) with a uniform color? At the moment I send vertices to the shader, where each vertice has both position and color information. Since all vertices for that triangle strip have the same color I thought I could reduce memory use by sending the color separate somehow. A vertex could then be represented by three floats instead of seven (xyz instead of xys + rgba). Does it make sense? What's the best practice?
  16. Hey all, I'm trying to understand implicit state promotion for directx 12 as well as its intended use case. https://msdn.microsoft.com/en-us/library/windows/desktop/dn899226(v=vs.85).aspx#implicit_state_transitions I'm attempting to utilize copy queues and finding that there's a lot of book-keeping I need to do to first "pre-transition" from my Graphics / Compute Read-Only state (P-SRV | NP-SRV) to Common, Common to Copy Dest, perform the copy on the copy command list, transition back to common, and then find another graphics command list to do the final Common -> (P-SRV | NP-SRV) again. With state promotion, it would seem that I can 'nix the Common -> Copy Dest, Copy Dest -> Common bits on the copy queue easily enough, but I'm curious whether I could just keep all of my "read-only" buffers and images in the common state and effectively not perform any barriers at all. This seems to be encouraged by the docs, but I'm not sure I fully understand the implications. Does this sound right? Thanks.
  17. I need to share heap between RTV and Stencil. I need to render to a texture and without copying it(only changing the barriers, etc) to be able to use that texture as stencil. without copying nothing around. But the creating of the placed resource fails. I think it could be because of the D3D12_RESOURCE_DESC has 8_UINT format, but D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL enabled too, and MSDN says Stencil does not support that format. Is the format the problem? And if the format is the problem, what format I have to use? For the texture of that resource I have the flags like: "D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL" and it fails, but when I remove the allow-stencil flag, it works.
  18. I know vertex buffer is just another GPU resource represented by ID3D12Resource, but why is it said that vertex buffer don’t need a descriptor heap?? Other resources like depth/stencil resource, swap chain’s buffer need to have descriptor heaps. How does these resources differ from vertex buffer.
  19. I am working on reusing as many command buffers as I can by pre-recording them at load time. This gives a significant boost on CPU although now I cannot get the GPU timestamps since there is no way to read back. I Map the readback buffer before and Unmap it after reading is done. Does this mean I need a persistently mapped readback buffer? void Init() { beginCmd(cmd); cmdBeginQuery(cmd); // Do a bunch of stuff cmdEndQuery(cmd); endCmd(cmd); } void Draw() { CommandBuffer* cmd = commands[frameIdx]; submit(cmd); } The begin and end query do exactly what the names say.
  20. Hi, I am moving from DX11 to DX12 and I started fighting with texture resources. I provide only an simplified example. Let's say, I have this root parameters: CD3DX12_DESCRIPTOR_RANGE diffuseTextureTable; diffuseTextureTable.Init(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 16, 0, 0); CD3DX12_ROOT_PARAMETER signatureParameters[3]; signatureParameters[0].InitAsConstantBufferView(0); // Per draw signatureParameters[1].InitAsConstantBufferView(1); // Per frame signatureParameters[2].InitAsDescriptorTable(1, &diffuseTextureTable, D3D12_SHADER_VISIBILITY_PIXEL); // 16 My shader has one per draw constant buffer, one per frame buffer and table of 16 SRVs. Every model can have up to 16 diffuse textures. Well, the question is, how can I set textures for a model before rendering ? I read that changing heaps is costly. That's the only thing I thought that's the way. Do i have to really load all textures into memory in initial time ? What If i can want to load some textures after initial time ? Is it possible to copy new texture descriptors into heap cheaply ? Thank you very much :-)
  21. Hi guys! I am using tile based shading in my project. I am adding shadows contribution to the shading pass and I am getting strange errors when compiling the pixel shader. Below is a code snippet of the pixel shader. float3 pointLightsContrib = float3(0.0f, 0.0f, 0.0f); for (uint lightIndexPerTile = pointLightIndexPerTileStart; lightIndexPerTile < pointLightIndexPerTileEnd; ++lightIndexPerTile) { uint lightIndex = g_PointLightIndexPerTileBuffer[lightIndexPerTile]; float3 lightWorldSpacePos = g_PointLightWorldBoundsBuffer[lightIndex].center; // Plus rest of the code float3 lightContrib = CalcPointLightContribution(lightWorldSpacePos, lightColor, lightRange, worldSpaceDirToViewer, worldSpacePos, worldSpaceNormal, diffuseAlbedo, specularAlbedo, shininess); // Plus rest of the code float lightVisibility = CalcPointLightVisibility(g_VarianceShadowMapSampler, g_PointLightTiledVarianceShadowMap, lightViewProjMatrix, lightViewNearPlane, lightRcpViewClipRange, worldSpacePos); pointLightsContrib += lightVisibility * lightContrib; } And there are helper functions used from the pixel shader above. float VSM(SamplerState shadowSampler, Texture2D<float2> varianceShadowMap, float2 shadowMapCoords, float receiverDepth) { float2 moments = varianceShadowMap.Sample(shadowSampler, shadowMapCoords).xy; return ChebyshevUpperBound(moments, receiverDepth); } float CalcPointLightVisibility(SamplerState shadowSampler, Texture2D<float2> varianceShadowMap, float4x4 lightViewProjMatrix, float lightViewNearPlane, float lightRcpViewClipRange, float3 worldSpacePos) { float4 lightClipSpacePos = mul(lightViewProjMatrix, float4(worldSpacePos, 1.0f)); float3 lightPostWDivideProjSpacePos = lightClipSpacePos.xyz / lightClipSpacePos.w; float2 shadowMapCoords = float2(0.5f * (lightPostWDivideProjSpacePos.x + 1.0f), 0.5f * (1.0f - lightPostWDivideProjSpacePos.y)); float lightSpaceDepth = lightClipSpacePos.w; float normalizedLightSpaceDepth = (lightSpaceDepth - lightViewNearPlane) * lightRcpViewClipRange; return VSM(shadowSampler, varianceShadowMap, shadowMapCoords, normalizedLightSpaceDepth); } When I compile the shader, I get the following warning and error. Warning: warning X3570: gradient instruction used in a loop with varying iteration, attempting to unroll the loop Error: error X3511: unable to unroll loop, loop does not appear to terminate in a timely manner (210 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number The warning points to the line "float2 moments = varianceShadowMap.Sample(shadowSampler, shadowMapCoords).xy;" of VSM function and the error points to the line "for (uint lightIndexPerTile = pointLightIndexPerTileStart; lightIndexPerTile < pointLightIndexPerTileEnd; ++lightIndexPerTile)". If I change implementation of VSM function to simply { return 1.0f } it compiles fine. What is going on?
  22. That means how do I use base DirectX or OpenGL api's to make a physics based destruction simulation? Will it be just smart rendering or something else is required?
  23. I'm using fxc.exe from the Win10 SDK (10.0.10586.0) to build my HLSL code. I've got some code in different pixel shaders that uses interlocked instructions on UAVs, such as: RWBuffer<uint> FragmentCount : register(u2); RWTexture2D<uint> HeadIndex : register(u3); ... uint newNode = 0; /*!!*/InterlockedAdd(FragmentCount[0], 1U, newNode);/*!!*/ ... uint previousTail = 0; /*!!*/InterlockedExchange(HeadIndex[xy], newNode+1, previousTail); /*!!*/ ... uint previousHead = 0; /*!!*/InterlockedAdd(HeadIndex[xy], 0x01000000, previousHead);/*!!*/ This compiles fine with the ps_5_0, cs_5_0 and cs_5_1 targets, but with ps_5_1, the compiler gives error x4532: cannot map expression to ps_5_1 instruction set, on the lines indicated with /*!!*/ Anyone else experienced this? What the hell, right?
  24. Hi, I have a question about this function in DX12 to get a HANDLE for descriptor. I am curious if this function returns ALWAYS same address for specific descriptor, or address can change overtime ? Same for GPU version of function. Thank you very much !
  25. Hi, I am a CAM developer working with C++ and C# for the past 5 years. I started working on DirectX from past 6 months. I developed a touch screen control viewer using Direct2D. I am working on 3D viewer currently. I am very slow with working on Direct3D. I want to be a gaming developer. As i am new to this i want to know what are the possibilities to explore in this area. How to start developing gaming engines? Is it through tutorials? I heard suggestions from my friends that going for an MS helps. I am not sure on which path to choose. Is it better to go for higher studies and start exploring? I am currently working in India. I want to go to Canada and settle there. Are there any good universities there to learn about graphics programming? Sorry if I am asking too many questions but i want to know the options to choose to get ahead.
  • Advertisement