v3d: Make the function to set tex dirty state for a stage global
authorNeil Roberts <nroberts@igalia.com>
Tue, 29 Sep 2020 15:20:31 +0000 (17:20 +0200)
committerNeil Roberts <nroberts@igalia.com>
Sun, 4 Oct 2020 13:29:54 +0000 (15:29 +0200)
This moves the static function v3d_dirty_tex_state_for_shader_type from
v3dx_state.c to v3d_context.c and adds a declaration for it in the
header so that it can be used as a general utility function in a later
patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6914>

src/gallium/drivers/v3d/v3d_context.c
src/gallium/drivers/v3d/v3d_context.h
src/gallium/drivers/v3d/v3dx_state.c

index 185bdc6..2b39b74 100644 (file)
@@ -194,6 +194,28 @@ v3d_get_real_line_width(struct v3d_context *v3d)
         return width;
 }
 
+void
+v3d_flag_dirty_sampler_state(struct v3d_context *v3d,
+                             enum pipe_shader_type shader)
+{
+        switch (shader) {
+        case PIPE_SHADER_VERTEX:
+                v3d->dirty |= VC5_DIRTY_VERTTEX;
+                break;
+        case PIPE_SHADER_GEOMETRY:
+                v3d->dirty |= VC5_DIRTY_GEOMTEX;
+                break;
+        case PIPE_SHADER_FRAGMENT:
+                v3d->dirty |= VC5_DIRTY_FRAGTEX;
+                break;
+        case PIPE_SHADER_COMPUTE:
+                v3d->dirty |= VC5_DIRTY_COMPTEX;
+                break;
+        default:
+                unreachable("Unsupported shader stage");
+        }
+}
+
 static void
 v3d_context_destroy(struct pipe_context *pctx)
 {
index 74df773..baf58d9 100644 (file)
@@ -703,6 +703,9 @@ bool v3d_line_smoothing_enabled(struct v3d_context *v3d);
 
 float v3d_get_real_line_width(struct v3d_context *v3d);
 
+void v3d_flag_dirty_sampler_state(struct v3d_context *v3d,
+                                  enum pipe_shader_type shader);
+
 #ifdef v3dX
 #  include "v3dx_context.h"
 #else
index ee41b9f..ee4f7d8 100644 (file)
@@ -771,28 +771,6 @@ v3d_create_sampler_state(struct pipe_context *pctx,
 }
 
 static void
-v3d_flag_dirty_sampler_state(struct v3d_context *v3d,
-                             enum pipe_shader_type shader)
-{
-        switch (shader) {
-        case PIPE_SHADER_VERTEX:
-                v3d->dirty |= VC5_DIRTY_VERTTEX;
-                break;
-        case PIPE_SHADER_GEOMETRY:
-                v3d->dirty |= VC5_DIRTY_GEOMTEX;
-                break;
-        case PIPE_SHADER_FRAGMENT:
-                v3d->dirty |= VC5_DIRTY_FRAGTEX;
-                break;
-        case PIPE_SHADER_COMPUTE:
-                v3d->dirty |= VC5_DIRTY_COMPTEX;
-                break;
-        default:
-                unreachable("Unsupported shader stage");
-        }
-}
-
-static void
 v3d_sampler_states_bind(struct pipe_context *pctx,
                         enum pipe_shader_type shader, unsigned start,
                         unsigned nr, void **hwcso)