i965: Fold brwInitVtbl() into brwCreateContext().
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 15 Oct 2013 23:17:15 +0000 (16:17 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 17 Oct 2013 21:27:03 +0000 (14:27 -0700)
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@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/Makefile.sources
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_vtbl.c [deleted file]

index b8e83ef237d04ae43483d9184716b492be104ab4..c4d689ebcd2cb72937cb2de89c75f0e25907dace 100644 (file)
@@ -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 \
index 3a6016197ff5cd762a45f7e1d328f0fcd6da7951..109f40babe34bc0b65276c93410af55c619d4ec0 100644 (file)
@@ -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 (file)
index a02259e..0000000
+++ /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@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;
-   }
-}