gallium: remove helpers converting to/from TGSI_PROCESSOR_*
authorMarek Olšák <marek.olsak@amd.com>
Sat, 16 Apr 2016 12:48:34 +0000 (14:48 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 21 Apr 2016 23:30:39 +0000 (01:30 +0200)
Acked-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_ureg.c
src/gallium/auxiliary/util/u_inlines.h
src/gallium/drivers/radeonsi/si_state_shaders.c
src/gallium/state_trackers/nine/nine_shader.c

index 17b39e20ed8cc8b7b163e29594a6a4f275272630..7ed9bd6c6081a3d22be045975d93b55d306bfbd0 100644 (file)
@@ -2090,8 +2090,7 @@ ureg_create_with_screen(unsigned processor, struct pipe_screen *screen)
    ureg->processor = processor;
    ureg->supports_any_inout_decl_range =
       screen &&
-      screen->get_shader_param(screen,
-                               util_pipe_shader_from_tgsi_processor(processor),
+      screen->get_shader_param(screen, processor,
                                PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE) != 0;
    ureg->next_shader_processor = -1;
 
index eedd32e9e47f7b40029a77c23ee4c732cb28706c..07c058abfba60322d43a68ed7c8599511aff9de0 100644 (file)
@@ -650,28 +650,6 @@ util_max_layer(const struct pipe_resource *r, unsigned level)
    }
 }
 
-static inline unsigned
-util_pipe_shader_from_tgsi_processor(unsigned processor)
-{
-   switch (processor) {
-   case PIPE_SHADER_VERTEX:
-      return PIPE_SHADER_VERTEX;
-   case PIPE_SHADER_TESS_CTRL:
-      return PIPE_SHADER_TESS_CTRL;
-   case PIPE_SHADER_TESS_EVAL:
-      return PIPE_SHADER_TESS_EVAL;
-   case PIPE_SHADER_GEOMETRY:
-      return PIPE_SHADER_GEOMETRY;
-   case PIPE_SHADER_FRAGMENT:
-      return PIPE_SHADER_FRAGMENT;
-   case PIPE_SHADER_COMPUTE:
-      return PIPE_SHADER_COMPUTE;
-   default:
-      assert(0);
-      return PIPE_SHADER_VERTEX;
-   }
-}
-
 #ifdef __cplusplus
 }
 #endif
index 80247f7281aea3352543975fc877f9f6517959d8..52b9851e01ee58f6a50dd0270843e33b838d15a5 100644 (file)
@@ -1037,7 +1037,7 @@ static void *si_create_shader_selector(struct pipe_context *ctx,
 
        sel->so = state->stream_output;
        tgsi_scan_shader(state->tokens, &sel->info);
-       sel->type = util_pipe_shader_from_tgsi_processor(sel->info.processor);
+       sel->type = sel->info.processor;
        p_atomic_inc(&sscreen->b.num_shaders_created);
 
        /* Set which opcode uses which (i,j) pair. */
index dc886baba539410db95af053969f56f948294773..a539ab91f600d3794f101f485fb99f23eed05a89 100644 (file)
@@ -3254,17 +3254,6 @@ tx_dtor(struct shader_translator *tx)
     FREE(tx);
 }
 
-static inline unsigned
-tgsi_processor_from_type(unsigned shader_type)
-{
-    switch (shader_type) {
-    case PIPE_SHADER_VERTEX: return PIPE_SHADER_VERTEX;
-    case PIPE_SHADER_FRAGMENT: return PIPE_SHADER_FRAGMENT;
-    default:
-        return ~0;
-    }
-}
-
 static void
 shader_add_ps_fog_stage(struct shader_translator *tx, struct ureg_src src_col)
 {
@@ -3326,7 +3315,7 @@ nine_translate_shader(struct NineDevice9 *device, struct nine_shader_info *info)
 {
     struct shader_translator *tx;
     HRESULT hr = D3D_OK;
-    const unsigned processor = tgsi_processor_from_type(info->type);
+    const unsigned processor = info->type;
     unsigned s, slot_max;
     unsigned max_const_f;