renderer_opengl.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include <algorithm>
  5. #include <cstddef>
  6. #include <cstdlib>
  7. #include <cstring>
  8. #include <memory>
  9. #include <glad/glad.h>
  10. #include "common/assert.h"
  11. #include "common/logging/log.h"
  12. #include "common/telemetry.h"
  13. #include "core/core.h"
  14. #include "core/core_timing.h"
  15. #include "core/frontend/emu_window.h"
  16. #include "core/frontend/scope_acquire_window_context.h"
  17. #include "core/memory.h"
  18. #include "core/perf_stats.h"
  19. #include "core/settings.h"
  20. #include "core/telemetry_session.h"
  21. #include "core/tracer/recorder.h"
  22. #include "video_core/morton.h"
  23. #include "video_core/renderer_opengl/gl_rasterizer.h"
  24. #include "video_core/renderer_opengl/renderer_opengl.h"
  25. namespace OpenGL {
  26. static const char vertex_shader[] = R"(
  27. #version 150 core
  28. in vec2 vert_position;
  29. in vec2 vert_tex_coord;
  30. out vec2 frag_tex_coord;
  31. // This is a truncated 3x3 matrix for 2D transformations:
  32. // The upper-left 2x2 submatrix performs scaling/rotation/mirroring.
  33. // The third column performs translation.
  34. // The third row could be used for projection, which we don't need in 2D. It hence is assumed to
  35. // implicitly be [0, 0, 1]
  36. uniform mat3x2 modelview_matrix;
  37. void main() {
  38. // Multiply input position by the rotscale part of the matrix and then manually translate by
  39. // the last column. This is equivalent to using a full 3x3 matrix and expanding the vector
  40. // to `vec3(vert_position.xy, 1.0)`
  41. gl_Position = vec4(mat2(modelview_matrix) * vert_position + modelview_matrix[2], 0.0, 1.0);
  42. frag_tex_coord = vert_tex_coord;
  43. }
  44. )";
  45. static const char fragment_shader[] = R"(
  46. #version 150 core
  47. in vec2 frag_tex_coord;
  48. out vec4 color;
  49. uniform sampler2D color_texture;
  50. void main() {
  51. // Swap RGBA -> ABGR so we don't have to do this on the CPU. This needs to change if we have to
  52. // support more framebuffer pixel formats.
  53. color = texture(color_texture, frag_tex_coord);
  54. }
  55. )";
  56. /**
  57. * Vertex structure that the drawn screen rectangles are composed of.
  58. */
  59. struct ScreenRectVertex {
  60. ScreenRectVertex(GLfloat x, GLfloat y, GLfloat u, GLfloat v) {
  61. position[0] = x;
  62. position[1] = y;
  63. tex_coord[0] = u;
  64. tex_coord[1] = v;
  65. }
  66. GLfloat position[2];
  67. GLfloat tex_coord[2];
  68. };
  69. /**
  70. * Defines a 1:1 pixel ortographic projection matrix with (0,0) on the top-left
  71. * corner and (width, height) on the lower-bottom.
  72. *
  73. * The projection part of the matrix is trivial, hence these operations are represented
  74. * by a 3x2 matrix.
  75. */
  76. static std::array<GLfloat, 3 * 2> MakeOrthographicMatrix(const float width, const float height) {
  77. std::array<GLfloat, 3 * 2> matrix; // Laid out in column-major order
  78. // clang-format off
  79. matrix[0] = 2.f / width; matrix[2] = 0.f; matrix[4] = -1.f;
  80. matrix[1] = 0.f; matrix[3] = -2.f / height; matrix[5] = 1.f;
  81. // Last matrix row is implicitly assumed to be [0, 0, 1].
  82. // clang-format on
  83. return matrix;
  84. }
  85. RendererOpenGL::RendererOpenGL(Core::Frontend::EmuWindow& window)
  86. : VideoCore::RendererBase{window} {}
  87. RendererOpenGL::~RendererOpenGL() = default;
  88. /// Swap buffers (render frame)
  89. void RendererOpenGL::SwapBuffers(
  90. std::optional<std::reference_wrapper<const Tegra::FramebufferConfig>> framebuffer) {
  91. Core::System::GetInstance().GetPerfStats().EndSystemFrame();
  92. // Maintain the rasterizer's state as a priority
  93. OpenGLState prev_state = OpenGLState::GetCurState();
  94. state.Apply();
  95. if (framebuffer) {
  96. // If framebuffer is provided, reload it from memory to a texture
  97. if (screen_info.texture.width != (GLsizei)framebuffer->get().width ||
  98. screen_info.texture.height != (GLsizei)framebuffer->get().height ||
  99. screen_info.texture.pixel_format != framebuffer->get().pixel_format) {
  100. // Reallocate texture if the framebuffer size has changed.
  101. // This is expected to not happen very often and hence should not be a
  102. // performance problem.
  103. ConfigureFramebufferTexture(screen_info.texture, *framebuffer);
  104. }
  105. // Load the framebuffer from memory, draw it to the screen, and swap buffers
  106. LoadFBToScreenInfo(*framebuffer);
  107. if (renderer_settings.screenshot_requested)
  108. CaptureScreenshot();
  109. DrawScreen(render_window.GetFramebufferLayout());
  110. render_window.SwapBuffers();
  111. }
  112. render_window.PollEvents();
  113. Core::System::GetInstance().FrameLimiter().DoFrameLimiting(CoreTiming::GetGlobalTimeUs());
  114. Core::System::GetInstance().GetPerfStats().BeginSystemFrame();
  115. // Restore the rasterizer state
  116. prev_state.Apply();
  117. }
  118. /**
  119. * Loads framebuffer from emulated memory into the active OpenGL texture.
  120. */
  121. void RendererOpenGL::LoadFBToScreenInfo(const Tegra::FramebufferConfig& framebuffer) {
  122. const u32 bytes_per_pixel{Tegra::FramebufferConfig::BytesPerPixel(framebuffer.pixel_format)};
  123. const u64 size_in_bytes{framebuffer.stride * framebuffer.height * bytes_per_pixel};
  124. const VAddr framebuffer_addr{framebuffer.address + framebuffer.offset};
  125. // Framebuffer orientation handling
  126. framebuffer_transform_flags = framebuffer.transform_flags;
  127. framebuffer_crop_rect = framebuffer.crop_rect;
  128. // Ensure no bad interactions with GL_UNPACK_ALIGNMENT, which by default
  129. // only allows rows to have a memory alignement of 4.
  130. ASSERT(framebuffer.stride % 4 == 0);
  131. if (!rasterizer->AccelerateDisplay(framebuffer, framebuffer_addr, framebuffer.stride)) {
  132. // Reset the screen info's display texture to its own permanent texture
  133. screen_info.display_texture = screen_info.texture.resource.handle;
  134. Memory::RasterizerFlushVirtualRegion(framebuffer_addr, size_in_bytes,
  135. Memory::FlushMode::Flush);
  136. VideoCore::MortonCopyPixels128(framebuffer.width, framebuffer.height, bytes_per_pixel, 4,
  137. Memory::GetPointer(framebuffer_addr),
  138. gl_framebuffer_data.data(), true);
  139. state.texture_units[0].texture = screen_info.texture.resource.handle;
  140. state.Apply();
  141. glActiveTexture(GL_TEXTURE0);
  142. glPixelStorei(GL_UNPACK_ROW_LENGTH, static_cast<GLint>(framebuffer.stride));
  143. // Update existing texture
  144. // TODO: Test what happens on hardware when you change the framebuffer dimensions so that
  145. // they differ from the LCD resolution.
  146. // TODO: Applications could theoretically crash yuzu here by specifying too large
  147. // framebuffer sizes. We should make sure that this cannot happen.
  148. glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, framebuffer.width, framebuffer.height,
  149. screen_info.texture.gl_format, screen_info.texture.gl_type,
  150. gl_framebuffer_data.data());
  151. glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
  152. state.texture_units[0].texture = 0;
  153. state.Apply();
  154. }
  155. }
  156. /**
  157. * Fills active OpenGL texture with the given RGB color. Since the color is solid, the texture can
  158. * be 1x1 but will stretch across whatever it's rendered on.
  159. */
  160. void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, u8 color_a,
  161. const TextureInfo& texture) {
  162. state.texture_units[0].texture = texture.resource.handle;
  163. state.Apply();
  164. glActiveTexture(GL_TEXTURE0);
  165. u8 framebuffer_data[4] = {color_a, color_b, color_g, color_r};
  166. // Update existing texture
  167. glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, framebuffer_data);
  168. state.texture_units[0].texture = 0;
  169. state.Apply();
  170. }
  171. /**
  172. * Initializes the OpenGL state and creates persistent objects.
  173. */
  174. void RendererOpenGL::InitOpenGLObjects() {
  175. glClearColor(Settings::values.bg_red, Settings::values.bg_green, Settings::values.bg_blue,
  176. 0.0f);
  177. // Link shaders and get variable locations
  178. shader.CreateFromSource(vertex_shader, nullptr, fragment_shader);
  179. state.draw.shader_program = shader.handle;
  180. state.Apply();
  181. uniform_modelview_matrix = glGetUniformLocation(shader.handle, "modelview_matrix");
  182. uniform_color_texture = glGetUniformLocation(shader.handle, "color_texture");
  183. attrib_position = glGetAttribLocation(shader.handle, "vert_position");
  184. attrib_tex_coord = glGetAttribLocation(shader.handle, "vert_tex_coord");
  185. // Generate VBO handle for drawing
  186. vertex_buffer.Create();
  187. // Generate VAO
  188. vertex_array.Create();
  189. state.draw.vertex_array = vertex_array.handle;
  190. // Attach vertex data to VAO
  191. glNamedBufferData(vertex_buffer.handle, sizeof(ScreenRectVertex) * 4, nullptr, GL_STREAM_DRAW);
  192. glVertexArrayAttribFormat(vertex_array.handle, attrib_position, 2, GL_FLOAT, GL_FALSE,
  193. offsetof(ScreenRectVertex, position));
  194. glVertexArrayAttribFormat(vertex_array.handle, attrib_tex_coord, 2, GL_FLOAT, GL_FALSE,
  195. offsetof(ScreenRectVertex, tex_coord));
  196. glVertexArrayAttribBinding(vertex_array.handle, attrib_position, 0);
  197. glVertexArrayAttribBinding(vertex_array.handle, attrib_tex_coord, 0);
  198. glEnableVertexArrayAttrib(vertex_array.handle, attrib_position);
  199. glEnableVertexArrayAttrib(vertex_array.handle, attrib_tex_coord);
  200. glVertexArrayVertexBuffer(vertex_array.handle, 0, vertex_buffer.handle, 0,
  201. sizeof(ScreenRectVertex));
  202. // Allocate textures for the screen
  203. screen_info.texture.resource.Create();
  204. // Allocation of storage is deferred until the first frame, when we
  205. // know the framebuffer size.
  206. state.texture_units[0].texture = screen_info.texture.resource.handle;
  207. state.Apply();
  208. glActiveTexture(GL_TEXTURE0);
  209. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
  210. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
  211. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
  212. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
  213. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
  214. screen_info.display_texture = screen_info.texture.resource.handle;
  215. state.texture_units[0].texture = 0;
  216. state.Apply();
  217. // Clear screen to black
  218. LoadColorToActiveGLTexture(0, 0, 0, 0, screen_info.texture);
  219. }
  220. void RendererOpenGL::CreateRasterizer() {
  221. if (rasterizer) {
  222. return;
  223. }
  224. // Initialize sRGB Usage
  225. OpenGLState::ClearsRGBUsed();
  226. rasterizer = std::make_unique<RasterizerOpenGL>(render_window, screen_info);
  227. }
  228. void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture,
  229. const Tegra::FramebufferConfig& framebuffer) {
  230. texture.width = framebuffer.width;
  231. texture.height = framebuffer.height;
  232. GLint internal_format;
  233. switch (framebuffer.pixel_format) {
  234. case Tegra::FramebufferConfig::PixelFormat::ABGR8:
  235. internal_format = GL_RGBA;
  236. texture.gl_format = GL_RGBA;
  237. texture.gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
  238. gl_framebuffer_data.resize(texture.width * texture.height * 4);
  239. break;
  240. default:
  241. internal_format = GL_RGBA;
  242. texture.gl_format = GL_RGBA;
  243. texture.gl_type = GL_UNSIGNED_INT_8_8_8_8_REV;
  244. gl_framebuffer_data.resize(texture.width * texture.height * 4);
  245. LOG_CRITICAL(Render_OpenGL, "Unknown framebuffer pixel format: {}",
  246. static_cast<u32>(framebuffer.pixel_format));
  247. UNREACHABLE();
  248. }
  249. state.texture_units[0].texture = texture.resource.handle;
  250. state.Apply();
  251. glActiveTexture(GL_TEXTURE0);
  252. glTexImage2D(GL_TEXTURE_2D, 0, internal_format, texture.width, texture.height, 0,
  253. texture.gl_format, texture.gl_type, nullptr);
  254. state.texture_units[0].texture = 0;
  255. state.Apply();
  256. }
  257. void RendererOpenGL::DrawScreenTriangles(const ScreenInfo& screen_info, float x, float y, float w,
  258. float h) {
  259. const auto& texcoords = screen_info.display_texcoords;
  260. auto left = texcoords.left;
  261. auto right = texcoords.right;
  262. if (framebuffer_transform_flags != Tegra::FramebufferConfig::TransformFlags::Unset) {
  263. if (framebuffer_transform_flags == Tegra::FramebufferConfig::TransformFlags::FlipV) {
  264. // Flip the framebuffer vertically
  265. left = texcoords.right;
  266. right = texcoords.left;
  267. } else {
  268. // Other transformations are unsupported
  269. LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}",
  270. static_cast<u32>(framebuffer_transform_flags));
  271. UNIMPLEMENTED();
  272. }
  273. }
  274. ASSERT_MSG(framebuffer_crop_rect.top == 0, "Unimplemented");
  275. ASSERT_MSG(framebuffer_crop_rect.left == 0, "Unimplemented");
  276. // Scale the output by the crop width/height. This is commonly used with 1280x720 rendering
  277. // (e.g. handheld mode) on a 1920x1080 framebuffer.
  278. f32 scale_u = 1.f, scale_v = 1.f;
  279. if (framebuffer_crop_rect.GetWidth() > 0) {
  280. scale_u = static_cast<f32>(framebuffer_crop_rect.GetWidth()) / screen_info.texture.width;
  281. }
  282. if (framebuffer_crop_rect.GetHeight() > 0) {
  283. scale_v = static_cast<f32>(framebuffer_crop_rect.GetHeight()) / screen_info.texture.height;
  284. }
  285. std::array<ScreenRectVertex, 4> vertices = {{
  286. ScreenRectVertex(x, y, texcoords.top * scale_u, left * scale_v),
  287. ScreenRectVertex(x + w, y, texcoords.bottom * scale_u, left * scale_v),
  288. ScreenRectVertex(x, y + h, texcoords.top * scale_u, right * scale_v),
  289. ScreenRectVertex(x + w, y + h, texcoords.bottom * scale_u, right * scale_v),
  290. }};
  291. state.texture_units[0].texture = screen_info.display_texture;
  292. state.texture_units[0].swizzle = {GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA};
  293. // Workaround brigthness problems in SMO by enabling sRGB in the final output
  294. // if it has been used in the frame. Needed because of this bug in QT: QTBUG-50987
  295. state.framebuffer_srgb.enabled = OpenGLState::GetsRGBUsed();
  296. state.Apply();
  297. glNamedBufferSubData(vertex_buffer.handle, 0, sizeof(vertices), vertices.data());
  298. glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  299. // Restore default state
  300. state.framebuffer_srgb.enabled = false;
  301. state.texture_units[0].texture = 0;
  302. state.Apply();
  303. // Clear sRGB state for the next frame
  304. OpenGLState::ClearsRGBUsed();
  305. }
  306. /**
  307. * Draws the emulated screens to the emulator window.
  308. */
  309. void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
  310. if (renderer_settings.set_background_color) {
  311. // Update background color before drawing
  312. glClearColor(Settings::values.bg_red, Settings::values.bg_green, Settings::values.bg_blue,
  313. 0.0f);
  314. }
  315. const auto& screen = layout.screen;
  316. glViewport(0, 0, layout.width, layout.height);
  317. glClear(GL_COLOR_BUFFER_BIT);
  318. // Set projection matrix
  319. std::array<GLfloat, 3 * 2> ortho_matrix =
  320. MakeOrthographicMatrix((float)layout.width, (float)layout.height);
  321. glUniformMatrix3x2fv(uniform_modelview_matrix, 1, GL_FALSE, ortho_matrix.data());
  322. // Bind texture in Texture Unit 0
  323. glActiveTexture(GL_TEXTURE0);
  324. glUniform1i(uniform_color_texture, 0);
  325. DrawScreenTriangles(screen_info, (float)screen.left, (float)screen.top,
  326. (float)screen.GetWidth(), (float)screen.GetHeight());
  327. m_current_frame++;
  328. }
  329. /// Updates the framerate
  330. void RendererOpenGL::UpdateFramerate() {}
  331. void RendererOpenGL::CaptureScreenshot() {
  332. // Draw the current frame to the screenshot framebuffer
  333. screenshot_framebuffer.Create();
  334. GLuint old_read_fb = state.draw.read_framebuffer;
  335. GLuint old_draw_fb = state.draw.draw_framebuffer;
  336. state.draw.read_framebuffer = state.draw.draw_framebuffer = screenshot_framebuffer.handle;
  337. state.Apply();
  338. Layout::FramebufferLayout layout{renderer_settings.screenshot_framebuffer_layout};
  339. GLuint renderbuffer;
  340. glGenRenderbuffers(1, &renderbuffer);
  341. glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
  342. glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB8, layout.width, layout.height);
  343. glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderbuffer);
  344. DrawScreen(layout);
  345. glReadPixels(0, 0, layout.width, layout.height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
  346. renderer_settings.screenshot_bits);
  347. screenshot_framebuffer.Release();
  348. state.draw.read_framebuffer = old_read_fb;
  349. state.draw.draw_framebuffer = old_draw_fb;
  350. state.Apply();
  351. glDeleteRenderbuffers(1, &renderbuffer);
  352. renderer_settings.screenshot_complete_callback();
  353. renderer_settings.screenshot_requested = false;
  354. }
  355. static const char* GetSource(GLenum source) {
  356. #define RET(s) \
  357. case GL_DEBUG_SOURCE_##s: \
  358. return #s
  359. switch (source) {
  360. RET(API);
  361. RET(WINDOW_SYSTEM);
  362. RET(SHADER_COMPILER);
  363. RET(THIRD_PARTY);
  364. RET(APPLICATION);
  365. RET(OTHER);
  366. default:
  367. UNREACHABLE();
  368. return "Unknown source";
  369. }
  370. #undef RET
  371. }
  372. static const char* GetType(GLenum type) {
  373. #define RET(t) \
  374. case GL_DEBUG_TYPE_##t: \
  375. return #t
  376. switch (type) {
  377. RET(ERROR);
  378. RET(DEPRECATED_BEHAVIOR);
  379. RET(UNDEFINED_BEHAVIOR);
  380. RET(PORTABILITY);
  381. RET(PERFORMANCE);
  382. RET(OTHER);
  383. RET(MARKER);
  384. default:
  385. UNREACHABLE();
  386. return "Unknown type";
  387. }
  388. #undef RET
  389. }
  390. static void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum severity,
  391. GLsizei length, const GLchar* message, const void* user_param) {
  392. const char format[] = "{} {} {}: {}";
  393. const char* const str_source = GetSource(source);
  394. const char* const str_type = GetType(type);
  395. switch (severity) {
  396. case GL_DEBUG_SEVERITY_HIGH:
  397. LOG_CRITICAL(Render_OpenGL, format, str_source, str_type, id, message);
  398. break;
  399. case GL_DEBUG_SEVERITY_MEDIUM:
  400. LOG_WARNING(Render_OpenGL, format, str_source, str_type, id, message);
  401. break;
  402. case GL_DEBUG_SEVERITY_NOTIFICATION:
  403. case GL_DEBUG_SEVERITY_LOW:
  404. LOG_DEBUG(Render_OpenGL, format, str_source, str_type, id, message);
  405. break;
  406. }
  407. }
  408. /// Initialize the renderer
  409. bool RendererOpenGL::Init() {
  410. Core::Frontend::ScopeAcquireWindowContext acquire_context{render_window};
  411. if (GLAD_GL_KHR_debug) {
  412. glEnable(GL_DEBUG_OUTPUT);
  413. glDebugMessageCallback(DebugHandler, nullptr);
  414. }
  415. const char* gl_version{reinterpret_cast<char const*>(glGetString(GL_VERSION))};
  416. const char* gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
  417. const char* gpu_model{reinterpret_cast<char const*>(glGetString(GL_RENDERER))};
  418. LOG_INFO(Render_OpenGL, "GL_VERSION: {}", gl_version);
  419. LOG_INFO(Render_OpenGL, "GL_VENDOR: {}", gpu_vendor);
  420. LOG_INFO(Render_OpenGL, "GL_RENDERER: {}", gpu_model);
  421. Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Vendor", gpu_vendor);
  422. Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_Model", gpu_model);
  423. Core::Telemetry().AddField(Telemetry::FieldType::UserSystem, "GPU_OpenGL_Version", gl_version);
  424. if (!GLAD_GL_VERSION_4_3) {
  425. return false;
  426. }
  427. InitOpenGLObjects();
  428. CreateRasterizer();
  429. return true;
  430. }
  431. /// Shutdown the renderer
  432. void RendererOpenGL::ShutDown() {}
  433. } // namespace OpenGL