16 bool initialize(GraphicsWrapperCreateInfo ci);
25 ID3D12Fence* fence_[num_buffers];
27 UINT64 fence_value_[num_buffers];
30 ID3D12CommandQueue* direct_command_queue_;
31 ID3D12CommandQueue* compute_command_queue_;
32 ID3D12CommandQueue* copy_command_queue_;
34 ComPtr<IDXGIAdapter4> dxgi_adapter_;
35 ComPtr<ID3D12Device2> device_;
36 ComPtr<IDXGISwapChain4> swap_chain_;
37 ComPtr<ID3D12CommandQueue> command_queue_;
38 ID3D12CommandAllocator* graphics_command_allocator_;
39 uint32_t current_backbuffer_index_;
41 std::vector<RenderTarget *> swap_chain_targets_;
42 ComPtr<ID3D12DescriptorHeap> rt_descriptor_heap_;
44 void setupDebugMessenger();
45 void createCommandQueues();
46 void pickPhysicalDevice();
47 void createLogicalDevice();
48 void createSwapChain();
49 void createCommandPool();
50 void createDescriptorPool();
51 void createSyncObjects();
55 virtual const char* getVendorName()
override;
56 virtual const char* getAdapterName()
override;
57 virtual const char* getAPIName()
override;
58 virtual const char* getAPIVersion()
override;
60 virtual void adjustPerspective(
float* perspective)
override;
62 void registerWindow(
Window* window);
64 virtual void deleteRenderTarget(
RenderTarget* ptr)
override;
66 virtual void deleteFramebuffer(
Framebuffer* ptr)
override;
67 virtual void deleteVertexBuffer(
VertexBuffer* ptr)
override;
68 virtual void deleteIndexBuffer(
IndexBuffer* ptr)
override;
69 virtual void deleteUniformBuffer(
UniformBuffer* ptr)
override;
70 virtual void deleteUniformBufferBinding(UniformBufferBinding* ptr)
override;
72 virtual void deleteRenderPass(
RenderPass* ptr)
override;
73 virtual void deleteTexture(
Texture* ptr)
override;
74 virtual void deleteTextureBinding(TextureBinding* ptr)
override;
75 virtual void deleteTextureBindingLayout(TextureBindingLayout* ptr)
override;
76 virtual void deleteCommandBuffer(
CommandBuffer* ptr)
override;
79 virtual Framebuffer* createFramebuffer(FramebufferCreateInfo ci)
override;
80 virtual RenderPass* createRenderPass(RenderPassCreateInfo ci)
override;
81 virtual GraphicsPipeline* createGraphicsPipeline(GraphicsPipelineCreateInfo ci)
override;
82 virtual CommandBuffer* createCommandBuffer(CommandBufferCreateInfo ci)
override;
83 virtual VertexArrayObject* createVertexArrayObject(VertexArrayObjectCreateInfo ci)
override;
84 virtual VertexBuffer* createVertexBuffer(VertexBufferCreateInfo ci)
override;
85 virtual IndexBuffer* createIndexBuffer(IndexBufferCreateInfo ci)
override;
86 virtual UniformBuffer* createUniformBuffer(UniformBufferCreateInfo ci)
override;
87 virtual UniformBufferBinding* createUniformBufferBinding(UniformBufferBindingCreateInfo ci)
override;
88 virtual Texture* createCubemap(CubemapCreateInfo createInfo)
override;
89 virtual Texture* createTexture(TextureCreateInfo createInfo)
override;
90 virtual TextureBinding* createTextureBinding(TextureBindingCreateInfo ci)
override;
91 virtual TextureBindingLayout* createTextureBindingLayout(TextureBindingLayoutCreateInfo createInfo)
override;
92 virtual RenderTarget* createRenderTarget(RenderTargetCreateInfo* rt, uint32_t rc,
bool cube =
false)
override;
93 virtual DepthStencilTarget* createDepthStencilTarget(DepthStencilTargetCreateInfo rt)
override;
95 virtual inline const bool shouldUseImmediateMode()
override;
96 virtual inline const bool supportsCommandBuffers()
override;
97 virtual inline const bool supportsTesselation()
override;
98 virtual inline const bool supportsGeometryShader()
override;
99 virtual inline const bool supportsComputeShader()
override;
100 virtual inline const bool supportsMultiDrawIndirect()
override;
102 virtual void waitUntilIdle()
override;
105 virtual void clear(ClearMode mask,
float clear_color[4],
float clear_depth, uint32_t clear_stencil)
override;
106 virtual void bindTextureBinding(TextureBinding*)
override;
108 virtual void drawImmediateIndexed(GeometryType geom_type,
bool largeBuffer, int32_t baseVertex, uint32_t indexOffsetPtr, uint32_t indexCount)
override;
109 virtual void drawImmediateVertices(GeometryType geom_type, uint32_t base, uint32_t count)
override;
110 virtual void setImmediateBlending(BlendMode)
override;
111 virtual void enableDepth(
bool state)
override;
112 virtual void setColorMask(ColorMask mask)
override;
114 virtual void bindDefaultFramebuffer(
bool depth)
override;
116 std::string vendor_name_;
117 std::string adapter_name_;
118 std::string api_version_;
Definition Texture.hpp:40