X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fcommon%2Fdriverfuncs.c;h=0dbc7c3e8535f4e25e1aa769588219f284efa296;hb=774fb90db3e83d5e7326b7a72e05ce805c306b24;hp=986f751bdc1a7bf0f9c42d40bdd0370d8f616829;hpb=8abc860bd46a6cd584f9a64cb4613be76f82db06;p=mesa.git diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 986f751bdc1..0dbc7c3e853 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -26,32 +26,32 @@ #include "main/glheader.h" #include "main/imports.h" #include "main/arrayobj.h" -#include "main/buffers.h" #include "main/context.h" #include "main/framebuffer.h" #include "main/mipmap.h" #include "main/queryobj.h" #include "main/renderbuffer.h" +#include "main/shaderobj.h" #include "main/texcompress.h" #include "main/texformat.h" +#include "main/texgetimage.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/texstore.h" -#if FEATURE_ARB_vertex_buffer_object #include "main/bufferobj.h" -#endif -#if FEATURE_EXT_framebuffer_object #include "main/fbobject.h" #include "main/texrender.h" -#endif +#include "main/samplerobj.h" +#include "main/syncobj.h" +#include "main/texturebarrier.h" +#include "main/transformfeedback.h" -#include "shader/program.h" -#include "shader/prog_execute.h" -#include "shader/shader_api.h" +#include "program/program.h" #include "tnl/tnl.h" #include "swrast/swrast.h" #include "driverfuncs.h" +#include "meta.h" @@ -67,7 +67,7 @@ void _mesa_init_driver_functions(struct dd_function_table *driver) { - _mesa_bzero(driver, sizeof(*driver)); + memset(driver, 0, sizeof(*driver)); driver->GetString = NULL; /* REQUIRED! */ driver->UpdateState = NULL; /* REQUIRED! */ @@ -96,12 +96,12 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexSubImage2D = _mesa_store_texsubimage2d; driver->TexSubImage3D = _mesa_store_texsubimage3d; driver->GetTexImage = _mesa_get_teximage; - driver->CopyTexImage1D = _swrast_copy_teximage1d; - driver->CopyTexImage2D = _swrast_copy_teximage2d; - driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d; - driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d; - driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d; - driver->GenerateMipmap = _mesa_generate_mipmap; + 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; @@ -110,7 +110,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; driver->GetCompressedTexImage = _mesa_get_compressed_teximage; - driver->CompressedTextureSize = _mesa_compressed_texture_size; driver->BindTexture = NULL; driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; @@ -118,25 +117,18 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->FreeTexImageData = _mesa_free_texture_image_data; driver->MapTexture = NULL; driver->UnmapTexture = NULL; - driver->TextureMemCpy = _mesa_memcpy; + driver->TextureMemCpy = memcpy; driver->IsTextureResident = NULL; - driver->PrioritizeTexture = NULL; - driver->ActiveTexture = NULL; driver->UpdateTexturePalette = NULL; /* imaging */ - driver->CopyColorTable = _swrast_CopyColorTable; - driver->CopyColorSubTable = _swrast_CopyColorSubTable; - driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + 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; -#if FEATURE_MESA_program_debug - driver->GetProgramRegister = _mesa_get_program_register; -#endif /* FEATURE_MESA_program_debug */ /* simple state commands */ driver->AlphaFunc = NULL; @@ -145,7 +137,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->BlendFuncSeparate = NULL; driver->ClearColor = NULL; driver->ClearDepth = NULL; - driver->ClearIndex = NULL; driver->ClearStencil = NULL; driver->ClipPlane = NULL; driver->ColorMask = NULL; @@ -160,7 +151,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->Enable = NULL; driver->Fogfv = NULL; driver->Hint = NULL; - driver->IndexMask = NULL; driver->Lightfv = NULL; driver->LightModelfv = NULL; driver->LineStipple = NULL; @@ -181,64 +171,38 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexGen = NULL; driver->TexEnv = NULL; driver->TexParameter = NULL; - driver->TextureMatrix = NULL; driver->Viewport = NULL; - /* vertex arrays */ - driver->VertexPointer = NULL; - driver->NormalPointer = NULL; - driver->ColorPointer = NULL; - driver->FogCoordPointer = NULL; - driver->IndexPointer = NULL; - driver->SecondaryColorPointer = NULL; - driver->TexCoordPointer = NULL; - driver->EdgeFlagPointer = NULL; - driver->VertexAttribPointer = NULL; - driver->LockArraysEXT = NULL; - driver->UnlockArraysEXT = NULL; - - /* state queries */ - driver->GetBooleanv = NULL; - driver->GetDoublev = NULL; - driver->GetFloatv = NULL; - driver->GetIntegerv = NULL; - driver->GetPointerv = NULL; - -#if FEATURE_ARB_vertex_buffer_object - driver->NewBufferObject = _mesa_new_buffer_object; - driver->DeleteBuffer = _mesa_delete_buffer_object; - driver->BindBuffer = NULL; - driver->BufferData = _mesa_buffer_data; - driver->BufferSubData = _mesa_buffer_subdata; - driver->GetBufferSubData = _mesa_buffer_get_subdata; - driver->MapBuffer = _mesa_buffer_map; - driver->UnmapBuffer = _mesa_buffer_unmap; -#endif - -#if FEATURE_EXT_framebuffer_object + /* 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; -#endif + driver->ValidateFramebuffer = _mesa_validate_framebuffer; -#if FEATURE_EXT_framebuffer_blit driver->BlitFramebuffer = _swrast_BlitFramebuffer; -#endif - /* query objects */ - driver->NewQueryObject = _mesa_new_query_object; - driver->DeleteQuery = _mesa_delete_query; - driver->BeginQuery = _mesa_begin_query; - driver->EndQuery = _mesa_end_query; - driver->WaitQuery = _mesa_wait_query; + _mesa_init_texture_barrier_functions(driver); /* 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); + + _mesa_init_sampler_object_functions(driver); + /* T&L stuff */ driver->NeedValidate = GL_FALSE; driver->ValidateTnlModule = NULL; @@ -258,10 +222,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->EndList = NULL; driver->BeginCallList = NULL; driver->EndCallList = NULL; - - - /* XXX temporary here */ - _mesa_init_glsl_driver_functions(driver); } @@ -271,26 +231,39 @@ _mesa_init_driver_functions(struct dd_function_table *driver) * Only the Intel drivers use this so far. */ void -_mesa_init_driver_state(GLcontext *ctx) +_mesa_init_driver_state(struct gl_context *ctx) { ctx->Driver.AlphaFunc(ctx, ctx->Color.AlphaFunc, ctx->Color.AlphaRef); ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor); ctx->Driver.BlendEquationSeparate(ctx, - ctx->Color.BlendEquationRGB, - ctx->Color.BlendEquationA); + ctx->Color.Blend[0].EquationRGB, + ctx->Color.Blend[0].EquationA); ctx->Driver.BlendFuncSeparate(ctx, - ctx->Color.BlendSrcRGB, - ctx->Color.BlendDstRGB, - ctx->Color.BlendSrcA, ctx->Color.BlendDstA); - - ctx->Driver.ColorMask(ctx, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP]); + ctx->Color.Blend[0].SrcRGB, + ctx->Color.Blend[0].DstRGB, + ctx->Color.Blend[0].SrcA, + ctx->Color.Blend[0].DstA); + + if (ctx->Driver.ColorMaskIndexed) { + GLuint i; + for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) { + ctx->Driver.ColorMaskIndexed(ctx, i, + ctx->Color.ColorMask[0][RCOMP], + ctx->Color.ColorMask[0][GCOMP], + ctx->Color.ColorMask[0][BCOMP], + ctx->Color.ColorMask[0][ACOMP]); + } + } + else { + ctx->Driver.ColorMask(ctx, + ctx->Color.ColorMask[0][RCOMP], + ctx->Color.ColorMask[0][GCOMP], + ctx->Color.ColorMask[0][BCOMP], + ctx->Color.ColorMask[0][ACOMP]); + } ctx->Driver.CullFace(ctx, ctx->Polygon.CullFaceMode); ctx->Driver.DepthFunc(ctx, ctx->Depth.Func); @@ -308,7 +281,7 @@ _mesa_init_driver_state(GLcontext *ctx) 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_STENCIL_TEST, ctx->Stencil.Enabled); + 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); ctx->Driver.Enable(ctx, GL_TEXTURE_RECTANGLE_NV, GL_FALSE);