Chia-I Wu <olva...@gmail.com> wrote: >> Fixes a fatal build error when compiling just OpenGL ES libraries, since >> FEATURE_EXT_framebuffer_blit is disabled then, so the BlitFramebuffer >> member doesn't exist. > Is this change enough to make dri_r300 function as a GLES only driver? > > To be honest, I am a little reluctant to sprinkle "#if FEATURE" in the drivers > at the moment. The drivers, execept for intel, have not specified GLES api > support yet. Even when they do, I would hope there is a more systematic to > enable/disable certain features, to effectively reduce the driver size. It's already sprinkled through the DRI drivers right now though(it's in intel_fbo.c at least), because struct dd_function_table's members in src/mesa/main/dd.h are #if'd based on the feature defines. As it is, the code for radeon and nouveau (and the mesa state tracker, now that I check) is just borked without them.
(new patch for st/mesa attached)
From 428e355978dbc4c3fff00ee46ad7f8455a07308a Mon Sep 17 00:00:00 2001 From: nobled <nobl...@nobled2-karmic.(none)> Date: Mon, 12 Jul 2010 21:22:08 -0400 Subject: [PATCH] dri/radeon: test for FEATURE defines 'struct dd_function_table' only conditionally contains the function pointer NewFramebuffer and friends based on FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h) Fixes the build when the features are disabled and the vfuncs don't exist. --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 5174850..0597d42 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -609,6 +609,7 @@ radeon_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) void radeon_fbo_init(struct radeon_context *radeon) { +#if FEATURE_EXT_framebuffer_object radeon->glCtx->Driver.NewFramebuffer = radeon_new_framebuffer; radeon->glCtx->Driver.NewRenderbuffer = radeon_new_renderbuffer; radeon->glCtx->Driver.BindFramebuffer = radeon_bind_framebuffer; @@ -617,7 +618,10 @@ void radeon_fbo_init(struct radeon_context *radeon) radeon->glCtx->Driver.FinishRenderTexture = radeon_finish_render_texture; radeon->glCtx->Driver.ResizeBuffers = radeon_resize_buffers; radeon->glCtx->Driver.ValidateFramebuffer = radeon_validate_framebuffer; +#endif +#if FEATURE_EXT_framebuffer_blit radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer; +#endif } -- 1.5.4.3
From 5cd07814b2ee90bec0eef3cb9ee40043a838c49e Mon Sep 17 00:00:00 2001 From: nobled <nobl...@nobled2-karmic.(none)> Date: Mon, 12 Jul 2010 22:53:32 -0400 Subject: [PATCH] dri/nouveau: test for FEATURE defines 'struct dd_function_table' only conditionally contains the function pointer NewFramebuffer and friends based on FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h) Fixes the build when the features are disabled and the vfuncs don't exist. --- src/mesa/drivers/dri/nouveau/nouveau_driver.c | 2 ++ src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c index 4ec864c..6452fe2 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c @@ -138,5 +138,7 @@ nouveau_driver_functions_init(struct dd_function_table *functions) functions->DrawPixels = _mesa_meta_DrawPixels; functions->CopyPixels = _mesa_meta_CopyPixels; functions->Bitmap = _mesa_meta_Bitmap; +#if FEATURE_EXT_framebuffer_blit functions->BlitFramebuffer = _mesa_meta_BlitFramebuffer; +#endif } diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index bd1273b..32d8f2d 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -262,10 +262,12 @@ nouveau_finish_render_texture(GLcontext *ctx, void nouveau_fbo_functions_init(struct dd_function_table *functions) { +#if FEATURE_EXT_framebuffer_object functions->NewFramebuffer = nouveau_framebuffer_new; functions->NewRenderbuffer = nouveau_renderbuffer_new; functions->BindFramebuffer = nouveau_bind_framebuffer; functions->FramebufferRenderbuffer = nouveau_framebuffer_renderbuffer; functions->RenderTexture = nouveau_render_texture; functions->FinishRenderTexture = nouveau_finish_render_texture; +#endif } -- 1.5.4.3
From 9c58ac433666dbdc95f6d0d2dba182379606e390 Mon Sep 17 00:00:00 2001 From: nobled <nob...@dreamwidth.org> Date: Fri, 13 Aug 2010 20:23:11 +0000 Subject: [PATCH] st/mesa: test for FEATURE defines 'struct dd_function_table' only conditionally contains the function pointer NewFramebuffer and friends based on FEATURE_EXT_framebuffer_* defines. (See src/mesa/main/dd.h) Fixes the build when the features are disabled and the vfuncs don't exist. --- src/mesa/state_tracker/st_cb_fbo.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 13119ce..86bb788 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -543,6 +543,7 @@ st_ReadBuffer(GLcontext *ctx, GLenum buffer) void st_init_fbo_functions(struct dd_function_table *functions) { +#if FEATURE_EXT_framebuffer_object functions->NewFramebuffer = st_new_framebuffer; functions->NewRenderbuffer = st_new_renderbuffer; functions->BindFramebuffer = st_bind_framebuffer; @@ -550,6 +551,7 @@ void st_init_fbo_functions(struct dd_function_table *functions) functions->RenderTexture = st_render_texture; functions->FinishRenderTexture = st_finish_render_texture; functions->ValidateFramebuffer = st_validate_framebuffer; +#endif /* no longer needed by core Mesa, drivers handle resizes... functions->ResizeBuffers = st_resize_buffers; */ -- 1.5.4.3
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev