[Mesa-dev] [PATCH 02/24] i965: Move some helpers from brw_context.h to brw_shader.h

Jason Ekstrand jason at jlekstrand.net
Wed Mar 1 16:43:22 UTC 2017


On Tue, Feb 28, 2017 at 10:19 PM, Matt Turner <mattst88 at gmail.com> wrote:

> On Tue, Feb 28, 2017 at 9:03 PM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> > ---
> >  src/mesa/drivers/dri/i965/brw_compiler.c |  1 +
> >  src/mesa/drivers/dri/i965/brw_context.h  | 16 ----------------
> >  src/mesa/drivers/dri/i965/brw_shader.h   | 18 ++++++++++++++++++
> >  3 files changed, 19 insertions(+), 16 deletions(-)
> >
> > diff --git a/src/mesa/drivers/dri/i965/brw_compiler.c
> b/src/mesa/drivers/dri/i965/brw_compiler.c
> > index f3dafec..18ca444 100644
> > --- a/src/mesa/drivers/dri/i965/brw_compiler.c
> > +++ b/src/mesa/drivers/dri/i965/brw_compiler.c
> > @@ -23,6 +23,7 @@
> >
> >  #include "brw_compiler.h"
> >  #include "brw_context.h"
> > +#include "brw_shader.h"
> >  #include "compiler/nir/nir.h"
> >  #include "main/errors.h"
> >  #include "util/debug.h"
> > diff --git a/src/mesa/drivers/dri/i965/brw_context.h
> b/src/mesa/drivers/dri/i965/brw_context.h
> > index c9a931c..eda5c32 100644
> > --- a/src/mesa/drivers/dri/i965/brw_context.h
> > +++ b/src/mesa/drivers/dri/i965/brw_context.h
> > @@ -1330,12 +1330,6 @@ key_debug(struct brw_context *brw, const char
> *name, int a, int b)
> >
> >  void brwInitFragProgFuncs( struct dd_function_table *functions );
> >
> > -/* Per-thread scratch space is a power-of-two multiple of 1KB. */
> > -static inline int
> > -brw_get_scratch_size(int size)
> > -{
> > -   return MAX2(1024, util_next_power_of_two(size));
> > -}
> >  void brw_get_scratch_bo(struct brw_context *brw,
> >                         drm_intel_bo **scratch_bo, int size);
> >  void brw_alloc_stage_scratch(struct brw_context *brw,
> > @@ -1358,13 +1352,6 @@ void brw_upload_urb_fence(struct brw_context
> *brw);
> >   */
> >  void brw_upload_cs_urb_state(struct brw_context *brw);
> >
> > -/* brw_fs_reg_allocate.cpp
> > - */
> > -void brw_fs_alloc_reg_sets(struct brw_compiler *compiler);
> > -
> > -/* brw_vec4_reg_allocate.cpp */
> > -void brw_vec4_alloc_reg_set(struct brw_compiler *compiler);
> > -
> >  /* brw_disasm.c */
> >  int brw_disassemble_inst(FILE *file, const struct gen_device_info
> *devinfo,
> >                           struct brw_inst *inst, bool is_compacted);
> > @@ -1628,9 +1615,6 @@ brw_program_reloc(struct brw_context *brw,
> uint32_t state_offset,
> >
> >  bool brw_do_cubemap_normalize(struct exec_list *instructions);
> >
> > -extern const char * const conditional_modifier[16];
> > -extern const char *const pred_ctrl_align16[16];
> > -
> >  static inline bool
> >  brw_depth_writes_enabled(const struct brw_context *brw)
> >  {
> > diff --git a/src/mesa/drivers/dri/i965/brw_shader.h
> b/src/mesa/drivers/dri/i965/brw_shader.h
> > index 60f498f..8cda6b2 100644
> > --- a/src/mesa/drivers/dri/i965/brw_shader.h
> > +++ b/src/mesa/drivers/dri/i965/brw_shader.h
> > @@ -258,6 +258,24 @@ bool opt_predicated_break(struct backend_shader *s);
> >  extern "C" {
> >  #endif
> >
> > +/* brw_fs_reg_allocate.cpp
> > + */
>
> Let's make this a single-line comment while we're moving it.
>

done


> > +void brw_fs_alloc_reg_sets(struct brw_compiler *compiler);
> > +
> > +/* brw_vec4_reg_allocate.cpp */
> > +void brw_vec4_alloc_reg_set(struct brw_compiler *compiler);
> > +
> > +/* brw_disasm.c */
> > +extern const char * const conditional_modifier[16];
>
> And let's remove the space after the * while we're here as well.
>

done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170301/fe260625/attachment.html>


More information about the mesa-dev mailing list