void st_init_driver_functions(struct dd_function_table *functions) { _mesa_init_shader_object_functions(functions); _mesa_init_sampler_object_functions(functions); functions->Accum = _mesa_accum; st_init_blit_functions(functions); st_init_bufferobject_functions(functions); st_init_clear_functions(functions); st_init_bitmap_functions(functions); st_init_drawpixels_functions(functions); st_init_rasterpos_functions(functions); st_init_drawtex_functions(functions); st_init_eglimage_functions(functions); st_init_fbo_functions(functions); st_init_feedback_functions(functions); st_init_program_functions(functions); st_init_query_functions(functions); st_init_cond_render_functions(functions); st_init_readpixels_functions(functions); st_init_texture_functions(functions); st_init_texture_barrier_functions(functions); st_init_flush_functions(functions); st_init_string_functions(functions); st_init_viewport_functions(functions); st_init_xformfb_functions(functions); st_init_syncobj_functions(functions); functions->UpdateState = st_invalidate_state; }
void st_init_driver_functions(struct pipe_screen *screen, struct dd_function_table *functions) { _mesa_init_shader_object_functions(functions); _mesa_init_sampler_object_functions(functions); st_init_blit_functions(functions); st_init_bufferobject_functions(screen, functions); st_init_clear_functions(functions); st_init_bitmap_functions(functions); st_init_copy_image_functions(functions); st_init_drawpixels_functions(functions); st_init_rasterpos_functions(functions); st_init_drawtex_functions(functions); st_init_eglimage_functions(functions); st_init_fbo_functions(functions); st_init_feedback_functions(functions); st_init_msaa_functions(functions); st_init_perfmon_functions(functions); st_init_program_functions(functions); st_init_query_functions(functions); st_init_cond_render_functions(functions); st_init_readpixels_functions(functions); st_init_texture_functions(functions); st_init_texture_barrier_functions(functions); st_init_flush_functions(screen, functions); st_init_string_functions(functions); st_init_viewport_functions(functions); st_init_compute_functions(functions); st_init_xformfb_functions(functions); st_init_syncobj_functions(functions); st_init_vdpau_functions(functions); if (screen->get_param(screen, PIPE_CAP_STRING_MARKER)) functions->EmitStringMarker = st_emit_string_marker; functions->Enable = st_Enable; functions->UpdateState = st_invalidate_state; functions->QueryMemoryInfo = st_query_memory_info; }
/** * Plug in default functions for all pointers in the dd_function_table * structure. * Device drivers should call this function and then plug in any * functions which it wants to override. * Some functions (pointers) MUST be implemented by all drivers (REQUIRED). * * \param table the dd_function_table to initialize */ void _mesa_init_driver_functions(struct dd_function_table *driver) { memset(driver, 0, sizeof(*driver)); driver->GetString = NULL; /* REQUIRED! */ driver->UpdateState = NULL; /* REQUIRED! */ driver->Finish = NULL; driver->Flush = NULL; /* framebuffer/image functions */ driver->Clear = _swrast_Clear; driver->RasterPos = _mesa_RasterPos; driver->DrawPixels = _swrast_DrawPixels; driver->ReadPixels = _mesa_readpixels; driver->CopyPixels = _swrast_CopyPixels; driver->Bitmap = _swrast_Bitmap; /* Texture functions */ driver->ChooseTextureFormat = _mesa_choose_tex_format; driver->QuerySamplesForFormat = _mesa_query_samples_for_format; driver->TexImage = _mesa_store_teximage; driver->TexSubImage = _mesa_store_texsubimage; driver->GetTexSubImage = _mesa_meta_GetTexSubImage; driver->ClearTexSubImage = _mesa_meta_ClearTexSubImage; driver->CopyTexSubImage = _mesa_meta_CopyTexSubImage; driver->GenerateMipmap = _mesa_meta_GenerateMipmap; driver->TestProxyTexImage = _mesa_test_proxy_teximage; driver->CompressedTexImage = _mesa_store_compressed_teximage; driver->CompressedTexSubImage = _mesa_store_compressed_texsubimage; driver->GetCompressedTexSubImage = _mesa_GetCompressedTexSubImage_sw; driver->BindTexture = NULL; driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; driver->NewTextureImage = _swrast_new_texture_image; driver->DeleteTextureImage = _swrast_delete_texture_image; driver->AllocTextureImageBuffer = _swrast_alloc_texture_image_buffer; driver->FreeTextureImageBuffer = _swrast_free_texture_image_buffer; driver->MapTextureImage = _swrast_map_teximage; driver->UnmapTextureImage = _swrast_unmap_teximage; driver->DrawTex = _mesa_meta_DrawTex; /* Vertex/fragment programs */ driver->BindProgram = NULL; driver->NewProgram = _mesa_new_program; driver->DeleteProgram = _mesa_delete_program; /* simple state commands */ driver->AlphaFunc = NULL; driver->BlendColor = NULL; driver->BlendEquationSeparate = NULL; driver->BlendFuncSeparate = NULL; driver->ClipPlane = NULL; driver->ColorMask = NULL; driver->ColorMaterial = NULL; driver->CullFace = NULL; driver->DrawBuffer = NULL; driver->DrawBuffers = NULL; driver->FrontFace = NULL; driver->DepthFunc = NULL; driver->DepthMask = NULL; driver->DepthRange = NULL; driver->Enable = NULL; driver->Fogfv = NULL; driver->Lightfv = NULL; driver->LightModelfv = NULL; driver->LineStipple = NULL; driver->LineWidth = NULL; driver->LogicOpcode = NULL; driver->PointParameterfv = NULL; driver->PointSize = NULL; driver->PolygonMode = NULL; driver->PolygonOffset = NULL; driver->PolygonStipple = NULL; driver->ReadBuffer = NULL; driver->RenderMode = NULL; driver->Scissor = NULL; driver->ShadeModel = NULL; driver->StencilFuncSeparate = NULL; driver->StencilOpSeparate = NULL; driver->StencilMaskSeparate = NULL; driver->TexGen = NULL; driver->TexEnv = NULL; driver->TexParameter = NULL; driver->Viewport = NULL; /* buffer objects */ _mesa_init_buffer_object_functions(driver); /* query objects */ _mesa_init_query_object_functions(driver); _mesa_init_sync_object_functions(driver); driver->NewFramebuffer = _mesa_new_framebuffer; driver->NewRenderbuffer = _swrast_new_soft_renderbuffer; driver->MapRenderbuffer = _swrast_map_soft_renderbuffer; driver->UnmapRenderbuffer = _swrast_unmap_soft_renderbuffer; driver->RenderTexture = _swrast_render_texture; driver->FinishRenderTexture = _swrast_finish_render_texture; driver->FramebufferRenderbuffer = _mesa_FramebufferRenderbuffer_sw; driver->ValidateFramebuffer = _mesa_validate_framebuffer; driver->BlitFramebuffer = _swrast_BlitFramebuffer; driver->DiscardFramebuffer = NULL; _mesa_init_texture_barrier_functions(driver); _mesa_init_shader_object_functions(driver); _mesa_init_transform_feedback_functions(driver); _mesa_init_sampler_object_functions(driver); /* T&L stuff */ driver->CurrentExecPrimitive = 0; driver->CurrentSavePrimitive = 0; driver->NeedFlush = 0; driver->SaveNeedFlush = 0; driver->ProgramStringNotify = _tnl_program_string; driver->LightingSpaceChange = NULL; /* GL_ARB_texture_storage */ driver->AllocTextureStorage = _mesa_AllocTextureStorage_sw; /* GL_ARB_texture_view */ driver->TextureView = NULL; /* GL_ARB_texture_multisample */ driver->GetSamplePosition = NULL; }
/** * Plug in default functions for all pointers in the dd_function_table * structure. * Device drivers should call this function and then plug in any * functions which it wants to override. * Some functions (pointers) MUST be implemented by all drivers (REQUIRED). * * \param table the dd_function_table to initialize */ void _mesa_init_driver_functions(struct dd_function_table *driver) { memset(driver, 0, sizeof(*driver)); driver->GetString = NULL; /* REQUIRED! */ driver->UpdateState = NULL; /* REQUIRED! */ driver->GetBufferSize = NULL; /* REQUIRED! */ driver->ResizeBuffers = _mesa_resize_framebuffer; driver->Error = NULL; driver->Finish = NULL; driver->Flush = NULL; /* framebuffer/image functions */ driver->Clear = _swrast_Clear; driver->Accum = _swrast_Accum; driver->RasterPos = _tnl_RasterPos; driver->DrawPixels = _swrast_DrawPixels; driver->ReadPixels = _swrast_ReadPixels; driver->CopyPixels = _swrast_CopyPixels; driver->Bitmap = _swrast_Bitmap; /* Texture functions */ driver->ChooseTextureFormat = _mesa_choose_tex_format; driver->TexImage1D = _mesa_store_teximage1d; driver->TexImage2D = _mesa_store_teximage2d; driver->TexImage3D = _mesa_store_teximage3d; driver->TexSubImage1D = _mesa_store_texsubimage1d; driver->TexSubImage2D = _mesa_store_texsubimage2d; driver->TexSubImage3D = _mesa_store_texsubimage3d; driver->GetTexImage = _mesa_get_teximage; driver->CopyTexImage1D = _mesa_meta_CopyTexImage1D; driver->CopyTexImage2D = _mesa_meta_CopyTexImage2D; driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D; driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D; driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D; driver->GenerateMipmap = _mesa_meta_GenerateMipmap; driver->TestProxyTexImage = _mesa_test_proxy_teximage; driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d; driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d; driver->CompressedTexImage3D = _mesa_store_compressed_teximage3d; driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; driver->GetCompressedTexImage = _mesa_get_compressed_teximage; driver->BindTexture = NULL; driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; driver->NewTextureImage = _mesa_new_texture_image; driver->FreeTexImageData = _mesa_free_texture_image_data; driver->MapTexture = NULL; driver->UnmapTexture = NULL; driver->TextureMemCpy = memcpy; driver->IsTextureResident = NULL; driver->UpdateTexturePalette = NULL; /* imaging */ driver->CopyColorTable = _mesa_meta_CopyColorTable; driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable; /* Vertex/fragment programs */ driver->BindProgram = NULL; driver->NewProgram = _mesa_new_program; driver->DeleteProgram = _mesa_delete_program; /* simple state commands */ driver->AlphaFunc = NULL; driver->BlendColor = NULL; driver->BlendEquationSeparate = NULL; driver->BlendFuncSeparate = NULL; driver->ClearColor = NULL; driver->ClearDepth = NULL; driver->ClearStencil = NULL; driver->ClipPlane = NULL; driver->ColorMask = NULL; driver->ColorMaterial = NULL; driver->CullFace = NULL; driver->DrawBuffer = NULL; driver->DrawBuffers = NULL; driver->FrontFace = NULL; driver->DepthFunc = NULL; driver->DepthMask = NULL; driver->DepthRange = NULL; driver->Enable = NULL; driver->Fogfv = NULL; driver->Hint = NULL; driver->Lightfv = NULL; driver->LightModelfv = NULL; driver->LineStipple = NULL; driver->LineWidth = NULL; driver->LogicOpcode = NULL; driver->PointParameterfv = NULL; driver->PointSize = NULL; driver->PolygonMode = NULL; driver->PolygonOffset = NULL; driver->PolygonStipple = NULL; driver->ReadBuffer = NULL; driver->RenderMode = NULL; driver->Scissor = NULL; driver->ShadeModel = NULL; driver->StencilFuncSeparate = NULL; driver->StencilOpSeparate = NULL; driver->StencilMaskSeparate = NULL; driver->TexGen = NULL; driver->TexEnv = NULL; driver->TexParameter = NULL; driver->Viewport = NULL; /* buffer objects */ _mesa_init_buffer_object_functions(driver); /* query objects */ _mesa_init_query_object_functions(driver); _mesa_init_sync_object_functions(driver); driver->NewFramebuffer = _mesa_new_framebuffer; driver->NewRenderbuffer = _mesa_new_soft_renderbuffer; driver->RenderTexture = _mesa_render_texture; driver->FinishRenderTexture = _mesa_finish_render_texture; driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer; driver->BlitFramebuffer = _swrast_BlitFramebuffer; /* APPLE_vertex_array_object */ driver->NewArrayObject = _mesa_new_array_object; driver->DeleteArrayObject = _mesa_delete_array_object; driver->BindArrayObject = NULL; _mesa_init_shader_object_functions(driver); _mesa_init_transform_feedback_functions(driver); /* T&L stuff */ driver->NeedValidate = GL_FALSE; driver->ValidateTnlModule = NULL; driver->CurrentExecPrimitive = 0; driver->CurrentSavePrimitive = 0; driver->NeedFlush = 0; driver->SaveNeedFlush = 0; driver->ProgramStringNotify = _tnl_program_string; driver->FlushVertices = NULL; driver->SaveFlushVertices = NULL; driver->NotifySaveBegin = NULL; driver->LightingSpaceChange = NULL; /* display list */ driver->NewList = NULL; driver->EndList = NULL; driver->BeginCallList = NULL; driver->EndCallList = NULL; }