st/mesa: move st_atom.c contents into st_context.c
authorMarek Olšák <marek.olsak@amd.com>
Mon, 21 Nov 2022 13:03:23 +0000 (08:03 -0500)
committerMarge Bot <emma+marge@anholt.net>
Mon, 12 Dec 2022 19:15:34 +0000 (19:15 +0000)
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19953>

src/mesa/meson.build
src/mesa/state_tracker/st_atom.c [deleted file]
src/mesa/state_tracker/st_atom.h
src/mesa/state_tracker/st_context.c
src/mesa/state_tracker/st_context.h

index 86f30ab..c664e98 100644 (file)
@@ -283,7 +283,6 @@ files_libmesa = files(
   'program/symbol_table.h',
   'state_tracker/st_atifs_to_nir.c',
   'state_tracker/st_atifs_to_nir.h',
-  'state_tracker/st_atom.c',
   'state_tracker/st_atom_array.cpp',
   'state_tracker/st_atom_atomicbuf.c',
   'state_tracker/st_atom_blend.c',
diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c
deleted file mode 100644 (file)
index 3e33c2b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/**************************************************************************
- * 
- * Copyright 2003 VMware, Inc.
- * All Rights Reserved.
- * 
- * 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, sub license, 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 NON-INFRINGEMENT.
- * IN NO EVENT SHALL VMWARE 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.
- * 
- **************************************************************************/
-
-
-#include <stdio.h>
-#include "main/arrayobj.h"
-#include "util/glheader.h"
-#include "main/context.h"
-
-#include "pipe/p_defines.h"
-#include "st_context.h"
-#include "st_atom.h"
-#include "st_program.h"
-#include "st_manager.h"
-#include "st_util.h"
-
-#include "util/u_cpu_detect.h"
-
-
-/* The list state update functions. */
-st_update_func_t st_update_functions[ST_NUM_ATOMS];
-
-static void
-init_atoms_once(void)
-{
-#define ST_STATE(FLAG, st_update) st_update_functions[FLAG##_INDEX] = st_update;
-#include "st_atom_list.h"
-#undef ST_STATE
-
-   if (util_get_cpu_caps()->has_popcnt)
-      st_update_functions[ST_NEW_VERTEX_ARRAYS_INDEX] = st_update_array_with_popcnt;
-}
-
-void st_init_atoms( struct st_context *st )
-{
-   STATIC_ASSERT(ARRAY_SIZE(st_update_functions) <= 64);
-
-   static once_flag flag = ONCE_FLAG_INIT;
-   call_once(&flag, init_atoms_once);
-}
-
-void st_destroy_atoms( struct st_context *st )
-{
-   /* no-op */
-}
index 11bfcb0..3afee88 100644 (file)
@@ -48,10 +48,6 @@ struct pipe_vertex_buffer;
 struct pipe_vertex_element;
 struct cso_velems_state;
 
-
-void st_init_atoms( struct st_context *st );
-void st_destroy_atoms( struct st_context *st );
-
 void
 st_setup_arrays(struct st_context *st,
                 const struct gl_vertex_program *vp,
@@ -183,10 +179,6 @@ enum {
 #define ST_ALL_STATES_MASK (ST_PIPELINE_RENDER_STATE_MASK | \
                             ST_PIPELINE_COMPUTE_STATE_MASK)
 
-typedef void (*st_update_func_t)(struct st_context *st);
-
-extern st_update_func_t st_update_functions[ST_NUM_ATOMS];
-
 #ifdef __cplusplus
 }
 #endif
index eda6649..cd2154e 100644 (file)
 
 DEBUG_GET_ONCE_BOOL_OPTION(mesa_mvp_dp4, "MESA_MVP_DP4", FALSE)
 
+/* The list of state update functions. */
+st_update_func_t st_update_functions[ST_NUM_ATOMS];
+
+static void
+init_atoms_once(void)
+{
+   STATIC_ASSERT(ARRAY_SIZE(st_update_functions) <= 64);
+
+#define ST_STATE(FLAG, st_update) st_update_functions[FLAG##_INDEX] = st_update;
+#include "st_atom_list.h"
+#undef ST_STATE
+
+   if (util_get_cpu_caps()->has_popcnt)
+      st_update_functions[ST_NEW_VERTEX_ARRAYS_INDEX] = st_update_array_with_popcnt;
+}
+
 void
 st_invalidate_buffers(struct st_context *st)
 {
@@ -331,7 +347,6 @@ st_context_free_zombie_objects(struct st_context *st)
 static void
 st_destroy_context_priv(struct st_context *st, bool destroy_pipe)
 {
-   st_destroy_atoms(st);
    st_destroy_draw(st);
    st_destroy_clear(st);
    st_destroy_bitmap(st);
@@ -475,7 +490,9 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
    st->cso_context = cso_create_context(pipe, cso_flags);
    ctx->cso_context = st->cso_context;
 
-   st_init_atoms(st);
+   static once_flag flag = ONCE_FLAG_INIT;
+   call_once(&flag, init_atoms_once);
+
    st_init_clear(st);
    {
       enum pipe_texture_transfer_mode val = screen->get_param(screen, PIPE_CAP_TEXTURE_TRANSFER_MODES);
index da27faa..c3996a2 100644 (file)
@@ -508,6 +508,10 @@ st_api_destroy_drawable(struct pipe_frontend_drawable *drawable);
 void
 st_screen_destroy(struct pipe_frontend_screen *fscreen);
 
+typedef void (*st_update_func_t)(struct st_context *st);
+
+extern st_update_func_t st_update_functions[ST_NUM_ATOMS];
+
 #ifdef __cplusplus
 }
 #endif