| 
									
										
										
										
											2015-05-24 06:55:12 +02:00
										 |  |  | // Copyright 2008 Dolphin Emulator Project
 | 
					
						
							| 
									
										
										
										
											2015-05-18 01:08:10 +02:00
										 |  |  | // Licensed under GPLv2+
 | 
					
						
							| 
									
										
										
										
											2013-04-17 23:29:41 -04:00
										 |  |  | // Refer to the license.txt file included.
 | 
					
						
							| 
									
										
										
										
											2010-06-09 01:37:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-10 13:54:46 -05:00
										 |  |  | #pragma once
 | 
					
						
							| 
									
										
										
										
											2010-06-09 01:37:08 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-03 23:03:26 +10:00
										 |  |  | #include <memory>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-17 05:18:15 -05:00
										 |  |  | #include "Common/CommonTypes.h"
 | 
					
						
							| 
									
										
										
										
											2015-10-09 20:50:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "VideoCommon/RenderBase.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-03 23:03:26 +10:00
										 |  |  | class SWOGLWindow; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-15 11:59:50 +10:00
										 |  |  | namespace SW | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | class SWRenderer final : public Renderer | 
					
						
							| 
									
										
										
										
											2014-02-16 23:51:41 -05:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-10-09 20:50:36 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2018-10-03 23:03:26 +10:00
										 |  |  |   SWRenderer(std::unique_ptr<SWOGLWindow> window); | 
					
						
							| 
									
										
										
										
											2014-03-29 11:05:44 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-03 23:03:13 +10:00
										 |  |  |   bool IsHeadless() const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-30 16:25:36 +10:00
										 |  |  |   std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config) override; | 
					
						
							| 
									
										
										
										
											2017-10-22 00:49:40 +10:00
										 |  |  |   std::unique_ptr<AbstractStagingTexture> | 
					
						
							|  |  |  |   CreateStagingTexture(StagingTextureType type, const TextureConfig& config) override; | 
					
						
							| 
									
										
										
										
											2018-01-21 20:22:45 +10:00
										 |  |  |   std::unique_ptr<AbstractFramebuffer> | 
					
						
							| 
									
										
										
										
											2019-02-15 11:59:50 +10:00
										 |  |  |   CreateFramebuffer(AbstractTexture* color_attachment, AbstractTexture* depth_attachment) override; | 
					
						
							| 
									
										
										
										
											2017-09-30 16:25:36 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-08 19:42:56 +10:00
										 |  |  |   std::unique_ptr<AbstractShader> CreateShaderFromSource(ShaderStage stage, const char* source, | 
					
						
							|  |  |  |                                                          size_t length) override; | 
					
						
							|  |  |  |   std::unique_ptr<AbstractShader> CreateShaderFromBinary(ShaderStage stage, const void* data, | 
					
						
							|  |  |  |                                                          size_t length) override; | 
					
						
							| 
									
										
										
										
											2019-02-15 11:59:50 +10:00
										 |  |  |   std::unique_ptr<NativeVertexFormat> | 
					
						
							|  |  |  |   CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) override; | 
					
						
							| 
									
										
										
										
											2019-04-15 21:55:26 +10:00
										 |  |  |   std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config, | 
					
						
							|  |  |  |                                                    const void* cache_data = nullptr, | 
					
						
							|  |  |  |                                                    size_t cache_data_length = 0) override; | 
					
						
							| 
									
										
										
										
											2017-09-08 19:42:56 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |   u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override; | 
					
						
							| 
									
										
										
										
											2017-07-30 15:56:12 -04:00
										 |  |  |   void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) override {} | 
					
						
							| 
									
										
										
										
											2016-06-24 10:43:46 +02:00
										 |  |  |   u16 BBoxRead(int index) override; | 
					
						
							|  |  |  |   void BBoxWrite(int index, u16 value) override; | 
					
						
							| 
									
										
										
										
											2015-10-09 20:50:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-16 00:47:46 +10:00
										 |  |  |   void RenderXFBToScreen(const AbstractTexture* texture, | 
					
						
							|  |  |  |                          const MathUtil::Rectangle<int>& rc) override; | 
					
						
							| 
									
										
										
										
											2015-10-09 20:50:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-16 00:47:46 +10:00
										 |  |  |   void ClearScreen(const MathUtil::Rectangle<int>& rc, bool colorEnable, bool alphaEnable, | 
					
						
							|  |  |  |                    bool zEnable, u32 color, u32 z) override; | 
					
						
							| 
									
										
										
										
											2015-10-09 20:50:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-15 11:59:50 +10:00
										 |  |  |   void ReinterpretPixelData(EFBReinterpretType convtype) override {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   void ScaleTexture(AbstractFramebuffer* dst_framebuffer, const MathUtil::Rectangle<int>& dst_rect, | 
					
						
							|  |  |  |                     const AbstractTexture* src_texture, | 
					
						
							|  |  |  |                     const MathUtil::Rectangle<int>& src_rect) override; | 
					
						
							| 
									
										
										
										
											2018-10-03 23:03:26 +10:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |   std::unique_ptr<SWOGLWindow> m_window; | 
					
						
							| 
									
										
										
										
											2015-10-09 20:50:36 +02:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2019-02-15 11:59:50 +10:00
										 |  |  | }  // namespace SW
 |