direct3d11

CLSID_D2D1ChromaKey issues

久未见 提交于 2020-03-24 14:14:21
问题 I try to use DirectX ChromaKey effect, but my function stucks on some step. What I do: Create ID2D1Factory1 Create ID3D11Device and ID3D11DeviceContext Obtain DXGIResource from received texture Obtain shared handle from DXGIResource Open DXGIResource as new ID3D11Texture2D using ID3D11Device Obtain D3D11_TEXTURE2D_DESC of new ID3D11Texture2D Create new ID3D11Texture2D using input ID3D11Texture2D and D3D11_TEXTURE2D_DESC Copy resource from obtained ID3D11Texture2D to created ID3D11Texture2D

A D3D11_USAGE_STAGING Resource cannot be shared via D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX

妖精的绣舞 提交于 2020-03-23 09:58:18
问题 I try to create new ID3D11Texture2D for map it to DXGI_MAPPED_RECT further. I receive some ID3D11Texture2D that I have no power on (can not change way of creation of). Here is the part of the code: CComPtr<IDXGIResource> cpDXGIResource; RET_HR_NULL(_pTexIn->QueryInterface(__uuidof(IDXGIResource), (void**)&cpDXGIResource), cpDXGIResource); HANDLE sharedHandle; cpDXGIResource->GetSharedHandle(&sharedHandle); CComPtr<ID3D11Texture2D> cpTexIn; cpD3D11Device->OpenSharedResource(sharedHandle, _

New to Direct3D programming: 11 vs 12

醉酒当歌 提交于 2020-01-21 03:21:28
问题 For a newbie in D3D programming, should one just learn D3D12 directly or is D3D11 necessary before diving into D3D12? Assuming starting from scratch and decent knowledge of C++, which way should I go? 回答1: I've answered this question before so you should take a look at that post. In short, Direct3D 12 should be thought of as "DirectX Extreme Pro". It assumes you are already an expert in how the Direct3D 11 runtime works to the point that you can basically write it yourself. It is designed to

New to Direct3D programming: 11 vs 12

时光怂恿深爱的人放手 提交于 2020-01-21 03:20:27
问题 For a newbie in D3D programming, should one just learn D3D12 directly or is D3D11 necessary before diving into D3D12? Assuming starting from scratch and decent knowledge of C++, which way should I go? 回答1: I've answered this question before so you should take a look at that post. In short, Direct3D 12 should be thought of as "DirectX Extreme Pro". It assumes you are already an expert in how the Direct3D 11 runtime works to the point that you can basically write it yourself. It is designed to

Can D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT be passed with D3D_FEATURE_LEVEL_11_0?

試著忘記壹切 提交于 2020-01-02 09:56:24
问题 MSDN on D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT says: Direct3D 11: This value is not supported until Direct3D 11.1. Does this mean runtime version or feature level? Can I pass the flag to D3D11CreateDevice but only pass feature level 11_0? Is the feature level irrelevant and it just depends on the installed runtime version? What happens if I pass the flag to a DX runtime 11.0? Will it just be ignored silently? Or do I first have to detect the DX runtime version somehow, and then pass the flag

Can D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT be passed with D3D_FEATURE_LEVEL_11_0?

爷,独闯天下 提交于 2020-01-02 09:56:24
问题 MSDN on D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT says: Direct3D 11: This value is not supported until Direct3D 11.1. Does this mean runtime version or feature level? Can I pass the flag to D3D11CreateDevice but only pass feature level 11_0? Is the feature level irrelevant and it just depends on the installed runtime version? What happens if I pass the flag to a DX runtime 11.0? Will it just be ignored silently? Or do I first have to detect the DX runtime version somehow, and then pass the flag

Can you look sample a texture in a vertex shader?

拟墨画扇 提交于 2019-12-24 02:13:10
问题 In shader model 3.0, I'm pretty sure this was a no but I want to ask this anyway, In shader model 5.0, can you sample a texture in a vertex shader? If I want to make large amounts of supplementary information available per-vertex, what are my options? Edit: Apparently it is possible to do a Vertex Texture Fetch, as done here, but when I try it in my hlsl shader model 5 program, I get the error error X4532: cannot map expression to vs_5_0 instruction set 回答1: Yes, sampling a texture from a

Can't figure out Shaders for DirectX11?

ぐ巨炮叔叔 提交于 2019-12-23 03:15:55
问题 So, I have no idea how to use shaders. Coding them is easy, but not actually using them . MSDN is really useless to me, meaning they have the worst tutorials out there. I am currently reading Frank Luna's Direct3d 11 book, and I am finally to the part where I actually get to draw stuff. Exciting, except for the fact that it doesn't work. His BoxDemo - I'm sure worked 3 years ago when the book was made, but now with all of the new DirectX stuff - omitting the DirectX SDK and now using "Windows

How can I improve performance of Direct3D when I'm writing to a single vertex buffer thousands of times per frame?

早过忘川 提交于 2019-12-22 06:09:46
问题 I am trying to write an OpenGL wrapper that will allow me to use all of my existing graphics code (written for OpenGL) and will route the OpenGL calls to Direct3D equivalents. This has worked surprisingly well so far, except performance is turning out to be quite a problem. Now, I admit I am most likely using D3D in a way it was never designed. I am updating a single vertex buffer thousands of times per render loop. Every time I draw a "sprite" I send 4 vertices to the GPU with texture