Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright 2011 Adam Rak <adam.rak@streamnovation.com>
  3.  *
  4.  * Permission is hereby granted, free of charge, to any person obtaining a
  5.  * copy of this software and associated documentation files (the "Software"),
  6.  * to deal in the Software without restriction, including without limitation
  7.  * on the rights to use, copy, modify, merge, publish, distribute, sub
  8.  * license, and/or sell copies of the Software, and to permit persons to whom
  9.  * the Software is furnished to do so, subject to the following conditions:
  10.  *
  11.  * The above copyright notice and this permission notice (including the next
  12.  * paragraph) shall be included in all copies or substantial portions of the
  13.  * Software.
  14.  *
  15.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17.  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  18.  * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
  19.  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  20.  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  21.  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  22.  *
  23.  * Authors:
  24.  *      Adam Rak <adam.rak@streamnovation.com>
  25.  */
  26.  
  27. #ifndef EVERGREEN_COMPUTE_H
  28. #define EVERGREEN_COMPUTE_H
  29. #include "r600_pipe.h"
  30.  
  31. struct r600_atom;
  32. struct evergreen_compute_resource;
  33.  
  34. void *evergreen_create_compute_state(struct pipe_context *ctx, const struct pipe_compute_state *cso);
  35. void evergreen_delete_compute_state(struct pipe_context *ctx, void *state);
  36. void evergreen_compute_upload_input(struct pipe_context *context, const uint *block_layout, const uint *grid_layout, const void *input);
  37. void evergreen_init_atom_start_compute_cs(struct r600_context *rctx);
  38. void evergreen_init_compute_state_functions(struct r600_context *rctx);
  39. void evergreen_emit_cs_shader(struct r600_context *rctx, struct r600_atom * atom);
  40.  
  41. struct pipe_resource *r600_compute_global_buffer_create(struct pipe_screen *screen, const struct pipe_resource *templ);
  42. void r600_compute_global_buffer_destroy(struct pipe_screen *screen, struct pipe_resource *res);
  43. void *r600_compute_global_transfer_map(
  44.         struct pipe_context *ctx_,
  45.         struct pipe_resource *resource,
  46.         unsigned level,
  47.         unsigned usage,
  48.         const struct pipe_box *box,
  49.         struct pipe_transfer **ptransfer);
  50. void r600_compute_global_transfer_unmap(struct pipe_context *ctx, struct pipe_transfer* transfer);
  51. void r600_compute_global_transfer_flush_region( struct pipe_context *, struct pipe_transfer *, const struct pipe_box *);
  52. void r600_compute_global_transfer_inline_write( struct pipe_context *, struct pipe_resource *, unsigned level,
  53.                                                 unsigned usage, const struct pipe_box *, const void *data, unsigned stride, unsigned layer_stride);
  54.  
  55.  
  56. static inline void COMPUTE_DBG(struct r600_screen *rscreen, const char *fmt, ...)
  57. {
  58.         if (!(rscreen->debug_flags & DBG_COMPUTE)) {
  59.                 return;
  60.         }
  61.  
  62.         va_list ap;
  63.         va_start(ap, fmt);
  64.         _debug_vprintf(fmt, ap);
  65.         va_end(ap);
  66. }
  67.  
  68. #endif
  69.