directx-12

How can I fix “& requires l-value” [closed]

蹲街弑〆低调 提交于 2021-01-07 01:42:58
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 21 days ago . Improve this question So, I created a project and copied this tutorial in it. When I tried to run it, it gave me this error: C2102 & requires l-value at m_commandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_renderTargets[m_frameIndex].Get(), D3D12_RESOURCE_STATE_PRESENT, D3D12

Using vertex buffer instancing, how to dynamically change separate instance position?

纵然是瞬间 提交于 2020-04-18 05:36:52
问题 I need to draw million cubes. Cubes has the same vertex array, but may have different scale/position/rotation. Important: they may change their position dynamically, after vertex buffer creation. Some of them should be connected by the line. So I also need to draw lines. Currently I deal with the instancing using constant buffer: VertexShader.hlsl struct VS_INPUT { float4 pos: POSITION; float4 colour: COLOUR; uint InstanceID: SV_InstanceID; } cbuffer ConstantBuffer : register(b0) { float4x4

GetCPUDescriptorHandleForHeapStart stack corruption

只愿长相守 提交于 2020-01-12 14:58:51
问题 I've stumbled upon a rather unusual problem while programming with DirectX 12.0. No research so far has been insightful. I am programming using C (not C++). It would appear the official DirectX 12 headers support bindings for both C and C++, however writing C equivalent code to do a said task causes a crash whereas C++ does not. I don't believe the error is mine. Here's the details: I have here in my D3D12 device-initialisation procedure the following block of code: /* Get a handle to the

D3D12 Use backbuffer surface as unordered access view (UAV)

风流意气都作罢 提交于 2019-12-31 04:15:10
问题 Im making a simple raytracer for a schoolproject were a compute shader is supposed to be used to shade a triangle or some other primitive. For this I'd like to write to a backbuffer-surface directly in the compute shader, to then present the results imideatly. I know for certain that this is possible in DX11 though i can't seem to get it to work in DX12. I couldn't gather that much information about this, but i found this gamedev thread discussing the exact same problem I try to figure out

which header file contains ThrowIfFailed() in DirectX 12

强颜欢笑 提交于 2019-12-23 05:46:51
问题 some part of code image, another part of code image, I am beginner to DirectX 12 (or Game Programming) and studying from Microsoft documentation. While using function ThrowIfFailed() I get an error from intellisense of vs2015 editor This declaration has no storage class or type specifier. Can anyone help. 回答1: As you are new to DirectX programming, I strongly recommend starting with DirectX 11 rather than DirectX 12. DirectX 12 assumes you are already an expert DirectX 11 developer, and is a

DirectX 12 - Descriptor heaps

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 18:22:07
问题 I've just been starting to learn the new DirectX 12 API. I want to write sone kind of rendering engine on top of dx12 and during initialization I'm supposed to create descriptor heaps. The problem with that is that at this point in time I don't know how many resource views I will create in the future. e.g. if I want to include some kinds of post processing effects which require render to texture approaches I have to create render target views for the textures I'm rendering to. The amount of

cuda - directx 12 texture2D (in 1D array) interop

情到浓时终转凉″ 提交于 2019-12-13 03:10:54
问题 I'm trying to update in cuda a texture used in directx12. I may miss something but I have no tip about it. there is an "all the time black" area in the top right area of the image. only when I have R G B having the same value for all pixels, I get the expected result (modulo the first problem), if not I have unexpected artefacts, as if the array was not having the expected structure. What do I miss ? Here is the creation of the texture: { TextureWidth = m_width; TextureHeight = m_height; auto

Is it possible to use nvidia Nsight to debug cppwinrt directx12 applications?

☆樱花仙子☆ 提交于 2019-12-12 23:13:29
问题 I have a UWP cppwinrt app that is using directx12 to render a cube with a basic shader. I would like to use a graphics debugger to inspect the data being sent to this shader. First I am trying to use the Nvidia Nsight debugger for visual studio 2017. The problem is that when I go to "Start Graphics Debugging" from the Nsight menu, the app immediately stop with an error saying: "Failed to launch UWP app (Could not terminate existing process)". I am able to launch the Nsight debugger on a

Mix DirectX 12 and XAML controls in UWP

扶醉桌前 提交于 2019-12-12 04:26:00
问题 I would like to create a UWP app (XAML) with C++/CX and DirectX 12 so that I can mix both XAML controls (things like Grid, buttons...) and DirectX, something like a Level Editor, but I'm struggling to find a way how to initialize DirectX to render inside a specific control (like a Grid). The basic template and all the other tutorials only show how to do it within the full area of the application. When creating a device resource we set the window where to draw with SetWindow(CoreWindow:

What is the D3D12 equivalent of D3D11 CreateTexture2D?

流过昼夜 提交于 2019-12-11 10:35:24
问题 I'm new to direct3d programming and I have been building a simple windows application to display 4 images one after other with d3d12. I know a basic understanding of the D3D12 architecture and so far I've created four command allocator (backb buffer size = 4) , a command list, a command queue, descriptor heap, and a fence. I also have loaded my images from file using WIC. I know somehow I have to make image texture data as a resource. While that part is still not clear, I'd like to clarify