5,933 questions
1
vote
0
answers
17
views
Is Managed code with DirectX Distributed with Product Code
I am trying to understand the distribution terms for the Managed DirectX libraries. I am particularly looking for information on whether these libraries are distributed alongside the product code or ...
-1
votes
0
answers
69
views
Scalling image saved in D3D11_MAPPED_SUBRESOURCE pResource
I am using DuplicateOutput to capture the screen. AcquireNextFrame gives me the captured image.
In the end i map it using:
hr = mComPtrlImmediateContext->Map(mComPtrlDestImage, subresource,
...
2
votes
2
answers
43
views
How are you supposed to make the mip map images for block compressed formats?
If you have an image that's 128 x 64 the mips are:
Mip 0: 128 x 64
Mip 1: 64 x 32
Mip 3: 32 x 16
Mip 4: 16 x 8
Mip 5: 8 x 4
Mip 6: 4 x 2
Mip 7: 2 x 1
Mip 8: 1 x 1
Now, with block compressed formats ...
3
votes
1
answer
49
views
I get a Seg Fault when releasing COM object (WICImagingFactory)
I've begun creating a simple game engine using Direct2D, but I've encountered an issue of getting a seg fault whenever I release the IWICImagingFactory*. The issue only occurs when the program is ...
2
votes
0
answers
36
views
D2D DEBUG ERROR - An operation failed because a device-dependent resource is associated with the wrong ID2D1Device (resource domain)
I want to extract the binary data from a bitmap, but I encounter an error when drawing the bitmap into the ID2D1RenderTarget. I'm not very familiar with DirectX resource management. The ...
2
votes
0
answers
69
views
the register assignment collision across shader stages in dx12
My vertex shader use cbuffer 'A' it get assign to register b0. At the same time, my pixel shader use cbuffer 'B' and after compilation it get assign to the same register b0.
As i can see, in order to ...
1
vote
1
answer
62
views
Fullscreen Optimizations - How to tell when swapchain is being presented directly to display?
I'm curious whether a fullscreen SwapChainPanel gets optimized by Fullscreen optimizations:
To get back this performance overhead, we enhanced the DWM to recognize when a game is running in a ...
0
votes
0
answers
45
views
Why does my code output 2 diagonal lines on one side of the cube? Am I mixing up some verticies?
I am using TRIANGLESTRIP topology trying to display the wireframe of a cube. Here is the vertex I use:
g_pImmediateContext->IASetPrimitiveTopology( D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP );
...
0
votes
0
answers
48
views
Unity Direct3D and SharpDX helper APIs
I've been working on a UWP streaming app using sharpdx and I've gotten it working as a standalone visual studio project. However it requires the use of Microsoft's Direct3D helper APIs.
This does not ...
7
votes
1
answer
148
views
How to correctly share a texture from DX12 to OpenGL?
Under normal circumstances, creating a shared handle in DX using CreateSharedHandle, then using glImportMemoryWin32HandleEXT in OpenGL should allow sharing. I tried rendering a triangle in DX and ...
1
vote
0
answers
53
views
after upgrading our visual studio projects to 2022, It gives errors with DirectX. qedit not found
after upgrading our visual studio projects to 2022, It gives errors with DirectX.
IT seems we may have to use windows SDK instead of DirectX in the latest VS projects. I tried to copy the missing ...
1
vote
1
answer
58
views
Disable switching fullscreen(alt+enter) in a Direct3D 11
As written in the title, how?
I thought that DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH in DXGI_SWAP_CHAIN_DESC::flags was responsible about this, but even when I set DXGI_SWAP_CHAIN_DESC::flags to 0, the ...
0
votes
0
answers
52
views
Texture Loading Problem in c# using sharpDx Direct3D11
I started doing my 3d engine in sharpdx and it works pretty well, but there is small one problem with the texture(How it looks on objects). So the texture loader works as well with shaders but how can ...
1
vote
1
answer
222
views
FPS drop in maximized/fullscreen window using DirectX12
I'm using a Direct2D(flip model) for rendering of two images. The config of my swap chain is standard except it's using 3 buffers, no VSync, 2 frames queue of Present(0, 0). And I noticed that in a ...
0
votes
0
answers
35
views
I was basically trying to make my function bounce when it hits the end of the window's sceen but instead it only stops and doesn't bounce
So here, I am trying to implement a Bounce logic whenever the object called Poo (followed a tutorial) hits the end of the screen. I copied my implementation for making any object not go off the screen ...
2
votes
1
answer
62
views
SharpDX UWP Swapchain null reference upon Present
I'm trying to set up a SwapChain in Visual Studio, I've created a SwapChainPanel UI element that I want the swapchain to draw to.
Currently when I run this code, I get a null reference exception when ...
1
vote
1
answer
73
views
Creating a directx user control to be used in a UWP xaml application
I'm trying to add some directx functionality to a large vb .net UWP xaml islands project. Looks like the best approach is to make a c++ windows runtime component with the directx logic and use it from ...
2
votes
0
answers
49
views
SV_PrimitiveID in Geometry Shader and Pixel Shader in Dx12
When I learn the system value SV_PrimitiveID,I have a question.
In my realize,SV_PrimitiveID will give each primitive an id.But if I add GS to pipeline and the GS adds new primitive.I want to know if ...
2
votes
1
answer
86
views
DirectX distorted/stretched triangle render
I'm currently making a simple DirectX engine to brush up some of my graphics programming knowledge, but currently I've been frustratingly stuck for a while. I'm trying to render a simple triangle with ...
2
votes
1
answer
160
views
How to upsample a depth texture under directX 12?
I wrote a graphics application. In my rendering pipeline I need to upsample my rasterization depth buffer to a higher resolution. Here how the upsampled texture is created:
nbBool DX12Renderer::...
3
votes
1
answer
78
views
Directx draws images with lighter colors
I tried a lot of png images and all of them fade in color
Window on the left, original image on the right
#include <Windows.h>
#include <d3d11.h>
#include <d3d11_4.h>
#include <...
2
votes
0
answers
49
views
DirectX 12 Recording The Front Buffer
I'm building an example DX12 application that utilizes FSR3 and DLSS3. Both of these techniques use frame generation, and as far as I can tell, the interpolated frame is presented in a separate swap ...
1
vote
1
answer
104
views
How to compile legacy source code with DirectMusic API?
I have some legacy source code that uses the old DirectMusic API. The source code depends on the dmusici.h, dmusicc.h and dmusicf.h header files, as well as other legacy DirectX header files.
...
1
vote
0
answers
59
views
Unity SharpDX IDirect3DSurface surface to SharpDX.Direct3D11.Texture2D
I'm working on a UWP application in Unity with SharpDX and ffmpeginteropX, my goal is to be able to draw the frames from ffmpeg onto a texture within Unity. Currently I can draw to the Unity texture, ...
1
vote
1
answer
102
views
Why computed prefilter radiance map looks different in opengl api comparing to dx11?
I've got a shader that computes radiance texture in my DX11 renderer and I want to port it to opengl.
//this ifdef is only for the showcase, it's not in the original shader
// because version ...
2
votes
0
answers
217
views
DX12 application blocking in Present
I've been experimenting with a simple dx12 application that runs in a single thread and uses a single direct queue for copy, graphics & dispatch. I'm running on RTX 4060 Laptop GPU, The work is ...
1
vote
1
answer
115
views
How can I convert Stream to D3DImage using SharpDX 4.2.0?
I want to display byte[] which is jpg on D3DImage in WPF app using SharpDX 4.2.0.
As I know, I should do below steps to get to finish this.
EDIT :
I made two D3D11.Texture2D, one for write pixel and ...
0
votes
0
answers
92
views
render SVG vector image files in DirectX 11
I need to render SVG vector image files (static images and animation) on DirectX 11. Is there a way to do this, or I have to convert SVG to a DirectX 11 compatible format file?
NOTE: I don't have a ...
3
votes
2
answers
160
views
Differences between Microsoft and Nvidia examples of DirectX12 CPU/GPU synchronization
I'm trying to understand the CPU/GPU synchronization in DirectX 12, but there are some things that confuse me. Here is the sample code from Microsoft's HelloFrameBuffering example:
// Prepare to ...
2
votes
0
answers
56
views
DirectX 11 Desktop Duplication API: Captured Frame Data is All Zeros
I'm developing a screen capture application using DirectX 11 and the Desktop Duplication API in C++. The goal is to capture the screen content and process it. However, I'm encountering an issue where ...
1
vote
1
answer
90
views
Some properties are missing in the DirectX 11 compared to the 9th
At the moment, I am porting the old code from the ninth version of DirectX to the newer, eleventh, and I have encountered some difficulties in finding analogues of existing properties and functions.
...
1
vote
0
answers
51
views
DirectX 11: Line List is drawn 2 pixels wide
I have ported an D3D9 application to DX11 and now I am facing this problem, that the line, that is drawn using a line list of 2 vertices, is drawn with 2px height on screen at certain zoom levels.
Now ...
0
votes
0
answers
61
views
Hololens 2 d3d11.dll could not be found
I'm writing some code using SharpDX which requires Direct3D.
I've written my project in a clean Unity 3d project built for UWP with just my SharpDX scripts. When run on the Hololens 2 I get the ...
1
vote
1
answer
79
views
Direct3D 11 and 2D : wrong display of a texture
I am still trying to improve my test program about Direct3D 11 in 2D, without any additional library (see direct3d 11 and 2D: pass coordinates of a vertex as int and not float).
I now want to display ...
1
vote
1
answer
72
views
How to read depth texture in DirectX 9 pixel shader?
I can use DirectX 9 and asm only. If I use following vertex shader:
struct VS_INPUT
{
float4 pos : POSITION;
float2 t0 : TEXCOORD0;
};
struct VS_OUTPUT
{
float4 pos : POSITION;
...
1
vote
2
answers
84
views
Win32 API convert ID3D11Texture2D to cv::Mat
So I am trying to convert ID3D11Texture2D to OpenCV cv::Mat, but my code distorts the image for some reason.
D3D11_TEXTURE2D_DESC capturedTextureDesc;
texture->GetDesc(&capturedTextureDesc);
...
0
votes
0
answers
34
views
Is it not possible to have depth test in wireframe view in direct x 11
I am trying to do z buffering in direct x11 with wireframe view. Currently with my rasterizer descriptor I am getting the correct result
D3D11_RASTERIZER_DESC rasDesc;
rasDesc.FillMode = ...
1
vote
0
answers
107
views
How do I use SRGB with DXGI_SWAP_EFFECT_FLIP_DISCARD?
I have a dx11 project and I'd like to change the color format from DXGI_FORMAT_R8G8B8A8_UNORM to DXGI_FORMAT_R8G8B8A8_UNORM_SRGB.
The problem is that doing this while having ...
-2
votes
1
answer
619
views
How can I render frames decoded by FFmpeg using hardware decoding with D3D11?
I have completed the process of decoding a video frame using FFmpeg. The format of the decoded frame is AV_PIX_FMT_NV12. Now, I want to render this frame to the screen using D3D11. My questions are:
...
1
vote
1
answer
70
views
DirectX Histogram Effect does not produce an output image, the local bounds rect is { 0, 0, 0, 0 }
I would like to demo the Histogram Effect but the output is blank I've tried a Sofware type and Hardware type render target but the results are the same. Ive also tried ensuring that the effect's ...
2
votes
1
answer
63
views
Using the ID3D11Texture2D pointer received from Unity in a native Rust plugin results in an error when calling a method
I am creating a Unity native plugin in Rust.
Since I needed to receive an ID3D11Texture2D in Rust, I decided to use the windows-rs crate version 0.56.0.
Unity Code
using System;
using System....
0
votes
1
answer
103
views
Reading/writing off the end of a buffer
What happens when you read and write off the end of a buffer in a hlsl shader?
In my experience it seems that writing of the end is a no-op, and reading always returns zero.
Is this undefined ...
1
vote
0
answers
105
views
DirectDraw leak in the DirectX SDK samples?
In the DirectDraw example program 1 that comes with the DirectX 6.1 SDK (file ddex1.cpp), the following C++ code is used in the InitApp function to initialize DirectDraw:
LPDIRECTDRAW ...
2
votes
1
answer
166
views
DispatchRays complains about (in)correct descriptor heap
I am trying to dispatch a compute shader before switching to my raytracing pipeline in DirectX 12 so I have two different pipeline states. One for the compute shader and one for raytracing. The ...
2
votes
1
answer
76
views
DirectX11 SwapChain Force Texture Format
ID3D11Texture2D* pTexture = nullptr;
HRESULT hrGetBuffer = pSwapChain->GetBuffer(
0,
__uuidof(ID3D11Texture2D),
reinterpret_cast<void**>(&pTexture)
);
Is it possible to ...
1
vote
0
answers
99
views
DX11: Do I need to resolve a MSAA texture before using it as a texture ressource in a pixel shader?
I apply elaborate pixel shaders to textures, using a simple quad (drawing two triangles covering the whole input texture). The pixel shader uses the result of previous draw calls, stored in a ...
1
vote
0
answers
32
views
True windows width and height
I am working my way through a windows game programming book book which takes you through the fundamentals of Direct X, 2d and 3d. It is going great and it is a great book. I have gotten far and have ...
0
votes
0
answers
195
views
Custom components with Direct2D paint
I have a project with alot of painted controls, such as grids, coloring, shapes, images, and so on. I decided to try using GPU acceleration to make the entire solution smoother and faster so that a ...
2
votes
1
answer
115
views
Why is Captured Image Data All Zeros When Using DXGI Output Duplication and Direct3D?
I am developing an application to capture screenshots from the desktop using DXGI output duplication and Direct3D in C#. My application initializes DXGI, creates a Direct3D device, and duplicates the ...
-1
votes
1
answer
186
views
how to use tessellation in directx12?
I'm using directx12. I want to make tessellation for my polygon, for this I wrote 2 simple shaders:
struct Vertex{
float3 Position : POSITION;
float4 Color : COLOR;
};
struct tesOutput{
...