Rise
The Vieneo Province
Loading...
Searching...
No Matches
Tests/Device11Tests.cpp

Source at documentation-generation time. See Test catalog for fixture associations.

1// Native D3D11 GPU integration tests. No D3D9/D3DX or game login is used.
2#include "../Rendering/Device11.h"
3#include "../Rendering/DeviceDiagnostics11.h"
4#include <d3dcompiler.h>
5#include <d3d11sdklayers.h>
6#include <DirectXMath.h>
7#include <algorithm>
8#include <chrono>
9#include <cmath>
10#include <cstring>
11#include <iostream>
12#include <stdexcept>
13#include <vector>
14
15using Microsoft::WRL::ComPtr;
16using namespace Rendering;
17namespace
18{
19 unsigned checks = 0;
20 void Check(bool value, const char* message)
21 {
22 ++checks;
23 if (!value) throw std::runtime_error(message);
24 }
25 void HR(HRESULT hr, const char* message)
26 {
27 if (FAILED(hr)) std::cerr << message << ": HRESULT=0x" << std::hex << hr << std::dec << '\n';
28 Check(SUCCEEDED(hr), message);
29 }
30
31 ComPtr<ID3DBlob> Compile(const char* source, const char* entry, const char* profile, UINT samples = 1)
32 {
33 const std::string count = std::to_string(samples);
34 const D3D_SHADER_MACRO macros[] = {{"RISE_SCENE_SAMPLES", count.c_str()}, {nullptr, nullptr}};
35 ComPtr<ID3DBlob> code, errors;
36 const HRESULT hr = D3DCompile(source, strlen(source), "Tests/Device11.inline.hlsl", macros,
37 D3D_COMPILE_STANDARD_FILE_INCLUDE, entry, profile,
38 D3DCOMPILE_ENABLE_STRICTNESS | D3DCOMPILE_WARNINGS_ARE_ERRORS | D3DCOMPILE_OPTIMIZATION_LEVEL3,
39 0, &code, &errors);
40 if (errors) std::cerr << static_cast<const char*>(errors->GetBufferPointer());
41 HR(hr, "compile test shader");
42 return code;
43 }
44
45 constexpr char shader[] = R"HLSL(
46#include "../Rendering/SceneDepth11.hlsli"
47float4 Fullscreen(uint vertex : SV_VertexID) : SV_Position
48{
49 return float4(vertex == 2 ? 3 : -1, vertex == 1 ? 3 : -1, 0, 1);
50}
51float4 Silhouette(uint vertex : SV_VertexID) : SV_Position
52{
53 return float4(vertex == 2 ? .5 : -1, vertex == 1 ? -3 : 1, 0, 1);
54}
55float WriteDepth(float4 pixel : SV_Position, uint sample : SV_SampleIndex) : SV_Depth
56{
57 // Oblique boundary plus per-sample distances exercises coverage and every
58 // sample slot. Not an averaged or sample-zero-only reference.
59 return .125 + .0625 * sample;
60}
61float4 Composite(float4 pixel : SV_Position, uint sample : SV_SampleIndex) : SV_Target
62{
63 float z = RiseLoadSceneDepth(uint2(pixel.xy), sample);
64 return float4(z, z, z, 1);
65}
66RWStructuredBuffer<float> result : register(u0);
67[numthreads(8,8,1)] void ReadSamples(uint3 id : SV_DispatchThreadID)
68{
69 if (id.x >= 64 || id.y >= 48) return;
70 [unroll] for (uint sample = 0; sample < RISE_SCENE_SAMPLES; ++sample)
71 result[(id.y * 64 + id.x) * RISE_SCENE_SAMPLES + sample] = RiseLoadSceneDepth(id.xy, sample);
72}
73)HLSL";
74
75 struct Pipeline
76 {
77 ComPtr<ID3D11VertexShader> vertex, silhouette;
78 ComPtr<ID3D11PixelShader> write, composite;
79 ComPtr<ID3D11ComputeShader> read;
80 ComPtr<ID3D11RasterizerState> raster;
81 ComPtr<ID3D11DepthStencilState> writable, readable;
82 Pipeline(ID3D11Device* device, UINT samples)
83 {
84 auto code = Compile(shader, "Fullscreen", "vs_5_0", samples);
85 HR(device->CreateVertexShader(code->GetBufferPointer(), code->GetBufferSize(), nullptr, &vertex), "create fullscreen VS");
86 code = Compile(shader, "Silhouette", "vs_5_0", samples);
87 HR(device->CreateVertexShader(code->GetBufferPointer(), code->GetBufferSize(), nullptr, &silhouette), "create silhouette VS");
88 code = Compile(shader, "WriteDepth", "ps_5_0", samples);
89 HR(device->CreatePixelShader(code->GetBufferPointer(), code->GetBufferSize(), nullptr, &write), "create depth writer");
90 code = Compile(shader, "Composite", "ps_5_0", samples);
91 HR(device->CreatePixelShader(code->GetBufferPointer(), code->GetBufferSize(), nullptr, &composite), "create sample composite");
92 code = Compile(shader, "ReadSamples", "cs_5_0", samples);
93 HR(device->CreateComputeShader(code->GetBufferPointer(), code->GetBufferSize(), nullptr, &read), "create depth reader");
94 D3D11_RASTERIZER_DESC rs{};
95 rs.FillMode = D3D11_FILL_SOLID; rs.CullMode = D3D11_CULL_NONE;
96 rs.DepthClipEnable = TRUE; rs.MultisampleEnable = TRUE;
97 HR(device->CreateRasterizerState(&rs, &raster), "create rasterizer");
98 D3D11_DEPTH_STENCIL_DESC ds{};
99 ds.DepthEnable = TRUE; ds.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
100 ds.DepthFunc = D3D11_COMPARISON_ALWAYS;
101 ds.StencilEnable = TRUE; ds.StencilReadMask = ds.StencilWriteMask = 0xff;
102 ds.FrontFace = ds.BackFace = {D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP,
103 D3D11_STENCIL_OP_REPLACE, D3D11_COMPARISON_ALWAYS};
104 HR(device->CreateDepthStencilState(&ds, &writable), "create writable depth state");
105 ds.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
106 ds.StencilWriteMask = 0;
107 ds.FrontFace = ds.BackFace = {D3D11_STENCIL_OP_KEEP, D3D11_STENCIL_OP_KEEP,
108 D3D11_STENCIL_OP_KEEP, D3D11_COMPARISON_EQUAL};
109 HR(device->CreateDepthStencilState(&ds, &readable), "create read-only depth/stencil state");
110 }
111 void Bind(ID3D11DeviceContext* context)
112 {
113 context->IASetInputLayout(nullptr);
114 context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
115 context->VSSetShader(vertex.Get(), nullptr, 0);
116 context->RSSetState(raster.Get());
117 const D3D11_VIEWPORT viewport{0, 0, 64, 48, 0, 1};
118 context->RSSetViewports(1, &viewport);
119 }
120 };
121
122 std::vector<float> ReadSamples(Device11& gpu, Pipeline& pipeline, const SceneDepth11& depth, UINT samples)
123 {
124 auto* device = gpu.Device(); auto* context = gpu.Context();
125 const UINT bytes = 64 * 48 * samples * sizeof(float);
126 D3D11_BUFFER_DESC desc{};
127 desc.ByteWidth = bytes; desc.Usage = D3D11_USAGE_DEFAULT;
128 desc.BindFlags = D3D11_BIND_UNORDERED_ACCESS;
129 desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
130 desc.StructureByteStride = sizeof(float);
131 ComPtr<ID3D11Buffer> buffer, staging;
132 HR(device->CreateBuffer(&desc, nullptr, &buffer), "create sample read buffer");
133 desc.Usage = D3D11_USAGE_STAGING; desc.BindFlags = desc.MiscFlags = desc.StructureByteStride = 0;
134 desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
135 HR(device->CreateBuffer(&desc, nullptr, &staging), "create sample staging buffer");
136 ComPtr<ID3D11UnorderedAccessView> output;
137 HR(device->CreateUnorderedAccessView(buffer.Get(), nullptr, &output), "create sample UAV");
138 context->OMSetRenderTargets(0, nullptr, nullptr);
139 auto* srv = depth.ShaderView(); auto* uav = output.Get();
140 context->CSSetShaderResources(15, 1, &srv);
141 context->CSSetUnorderedAccessViews(0, 1, &uav, nullptr);
142 context->CSSetShader(pipeline.read.Get(), nullptr, 0);
143 context->Dispatch(8, 6, 1);
145 uav = nullptr; context->CSSetUnorderedAccessViews(0, 1, &uav, nullptr);
146 context->CSSetShader(nullptr, nullptr, 0);
147 context->CopyResource(staging.Get(), buffer.Get());
148 D3D11_MAPPED_SUBRESOURCE mapped{};
149 HR(context->Map(staging.Get(), 0, D3D11_MAP_READ, 0, &mapped), "read depth samples");
150 std::vector<float> values(bytes / sizeof(float));
151 memcpy(values.data(), mapped.pData, bytes);
152 context->Unmap(staging.Get(), 0);
153 return values;
154 }
155
156 void TestSamples(Device11& gpu, UINT samples)
157 {
158 if (!gpu.SupportsSamples(samples))
159 {
160 std::cout << "SKIP: MSAA " << samples << " unsupported by standard format checks\n";
161 return;
162 }
163 auto* device = gpu.Device(); auto* context = gpu.Context();
164 SceneDepth11 depth;
165 HR(depth.Create(device, 64, 48, {samples, 0}), "create shader-readable depth");
166 D3D11_TEXTURE2D_DESC actual{}; depth.Texture()->GetDesc(&actual);
167 Check(actual.Format == DXGI_FORMAT_R24G8_TYPELESS && actual.SampleDesc.Count == samples,
168 "depth format and sample count preserved");
169 D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc{}; depth.ShaderView()->GetDesc(&srvDesc);
170 Check(srvDesc.ViewDimension == (samples > 1 ? D3D11_SRV_DIMENSION_TEXTURE2DMS : D3D11_SRV_DIMENSION_TEXTURE2D),
171 "SRV dimension matches multisampling");
172 Pipeline pipeline(device, samples);
173 pipeline.Bind(context);
174 context->ClearDepthStencilView(depth.WriteView(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1, 0);
175 context->OMSetRenderTargets(0, nullptr, depth.WriteView());
176 context->OMSetDepthStencilState(pipeline.writable.Get(), 7);
177 context->PSSetShader(pipeline.write.Get(), nullptr, 0);
178 context->VSSetShader(pipeline.silhouette.Get(), nullptr, 0);
179 context->Draw(3, 0);
180 const auto values = ReadSamples(gpu, pipeline, depth, samples);
181 unsigned mixed = 0;
182 for (UINT y = 0; y < 48; ++y) for (UINT x = 0; x < 64; ++x)
183 {
184 unsigned covered = 0;
185 for (UINT sample = 0; sample < samples; ++sample)
186 {
187 const float z = values[(y * 64 + x) * samples + sample];
188 const float expected = .125f + .0625f * sample;
189 Check(std::abs(z - expected) < 1e-6f || z == 1, "each sample retains its own depth or clear value");
190 if (z < 1) ++covered;
191 if (x < 20) Check(std::abs(z - expected) < 1e-6f, "interior sample depth exact");
192 if (x > 50) Check(z == 1, "outside geometry remains cleared sky");
193 }
194 if (covered != 0 && covered != samples) ++mixed;
195 }
196 if (samples > 1) Check(mixed > 0, "diagonal silhouette has partially covered pixels");
197
198 D3D11_TEXTURE2D_DESC colorDesc{};
199 colorDesc.Width = 64; colorDesc.Height = 48; colorDesc.MipLevels = colorDesc.ArraySize = 1;
200 colorDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
201 colorDesc.SampleDesc = {samples, 0}; colorDesc.BindFlags = D3D11_BIND_RENDER_TARGET;
202 ComPtr<ID3D11Texture2D> color, resolved, staging;
203 HR(device->CreateTexture2D(&colorDesc, nullptr, &color), "create multisample composite color");
204 ComPtr<ID3D11RenderTargetView> rtv;
205 HR(device->CreateRenderTargetView(color.Get(), nullptr, &rtv), "create composite RTV");
206 const float clear[] = {1, 1, 1, 1}; context->ClearRenderTargetView(rtv.Get(), clear);
207 pipeline.Bind(context);
208 auto* target = rtv.Get(); auto* srv = depth.ShaderView();
209 context->OMSetDepthStencilState(pipeline.readable.Get(), 7);
210 context->OMSetRenderTargets(1, &target, depth.ReadView());
211 context->PSSetShaderResources(15, 1, &srv);
212 context->PSSetShader(pipeline.composite.Get(), nullptr, 0);
213 context->Draw(3, 0);
214 gpu.UnbindShaderResources(); context->OMSetRenderTargets(0, nullptr, nullptr);
215 colorDesc.SampleDesc = {1, 0};
216 HR(device->CreateTexture2D(&colorDesc, nullptr, &resolved), "create resolved color");
217 if (samples > 1) context->ResolveSubresource(resolved.Get(), 0, color.Get(), 0, colorDesc.Format);
218 else context->CopyResource(resolved.Get(), color.Get());
219 colorDesc.BindFlags = 0; colorDesc.Usage = D3D11_USAGE_STAGING; colorDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ;
220 HR(device->CreateTexture2D(&colorDesc, nullptr, &staging), "create color staging");
221 context->CopyResource(staging.Get(), resolved.Get());
222 D3D11_MAPPED_SUBRESOURCE mapped{};
223 HR(context->Map(staging.Get(), 0, D3D11_MAP_READ, 0, &mapped), "read composited color");
224 for (UINT y = 0; y < 48; ++y) for (UINT x = 0; x < 64; ++x)
225 {
226 const auto* row = reinterpret_cast<const float*>(static_cast<const char*>(mapped.pData) + y * mapped.RowPitch);
227 float expected = 0;
228 for (UINT sample = 0; sample < samples; ++sample) expected += values[(y * 64 + x) * samples + sample] / samples;
229 Check(std::abs(row[x * 4] - expected) < 1e-5f,
230 "sample-frequency composite preserves silhouettes and stencil while reading depth");
231 }
232 context->Unmap(staging.Get(), 0);
233 // Writable use after sampling must not be silently nulled by the runtime.
234 context->OMSetDepthStencilState(pipeline.writable.Get(), 7);
235 context->OMSetRenderTargets(0, nullptr, depth.WriteView());
236 context->ClearDepthStencilView(depth.WriteView(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, .75f, 0);
237 const auto cleared = ReadSamples(gpu, pipeline, depth, samples);
238 for (float value : cleared) Check(std::abs(value - .75f) < 1e-6f, "depth safely returns to writable use");
239 auto* original = depth.Texture();
240 Check(depth.Create(device, 0, 48, {samples, 0}) == E_INVALIDARG && depth.Texture() == original,
241 "invalid replacement preserves existing depth resource");
242 HR(depth.Create(device, 91, 37, {samples, 0}), "resize independent depth resource");
243 Check(depth.Description().Width == 91 && depth.Description().Height == 37, "resized depth dimensions");
244 context->ClearState();
245 std::cout << "PASS: " << samples << "x depth samples, read-only DSV/SRV, stencil, silhouette ("
246 << mixed << " mixed pixels), resize, role transitions\n";
247 }
248
249 void TestProjection()
250 {
251 using namespace DirectX;
252 // The zoomed view scales z, so normalizing viewRay would change units.
253 for (float nearPlane : {.0001f, .001f, .1f, 10.f})
254 for (float farPlane : {384.f, 100000.f}) for (float zoom : {.25f, 1.f, 4.f})
255 {
256 XMFLOAT4X4 p;
257 XMStoreFloat4x4(&p, XMMatrixPerspectiveFovRH(XM_PI / 3, 16.f / 9, nearPlane, farPlane));
258 for (float distance : {nearPlane * 2, nearPlane * 10, nearPlane * 100})
259 {
260 const double viewZ = -double(distance) * zoom;
261 const double depth = (viewZ * p._33 + p._43) / -viewZ;
262 const double recovered = p._43 / (depth + p._33) / zoom;
263 Check(std::abs(recovered - distance) < distance * 1e-6, "RH depth reconstruction preserves camera zoom and kilometers");
264 }
265 }
266 // Quantization is measured, not hidden by a permissive tolerance.
267 XMFLOAT4X4 p;
268 XMStoreFloat4x4(&p, XMMatrixPerspectiveFovRH(XM_PI / 3, 16.f / 9, .0001f, 100000.f));
269 const double distance = 636;
270 const double z = (-distance * p._33 + p._43) / distance;
271 const double quantized = std::round(z * 16777215) / 16777215;
272 const double recovered = p._43 / (quantized + p._33);
273 std::cout << "D24 reference precision at 636 km with near=0.0001 far=100000: recovered="
274 << recovered << " km; error=" << recovered - distance << " km (scene frustum/scaling parity still required)\n";
275 }
276
277 void CheckDebugMessages(Device11& gpu)
278 {
279 ComPtr<ID3D11InfoQueue> queue;
280 if (FAILED(gpu.Device()->QueryInterface(IID_PPV_ARGS(&queue))))
281 {
282 std::cout << "UNVERIFIED: optional D3D11 debug layer unavailable\n"; return;
283 }
284 unsigned actionable = 0;
285 for (UINT64 i = 0; i < queue->GetNumStoredMessages(); ++i)
286 {
287 SIZE_T length = 0; HR(queue->GetMessage(i, nullptr, &length), "debug message length");
288 std::vector<char> bytes(length);
289 auto* message = reinterpret_cast<D3D11_MESSAGE*>(bytes.data());
290 HR(queue->GetMessage(i, message, &length), "read debug message");
291 if (message->Severity <= D3D11_MESSAGE_SEVERITY_WARNING)
292 {
293 std::cerr << "D3D11 debug " << message->ID << ": " << message->pDescription << '\n'; ++actionable;
294 }
295 }
296 Check(actionable == 0, "no debug-layer resource/state warnings or errors");
297 queue->ClearStoredMessages();
298 std::cout << "PASS: D3D11 debug layer, zero warnings/errors\n";
299 }
300
301 void TestDiagnostics(Device11& gpu)
302 {
303 const auto driver=DriverDiagnostics11(gpu.Device());
304 std::cout << driver << '\n';
305 Check(driver.find("driverVersion=")!=std::string::npos && driver.find("vendorId=")!=std::string::npos,
306 "real device identifies its owning adapter and driver query result");
307 Check(DriverDiagnostics11(nullptr).find("unavailable")!=std::string::npos,
308 "diagnostics tolerate absent startup/teardown device");
309 const auto lost=DeviceFailureDiagnostics11(DXGI_ERROR_DEVICE_REMOVED,gpu.Device());
310 Check(lost.find("removalReason=0x00000000")!=std::string::npos,
311 "healthy device reason is recorded without inventing a GPU reset");
312 Check(lost.substr(0,64).find("0x887a0005")!=std::string::npos &&
313 lost.substr(0,64).find("removalReason=0x00000000")!=std::string::npos,
314 "error packet suffix preserves both operation and underlying reason");
315 Check(DeviceFailureDiagnostics11(DXGI_ERROR_DEVICE_REMOVED,nullptr).find("unavailable")!=std::string::npos,
316 "missing device reason is explicit, not reported as healthy");
317 for(const HRESULT result:{DXGI_ERROR_DEVICE_REMOVED,DXGI_ERROR_DEVICE_RESET,DXGI_ERROR_DEVICE_HUNG,DXGI_ERROR_DRIVER_INTERNAL_ERROR})
318 Check(IsDeviceRemovalError11(result),"device-loss diagnostics cover graphics failure classes");
319 Check(!IsDeviceRemovalError11(E_OUTOFMEMORY) && !IsDeviceRemovalError11(E_INVALIDARG),
320 "unrelated errors keep their existing diagnostics");
321 }
322
323 void TestSwapChain(Device11& gpu)
324 {
325 HWND window = CreateWindowW(L"STATIC", L"Rise D3D11 lifecycle fixture", WS_OVERLAPPEDWINDOW,
326 0, 0, 160, 90, nullptr, nullptr, GetModuleHandleW(nullptr), nullptr);
327 Check(window != nullptr, "create hidden lifecycle window");
328 HR(gpu.AttachWindow(window, 160, 90, 4), "attach flip swap chain");
329 for (UINT samples : {1u, 4u, 2u, 8u, 1u})
330 {
331 HR(gpu.Resize(160 + samples, 90 + samples, samples), "resize/sample-count change");
332 Check(gpu.Depth().Description().SampleDesc.Count == gpu.SelectSamples(samples), "selected samples bound to scene depth");
333 gpu.BindScene();
334 const float clear[] = {.2f, .4f, .8f, 1};
335 gpu.Context()->ClearRenderTargetView(gpu.SceneTarget(), clear);
336 gpu.Context()->ClearDepthStencilView(gpu.Depth().WriteView(), D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1, 0);
337 HR(gpu.Present(0), "resolve color and present");
338 Check(gpu.Resize(0, 0, samples) == S_FALSE && gpu.Suspended(), "minimize suspends renderer");
339 Check(gpu.Present(0) == S_FALSE, "minimized present is idle");
340 HR(gpu.Resize(160 + samples, 90 + samples, samples), "restore without needless resource recreation");
341 Check(!gpu.Suspended(), "restore resumes renderer");
342 }
343 HR(gpu.RemovalReason(), "device remains healthy");
344 CheckDebugMessages(gpu);
345 gpu.Reset();
346 DestroyWindow(window);
347 std::cout << "PASS: flip swap chain, color resolve, resize, minimize/restore, MSAA changes, complete device teardown\n";
348 }
349}
350
351int main(int argc, char** argv)
352{
353 try
354 {
355 DeviceOptions11 options;
356 options.debugLayer = true;
357 for (int i = 1; i < argc; ++i)
358 {
359 if (!strcmp(argv[i], "--warp")) options.driver = D3D_DRIVER_TYPE_WARP;
360 else if (!strcmp(argv[i], "--no-debug-layer")) options.debugLayer = false;
361 else throw std::runtime_error("usage: Device11Tests [--warp] [--no-debug-layer]");
362 }
363 Device11 gpu;
364 HR(gpu.Create(options), "create native D3D11 device");
365 std::cout << gpu.Status() << '\n';
366 TestDiagnostics(gpu);
367 HR(gpu.CheckCloudFormats(), "standard cloud format capabilities");
368 TestProjection();
369 for (UINT samples : {1u, 2u, 4u, 8u}) TestSamples(gpu, samples);
370 CheckDebugMessages(gpu);
371 TestSwapChain(gpu);
372 HR(gpu.Create(options), "recreate complete device");
373 TestSamples(gpu, 4);
374 CheckDebugMessages(gpu);
375 gpu.Reset();
376 std::cout << "PASS: " << checks << " native D3D11 checks; "
377 << (options.driver == D3D_DRIVER_TYPE_WARP ? "WARP software" : "local hardware") << '\n';
378 return 0;
379 }
380 catch (const std::exception& e) { std::cerr << "FAIL: " << e.what() << '\n'; return 1; }
381}
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
UINT SelectSamples(UINT requested) const
Definition Device11.cpp:124
HRESULT AttachWindow(HWND window, UINT width, UINT height, UINT requestedSamples)
Definition Device11.cpp:142
bool SupportsSamples(UINT count) const
Definition Device11.cpp:112
void UnbindShaderResources()
Definition Device11.cpp:163
ID3D11DeviceContext * Context() const
Definition Device11.h:66
bool Suspended() const
Definition Device11.h:73
ID3D11RenderTargetView * SceneTarget() const
Definition Device11.h:68
HRESULT CheckCloudFormats() const
Definition Device11.cpp:131
ID3D11Device * Device() const
Definition Device11.h:65
HRESULT Present(UINT syncInterval=1)
Definition Device11.cpp:243
const std::string & Status() const
Definition Device11.h:75
HRESULT Resize(UINT width, UINT height, UINT requestedSamples)
Definition Device11.cpp:210
HRESULT Create(const DeviceOptions11 &options={})
Definition Device11.cpp:84
HRESULT RemovalReason() const
Definition Device11.cpp:268
const SceneDepth11 & Depth() const
Definition Device11.h:70
ID3D11ShaderResourceView * ShaderView() const
Definition Device11.h:20
ID3D11Texture2D * Texture() const
Definition Device11.h:17
const D3D11_TEXTURE2D_DESC & Description() const
Definition Device11.h:22
HRESULT Create(ID3D11Device *device, UINT width, UINT height, DXGI_SAMPLE_DESC samples)
Definition Device11.cpp:20
ID3D11DepthStencilView * ReadView() const
Definition Device11.h:19
ID3D11DepthStencilView * WriteView() const
Definition Device11.h:18
Definition DDS.h:24
bool IsDeviceRemovalError11(HRESULT result)
std::string DriverDiagnostics11(ID3D11Device *device)
std::string DeviceFailureDiagnostics11(HRESULT operation, ID3D11Device *device)
void Bind(Rendering::RenderDevice &device, Rendering::RenderTexture *texture)
D3D_DRIVER_TYPE driver
Definition Device11.h:32