DX12: added macro DISABLE_DX12 that allows to disable DX12 backend.

This commit is contained in:
Artem Kharytoniuk
2017-12-25 16:57:33 +01:00
parent 52ac138485
commit 497a74dcca
6 changed files with 87 additions and 30 deletions

View File

@@ -4,9 +4,14 @@
#include <chrono>
#include <functional>
#ifndef DISABLE_DX12
#include "D3d12.h"
#include "DXGI1_4.h"
#pragma comment (lib, "D3d12.lib")
#pragma comment (lib, "DXGI.lib")
const int VERTEX_CHUNK_SIZE = 512 * 1024;
const int XYZ_SIZE = 4 * VERTEX_CHUNK_SIZE;
@@ -1479,3 +1484,23 @@ void dx_end_frame() {
DX_CHECK(dx.swapchain->Present(0, 0));
}
#else // DISABLE_DX12
void dx_initialize() {}
void dx_shutdown() {}
void dx_release_resources() {}
void dx_wait_device_idle() {}
Dx_Image dx_create_image(int width, int height, Dx_Image_Format format, int mip_levels, bool repeat_texture, int image_index) { return Dx_Image{}; }
void dx_upload_image_data(ID3D12Resource* texture, int width, int height, int mip_levels, const uint8_t* pixels, int bytes_per_pixel) {}
void dx_create_sampler_descriptor(const Vk_Sampler_Def& def, Dx_Sampler_Index sampler_index) {}
ID3D12PipelineState* dx_find_pipeline(const Vk_Pipeline_Def& def) { return nullptr; }
void dx_clear_attachments(bool clear_depth_stencil, bool clear_color, vec4_t color) {}
void dx_bind_geometry() {}
void dx_shade_geometry(ID3D12PipelineState* pipeline, bool multitexture, Vk_Depth_Range depth_range, bool indexed, bool lines) {}
void dx_begin_frame() {}
void dx_end_frame() {}
#endif // DISABLE_DX12