[Mesa-dev] [PATCH 6/6] i965: Fold brwInitVtbl() into brwCreateContext().

Kenneth Graunke kenneth at whitecape.org
Wed Oct 16 04:02:48 CEST 2013


With most of the virtual functions gone, brwInitVtbl() is now tiny.

Merging it into the caller allows us to delete the entire file.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/Makefile.sources |  1 -
 src/mesa/drivers/dri/i965/brw_context.c    | 10 ++++-
 src/mesa/drivers/dri/i965/brw_vtbl.c       | 70 ------------------------------
 3 files changed, 9 insertions(+), 72 deletions(-)
 delete mode 100644 src/mesa/drivers/dri/i965/brw_vtbl.c

diff --git a/src/mesa/drivers/dri/i965/Makefile.sources b/src/mesa/drivers/dri/i965/Makefile.sources
index b8e83ef..c4d689e 100644
--- a/src/mesa/drivers/dri/i965/Makefile.sources
+++ b/src/mesa/drivers/dri/i965/Makefile.sources
@@ -101,7 +101,6 @@ i965_FILES = \
 	brw_vs.c \
 	brw_vs_state.c \
 	brw_vs_surface_state.c \
-	brw_vtbl.c \
 	brw_wm.c \
 	brw_wm_iz.cpp \
 	brw_wm_sampler_state.c \
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 3a60161..109f40b 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -530,7 +530,15 @@ brwCreateContext(gl_api api,
    brw->must_use_separate_stencil = screen->hw_must_use_separate_stencil;
    brw->has_swizzling = screen->hw_has_swizzling;
 
-   brwInitVtbl( brw );
+   if (brw->gen >= 7) {
+      gen7_init_vtable_surface_functions(brw);
+      gen7_init_vtable_sampler_functions(brw);
+      brw->vtbl.emit_depth_stencil_hiz = gen7_emit_depth_stencil_hiz;
+   } else {
+      gen4_init_vtable_surface_functions(brw);
+      gen4_init_vtable_sampler_functions(brw);
+      brw->vtbl.emit_depth_stencil_hiz = brw_emit_depth_stencil_hiz;
+   }
 
    brw_init_driver_functions(brw, &functions);
 
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
deleted file mode 100644
index a02259e..0000000
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- Copyright (C) Intel Corp.  2006.  All Rights Reserved.
- Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
- develop this 3D driver.
- 
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to
- permit persons to whom the Software is furnished to do so, subject to
- the following conditions:
- 
- The above copyright notice and this permission notice (including the
- next paragraph) shall be included in all copies or substantial
- portions of the Software.
- 
- 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 THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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.
- 
-**********************************************************************/
-
-/*
- * Authors:
- *   Keith Whitwell <keith at tungstengraphics.com>
- */
-
-#include "main/glheader.h"
-#include "main/mtypes.h"
-#include "main/imports.h"
-#include "main/macros.h"
-#include "main/colormac.h"
-#include "main/renderbuffer.h"
-#include "main/framebuffer.h"
-
-#include "intel_batchbuffer.h" 
-#include "intel_regions.h" 
-#include "intel_fbo.h"
-
-#include "brw_context.h"
-#include "brw_program.h"
-#include "brw_defines.h"
-#include "brw_state.h"
-#include "brw_draw.h"
-#include "brw_vs.h"
-#include "brw_wm.h"
-
-#include "gen6_blorp.h"
-#include "gen7_blorp.h"
-
-#include "glsl/ralloc.h"
-
-void brwInitVtbl( struct brw_context *brw )
-{
-   assert(brw->gen >= 4);
-   if (brw->gen >= 7) {
-      gen7_init_vtable_surface_functions(brw);
-      gen7_init_vtable_sampler_functions(brw);
-      brw->vtbl.emit_depth_stencil_hiz = gen7_emit_depth_stencil_hiz;
-   } else if (brw->gen >= 4) {
-      gen4_init_vtable_surface_functions(brw);
-      gen4_init_vtable_sampler_functions(brw);
-      brw->vtbl.emit_depth_stencil_hiz = brw_emit_depth_stencil_hiz;
-   }
-}
-- 
1.8.3.2



More information about the mesa-dev mailing list