dxgi

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, _

How to create 2D texture using DXGI format DXGI_FORMAT_R1_UNORM?

前提是你 提交于 2020-02-16 10:42:31
问题 I want to create a 1 bit per pixel monochrome texture 2D in DirectX 11 using dxgi format DXGI_FORMAT_R1_UNORM I have done trying the following but it's showing following errors: D3D11 ERROR: ID3D11Device::CreateTexture2D: Device does not support the format R1_UNORM. [ STATE_CREATION ERROR #92: CREATETEXTURE2D_UNSUPPORTEDFORMAT] D3D11: BREAK enabled for the previous message, which was: [ ERROR STATE_CREATION #92: CREATETEXTURE2D_UNSUPPORTEDFORMAT ] I have tried to create a texture for

How to create 2D texture using DXGI format DXGI_FORMAT_R1_UNORM?

对着背影说爱祢 提交于 2020-02-16 10:42:28
问题 I want to create a 1 bit per pixel monochrome texture 2D in DirectX 11 using dxgi format DXGI_FORMAT_R1_UNORM I have done trying the following but it's showing following errors: D3D11 ERROR: ID3D11Device::CreateTexture2D: Device does not support the format R1_UNORM. [ STATE_CREATION ERROR #92: CREATETEXTURE2D_UNSUPPORTEDFORMAT] D3D11: BREAK enabled for the previous message, which was: [ ERROR STATE_CREATION #92: CREATETEXTURE2D_UNSUPPORTEDFORMAT ] I have tried to create a texture for

Custom output resolution DuplicateOutput DXGI

被刻印的时光 ゝ 提交于 2020-01-14 04:41:05
问题 I'm using AcquireNextFrame to make a screenshot of my desktop. Is it possible to set a dimension of the output image I want on the setup ? I saw on the documentation this function IDXGIOutput::SetDisplaySurface that could help. Here is my code : //Here I init a output texture with less resolution D3D11_TEXTURE2D_DESC desc; desc.Width = 1280; desc.Height = 720; desc.MipLevels = desc.ArraySize = 1; desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; desc.SampleDesc.Count = 1; desc.Usage = D3D11_USAGE

Resetting window after using DirectX 11

。_饼干妹妹 提交于 2020-01-01 14:22:48
问题 I've written an application that can switch between OpenGL, DirectX 9 and DirectX 11 for rendering without restarting or recreating the window. Switching between OpenGL and DirectX 9 as well as to DirectX 11 mode works well, however, after using DirectX 11 no other rendering mode works any longer. After releasing all DirectX 11 interfaces, the window still shows the last rendered frame, it is even properly updated when resizing the window. A DirectX 9 device can be created and the Present

SaveDDSTextureToFile() saves a black texture instead the expected

无人久伴 提交于 2019-12-24 11:55:18
问题 I have created a red colored texture of DXGI format DXGI_FORMAT_R32_FLOAT. I have a byte buffer of red color pixels where 4 byte per pixel is prepared. The byte buffer is then copied using device context map and unmap functions and after that I have created a shader resource view. I have get the resource back from resource view then passed that to SaveDDSTextureToFile() to save the bitmap data to dds file format. But when I am going to save it in dds in file to check it's saves a same sized

AcquireNextFrame not working (Desktop Duplication API & D3D11)

大兔子大兔子 提交于 2019-12-24 02:15:10
问题 I've put together this code that takes a screenshot of the desktop and maps it for raw pixel data access, but the output is all zeros. I have no idea what i've done wrong. After looking at many examples of the Desktop Duplication Api online I don't see any differences between them and mine. This is my method to initialize everything, and no errors are raised. BOOL init() { CHECKHR(D3D11CreateDevice(nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, gFeatureLevels, gNumFeatureLevels, D3D11_SDK

Directx 11 Front Buffer

时光毁灭记忆、已成空白 提交于 2019-12-21 20:55:49
问题 I am hoping this is a easy answer to an easy question which I cannot find an answer to. How do I access the front buffer in Directx 11 / DXGI? I have found in Directx 9 you can use GetFrontBufferData() and you can use GetBuffer() in Directx 11 to get access to the backbuffer but there are problems with this. The backbuffer doesn't have calculations done to it that the front buffer does. So I was wondering if there is something I am missing. I could try using GetDisplaySurfaceData and unless I

How to get current display mode (resolution, refresh rate) of a monitor/output in DXGI?

[亡魂溺海] 提交于 2019-12-21 03:42:22
问题 I am creating a multi-monitor full screen DXGI/D3D application. I am enumerating through the available outputs and adapters in preparation of creating their swap chains. When creating my swap chain using DXGI's IDXGIFactory::CreateSwapChain method, I need to provide a swap chain description which includes a buffer description of type DXGI_MODE_DESC that details the width, height, refresh rate, etc. How can I find out what the output is currently set to (or how can I find out what the display

Using Media Foundation to encode Direct X surfaces

只愿长相守 提交于 2019-12-20 11:32:12
问题 I'm trying to use the MediaFoundation API to encode a video but I'm having problems pushing the samples to the SinkWriter. I'm getting the frames to encode through the Desktop Duplication API. What I end up with is an ID3D11Texture2D with the desktop image in it. I'm trying to create an IMFVideoSample containing this surface and then push that video sample to a SinkWriter. I've tried going about this in different ways: I called MFCreateVideoSampleFromSurface(texture, &pSample) where texture