Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef COMMON_MISC_H
  2. #define COMMON_MISC_H
  3. #include "radeon_common_context.h"
  4. #include "radeon_dma.h"
  5. #include "radeon_texture.h"
  6. void radeonUserClear(struct gl_context *ctx, GLuint mask);
  7. void radeonRecalcScissorRects(radeonContextPtr radeon);
  8. void radeonSetCliprects(radeonContextPtr radeon);
  9. void radeonUpdateScissor( struct gl_context *ctx );
  10. void radeonScissor(struct gl_context* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
  11. extern uint32_t radeonGetAge(radeonContextPtr radeon);
  12. void radeonFlush(struct gl_context *ctx);
  13. void radeonFinish(struct gl_context * ctx);
  14. void radeonEmitState(radeonContextPtr radeon);
  15. GLuint radeonCountStateEmitSize(radeonContextPtr radeon);
  16. void radeon_clear_tris(struct gl_context *ctx, GLbitfield mask);
  17. void radeon_window_moved(radeonContextPtr radeon);
  18. void radeon_draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb);
  19. void radeonDrawBuffer( struct gl_context *ctx, GLenum mode );
  20. void radeonReadBuffer( struct gl_context *ctx, GLenum mode );
  21. void radeon_viewport(struct gl_context *ctx, GLint x, GLint y, GLsizei width, GLsizei height);
  22. void radeon_fbo_init(struct radeon_context *radeon);
  23. void
  24. radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
  25. struct radeon_bo *bo);
  26. struct radeon_renderbuffer *
  27. radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv);
  28. void
  29. radeonReadPixels(struct gl_context * ctx,
  30. GLint x, GLint y, GLsizei width, GLsizei height,
  31. GLenum format, GLenum type,
  32. const struct gl_pixelstore_attrib *pack, GLvoid * pixels);
  33. void radeon_check_front_buffer_rendering(struct gl_context *ctx);
  34. static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb)
  35. {
  36. struct radeon_renderbuffer *rrb = (struct radeon_renderbuffer *)rb;
  37. radeon_print(RADEON_MEMORY, RADEON_TRACE,
  38. "%s(rb %p)\n",
  39. __func__, rb);
  40. if (rrb && rrb->base.ClassID == RADEON_RB_CLASS)
  41. return rrb;
  42. else
  43. return NULL;
  44. }
  45. static inline struct radeon_renderbuffer *radeon_get_renderbuffer(struct gl_framebuffer *fb, int att_index)
  46. {
  47. radeon_print(RADEON_MEMORY, RADEON_TRACE,
  48. "%s(fb %p, index %d)\n",
  49. __func__, fb, att_index);
  50. if (att_index >= 0)
  51. return radeon_renderbuffer(fb->Attachment[att_index].Renderbuffer);
  52. else
  53. return NULL;
  54. }
  55. static inline struct radeon_renderbuffer *radeon_get_depthbuffer(radeonContextPtr rmesa)
  56. {
  57. struct radeon_renderbuffer *rrb;
  58. rrb = radeon_renderbuffer(rmesa->state.depth.rb);
  59. if (!rrb)
  60. return NULL;
  61. return rrb;
  62. }
  63. static inline struct radeon_renderbuffer *radeon_get_colorbuffer(radeonContextPtr rmesa)
  64. {
  65. struct radeon_renderbuffer *rrb;
  66. rrb = radeon_renderbuffer(rmesa->state.color.rb);
  67. if (!rrb)
  68. return NULL;
  69. return rrb;
  70. }
  71. #include "radeon_cmdbuf.h"
  72. #endif