Ejemplo n.º 1
0
// This is called after Initialize() from the Core
// Run from the graphics thread
void VideoBackend::Video_Prepare()
{
	GLInterface->MakeCurrent();

	g_renderer = std::make_unique<Renderer>();

	CommandProcessor::Init();
	PixelEngine::Init();

	BPInit();
	g_vertex_manager = std::make_unique<VertexManager>();
	g_perf_query = GetPerfQuery();
	Fifo_Init(); // must be done before OpcodeDecoder_Init()
	OpcodeDecoder_Init();
	IndexGenerator::Init();
	VertexShaderManager::Init();
	PixelShaderManager::Init();
	GeometryShaderManager::Init();
	ProgramShaderCache::Init();
	g_texture_cache = std::make_unique<TextureCache>();
	g_sampler_cache = std::make_unique<SamplerCache>();
	Renderer::Init();
	VertexLoaderManager::Init();
	TextureConverter::Init();
	BoundingBox::Init();

	// Notify the core that the video backend is ready
	Host_Message(WM_USER_CREATE);
}
Ejemplo n.º 2
0
bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
{
  InitializeShared();

  std::unique_ptr<GLContext> main_gl_context =
      GLContext::Create(wsi, g_ActiveConfig.stereo_mode == StereoMode::QuadBuffer, true, false,
                        Config::Get(Config::GFX_PREFER_GLES));
  if (!main_gl_context)
    return false;

  if (!InitializeGLExtensions(main_gl_context.get()) || !FillBackendInfo())
    return false;

  g_renderer = std::make_unique<Renderer>(std::move(main_gl_context), wsi.render_surface_scale);
  ProgramShaderCache::Init();
  g_vertex_manager = std::make_unique<VertexManager>();
  g_shader_cache = std::make_unique<VideoCommon::ShaderCache>();
  g_framebuffer_manager = std::make_unique<FramebufferManager>();
  g_perf_query = GetPerfQuery();
  g_texture_cache = std::make_unique<TextureCacheBase>();
  g_sampler_cache = std::make_unique<SamplerCache>();
  BoundingBox::Init();

  if (!g_vertex_manager->Initialize() || !g_shader_cache->Initialize() ||
      !g_renderer->Initialize() || !g_framebuffer_manager->Initialize() ||
      !g_texture_cache->Initialize())
  {
    PanicAlert("Failed to initialize renderer classes");
    Shutdown();
    return false;
  }

  g_shader_cache->InitializeShaderCache();
  return true;
}
Ejemplo n.º 3
0
// This is called after Initialize() from the Core
// Run from the graphics thread
void VideoBackend::Video_Prepare()
{
  GLInterface->MakeCurrent();

  g_renderer = std::make_unique<Renderer>();

  g_vertex_manager = std::make_unique<VertexManager>();
  g_perf_query = GetPerfQuery();
  ProgramShaderCache::Init();
  g_texture_cache = std::make_unique<TextureCache>();
  g_sampler_cache = std::make_unique<SamplerCache>();
  Renderer::Init();
  TextureConverter::Init();
  BoundingBox::Init();
}