X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fcommon%2Fdriverfuncs.c;h=0d094ddf4e60457f90d6c33963a42556c39ec817;hb=68ed14d6adcaf4b91216fc1c53792e88d1fd024d;hp=6484d284d7d60242ae1f0e4b39ab09d8573e0cd1;hpb=eb805a518216ae61317e7eef78a0b2c692c10eae;p=mesa.git diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 6484d284d7d..0d094ddf4e6 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.1 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * @@ -17,19 +16,23 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" #include "main/imports.h" +#include "main/accum.h" #include "main/arrayobj.h" #include "main/context.h" +#include "main/formatquery.h" #include "main/framebuffer.h" #include "main/mipmap.h" #include "main/queryobj.h" +#include "main/readpix.h" #include "main/renderbuffer.h" #include "main/shaderobj.h" #include "main/texcompress.h" @@ -37,6 +40,7 @@ #include "main/texgetimage.h" #include "main/teximage.h" #include "main/texobj.h" +#include "main/texstorage.h" #include "main/texstore.h" #include "main/bufferobj.h" #include "main/fbobject.h" @@ -48,6 +52,7 @@ #include "program/program.h" #include "tnl/tnl.h" #include "swrast/swrast.h" +#include "swrast/s_renderbuffer.h" #include "driverfuncs.h" #include "meta.h" @@ -70,54 +75,43 @@ _mesa_init_driver_functions(struct dd_function_table *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->Accum = _mesa_accum; driver->RasterPos = _tnl_RasterPos; driver->DrawPixels = _swrast_DrawPixels; - driver->ReadPixels = _swrast_ReadPixels; + driver->ReadPixels = _mesa_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->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D; - driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D; - driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D; + driver->QuerySamplesForFormat = _mesa_query_samples_for_format; + driver->TexImage = _mesa_store_teximage; + driver->TexSubImage = _mesa_store_texsubimage; + driver->GetTexImage = _mesa_meta_GetTexImage; + driver->ClearTexSubImage = _mesa_meta_ClearTexSubImage; + driver->CopyTexSubImage = _mesa_meta_CopyTexSubImage; 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->CompressedTexImage = _mesa_store_compressed_teximage; + driver->CompressedTexSubImage = _mesa_store_compressed_texsubimage; + driver->GetCompressedTexImage = _mesa_GetCompressedTexImage_sw; driver->BindTexture = NULL; driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; - driver->NewTextureImage = _mesa_new_texture_image; - driver->FreeTextureImageBuffer = _mesa_free_texture_image_data; + 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->MapTexture = NULL; - driver->UnmapTexture = NULL; - driver->TextureMemCpy = memcpy; - driver->IsTextureResident = NULL; + driver->DrawTex = _mesa_meta_DrawTex; /* Vertex/fragment programs */ driver->BindProgram = NULL; @@ -129,9 +123,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) 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; @@ -176,19 +167,22 @@ _mesa_init_driver_functions(struct dd_function_table *driver) _mesa_init_sync_object_functions(driver); driver->NewFramebuffer = _mesa_new_framebuffer; - driver->NewRenderbuffer = _mesa_new_soft_renderbuffer; + 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_framebuffer_renderbuffer; driver->ValidateFramebuffer = _mesa_validate_framebuffer; driver->BlitFramebuffer = _swrast_BlitFramebuffer; + driver->DiscardFramebuffer = NULL; _mesa_init_texture_barrier_functions(driver); /* APPLE_vertex_array_object */ - driver->NewArrayObject = _mesa_new_array_object; - driver->DeleteArrayObject = _mesa_delete_array_object; + driver->NewArrayObject = _mesa_new_vao; + driver->DeleteArrayObject = _mesa_delete_vao; driver->BindArrayObject = NULL; _mesa_init_shader_object_functions(driver); @@ -198,8 +192,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) _mesa_init_sampler_object_functions(driver); /* T&L stuff */ - driver->NeedValidate = GL_FALSE; - driver->ValidateTnlModule = NULL; driver->CurrentExecPrimitive = 0; driver->CurrentSavePrimitive = 0; driver->NeedFlush = 0; @@ -216,6 +208,15 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->EndList = NULL; driver->BeginCallList = NULL; driver->EndCallList = NULL; + + /* GL_ARB_texture_storage */ + driver->AllocTextureStorage = _mesa_AllocTextureStorage_sw; + + /* GL_ARB_texture_view */ + driver->TextureView = NULL; + + /* GL_ARB_texture_multisample */ + driver->GetSamplePosition = NULL; } @@ -274,7 +275,7 @@ _mesa_init_driver_state(struct gl_context *ctx) ctx->Driver.Enable(ctx, GL_LIGHTING, ctx->Light.Enabled); ctx->Driver.Enable(ctx, GL_LINE_SMOOTH, ctx->Line.SmoothFlag); ctx->Driver.Enable(ctx, GL_POLYGON_STIPPLE, ctx->Polygon.StippleFlag); - ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.Enabled); + ctx->Driver.Enable(ctx, GL_SCISSOR_TEST, ctx->Scissor.EnableFlags); ctx->Driver.Enable(ctx, GL_STENCIL_TEST, ctx->Stencil._Enabled); ctx->Driver.Enable(ctx, GL_TEXTURE_1D, GL_FALSE); ctx->Driver.Enable(ctx, GL_TEXTURE_2D, GL_FALSE); @@ -302,8 +303,7 @@ _mesa_init_driver_state(struct gl_context *ctx) ctx->Driver.LogicOpcode(ctx, ctx->Color.LogicOp); ctx->Driver.PointSize(ctx, ctx->Point.Size); ctx->Driver.PolygonStipple(ctx, (const GLubyte *) ctx->PolygonStipple); - ctx->Driver.Scissor(ctx, ctx->Scissor.X, ctx->Scissor.Y, - ctx->Scissor.Width, ctx->Scissor.Height); + ctx->Driver.Scissor(ctx); ctx->Driver.ShadeModel(ctx, ctx->Light.ShadeModel); ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, ctx->Stencil.Function[0],