mesa: rework texture completeness testing
[mesa.git] / src / mesa / swrast / swrast.h
index 9b88c70220e1d5abdae1a6d02b2b61de8a59c5a0..a299e6fda87895b92bb52a98e49cb977e64df29e 100644 (file)
 #define SWRAST_H
 
 #include "main/mtypes.h"
+#include "swrast/s_chan.h"
+
+
+/**
+ * If non-zero use GLdouble for walking triangle edges, for better accuracy.
+ */
+#define TRIANGLE_WALK_DOUBLE 0
+
+
+/**
+ * Bits per depth buffer value (max is 32).
+ */
+#ifndef DEFAULT_SOFTWARE_DEPTH_BITS
+#define DEFAULT_SOFTWARE_DEPTH_BITS 16
+#endif
+/** Depth buffer data type */
+#if DEFAULT_SOFTWARE_DEPTH_BITS <= 16
+#define DEFAULT_SOFTWARE_DEPTH_TYPE GLushort
+#else
+#define DEFAULT_SOFTWARE_DEPTH_TYPE GLuint
+#endif
+
+
+/**
+ * Max image/surface/texture size.
+ */
+#define SWRAST_MAX_WIDTH 16384
+#define SWRAST_MAX_HEIGHT 16384
+
 
 /**
  * \struct SWvertex
@@ -109,6 +138,11 @@ _swrast_CopyPixels( struct gl_context *ctx,
                    GLsizei width, GLsizei height,
                    GLenum type );
 
+extern GLboolean
+swrast_fast_copy_pixels(struct gl_context *ctx,
+                       GLint srcX, GLint srcY, GLsizei width, GLsizei height,
+                       GLint dstX, GLint dstY, GLenum type);
+
 extern void
 _swrast_DrawPixels( struct gl_context *ctx,
                    GLint x, GLint y,
@@ -117,13 +151,6 @@ _swrast_DrawPixels( struct gl_context *ctx,
                    const struct gl_pixelstore_attrib *unpack,
                    const GLvoid *pixels );
 
-extern void
-_swrast_ReadPixels( struct gl_context *ctx,
-                   GLint x, GLint y, GLsizei width, GLsizei height,
-                   GLenum format, GLenum type,
-                   const struct gl_pixelstore_attrib *unpack,
-                   GLvoid *pixels );
-
 extern void
 _swrast_BlitFramebuffer(struct gl_context *ctx,
                         GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
@@ -133,9 +160,6 @@ _swrast_BlitFramebuffer(struct gl_context *ctx,
 extern void
 _swrast_Clear(struct gl_context *ctx, GLbitfield buffers);
 
-extern void
-_swrast_Accum(struct gl_context *ctx, GLenum op, GLfloat value);
-
 
 
 /* Reset the stipple counter
@@ -182,6 +206,41 @@ _swrast_render_start( struct gl_context *ctx );
 extern void
 _swrast_render_finish( struct gl_context *ctx );
 
+extern struct gl_texture_image *
+_swrast_new_texture_image( struct gl_context *ctx );
+
+extern void
+_swrast_delete_texture_image(struct gl_context *ctx,
+                             struct gl_texture_image *texImage);
+
+extern GLboolean
+_swrast_alloc_texture_image_buffer(struct gl_context *ctx,
+                                   struct gl_texture_image *texImage,
+                                   gl_format format, GLsizei width,
+                                   GLsizei height, GLsizei depth);
+
+extern void
+_swrast_init_texture_image(struct gl_texture_image *texImage, GLsizei width,
+                           GLsizei height, GLsizei depth);
+
+extern void
+_swrast_free_texture_image_buffer(struct gl_context *ctx,
+                                  struct gl_texture_image *texImage);
+
+extern void
+_swrast_map_teximage(struct gl_context *ctx,
+                    struct gl_texture_image *texImage,
+                    GLuint slice,
+                    GLuint x, GLuint y, GLuint w, GLuint h,
+                    GLbitfield mode,
+                    GLubyte **mapOut,
+                    GLint *rowStrideOut);
+
+extern void
+_swrast_unmap_teximage(struct gl_context *ctx,
+                      struct gl_texture_image *texImage,
+                      GLuint slice);
+
 /* Tell the software rasterizer about core state changes.
  */
 extern void
@@ -206,6 +265,23 @@ extern void
 _swrast_eject_texture_images(struct gl_context *ctx);
 
 
+extern void
+_swrast_render_texture(struct gl_context *ctx,
+                       struct gl_framebuffer *fb,
+                       struct gl_renderbuffer_attachment *att);
+
+extern void
+_swrast_finish_render_texture(struct gl_context *ctx,
+                              struct gl_renderbuffer_attachment *att);
+
+
+
+extern GLboolean
+_swrast_AllocTextureStorage(struct gl_context *ctx,
+                            struct gl_texture_object *texObj,
+                            GLsizei levels, GLsizei width,
+                            GLsizei height, GLsizei depth);
+
 
 /**
  * The driver interface for the software rasterizer.