void _start(uintptr_t info[]) { Elf_auxv_t* auxv = nacl_startup_auxv(info); grok_auxv(auxv); DO_QUERY(NACL_IRT_BASIC_v0_1, __libnacl_irt_basic); struct nacl_irt_ppapihook ppapihook; DO_QUERY(NACL_IRT_PPAPIHOOK_v0_1, ppapihook); /* This is local as a workaround to avoid having to apply * relocations to global variables. */ struct PP_StartFunctions start_funcs = { MyPPP_InitializeModule, MyPPP_ShutdownModule, MyPPP_GetInterface, }; /* Similarly, initialise some global variables, avoiding relocations. */ struct PPP_Instance_1_0 local_ppp_instance = { DidCreate, DidDestroy, DidChangeView, DidChangeFocus, HandleDocumentLoad, }; ppp_instance = local_ppp_instance; struct PPP_Messaging_1_0 local_ppp_messaging = { HandleMessage, }; ppp_messaging = local_ppp_messaging; ppapihook.ppapi_start(&start_funcs); __libnacl_irt_basic.exit(0); }
void _start(uintptr_t info[]) { Elf_auxv_t* auxv = nacl_startup_auxv(info); grok_auxv(auxv); DO_QUERY(NACL_IRT_BASIC_v0_1, __libnacl_irt_basic); DO_QUERY(NACL_IRT_RANDOM_v0_1, __libnacl_irt_random); struct nacl_irt_ppapihook ppapihook; DO_QUERY(NACL_IRT_PPAPIHOOK_v0_1, ppapihook); /* This is local as a workaround to avoid having to apply * relocations to global variables. */ struct PP_StartFunctions start_funcs; start_funcs.PPP_InitializeModule = MyPPP_InitializeModule; start_funcs.PPP_ShutdownModule = MyPPP_ShutdownModule; start_funcs.PPP_GetInterface = MyPPP_GetInterface; /* Similarly, initialize some global variables, avoiding relocations. */ ppp_instance.DidCreate = DidCreate; ppp_instance.DidDestroy = DidDestroy; ppp_instance.DidChangeView = DidChangeView; ppp_instance.DidChangeFocus = DidChangeFocus; ppp_instance.HandleDocumentLoad = HandleDocumentLoad; ppp_messaging.HandleMessage = HandleMessage; ppapihook.ppapi_start(&start_funcs); __libnacl_irt_basic.exit(0); }
/* * Initialize all our IRT function tables using the query function. * The query function's address is passed via AT_SYSINFO in auxv. */ void __libnacl_irt_init(Elf32_auxv_t *auxv) { grok_auxv(auxv); DO_QUERY(NACL_IRT_BASIC_v0_1, ih, basic); DO_QUERY(NACL_IRT_FDIO_v0_1, ih, fdio); // DO_QUERY(NACL_IRT_FILENAME_v0_1, filename); // DO_QUERY(NACL_IRT_MEMORY_v0_1, ih, memory); // DO_QUERY(NACL_IRT_DYNCODE_v0_1, dyncode); // DO_QUERY(NACL_IRT_TLS_v0_1, tls); // DO_QUERY(NACL_IRT_BLOCKHOOK_v0_1, blockhook); }
bool vogl_framebuffer_attachment::snapshot(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLenum attachment, GLenum type) { VOGL_FUNC_TRACER VOGL_NOTE_UNUSED(remapper); VOGL_NOTE_UNUSED(context_info); clear(); m_attachment = attachment; m_type = type; #define DO_QUERY(e) \ do \ { \ int val = 0; \ GL_ENTRYPOINT(glGetFramebufferAttachmentParameteriv)(GL_FRAMEBUFFER, attachment, e, &val); \ VOGL_CHECK_GL_ERROR; \ m_params.insert(e, val); \ } while (0) // TODO: Is this query really valid on default framebuffer FBO's? DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME); static const GLenum s_common_queries[] = { GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING }; for (uint32_t i = 0; i < VOGL_ARRAY_SIZE(s_common_queries); i++) { DO_QUERY(s_common_queries[i]); } if (m_type == GL_TEXTURE) { DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL); DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE); DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER); // only need to query LAYERED if GS supported if (context_info.supports_extension("GL_ARB_geometry_shader4")) DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_LAYERED); } #undef DO_QUERY return true; }