Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

176 Neutral

About Corefanatic

  • Rank
  1.   Thank you, that worked.
  2. 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  
  3. Thank you both, will try this later today once I get to my Win10 machine.
  4. 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?
  5. 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?
  6.   Agreed, viewport sets the area of the render target you render into, therefore with every render target size, you need to set the viewport accordingly in order for the scene to render into the whole render target.
  • 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!