Jump to content
  • Advertisement

ADDMX

Member
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

281 Neutral

About ADDMX

  • Rank
    Member

Personal Information

  • Interests
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. 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
  2. ?RayGeneration@@YAXXZ OMG!!! after 3 hours of stripping down the bits of code and trying various thigns I'v finally managed to figure out what was wrong!!! Behold - there is a solution In my Library definition I'v filled D3D12_EXPORT_DESC::ExportToRename with _MANGLED_ name (as it came from reflection D3D12_FUNCTION_DESC::Name) and D3D12_EXPORT_DESC::Name with the name + library name. Filling D3D12_EXPORT_DESC::ExportToRename with mangled name (?RayGeneration@@YAXXZ) was the root of the driver crash (WTF - seriously - WTF!) If the D3D12_EXPORT_DESC::ExportToRename is set to non-existing export, then the debug layer reports error - OK if the D3D12_EXPORT_DESC::ExportToRename is set to non-mangled name (for ?RayGeneration@@YAXXZ it would be RayGeneration) then the ID3D12StateObject will be created if the D3D12_EXPORT_DESC::ExportToRename begins with '?' character (?RayGeneration@@YAXXZ ... starts with '?') ... then the driver crashes ... SERIOUSLY ?! what the hell happends under the hood - I'm very curious the code behind this string comparition.... (and no, I didn't used the original string pointer from reflection somehow, I'v copied it into managed string table, so the string pointer was valid (at first when I discovered the solution, that was my first thought that the string pointer was somehow broken)) Ok back to assignments - what is the point of assigning individual shaders of hit group to LocalRootSignature ? From what I'v read all shaders in the HitGroup need to share that same LocalRootSignature - right ? (or is that some of the shaders in hitgroup could have LocalRootSignature, and others don't ? - it's not crystal clear to me) As for assigning raytracing config to HitShader(s), MissShader(s) and all HitGroups, without this step, the code runs fine on NV2080, but does not produce ID3D12StateObject if ran on NV1080 with some internal error (again) (both of them on latest NV drivers) And I'm not assigning raytracing pipeline config to anything ...
  3. I'v also exported working ID3D12StateObject from NVidia example and now I have doubts about how it works -------------------------------------------------------------------- | D3D12 State Object 0x0000006DDABBE928: Raytracing Pipeline | [0]: DXIL Library 0x0000022A5A7DCF00, 6356 bytes | [0]: rayGen | [1]: miss | [2]: planeChs | [3]: triangleChs | [4]: shadowMiss | [5]: shadowChs |-------------------------------------------------------------------- | [1]: Hit Group (TriHitGroup) | [0]: Any Hit Import: [none] | [1]: Closest Hit Import: triangleChs | [2]: Intersection Import: [none] |-------------------------------------------------------------------- | [2]: Hit Group (PlaneHitGroup) | [0]: Any Hit Import: [none] | [1]: Closest Hit Import: planeChs | [2]: Intersection Import: [none] |-------------------------------------------------------------------- | [3]: Hit Group (ShadowHitGroup) | [0]: Any Hit Import: [none] | [1]: Closest Hit Import: shadowChs | [2]: Intersection Import: [none] |-------------------------------------------------------------------- | [4]: Local Root Signature 0x0000022A5ADCB2E0 |-------------------------------------------------------------------- | [5]: Subobject to Exports Association (Subobject [4]) | [0]: rayGen |-------------------------------------------------------------------- | [6]: Local Root Signature 0x0000022A5ADCBCA0 |-------------------------------------------------------------------- | [7]: Subobject to Exports Association (Subobject [6]) | [0]: triangleChs -------------------------------------------------> ?? Why the local root signature is bound to 'Closest Hit Import' not to the 'TriHitGroup' hitgroup ? this is even legit ? |-------------------------------------------------------------------- | [8]: Local Root Signature 0x0000022A5ADCAB90 |-------------------------------------------------------------------- | [9]: Subobject to Exports Association (Subobject [8]) | [0]: PlaneHitGroup -----------------------------------------------> The another local root signature is bound to the hitgroup |-------------------------------------------------------------------- | [10]: Local Root Signature 0x0000022A5ADCBF10 |-------------------------------------------------------------------- | [11]: Subobject to Exports Association (Subobject [10]) | [0]: miss | [1]: shadowChs ---------------------------------------------------> ?? Yet another one is again bound just to 'Closest Hit Import' | [2]: shadowMiss |-------------------------------------------------------------------- | [12]: Raytracing Shader Config | [0]: Max Payload Size: 12 bytes | [1]: Max Attribute Size: 8 bytes |-------------------------------------------------------------------- | [13]: Subobject to Exports Association (Subobject [12]) | [0]: rayGen | [1]: miss | [2]: triangleChs -------------------------------------------------> ??? Documentation states that 'Raytracing Shader Config' should be bound to RayGen, RayMiss and HitGroups ... but the example binds it to 'Closest Hit Import' of HitGroup | [3]: planeChs | [4]: shadowMiss | [5]: shadowChs |-------------------------------------------------------------------- | [14]: Raytracing Pipeline Config | [0]: Max Recursion Depth: 2 |-------------------------------------------------------------------- | [15]: Global Root Signature 0x0000022A5ADCBA30 |-------------------------------------------------------------------- why in some cases the example binds LocalRootSignature to MEMBER of hitgroup, yet another time it binds it to HitGroup ? I still see no reason why my structure does not produce valid object, and the example produces one
  4. Hi I'm (still) strugling with adding DXR into my engine Now when all the infrastructure is in place I'm trying to launch it (NVidia 2080, Latest Windows 10, latest nvidia drivers, all DXR examples and DXR implementation in UE4 works just fine) I cannot create ID3D12StateObject Here is the dump of object in question with comments (marked --->) what is what -------------------------------------------------------------------- ---> [This is my library, and mapping of library into unique names, since in future I can have multiple libraries with that same names] | D3D12 State Object 0x0000004AB897D238: Raytracing Pipeline | [0]: DXIL Library 0x000001B1CA8A0100, 18500 bytes | [0]: ?RayGeneration@@YAXXZ --> RG_010C79FD_D1D898AD_?RayGeneration@@YAXXZ | [1]: ?RayHit@@YAXURayPayload@@UBuiltInTriangleIntersectionAttributes@@@Z --> RH_010C79FD_D1D898AD_?RayHit@@YAXURayPayload@@UBuiltInTriangleIntersectionAttributes@@@Z | [2]: ?RayMiss@@YAXURayPayload@@@Z --> RM_010C79FD_D1D898AD_?RayMiss@@YAXURayPayload@@@Z |-------------------------------------------------------------------- ---> [This is my hit group] | [1]: Hit Group (Hit_15D00DA7_C3757D0A) | [0]: Any Hit Import: [none] | [1]: Closest Hit Import: RH_010C79FD_D1D898AD_?RayHit@@YAXURayPayload@@UBuiltInTriangleIntersectionAttributes@@@Z | [2]: Intersection Import: [none] |-------------------------------------------------------------------- ---> [This is my local RootSignature] | [2]: Local Root Signature 0x000001B1CABCB5F0 |-------------------------------------------------------------------- ---> [That is assigned to my HitGroup] | [3]: Subobject to Exports Association (Subobject [2]) | [0]: Hit_15D00DA7_C3757D0A |-------------------------------------------------------------------- ---> [This is my local RootSignature] | [4]: Local Root Signature 0x000001B1CABCB5F8 |-------------------------------------------------------------------- ---> [That is assigned to my RayGen shader] | [5]: Subobject to Exports Association (Subobject [4]) | [0]: RG_010C79FD_D1D898AD_?RayGeneration@@YAXXZ |-------------------------------------------------------------------- ---> [This is my local RootSignature] | [6]: Local Root Signature 0x000001B1CABCB600 |-------------------------------------------------------------------- ---> [That is assigned to my RayMiss shader] | [7]: Subobject to Exports Association (Subobject [6]) | [0]: RM_010C79FD_D1D898AD_?RayMiss@@YAXURayPayload@@@Z |-------------------------------------------------------------------- ---> [This is Raytracing config, sizeof(RayPayload) == 64, attributes are 2 floats (barycentrics) so I pass 8] | [8]: Raytracing Shader Config | [0]: Max Payload Size: 64 bytes | [1]: Max Attribute Size: 8 bytes |-------------------------------------------------------------------- ---> [This associates HitGroup, RayGen and RayMiss shader to Raytracing config] | [9]: Subobject to Exports Association (Subobject [8]) | [0]: Hit_15D00DA7_C3757D0A | [1]: RG_010C79FD_D1D898AD_?RayGeneration@@YAXXZ | [2]: RM_010C79FD_D1D898AD_?RayMiss@@YAXURayPayload@@@Z |-------------------------------------------------------------------- ---> [This is Pipeline config with recursion set to 2] | [10]: Raytracing Pipeline Config | [0]: Max Recursion Depth: 2 |-------------------------------------------------------------------- ---> [This is global root signature for all shaders] | [11]: Global Root Signature 0x0000004AB897CA28 |-------------------------------------------------------------------- ---> [This is empty local signature *(1)] | [12]: Local Root Signature 0x0000004AB897D130 |-------------------------------------------------------------------- *(1) According to NVIDIA the current implementation of DXR requires pipelines to contain at least one global and one local empty root signatures, which do not have to be associated with any shader. D3D12_STATE_OBJECT_DESC StateDesc; StateDesc.NumSubobjects = UINT(StateSubObjects.size()); StateDesc.pSubobjects = &StateSubObjects[0]; StateDesc.Type = D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE; GetDevice()->CreateStateObject(&StateDesc, __uuidof(ID3D12StateObject), (void **)&StateObject) And here is error message - witch is not very helpfull D3D12: Removing Device. D3D12 WARNING: ID3D12Device::RemoveDevice: Device removal has been triggered for the following reason (DXGI_ERROR_DRIVER_INTERNAL_ERROR: There is strong evidence that the driver has performed an undefined operation; but it may be because the application performed an illegal or undefined operation to begin with.). [ EXECUTION WARNING #233: DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT] Ofcourse all Root signatures are legit, the library is legit, etc. Is there something aparrently wrong with my D3D12_STATE_OBJECT_DESC ? How to debug this kind of problem, since the D3D12_STATE_OBJECT_DESC is realy simple, and 'should just work or spill anything usefull out of log' (I'v tried with both state #12 added, and without - no difference at all)
  5. Hi Is there any way to determine function type based on what is available from ID3D12FunctionReflection ? (I mean D3D12_FUNCTION_DESC probably) I want to automatically extract [shader("miss")], [shader("closesthit")] etc. from passed library (that is not known at compile time) and do not depend on the mangled names of functions to determine what they are, is there any way to know their type (or at least to annotate them with some custom string that is available during reflection ?)
  6. ADDMX

    How to create IDxcBlob ?

    OK, fine for me, I'v asked because the old compiler api has D3DCreateBlob, so I thought there will be something similar in new API Thanks!
  7. Silly question - how to create IDxcBlob ? I have result from IDxcCompiler loaded from disk (say std::vector<uint8>) - how can I create IDxcBlob from it to for example explore content of those data using IDxcContainerReflection (IDxcContainerReflection::Load accepts only IDxcBlob)
  8. Are you sure about point 3. ? In your code (and in all DXR samples) the table entry is: [ShaderID of HitGroup][LocalRootSignatureData] there are no individual ShaderIDs in table, just HitGroups IDs anyway thanks for clarification about LocalRootSignatures
  9. Hi I'm trying to implement DXR (just true DXR, not the fallback layer) into my home-made engine (thankfully already DX12 centered), and I have couple of questions that bother my mind. Looking at all the examples (from microsoft ATG and NVidia) the HitGroups just have ClosestHitShaderImport (for D3D12_HIT_GROUP_TYPE_TRIANGLES) but to support alpha-tested geometry I also need AnyHitShaderImport right ? If so, my AnyHitShaderImport need it's LocalRootSignature (as it needs descriptor table to be able to sample texture, resolve UV from VB etc.), then where do I need to put those arguments (in shaders table) ? So questions: Do ClosestHitShaderImport and AnyHitShaderImport _must_ share that same LocalRootSignature (and in general all shaders in HitGroup must share that _same_ LocalRootSignature and they have only 1 entry in shaders table for arguments - seems logical) If they do not need to share that same LocalRootSignature what is the layout ? (I know that every entry in shaders table is D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES + largest possible LocalRootSignature data size aligned to D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT, but the exaples does not cover cases with multiple shaders in single HitGroup) Second question is about ShaderLibraries in D3D12_STATE_OBJECT_DESC, as I understand I may have as many of them (D3D12_DXIL_LIBRARY_DESC subobjects) as I like, but the exports from them need to have unique names - is that right ? (I realy want to have many of them, since each different (hit)shader then will live in it's own (material)library (that same library where original rasterize-pipeline VS/PS live))
  10. OK - thanks ! Indeed I'm experimenting with raycasting and I didn't have this problem on my older hardware (GTX960) - but the copy should work regardless of error ? or if the debug layer is enabled the copy wont work on RTX hardware ? (that would sucks realy :/)
  11. Hi It is possible at all to copy descriptors between _two different_ heaps ? The documentation says so: First (source) heap is: D3D12_DESCRIPTOR_HEAP_DESC HeapDesc; HeapDesc.NumDescriptors = 256; HeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER; HeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE; HeapDesc.NodeMask = 0; and SrcHeap->GetCPUDescriptorHandleForHeapStart() ==> Handle.ptr == 4 (strange, value indeed, I'd expected ptr as in case of GPU handles) Second (destination) heap is: HeapDesc.NumDescriptors = 128; HeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER; HeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE; HeapDesc.NodeMask = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; and DstHeap->GetCPUDescriptorHandleForHeapStart() ==> Handle.ptr == 9 (strange, value indeed, I'd expected ptr as in case of GPU handles) and I want to copy elements 5, 6, and 7 from first one to the second one auto Increment = Device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER); // Return 32 CD3DX12_CPU_DESCRIPTOR_HANDLE Src = CD3DX12_CPU_DESCRIPTOR_HANDLE(SrcHeap->GetCPUDescriptorHandleForHeapStart(), 5, Increment); CD3DX12_CPU_DESCRIPTOR_HANDLE Dst = CD3DX12_CPU_DESCRIPTOR_HANDLE(DstHeap->GetCPUDescriptorHandleForHeapStart(), 0, Increment); Device->CopyDescriptorsSimple(3, Dst, Src, D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER); and debug layers says: D3D12 ERROR: ID3D12Device::CopyDescriptors: Source ranges and dest ranges overlap, which results in undefined behavior. [ EXECUTION ERROR #653: COPY_DESCRIPTORS_INVALID_RANGES] and indeed samplers are not copied to the shader visible descriptors heap ... why ? I have win10 1809 (x64), latest nvidia drivers and 2080RTX (I do not have any other cards, and device is initialized on 2080RTX) I'v compilled ModelViewer from DXSamples MiniEngine ... and it spills out that same error from within it's DynamicDescriptorHeap implementation :/
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!