From: Marek Olšák <[email protected]>

---
 src/gallium/drivers/radeonsi/si_pipe.h   | 37 ++++++++++++++++++++++++++++----
 src/gallium/drivers/radeonsi/si_shader.h | 34 ++---------------------------
 2 files changed, 35 insertions(+), 36 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_pipe.h 
b/src/gallium/drivers/radeonsi/si_pipe.h
index 55e4ca7..558e185 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -19,24 +19,21 @@
  * 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:
  *      Jerome Glisse
  */
 #ifndef SI_PIPE_H
 #define SI_PIPE_H
 
-#include "si_state.h"
-#include "util/u_queue.h"
-
-#include <llvm-c/TargetMachine.h>
+#include "si_shader.h"
 
 #ifdef PIPE_ARCH_BIG_ENDIAN
 #define SI_BIG_ENDIAN 1
 #else
 #define SI_BIG_ENDIAN 0
 #endif
 
 /* The base vertex and primitive restart can be any number, but we must pick
  * one which will mean "unknown" for the purpose of state tracking and
  * the number shouldn't be a commonly-used one. */
@@ -437,11 +434,43 @@ si_is_atom_dirty(struct si_context *sctx,
        return sctx->dirty_atoms & bit;
 }
 
 static inline void
 si_mark_atom_dirty(struct si_context *sctx,
                   struct r600_atom *atom)
 {
        si_set_atom_dirty(sctx, atom, true);
 }
 
+static inline struct tgsi_shader_info *si_get_vs_info(struct si_context *sctx)
+{
+       if (sctx->gs_shader.cso)
+               return &sctx->gs_shader.cso->info;
+       else if (sctx->tes_shader.cso)
+               return &sctx->tes_shader.cso->info;
+       else if (sctx->vs_shader.cso)
+               return &sctx->vs_shader.cso->info;
+       else
+               return NULL;
+}
+
+static inline struct si_shader* si_get_vs_state(struct si_context *sctx)
+{
+       if (sctx->gs_shader.current)
+               return sctx->gs_shader.current->gs_copy_shader;
+       else if (sctx->tes_shader.current)
+               return sctx->tes_shader.current;
+       else
+               return sctx->vs_shader.current;
+}
+
+static inline bool si_vs_exports_prim_id(struct si_shader *shader)
+{
+       if (shader->selector->type == PIPE_SHADER_VERTEX)
+               return shader->key.vs.epilog.export_prim_id;
+       else if (shader->selector->type == PIPE_SHADER_TESS_EVAL)
+               return shader->key.tes.epilog.export_prim_id;
+       else
+               return false;
+}
+
 #endif
diff --git a/src/gallium/drivers/radeonsi/si_shader.h 
b/src/gallium/drivers/radeonsi/si_shader.h
index de4705d..67cb67d2 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -62,21 +62,23 @@
  * output addresses like the vertex stride, the patch stride, and the offsets
  * where per-vertex and per-patch data start, is passed to the shader via
  * user data SGPRs. The offsets and strides are calculated at draw time and
  * aren't available at compile time.
  */
 
 #ifndef SI_SHADER_H
 #define SI_SHADER_H
 
 #include <llvm-c/Core.h> /* LLVMModuleRef */
+#include <llvm-c/TargetMachine.h>
 #include "tgsi/tgsi_scan.h"
+#include "util/u_queue.h"
 #include "si_state.h"
 
 struct radeon_shader_binary;
 struct radeon_shader_reloc;
 
 #define SI_MAX_VS_OUTPUTS      40
 
 /* SGPR user data indices */
 enum {
        SI_SGPR_RW_BUFFERS,  /* rings (& stream-out, VS only) */
@@ -449,52 +451,20 @@ struct si_shader {
        size_t                          shader_log_size;
 };
 
 struct si_shader_part {
        struct si_shader_part *next;
        union si_shader_part_key key;
        struct radeon_shader_binary binary;
        struct si_shader_config config;
 };
 
-static inline struct tgsi_shader_info *si_get_vs_info(struct si_context *sctx)
-{
-       if (sctx->gs_shader.cso)
-               return &sctx->gs_shader.cso->info;
-       else if (sctx->tes_shader.cso)
-               return &sctx->tes_shader.cso->info;
-       else if (sctx->vs_shader.cso)
-               return &sctx->vs_shader.cso->info;
-       else
-               return NULL;
-}
-
-static inline struct si_shader* si_get_vs_state(struct si_context *sctx)
-{
-       if (sctx->gs_shader.current)
-               return sctx->gs_shader.current->gs_copy_shader;
-       else if (sctx->tes_shader.current)
-               return sctx->tes_shader.current;
-       else
-               return sctx->vs_shader.current;
-}
-
-static inline bool si_vs_exports_prim_id(struct si_shader *shader)
-{
-       if (shader->selector->type == PIPE_SHADER_VERTEX)
-               return shader->key.vs.epilog.export_prim_id;
-       else if (shader->selector->type == PIPE_SHADER_TESS_EVAL)
-               return shader->key.tes.epilog.export_prim_id;
-       else
-               return false;
-}
-
 /* si_shader.c */
 int si_compile_tgsi_shader(struct si_screen *sscreen,
                           LLVMTargetMachineRef tm,
                           struct si_shader *shader,
                           bool is_monolithic,
                           struct pipe_debug_callback *debug);
 int si_shader_create(struct si_screen *sscreen, LLVMTargetMachineRef tm,
                     struct si_shader *shader,
                     struct pipe_debug_callback *debug);
 int si_compile_llvm(struct si_screen *sscreen,
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to