Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Corefanatic

Member Since 09 Apr 2010
Offline Last Active May 18 2015 06:52 AM

Posts I've Made

In Topic: Direct3D 12 documentation is now public

08 May 2015 - 06:31 PM

ID3D12Debug* d3d12DebugController{};

//...

throwIfFailed( D3D12GetDebugInterface( __uuidof(ID3D12Debug), (void**)&d3d12DebugController) );
d3d12DebugController->EnableDebugLayer();
You also need to install the last graphics tools. You can find them in PC Settings, System, Installed Apps, Manage Optional Features, Add feature.
 
As for ID3D12DebugDevice, ID3D12DebugCommandList, ID3D12DebugCommandQueue and ID3D12InfoQueue interfaces I am not yet able to get them work, so they could be not enable in the current graphics tools branch.

 

 

Thank you, that worked.


In Topic: Direct3D 12 documentation is now public

08 May 2015 - 04:47 PM

Hi all, 

I've been trying to startup the D3D12 debug layer, however have not been able to. Here's what I do

 
#include <d3d12sdklayers.h>
 
...
 
HMODULE sdk_layers = LoadLibraryA("d3d12SDKLayers.dll");
 
...
 
ID3D12Device* device = nullptr;
 
D3D12CreateDevice(
       nullptr,
       D3D_FEATURE_LEVEL_11_1,
       __uuidof(ID3D12Device),
      (void**)&device);
 
//device created successfully
 
ID3D12Debug* debug = nullptr;
 
//get the debug form device as per https://msdn.microsoft.com/en-us/library/dn950153(v=vs.85).aspx 
device->QueryInterface(__uuidof(ID3D12Debug), (void**)&debug);
 
//debug is null
 

I am not sure what is wrong here, has anyone been able to get the debug layer working?

 

Thanks

 


In Topic: Direct3D 12 documentation is now public

05 May 2015 - 08:01 AM

Thank you both, will try this later today once I get to my Win10 machine.


In Topic: Direct3D 12 documentation is now public

05 May 2015 - 04:41 AM

 

The mapping fails with invalid arguments enum returned. 
 
Does anyone know what might be the problem?


You can't map a default buffer, it's GPU access only, you have to use an upload buffer. So desc.Properties.Type = D3D12_HEAP_TYPE_DEFAULT should be changed to D3D12_HEAP_TYPE_UPLOAD. There's more information here, in the heap types section:

https://msdn.microsoft.com/en-us/library/dn899216(v=vs.85).aspx

Edit: I should really use the correct nomenclature. What I meant to say is that you can't map a resource that was created on a default heap, you can only map resources created on upload heaps (or readback heaps).

 

 

That makes sense, thank you.

 

The reason why I went with default type of heap is that the documentation recommends using it for data that will be used across multiple frames, such as the static buffer I am creating here. So the question is, how do I get data into a default heap/ resource on default heap?


In Topic: Direct3D 12 documentation is now public

04 May 2015 - 12:06 PM

I am having a problem uploading data to a buffer created on a heap.

 

The heap is created as follows:

 
D3D12_HEAP_DESC desc;
Zeromemory(&desc, sizeof(desc));
 
desc.Alignment = 0;
desc.SizeInBytes = 1024 * 1024;
desc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS;
 
desc.Properties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
desc.Properties.Type = D3D12_HEAP_TYPE_DEFAULT;
desc.Properties.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
desc.Properties.CreationNodeMask = 0; //single_gpu
desc.Properties.VisibleNodeMask = 0; //single_gpu
 
ID3D12Heap* heap = nullptr;
 

device->CreateHeap(&desc, 
__uuidof(ID3D12Heap), 
(void**)&heap);

The heap is created fine. Then I go to create the resoource:

 
D3D12_RESOURCE_DESC desc;
ZeroMemory(&desc, sizeof(desc));
 
desc.Alignment = 0;
desc.DepthOrArraySize = 1;
desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
desc.Flags = D3D12_RESOURCE_FLAG_NONE;
desc.Format = DXGI_FORMAT_UNKNOWN;
desc.Height = 1;
desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
desc.MipLevels = 1;
desc.SampleDesc.Count = 1;
desc.SampleDesc.Quality = 0;
desc.Width = sizeof(Vertex) * 3; //(32)
 
ID3D12Resource* new_resource = nullptr;
 
HRESULT ok = device->CreatePlacedResource(heap,
0,
&desc,
D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER,
nullptr,
__uuidof(ID3D12Resource),
(void**)&new_resource);
 

The resource is also created fine. Then I try to map the resource:

 
UINT8* data = 0;
HRESULT ok = new_resource->Map(0, nullptr, reinterpret_cast<void**>(&data));
 

The mapping fails with invalid arguments enum returned. 

 

Does anyone know what might be the problem?


PARTNERS