Skip to content

Commit d763a36

Browse files
committed
Built but not tested due to lax of dx11 card
After a few weeks of banging my head against the wall to understand the intricate way of trying to get iddcx and dxgi and d3d11 to work together. It finally built, if some one finds the time / want to subject themself to my shitty code =) I'' gladly help you along on our discord. at least sofar that you an compile and test locally.
1 parent d399ebf commit d763a36

11 files changed

Lines changed: 1427 additions & 176 deletions

File tree

Common/Dx11-Shader/TV_shader.cpp

Lines changed: 476 additions & 0 deletions
Large diffs are not rendered by default.

Common/Dx11-Shader/TV_shader.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// TV_shader.h
2+
#pragma once
3+
#include <DirectXMath.h>
4+
5+
extern const int TVShader_VS_size;
6+
extern const BYTE TVShader_VS[];
7+
8+
extern const int TVShader_PS_size;
9+
extern const BYTE TVShader_PS[];
10+
11+
struct PerFrameBuffer
12+
{
13+
DirectX::XMFLOAT4 resolution;
14+
float time;
15+
float padding[3]; // Align to 16 bytes
16+
};

Common/Include/crt_shader.h

Lines changed: 477 additions & 0 deletions
Large diffs are not rendered by default.

Common/Include/frame_handler.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#ifndef FRAME_HANDLER_H
2+
#define FRAME_HANDLER_H
3+
4+
#include <d3d11.h>
5+
#include <dxgi1_2.h>
6+
#include <DirectXMath.h>
7+
#include <wdf.h>
8+
#include <iddcx.h>
9+
10+
struct PerFrameBuffer {
11+
DirectX::XMFLOAT4 resolution;
12+
float time;
13+
float padding[3];
14+
};
15+
16+
class FrameHandler {
17+
public:
18+
static ID3D11Device* g_device;
19+
static ID3D11DeviceContext* g_deviceContext;
20+
static ID3D11VertexShader* g_vertexShader;
21+
static ID3D11PixelShader* g_pixelShader;
22+
static ID3D11InputLayout* g_inputLayout;
23+
static ID3D11Buffer* g_constantBuffer;
24+
static ID3D11RenderTargetView* g_outputRTV;
25+
static bool enabled;
26+
27+
static void InitializeFrameHandler(ID3D11Device* device, ID3D11DeviceContext* context, const wchar_t* shaderFilePath);
28+
static NTSTATUS AssignSwapChain(IDDCX_SWAPCHAIN hSwapChain, IDXGISwapChain* dxgiSwapChain);
29+
static void ProcessFrame(IDDCX_SWAPCHAIN hSwapChain, LARGE_INTEGER PresentationTime);
30+
static bool IsEnabled() { return enabled; }
31+
};
32+
33+
#endif

0 commit comments

Comments
 (0)