summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/NOTES12
-rw-r--r--src/mesa/swrast/s_aaline.c6
-rw-r--r--src/mesa/swrast/s_aaline.h2
-rw-r--r--src/mesa/swrast/s_aalinetemp.h4
-rw-r--r--src/mesa/swrast/s_aatriangle.c7
-rw-r--r--src/mesa/swrast/s_aatriangle.h2
-rw-r--r--src/mesa/swrast/s_aatritemp.h2
-rw-r--r--src/mesa/swrast/s_accum.c16
-rw-r--r--src/mesa/swrast/s_accum.h2
-rw-r--r--src/mesa/swrast/s_alpha.c2
-rw-r--r--src/mesa/swrast/s_alpha.h2
-rw-r--r--src/mesa/swrast/s_atifragshader.c10
-rw-r--r--src/mesa/swrast/s_atifragshader.h2
-rw-r--r--src/mesa/swrast/s_bitmap.c4
-rw-r--r--src/mesa/swrast/s_blend.c26
-rw-r--r--src/mesa/swrast/s_blend.h4
-rw-r--r--src/mesa/swrast/s_blit.c8
-rw-r--r--src/mesa/swrast/s_clear.c8
-rw-r--r--src/mesa/swrast/s_context.c72
-rw-r--r--src/mesa/swrast/s_context.h34
-rw-r--r--src/mesa/swrast/s_copypix.c121
-rw-r--r--src/mesa/swrast/s_depth.c24
-rw-r--r--src/mesa/swrast/s_depth.h12
-rw-r--r--src/mesa/swrast/s_drawpix.c104
-rw-r--r--src/mesa/swrast/s_feedback.c14
-rw-r--r--src/mesa/swrast/s_feedback.h12
-rw-r--r--src/mesa/swrast/s_fog.c4
-rw-r--r--src/mesa/swrast/s_fog.h4
-rw-r--r--src/mesa/swrast/s_fragprog.c10
-rw-r--r--src/mesa/swrast/s_fragprog.h2
-rw-r--r--src/mesa/swrast/s_lines.c8
-rw-r--r--src/mesa/swrast/s_lines.h4
-rw-r--r--src/mesa/swrast/s_linetemp.h2
-rw-r--r--src/mesa/swrast/s_logic.c8
-rw-r--r--src/mesa/swrast/s_logic.h2
-rw-r--r--src/mesa/swrast/s_masking.c2
-rw-r--r--src/mesa/swrast/s_masking.h2
-rw-r--r--src/mesa/swrast/s_points.c14
-rw-r--r--src/mesa/swrast/s_points.h4
-rw-r--r--src/mesa/swrast/s_readpix.c71
-rw-r--r--src/mesa/swrast/s_span.c32
-rw-r--r--src/mesa/swrast/s_span.h16
-rw-r--r--src/mesa/swrast/s_spantemp.h14
-rw-r--r--src/mesa/swrast/s_stencil.c20
-rw-r--r--src/mesa/swrast/s_stencil.h8
-rw-r--r--src/mesa/swrast/s_texcombine.c4
-rw-r--r--src/mesa/swrast/s_texcombine.h2
-rw-r--r--src/mesa/swrast/s_texfilter.c149
-rw-r--r--src/mesa/swrast/s_texfilter.h2
-rw-r--r--src/mesa/swrast/s_triangle.c12
-rw-r--r--src/mesa/swrast/s_triangle.h6
-rw-r--r--src/mesa/swrast/s_tritemp.h2
-rw-r--r--src/mesa/swrast/s_zoom.c14
-rw-r--r--src/mesa/swrast/s_zoom.h10
-rw-r--r--src/mesa/swrast/swrast.h54
55 files changed, 390 insertions, 604 deletions
diff --git a/src/mesa/swrast/NOTES b/src/mesa/swrast/NOTES
index f906e41b955..ea373aa1272 100644
--- a/src/mesa/swrast/NOTES
+++ b/src/mesa/swrast/NOTES
@@ -21,24 +21,24 @@ STATE
To create and destroy the module:
- GLboolean _swrast_CreateContext( GLcontext *ctx );
- void _swrast_DestroyContext( GLcontext *ctx );
+ GLboolean _swrast_CreateContext( struct gl_context *ctx );
+ void _swrast_DestroyContext( struct gl_context *ctx );
This module tracks state changes internally and maintains derived
values based on the current state. For this to work, the driver
ensure the following funciton is called whenever the state changes and
the swsetup module is 'awake':
- void _swrast_InvalidateState( GLcontext *ctx, GLuint new_state );
+ void _swrast_InvalidateState( struct gl_context *ctx, GLuint new_state );
There is no explicit call to put the swrast module to sleep.
CUSTOMIZATION
- void (*choose_point)( GLcontext * );
- void (*choose_line)( GLcontext * );
- void (*choose_triangle)( GLcontext * );
+ void (*choose_point)( struct gl_context * );
+ void (*choose_line)( struct gl_context * );
+ void (*choose_triangle)( struct gl_context * );
Drivers may add additional triangle/line/point functions to swrast by
overriding these functions. It is necessary for the driver to be very
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index 6ba4604e690..65b9af06aff 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -323,7 +323,7 @@ compute_coveragef(const struct LineInfo *info,
}
-typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line,
+typedef void (*plot_func)(struct gl_context *ctx, struct LineInfo *line,
int ix, int iy);
@@ -332,7 +332,7 @@ typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line,
* Draw an AA line segment (called many times per line when stippling)
*/
static void
-segment(GLcontext *ctx,
+segment(struct gl_context *ctx,
struct LineInfo *line,
plot_func plot,
GLfloat t0, GLfloat t1)
@@ -472,7 +472,7 @@ segment(GLcontext *ctx,
void
-_swrast_choose_aa_line_function(GLcontext *ctx)
+_swrast_choose_aa_line_function(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
diff --git a/src/mesa/swrast/s_aaline.h b/src/mesa/swrast/s_aaline.h
index 922eb230e51..f7d92c52412 100644
--- a/src/mesa/swrast/s_aaline.h
+++ b/src/mesa/swrast/s_aaline.h
@@ -32,7 +32,7 @@
extern void
-_swrast_choose_aa_line_function(GLcontext *ctx);
+_swrast_choose_aa_line_function(struct gl_context *ctx);
#endif
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index c28d47a671d..d99d9d3d904 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -34,7 +34,7 @@
* \param iy - integer fragment window Y coordiante
*/
static void
-NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
+NAME(plot)(struct gl_context *ctx, struct LineInfo *line, int ix, int iy)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLfloat fx = (GLfloat) ix;
@@ -103,7 +103,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
* Line setup
*/
static void
-NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
+NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLfloat tStart, tEnd; /* segment start, end along line length */
diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c
index 1d90f322a3a..c597808e40e 100644
--- a/src/mesa/swrast/s_aatriangle.c
+++ b/src/mesa/swrast/s_aatriangle.c
@@ -31,7 +31,6 @@
#include "main/glheader.h"
#include "main/context.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "main/macros.h"
#include "main/imports.h"
#include "s_aatriangle.h"
@@ -269,7 +268,7 @@ compute_coveragef(const GLfloat v0[3], const GLfloat v1[3],
static void
-rgba_aa_tri(GLcontext *ctx,
+rgba_aa_tri(struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2)
@@ -280,7 +279,7 @@ rgba_aa_tri(GLcontext *ctx,
static void
-general_aa_tri(GLcontext *ctx,
+general_aa_tri(struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2)
@@ -297,7 +296,7 @@ general_aa_tri(GLcontext *ctx,
* appropriate antialiased triangle rasterizer function.
*/
void
-_swrast_set_aa_triangle_function(GLcontext *ctx)
+_swrast_set_aa_triangle_function(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
diff --git a/src/mesa/swrast/s_aatriangle.h b/src/mesa/swrast/s_aatriangle.h
index 9aed41a1915..746e456f5f4 100644
--- a/src/mesa/swrast/s_aatriangle.h
+++ b/src/mesa/swrast/s_aatriangle.h
@@ -32,7 +32,7 @@
extern void
-_swrast_set_aa_triangle_function(GLcontext *ctx);
+_swrast_set_aa_triangle_function(struct gl_context *ctx);
#endif
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 5c1c6d9044b..91d4f7a10ab 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -36,7 +36,7 @@
* DO_ATTRIBS - if defined, compute texcoords, varying, etc.
*/
-/*void triangle( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
+/*void triangle( struct gl_context *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv )*/
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLfloat *p0 = v0->attrib[FRAG_ATTRIB_WPOS];
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index 854e106b7f0..88d107a17da 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -78,7 +78,7 @@
* representing the range[-1, 1].
*/
static void
-rescale_accum( GLcontext *ctx )
+rescale_accum( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_renderbuffer *rb
@@ -125,7 +125,7 @@ rescale_accum( GLcontext *ctx )
* Clear the accumulation Buffer.
*/
void
-_swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
+_swrast_clear_accum_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint x, y, width, height;
@@ -179,7 +179,7 @@ _swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
static void
-accum_add(GLcontext *ctx, GLfloat value,
+accum_add(struct gl_context *ctx, GLfloat value,
GLint xpos, GLint ypos, GLint width, GLint height )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -222,7 +222,7 @@ accum_add(GLcontext *ctx, GLfloat value,
static void
-accum_mult(GLcontext *ctx, GLfloat mult,
+accum_mult(struct gl_context *ctx, GLfloat mult,
GLint xpos, GLint ypos, GLint width, GLint height )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -265,7 +265,7 @@ accum_mult(GLcontext *ctx, GLfloat mult,
static void
-accum_accum(GLcontext *ctx, GLfloat value,
+accum_accum(struct gl_context *ctx, GLfloat value,
GLint xpos, GLint ypos, GLint width, GLint height )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -341,7 +341,7 @@ accum_accum(GLcontext *ctx, GLfloat value,
static void
-accum_load(GLcontext *ctx, GLfloat value,
+accum_load(struct gl_context *ctx, GLfloat value,
GLint xpos, GLint ypos, GLint width, GLint height )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -423,7 +423,7 @@ accum_load(GLcontext *ctx, GLfloat value,
static void
-accum_return(GLcontext *ctx, GLfloat value,
+accum_return(struct gl_context *ctx, GLfloat value,
GLint xpos, GLint ypos, GLint width, GLint height )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -540,7 +540,7 @@ accum_return(GLcontext *ctx, GLfloat value,
* Software fallback for glAccum.
*/
void
-_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value)
+_swrast_Accum(struct gl_context *ctx, GLenum op, GLfloat value)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLint xpos, ypos, width, height;
diff --git a/src/mesa/swrast/s_accum.h b/src/mesa/swrast/s_accum.h
index 42e38cf02b3..071644b64fa 100644
--- a/src/mesa/swrast/s_accum.h
+++ b/src/mesa/swrast/s_accum.h
@@ -31,7 +31,7 @@
extern void
-_swrast_clear_accum_buffer(GLcontext *ctx, struct gl_renderbuffer *rb);
+_swrast_clear_accum_buffer(struct gl_context *ctx, struct gl_renderbuffer *rb);
#endif
diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c
index 509477433a5..df2181ba968 100644
--- a/src/mesa/swrast/s_alpha.c
+++ b/src/mesa/swrast/s_alpha.c
@@ -90,7 +90,7 @@ do { \
* 1 if one or more pixels passed the alpha test.
*/
GLint
-_swrast_alpha_test(const GLcontext *ctx, SWspan *span)
+_swrast_alpha_test(const struct gl_context *ctx, SWspan *span)
{
const GLuint n = span->end;
GLubyte *mask = span->array->mask;
diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h
index 239484a9743..7cd6d800b29 100644
--- a/src/mesa/swrast/s_alpha.h
+++ b/src/mesa/swrast/s_alpha.h
@@ -33,7 +33,7 @@
extern GLint
-_swrast_alpha_test( const GLcontext *ctx, SWspan *span );
+_swrast_alpha_test( const struct gl_context *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 1338b6802d4..1eb026e0092 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -43,7 +43,7 @@ struct atifs_machine
* Fetch a texel.
*/
static void
-fetch_texel(GLcontext * ctx, const GLfloat texcoord[4], GLfloat lambda,
+fetch_texel(struct gl_context * ctx, const GLfloat texcoord[4], GLfloat lambda,
GLuint unit, GLfloat color[4])
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -272,7 +272,7 @@ handle_pass_op(struct atifs_machine *machine, struct atifs_setupinst *texinst,
}
static void
-handle_sample_op(GLcontext * ctx, struct atifs_machine *machine,
+handle_sample_op(struct gl_context * ctx, struct atifs_machine *machine,
struct atifs_setupinst *texinst, const SWspan *span,
GLuint column, GLuint idx)
{
@@ -311,7 +311,7 @@ do { \
* \param column - which pixel [i] we're operating on in the span
*/
static void
-execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
+execute_shader(struct gl_context *ctx, const struct ati_fragment_shader *shader,
struct atifs_machine *machine, const SWspan *span,
GLuint column)
{
@@ -555,7 +555,7 @@ execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
* Init fragment shader virtual machine state.
*/
static void
-init_machine(GLcontext * ctx, struct atifs_machine *machine,
+init_machine(struct gl_context * ctx, struct atifs_machine *machine,
const struct ati_fragment_shader *shader,
const SWspan *span, GLuint col)
{
@@ -577,7 +577,7 @@ init_machine(GLcontext * ctx, struct atifs_machine *machine,
* Execute the current ATI shader program, operating on the given span.
*/
void
-_swrast_exec_fragment_shader(GLcontext * ctx, SWspan *span)
+_swrast_exec_fragment_shader(struct gl_context * ctx, SWspan *span)
{
const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current;
struct atifs_machine machine;
diff --git a/src/mesa/swrast/s_atifragshader.h b/src/mesa/swrast/s_atifragshader.h
index cce455a0465..39a6e64ed92 100644
--- a/src/mesa/swrast/s_atifragshader.h
+++ b/src/mesa/swrast/s_atifragshader.h
@@ -32,7 +32,7 @@
extern void
-_swrast_exec_fragment_shader( GLcontext *ctx, SWspan *span );
+_swrast_exec_fragment_shader( struct gl_context *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index da730213aca..21488d3ba3e 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -45,7 +45,7 @@
* All parameter error checking will have been done before this is called.
*/
void
-_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
+_swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py,
GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap )
@@ -144,7 +144,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
* draw or skip.
*/
void
-_swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
+_swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py,
GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap )
diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index 5b090c72c79..1a550c445d3 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -70,7 +70,7 @@
* Any chanType ok.
*/
static void _BLENDAPI
-blend_noop(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_noop(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLint bytes;
@@ -98,7 +98,7 @@ blend_noop(GLcontext *ctx, GLuint n, const GLubyte mask[],
* Any chanType ok.
*/
static void _BLENDAPI
-blend_replace(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_replace(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
ASSERT(ctx->Color.BlendEquationRGB == GL_FUNC_ADD);
@@ -118,7 +118,7 @@ blend_replace(GLcontext *ctx, GLuint n, const GLubyte mask[],
* glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).
*/
static void _BLENDAPI
-blend_transparency_ubyte(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_transparency_ubyte(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLubyte (*rgba)[4] = (GLubyte (*)[4]) src;
@@ -163,7 +163,7 @@ blend_transparency_ubyte(GLcontext *ctx, GLuint n, const GLubyte mask[],
static void _BLENDAPI
-blend_transparency_ushort(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_transparency_ushort(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLushort (*rgba)[4] = (GLushort (*)[4]) src;
@@ -201,7 +201,7 @@ blend_transparency_ushort(GLcontext *ctx, GLuint n, const GLubyte mask[],
static void _BLENDAPI
-blend_transparency_float(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_transparency_float(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLfloat (*rgba)[4] = (GLfloat (*)[4]) src;
@@ -243,7 +243,7 @@ blend_transparency_float(GLcontext *ctx, GLuint n, const GLubyte mask[],
* Any chanType ok.
*/
static void _BLENDAPI
-blend_add(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_add(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
@@ -309,7 +309,7 @@ blend_add(GLcontext *ctx, GLuint n, const GLubyte mask[],
* Any chanType ok.
*/
static void _BLENDAPI
-blend_min(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_min(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
@@ -362,7 +362,7 @@ blend_min(GLcontext *ctx, GLuint n, const GLubyte mask[],
* Any chanType ok.
*/
static void _BLENDAPI
-blend_max(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_max(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
@@ -416,7 +416,7 @@ blend_max(GLcontext *ctx, GLuint n, const GLubyte mask[],
* Any chanType ok.
*/
static void _BLENDAPI
-blend_modulate(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_modulate(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst, GLenum chanType)
{
GLuint i;
@@ -471,7 +471,7 @@ blend_modulate(GLcontext *ctx, GLuint n, const GLubyte mask[],
* \param dest array of pixels from the dest color buffer
*/
static void
-blend_general_float(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_general_float(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLfloat rgba[][4], GLfloat dest[][4],
GLenum chanType)
{
@@ -816,7 +816,7 @@ blend_general_float(GLcontext *ctx, GLuint n, const GLubyte mask[],
* Do any blending operation, any chanType.
*/
static void
-blend_general(GLcontext *ctx, GLuint n, const GLubyte mask[],
+blend_general(struct gl_context *ctx, GLuint n, const GLubyte mask[],
void *src, const void *dst, GLenum chanType)
{
GLfloat rgbaF[MAX_WIDTH][4], destF[MAX_WIDTH][4];
@@ -892,7 +892,7 @@ blend_general(GLcontext *ctx, GLuint n, const GLubyte mask[],
* Result: the ctx->Color.BlendFunc pointer is updated.
*/
void
-_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType)
+_swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLenum eq = ctx->Color.BlendEquationRGB;
@@ -985,7 +985,7 @@ _swrast_choose_blend_func(GLcontext *ctx, GLenum chanType)
* pixel coordinates.
*/
void
-_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span)
+_swrast_blend_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *span)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
void *rbPixels;
diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h
index 9cedde3bf20..8b06dd5031e 100644
--- a/src/mesa/swrast/s_blend.h
+++ b/src/mesa/swrast/s_blend.h
@@ -32,11 +32,11 @@
extern void
-_swrast_blend_span(GLcontext *ctx, struct gl_renderbuffer *rb, SWspan *span);
+_swrast_blend_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *span);
extern void
-_swrast_choose_blend_func(GLcontext *ctx, GLenum chanType);
+_swrast_choose_blend_func(struct gl_context *ctx, GLenum chanType);
#endif
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
index 753f3136f55..d943e09b29f 100644
--- a/src/mesa/swrast/s_blit.c
+++ b/src/mesa/swrast/s_blit.c
@@ -103,7 +103,7 @@ RESAMPLE(resample_row_16, GLuint, 4)
* Blit color, depth or stencil with GL_NEAREST filtering.
*/
static void
-blit_nearest(GLcontext *ctx,
+blit_nearest(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield buffer)
@@ -316,7 +316,7 @@ resample_linear_row_ub(GLint srcWidth, GLint dstWidth,
* Bilinear filtered blit (color only).
*/
static void
-blit_linear(GLcontext *ctx,
+blit_linear(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1)
{
@@ -455,7 +455,7 @@ blit_linear(GLcontext *ctx,
* XXX we could easily support vertical flipping here.
*/
static void
-simple_blit(GLcontext *ctx,
+simple_blit(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield buffer)
@@ -556,7 +556,7 @@ simple_blit(GLcontext *ctx,
* Software fallback for glBlitFramebufferEXT().
*/
void
-_swrast_BlitFramebuffer(GLcontext *ctx,
+_swrast_BlitFramebuffer(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter)
diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c
index efe500ae2b1..75805f9605d 100644
--- a/src/mesa/swrast/s_clear.c
+++ b/src/mesa/swrast/s_clear.c
@@ -40,7 +40,7 @@
* Clear the color buffer when glColorMask is in effect.
*/
static void
-clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb,
+clear_rgba_buffer_with_masking(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint buf)
{
const GLint x = ctx->DrawBuffer->_Xmin;
@@ -106,7 +106,7 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb,
* Clear an rgba color buffer without channel masking.
*/
static void
-clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint buf)
+clear_rgba_buffer(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint buf)
{
const GLint x = ctx->DrawBuffer->_Xmin;
const GLint y = ctx->DrawBuffer->_Ymin;
@@ -159,7 +159,7 @@ clear_rgba_buffer(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint buf)
* clear its own color buffers for some reason (such as with masking).
*/
static void
-clear_color_buffers(GLcontext *ctx)
+clear_color_buffers(struct gl_context *ctx)
{
GLuint buf;
@@ -186,7 +186,7 @@ clear_color_buffers(GLcontext *ctx)
* \param all if GL_TRUE, clear whole buffer, else clear specified region.
*/
void
-_swrast_Clear(GLcontext *ctx, GLbitfield buffers)
+_swrast_Clear(struct gl_context *ctx, GLbitfield buffers)
{
#ifdef DEBUG_FOO
{
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index f76a2b68ecd..491fcfcdbbf 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -50,7 +50,7 @@
* stenciling, logic-op, fog, etc?).
*/
static void
-_swrast_update_rasterflags( GLcontext *ctx )
+_swrast_update_rasterflags( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLbitfield rasterMask = 0;
@@ -129,7 +129,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
* factors in.
*/
static void
-_swrast_update_polygon( GLcontext *ctx )
+_swrast_update_polygon( struct gl_context *ctx )
{
GLfloat backface_sign;
@@ -165,7 +165,7 @@ _swrast_update_polygon( GLcontext *ctx )
* fog blend factors (from the fog coords) per-fragment.
*/
static void
-_swrast_update_fog_hint( GLcontext *ctx )
+_swrast_update_fog_hint( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
swrast->_PreferPixelFog = (!swrast->AllowVertexFog ||
@@ -180,7 +180,7 @@ _swrast_update_fog_hint( GLcontext *ctx )
* Update the swrast->_TextureCombinePrimary flag.
*/
static void
-_swrast_update_texture_env( GLcontext *ctx )
+_swrast_update_texture_env( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint i;
@@ -211,7 +211,7 @@ _swrast_update_texture_env( GLcontext *ctx )
* lots of fragments.
*/
static void
-_swrast_update_deferred_texture(GLcontext *ctx)
+_swrast_update_deferred_texture(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (ctx->Color.AlphaEnabled) {
@@ -243,7 +243,7 @@ _swrast_update_deferred_texture(GLcontext *ctx)
* Update swrast->_FogColor and swrast->_FogEnable values.
*/
static void
-_swrast_update_fog_state( GLcontext *ctx )
+_swrast_update_fog_state( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
@@ -268,7 +268,7 @@ _swrast_update_fog_state( GLcontext *ctx )
* program parameters with current state values.
*/
static void
-_swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState)
+_swrast_update_fragment_program(struct gl_context *ctx, GLbitfield newState)
{
const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
if (fp) {
@@ -282,7 +282,7 @@ _swrast_update_fragment_program(GLcontext *ctx, GLbitfield newState)
* add per vertex instead of per-fragment.
*/
static void
-_swrast_update_specular_vertex_add(GLcontext *ctx)
+_swrast_update_specular_vertex_add(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLboolean separateSpecular = ctx->Fog.ColorSumEnabled ||
@@ -346,7 +346,7 @@ _swrast_update_specular_vertex_add(GLcontext *ctx)
* after a state change.
*/
static void
-_swrast_validate_triangle( GLcontext *ctx,
+_swrast_validate_triangle( struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2 )
@@ -371,7 +371,7 @@ _swrast_validate_triangle( GLcontext *ctx,
* line routine. Then call it.
*/
static void
-_swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
+_swrast_validate_line( struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1 )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -392,7 +392,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
* point routine. Then call it.
*/
static void
-_swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
+_swrast_validate_point( struct gl_context *ctx, const SWvertex *v0 )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -413,7 +413,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 )
* function, then call it.
*/
static void _ASMAPI
-_swrast_validate_blend_func(GLcontext *ctx, GLuint n, const GLubyte mask[],
+_swrast_validate_blend_func(struct gl_context *ctx, GLuint n, const GLubyte mask[],
GLvoid *src, const GLvoid *dst,
GLenum chanType )
{
@@ -431,7 +431,7 @@ _swrast_validate_blend_func(GLcontext *ctx, GLuint n, const GLubyte mask[],
* for subsequent rendering.
*/
static void
-_swrast_validate_texture_images(GLcontext *ctx)
+_swrast_validate_texture_images(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint u;
@@ -470,7 +470,7 @@ _swrast_validate_texture_images(GLcontext *ctx)
* from software to hardware rendering.
*/
void
-_swrast_eject_texture_images(GLcontext *ctx)
+_swrast_eject_texture_images(struct gl_context *ctx)
{
GLuint u;
@@ -504,14 +504,14 @@ _swrast_eject_texture_images(GLcontext *ctx)
static void
-_swrast_sleep( GLcontext *ctx, GLbitfield new_state )
+_swrast_sleep( struct gl_context *ctx, GLbitfield new_state )
{
(void) ctx; (void) new_state;
}
static void
-_swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state )
+_swrast_invalidate_state( struct gl_context *ctx, GLbitfield new_state )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint i;
@@ -546,7 +546,7 @@ _swrast_invalidate_state( GLcontext *ctx, GLbitfield new_state )
void
-_swrast_update_texture_samplers(GLcontext *ctx)
+_swrast_update_texture_samplers(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint u;
@@ -569,7 +569,7 @@ _swrast_update_texture_samplers(GLcontext *ctx)
* swrast->_ActiveAtttribMask.
*/
static void
-_swrast_update_active_attribs(GLcontext *ctx)
+_swrast_update_active_attribs(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint attribsMask;
@@ -626,7 +626,7 @@ _swrast_update_active_attribs(GLcontext *ctx)
void
-_swrast_validate_derived( GLcontext *ctx )
+_swrast_validate_derived( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -681,7 +681,7 @@ _swrast_validate_derived( GLcontext *ctx )
/* Public entrypoints: See also s_accum.c, s_bitmap.c, etc.
*/
void
-_swrast_Quad( GLcontext *ctx,
+_swrast_Quad( struct gl_context *ctx,
const SWvertex *v0, const SWvertex *v1,
const SWvertex *v2, const SWvertex *v3 )
{
@@ -697,7 +697,7 @@ _swrast_Quad( GLcontext *ctx,
}
void
-_swrast_Triangle( GLcontext *ctx, const SWvertex *v0,
+_swrast_Triangle( struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2 )
{
if (SWRAST_DEBUG) {
@@ -710,7 +710,7 @@ _swrast_Triangle( GLcontext *ctx, const SWvertex *v0,
}
void
-_swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
+_swrast_Line( struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1 )
{
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_Line\n");
@@ -721,7 +721,7 @@ _swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
}
void
-_swrast_Point( GLcontext *ctx, const SWvertex *v0 )
+_swrast_Point( struct gl_context *ctx, const SWvertex *v0 )
{
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_Point\n");
@@ -731,7 +731,7 @@ _swrast_Point( GLcontext *ctx, const SWvertex *v0 )
}
void
-_swrast_InvalidateState( GLcontext *ctx, GLbitfield new_state )
+_swrast_InvalidateState( struct gl_context *ctx, GLbitfield new_state )
{
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_InvalidateState\n");
@@ -740,7 +740,7 @@ _swrast_InvalidateState( GLcontext *ctx, GLbitfield new_state )
}
void
-_swrast_ResetLineStipple( GLcontext *ctx )
+_swrast_ResetLineStipple( struct gl_context *ctx )
{
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_ResetLineStipple\n");
@@ -749,13 +749,13 @@ _swrast_ResetLineStipple( GLcontext *ctx )
}
void
-_swrast_SetFacing(GLcontext *ctx, GLuint facing)
+_swrast_SetFacing(struct gl_context *ctx, GLuint facing)
{
SWRAST_CONTEXT(ctx)->PointLineFacing = facing;
}
void
-_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
+_swrast_allow_vertex_fog( struct gl_context *ctx, GLboolean value )
{
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_allow_vertex_fog %d\n", value);
@@ -765,7 +765,7 @@ _swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
}
void
-_swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value )
+_swrast_allow_pixel_fog( struct gl_context *ctx, GLboolean value )
{
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_allow_pixel_fog %d\n", value);
@@ -776,7 +776,7 @@ _swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value )
GLboolean
-_swrast_CreateContext( GLcontext *ctx )
+_swrast_CreateContext( struct gl_context *ctx )
{
GLuint i;
SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
@@ -848,7 +848,7 @@ _swrast_CreateContext( GLcontext *ctx )
}
void
-_swrast_DestroyContext( GLcontext *ctx )
+_swrast_DestroyContext( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -867,14 +867,14 @@ _swrast_DestroyContext( GLcontext *ctx )
struct swrast_device_driver *
-_swrast_GetDeviceDriverReference( GLcontext *ctx )
+_swrast_GetDeviceDriverReference( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
return &swrast->Driver;
}
void
-_swrast_flush( GLcontext *ctx )
+_swrast_flush( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
/* flush any pending fragments from rendering points */
@@ -885,7 +885,7 @@ _swrast_flush( GLcontext *ctx )
}
void
-_swrast_render_primitive( GLcontext *ctx, GLenum prim )
+_swrast_render_primitive( struct gl_context *ctx, GLenum prim )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->Primitive == GL_POINTS && prim != GL_POINTS) {
@@ -896,7 +896,7 @@ _swrast_render_primitive( GLcontext *ctx, GLenum prim )
void
-_swrast_render_start( GLcontext *ctx )
+_swrast_render_start( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->Driver.SpanRenderStart)
@@ -905,7 +905,7 @@ _swrast_render_start( GLcontext *ctx )
}
void
-_swrast_render_finish( GLcontext *ctx )
+_swrast_render_finish( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->Driver.SpanRenderFinish)
@@ -918,7 +918,7 @@ _swrast_render_finish( GLcontext *ctx )
#define SWRAST_DEBUG_VERTICES 0
void
-_swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
+_swrast_print_vertex( struct gl_context *ctx, const SWvertex *v )
{
GLuint i;
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index 6d81f74768f..5dbdd609adb 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -50,26 +50,26 @@
#include "s_span.h"
-typedef void (*texture_sample_func)(GLcontext *ctx,
+typedef void (*texture_sample_func)(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4]);
-typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n,
+typedef void (_ASMAPIP blend_func)( struct gl_context *ctx, GLuint n,
const GLubyte mask[],
GLvoid *src, const GLvoid *dst,
GLenum chanType);
-typedef void (*swrast_point_func)( GLcontext *ctx, const SWvertex *);
+typedef void (*swrast_point_func)( struct gl_context *ctx, const SWvertex *);
-typedef void (*swrast_line_func)( GLcontext *ctx,
+typedef void (*swrast_line_func)( struct gl_context *ctx,
const SWvertex *, const SWvertex *);
-typedef void (*swrast_tri_func)( GLcontext *ctx, const SWvertex *,
+typedef void (*swrast_tri_func)( struct gl_context *ctx, const SWvertex *,
const SWvertex *, const SWvertex *);
-typedef void (*validate_texture_image_func)(GLcontext *ctx,
+typedef void (*validate_texture_image_func)(struct gl_context *ctx,
struct gl_texture_object *texObj,
GLuint face, GLuint level);
@@ -160,7 +160,7 @@ typedef struct
GLenum Primitive; /* current primitive being drawn (ala glBegin) */
GLboolean SpecularVertexAdd; /**< Add specular/secondary color per vertex */
- void (*InvalidateState)( GLcontext *ctx, GLbitfield new_state );
+ void (*InvalidateState)( struct gl_context *ctx, GLbitfield new_state );
/**
* When the NewState mask intersects these masks, we invalidate the
@@ -177,9 +177,9 @@ typedef struct
* Will be called when the GL state change mask intersects the above masks.
*/
/*@{*/
- void (*choose_point)( GLcontext * );
- void (*choose_line)( GLcontext * );
- void (*choose_triangle)( GLcontext * );
+ void (*choose_point)( struct gl_context * );
+ void (*choose_line)( struct gl_context * );
+ void (*choose_triangle)( struct gl_context * );
/*@}*/
/**
@@ -234,22 +234,22 @@ typedef struct
extern void
-_swrast_validate_derived( GLcontext *ctx );
+_swrast_validate_derived( struct gl_context *ctx );
extern void
-_swrast_update_texture_samplers(GLcontext *ctx);
+_swrast_update_texture_samplers(struct gl_context *ctx);
-/** Return SWcontext for the given GLcontext */
+/** Return SWcontext for the given struct gl_context */
static INLINE SWcontext *
-SWRAST_CONTEXT(GLcontext *ctx)
+SWRAST_CONTEXT(struct gl_context *ctx)
{
return (SWcontext *) ctx->swrast_context;
}
/** const version of above */
static INLINE const SWcontext *
-CONST_SWRAST_CONTEXT(const GLcontext *ctx)
+CONST_SWRAST_CONTEXT(const struct gl_context *ctx)
{
return (const SWcontext *) ctx->swrast_context;
}
@@ -261,7 +261,7 @@ CONST_SWRAST_CONTEXT(const GLcontext *ctx)
* driver's opportunity to map renderbuffers and textures.
*/
static INLINE void
-swrast_render_start(GLcontext *ctx)
+swrast_render_start(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->Driver.SpanRenderStart)
@@ -271,7 +271,7 @@ swrast_render_start(GLcontext *ctx)
/** Called after framebuffer reading/writing */
static INLINE void
-swrast_render_finish(GLcontext *ctx)
+swrast_render_finish(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (swrast->Driver.SpanRenderFinish)
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index f4f0c8a330e..86fe3e0a891 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -27,7 +27,6 @@
#include "main/context.h"
#include "main/colormac.h"
#include "main/condrender.h"
-#include "main/convolve.h"
#include "main/image.h"
#include "main/macros.h"
#include "main/imports.h"
@@ -94,106 +93,10 @@ regions_overlap(GLint srcx, GLint srcy,
/**
- * RGBA copypixels with convolution.
- */
-static void
-copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
- GLint width, GLint height, GLint destx, GLint desty)
-{
- GLint row;
- const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
- const GLbitfield transferOps = ctx->_ImageTransferState;
- const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink)
- || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink);
- GLfloat *dest, *tmpImage, *convImage;
- SWspan span;
-
- INIT_SPAN(span, GL_BITMAP);
- _swrast_span_default_attribs(ctx, &span);
- span.arrayMask = SPAN_RGBA;
- span.arrayAttribs = FRAG_BIT_COL0;
-
- /* allocate space for GLfloat image */
- tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!tmpImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels");
- return;
- }
- convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!convImage) {
- free(tmpImage);
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels");
- return;
- }
-
- /* read source image as float/RGBA */
- dest = tmpImage;
- for (row = 0; row < height; row++) {
- _swrast_read_rgba_span(ctx, ctx->ReadBuffer->_ColorReadBuffer,
- width, srcx, srcy + row, GL_FLOAT, dest);
- dest += 4 * width;
- }
-
- /* do the image transfer ops which preceed convolution */
- for (row = 0; row < height; row++) {
- GLfloat (*rgba)[4] = (GLfloat (*)[4]) (tmpImage + row * width * 4);
- _mesa_apply_rgba_transfer_ops(ctx,
- transferOps & IMAGE_PRE_CONVOLUTION_BITS,
- width, rgba);
- }
-
- /* do convolution */
- if (ctx->Pixel.Convolution2DEnabled) {
- _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage);
- }
- else {
- ASSERT(ctx->Pixel.Separable2DEnabled);
- _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage);
- }
- free(tmpImage);
-
- /* do remaining post-convolution image transfer ops */
- for (row = 0; row < height; row++) {
- GLfloat (*rgba)[4] = (GLfloat (*)[4]) (convImage + row * width * 4);
- _mesa_apply_rgba_transfer_ops(ctx,
- transferOps & IMAGE_POST_CONVOLUTION_BITS,
- width, rgba);
- }
-
- if (!sink) {
- /* write the new image */
- for (row = 0; row < height; row++) {
- const GLfloat *src = convImage + row * width * 4;
- GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0];
-
- /* copy convolved colors into span array */
- memcpy(rgba, src, width * 4 * sizeof(GLfloat));
-
- /* write span */
- span.x = destx;
- span.y = desty + row;
- span.end = width;
- span.array->ChanType = GL_FLOAT;
- if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, destx, desty, &span, rgba);
- }
- else {
- _swrast_write_rgba_span(ctx, &span);
- }
- }
- /* restore this */
- span.array->ChanType = CHAN_TYPE;
- }
-
- free(convImage);
-}
-
-
-/**
* RGBA copypixels
*/
static void
-copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
+copy_rgba_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
GLint width, GLint height, GLint destx, GLint desty)
{
GLfloat *tmpImage, *p;
@@ -208,16 +111,6 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
return;
}
- if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
- copy_conv_rgba_pixels(ctx, srcx, srcy, width, height, destx, desty);
- return;
- }
- else if (ctx->Pixel.Convolution1DEnabled) {
- /* make sure we don't apply 1D convolution */
- transferOps &= ~(IMAGE_CONVOLUTION_BIT |
- IMAGE_POST_CONVOLUTION_SCALE_BIAS);
- }
-
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
@@ -312,7 +205,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
* Z scale and bias.
*/
static void
-scale_and_bias_z(GLcontext *ctx, GLuint width,
+scale_and_bias_z(struct gl_context *ctx, GLuint width,
const GLfloat depth[], GLuint z[])
{
const GLuint depthMax = ctx->DrawBuffer->_DepthMax;
@@ -347,7 +240,7 @@ scale_and_bias_z(GLcontext *ctx, GLuint width,
* TODO: Optimize!!!!
*/
static void
-copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
+copy_depth_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
GLint width, GLint height,
GLint destx, GLint desty )
{
@@ -441,7 +334,7 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
static void
-copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
+copy_stencil_pixels( struct gl_context *ctx, GLint srcx, GLint srcy,
GLint width, GLint height,
GLint destx, GLint desty )
{
@@ -534,7 +427,7 @@ copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
* CopyPixels function.
*/
static void
-copy_depth_stencil_pixels(GLcontext *ctx,
+copy_depth_stencil_pixels(struct gl_context *ctx,
const GLint srcX, const GLint srcY,
const GLint width, const GLint height,
const GLint destX, const GLint destY)
@@ -709,7 +602,7 @@ copy_depth_stencil_pixels(GLcontext *ctx,
* Try to do a fast copy pixels.
*/
static GLboolean
-fast_copy_pixels(GLcontext *ctx,
+fast_copy_pixels(struct gl_context *ctx,
GLint srcX, GLint srcY, GLsizei width, GLsizei height,
GLint dstX, GLint dstY, GLenum type)
{
@@ -791,7 +684,7 @@ fast_copy_pixels(GLcontext *ctx,
* By time we get here, all parameters will have been error-checked.
*/
void
-_swrast_CopyPixels( GLcontext *ctx,
+_swrast_CopyPixels( struct gl_context *ctx,
GLint srcx, GLint srcy, GLsizei width, GLsizei height,
GLint destx, GLint desty, GLenum type )
{
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index f952fd6baa7..58440cb97bd 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -40,7 +40,7 @@
* Return: number of fragments which pass the test.
*/
static GLuint
-depth_test_span16( GLcontext *ctx, GLuint n,
+depth_test_span16( struct gl_context *ctx, GLuint n,
GLushort zbuffer[], const GLuint z[], GLubyte mask[] )
{
GLuint passed = 0;
@@ -269,7 +269,7 @@ depth_test_span16( GLcontext *ctx, GLuint n,
static GLuint
-depth_test_span32( GLcontext *ctx, GLuint n,
+depth_test_span32( struct gl_context *ctx, GLuint n,
GLuint zbuffer[], const GLuint z[], GLubyte mask[] )
{
GLuint passed = 0;
@@ -506,7 +506,7 @@ depth_test_span32( GLcontext *ctx, GLuint n,
* [0,1] range.
*/
void
-_swrast_depth_clamp_span( GLcontext *ctx, SWspan *span )
+_swrast_depth_clamp_span( struct gl_context *ctx, SWspan *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
const GLuint count = span->end;
@@ -552,7 +552,7 @@ _swrast_depth_clamp_span( GLcontext *ctx, SWspan *span )
* Apply depth test to span of fragments.
*/
static GLuint
-depth_test_span( GLcontext *ctx, SWspan *span)
+depth_test_span( struct gl_context *ctx, SWspan *span)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_DepthBuffer;
@@ -610,7 +610,7 @@ depth_test_span( GLcontext *ctx, SWspan *span)
* Do depth testing for an array of fragments at assorted locations.
*/
static void
-direct_depth_test_pixels16(GLcontext *ctx, GLushort *zStart, GLuint stride,
+direct_depth_test_pixels16(struct gl_context *ctx, GLushort *zStart, GLuint stride,
GLuint n, const GLint x[], const GLint y[],
const GLuint z[], GLubyte mask[] )
{
@@ -856,7 +856,7 @@ direct_depth_test_pixels16(GLcontext *ctx, GLushort *zStart, GLuint stride,
* Do depth testing for an array of fragments with direct access to zbuffer.
*/
static void
-direct_depth_test_pixels32(GLcontext *ctx, GLuint *zStart, GLuint stride,
+direct_depth_test_pixels32(struct gl_context *ctx, GLuint *zStart, GLuint stride,
GLuint n, const GLint x[], const GLint y[],
const GLuint z[], GLubyte mask[] )
{
@@ -1100,7 +1100,7 @@ direct_depth_test_pixels32(GLcontext *ctx, GLuint *zStart, GLuint stride,
static GLuint
-depth_test_pixels( GLcontext *ctx, SWspan *span )
+depth_test_pixels( struct gl_context *ctx, SWspan *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_DepthBuffer;
@@ -1150,7 +1150,7 @@ depth_test_pixels( GLcontext *ctx, SWspan *span )
* \return approx number of pixels that passed (only zero is reliable)
*/
GLuint
-_swrast_depth_test_span( GLcontext *ctx, SWspan *span)
+_swrast_depth_test_span( struct gl_context *ctx, SWspan *span)
{
if (span->arrayMask & SPAN_XY)
return depth_test_pixels(ctx, span);
@@ -1167,7 +1167,7 @@ _swrast_depth_test_span( GLcontext *ctx, SWspan *span)
* \return GL_TRUE if any fragments pass, GL_FALSE if no fragments pass
*/
GLboolean
-_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span )
+_swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_DepthBuffer;
@@ -1252,7 +1252,7 @@ _swrast_depth_bounds_test( GLcontext *ctx, SWspan *span )
* _swrast_ReadPixels.
*/
void
-_swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_depth_span_float( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLfloat depth[] )
{
const GLfloat scale = 1.0F / ctx->DrawBuffer->_DepthMaxF;
@@ -1318,7 +1318,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb,
* As above, but return 32-bit GLuint values.
*/
void
-_swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_depth_span_uint( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLuint depth[] )
{
GLuint depthBits;
@@ -1400,7 +1400,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb,
* Clear the given z/depth renderbuffer.
*/
void
-_swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
+_swrast_clear_depth_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb )
{
GLuint clearValue;
GLint x, y, width, height;
diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h
index 878d242f5e5..e5dae7ef865 100644
--- a/src/mesa/swrast/s_depth.h
+++ b/src/mesa/swrast/s_depth.h
@@ -32,27 +32,27 @@
extern GLuint
-_swrast_depth_test_span( GLcontext *ctx, SWspan *span);
+_swrast_depth_test_span( struct gl_context *ctx, SWspan *span);
extern void
-_swrast_depth_clamp_span( GLcontext *ctx, SWspan *span );
+_swrast_depth_clamp_span( struct gl_context *ctx, SWspan *span );
extern GLboolean
-_swrast_depth_bounds_test( GLcontext *ctx, SWspan *span );
+_swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span );
extern void
-_swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_depth_span_float( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLfloat depth[] );
extern void
-_swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_depth_span_uint( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLuint depth[] );
extern void
-_swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb );
+_swrast_clear_depth_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb );
#endif
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 3cec3a7a2ba..4e7cd9414fd 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -27,7 +27,6 @@
#include "main/bufferobj.h"
#include "main/condrender.h"
#include "main/context.h"
-#include "main/convolve.h"
#include "main/image.h"
#include "main/macros.h"
#include "main/imports.h"
@@ -45,7 +44,7 @@
* Return: GL_TRUE if success, GL_FALSE if slow path must be used instead
*/
static GLboolean
-fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
+fast_draw_rgba_pixels(struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *userUnpack,
@@ -311,7 +310,7 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
* Draw stencil image.
*/
static void
-draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
+draw_stencil_pixels( struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum type,
const struct gl_pixelstore_attrib *unpack,
@@ -355,7 +354,7 @@ draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
* Draw depth image.
*/
static void
-draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
+draw_depth_pixels( struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum type,
const struct gl_pixelstore_attrib *unpack,
@@ -461,7 +460,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
* Draw RGBA image.
*/
static void
-draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
+draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack,
@@ -484,62 +483,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
span.arrayMask = SPAN_RGBA;
span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */
- if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
- /* Convolution has to be handled specially. We'll create an
- * intermediate image, applying all pixel transfer operations
- * up to convolution. Then we'll convolve the image. Then
- * we'll proceed with the rest of the transfer operations and
- * rasterize the image.
- */
- GLint row;
- GLfloat *dest, *tmpImage;
-
- tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!tmpImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
- return;
- }
- convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!convImage) {
- free(tmpImage);
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
- return;
- }
-
- /* Unpack the image and apply transfer ops up to convolution */
- dest = tmpImage;
- for (row = 0; row < height; row++) {
- const GLvoid *source = _mesa_image_address2d(unpack,
- pixels, width, height, format, type, row, 0);
- _mesa_unpack_color_span_float(ctx, width, GL_RGBA, (GLfloat *) dest,
- format, type, source, unpack,
- transferOps & IMAGE_PRE_CONVOLUTION_BITS);
- dest += width * 4;
- }
-
- /* do convolution */
- if (ctx->Pixel.Convolution2DEnabled) {
- _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage);
- }
- else {
- ASSERT(ctx->Pixel.Separable2DEnabled);
- _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage);
- }
- free(tmpImage);
-
- /* continue transfer ops and draw the convolved image */
- unpack = &ctx->DefaultPacking;
- pixels = convImage;
- format = GL_RGBA;
- type = GL_FLOAT;
- transferOps &= IMAGE_POST_CONVOLUTION_BITS;
- }
- else if (ctx->Pixel.Convolution1DEnabled) {
- /* we only want to apply 1D convolution to glTexImage1D */
- transferOps &= ~(IMAGE_CONVOLUTION_BIT |
- IMAGE_POST_CONVOLUTION_SCALE_BIAS);
- }
-
if (ctx->DrawBuffer->_NumColorDrawBuffers > 0 &&
ctx->DrawBuffer->_ColorDrawBuffers[0]->DataType != GL_FLOAT &&
ctx->Color.ClampFragmentColor != GL_FALSE) {
@@ -551,8 +494,6 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
* General solution
*/
{
- const GLboolean sink = (ctx->Pixel.MinMaxEnabled && ctx->MinMax.Sink)
- || (ctx->Pixel.HistogramEnabled && ctx->Histogram.Sink);
const GLbitfield interpMask = span.interpMask;
const GLbitfield arrayMask = span.arrayMask;
const GLint srcStride
@@ -575,24 +516,21 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
_mesa_unpack_color_span_float(ctx, spanWidth, GL_RGBA, rgba,
format, type, source, unpack,
transferOps);
- /* draw the span */
- if (!sink) {
- /* Set these for each row since the _swrast_write_* functions
- * may change them while clipping/rendering.
- */
- span.array->ChanType = GL_FLOAT;
- span.x = x + skipPixels;
- span.y = y + row;
- span.end = spanWidth;
- span.arrayMask = arrayMask;
- span.interpMask = interpMask;
- if (zoom) {
- _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba);
- }
- else {
- _swrast_write_rgba_span(ctx, &span);
- }
- }
+ /* Set these for each row since the _swrast_write_* functions
+ * may change them while clipping/rendering.
+ */
+ span.array->ChanType = GL_FLOAT;
+ span.x = x + skipPixels;
+ span.y = y + row;
+ span.end = spanWidth;
+ span.arrayMask = arrayMask;
+ span.interpMask = interpMask;
+ if (zoom) {
+ _swrast_write_zoomed_rgba_span(ctx, imgX, imgY, &span, rgba);
+ }
+ else {
+ _swrast_write_rgba_span(ctx, &span);
+ }
source += srcStride;
} /* for row */
@@ -619,7 +557,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
* color buffer(s).
*/
static void
-draw_depth_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
+draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y,
GLsizei width, GLsizei height, GLenum type,
const struct gl_pixelstore_attrib *unpack,
const GLvoid *pixels)
@@ -749,7 +687,7 @@ draw_depth_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
* By time we get here, all error checking will have been done.
*/
void
-_swrast_DrawPixels( GLcontext *ctx,
+_swrast_DrawPixels( struct gl_context *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c
index 6ac8ac73b0b..00f92d463c3 100644
--- a/src/mesa/swrast/s_feedback.c
+++ b/src/mesa/swrast/s_feedback.c
@@ -34,7 +34,7 @@
static void
-feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv)
+feedback_vertex(struct gl_context * ctx, const SWvertex * v, const SWvertex * pv)
{
GLfloat win[4];
const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0];
@@ -53,7 +53,7 @@ feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv)
* Put triangle in feedback buffer.
*/
void
-_swrast_feedback_triangle(GLcontext *ctx, const SWvertex *v0,
+_swrast_feedback_triangle(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2)
{
if (!_swrast_culltriangle(ctx, v0, v1, v2)) {
@@ -75,7 +75,7 @@ _swrast_feedback_triangle(GLcontext *ctx, const SWvertex *v0,
void
-_swrast_feedback_line(GLcontext *ctx, const SWvertex *v0,
+_swrast_feedback_line(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1)
{
GLenum token = GL_LINE_TOKEN;
@@ -100,7 +100,7 @@ _swrast_feedback_line(GLcontext *ctx, const SWvertex *v0,
void
-_swrast_feedback_point(GLcontext *ctx, const SWvertex *v)
+_swrast_feedback_point(struct gl_context *ctx, const SWvertex *v)
{
_mesa_feedback_token(ctx, (GLfloat) (GLint) GL_POINT_TOKEN);
feedback_vertex(ctx, v, v);
@@ -108,7 +108,7 @@ _swrast_feedback_point(GLcontext *ctx, const SWvertex *v)
void
-_swrast_select_triangle(GLcontext *ctx, const SWvertex *v0,
+_swrast_select_triangle(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2)
{
if (!_swrast_culltriangle(ctx, v0, v1, v2)) {
@@ -122,7 +122,7 @@ _swrast_select_triangle(GLcontext *ctx, const SWvertex *v0,
void
-_swrast_select_line(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
+_swrast_select_line(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1)
{
const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF;
_mesa_update_hitflag( ctx, v0->attrib[FRAG_ATTRIB_WPOS][2] * zs );
@@ -131,7 +131,7 @@ _swrast_select_line(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
void
-_swrast_select_point(GLcontext *ctx, const SWvertex *v)
+_swrast_select_point(struct gl_context *ctx, const SWvertex *v)
{
const GLfloat zs = 1.0F / ctx->DrawBuffer->_DepthMaxF;
_mesa_update_hitflag( ctx, v->attrib[FRAG_ATTRIB_WPOS][2] * zs );
diff --git a/src/mesa/swrast/s_feedback.h b/src/mesa/swrast/s_feedback.h
index 9feab75dbb0..6bfd49735cc 100644
--- a/src/mesa/swrast/s_feedback.h
+++ b/src/mesa/swrast/s_feedback.h
@@ -31,20 +31,20 @@
#include "swrast.h"
-extern void _swrast_feedback_point( GLcontext *ctx, const SWvertex *v );
+extern void _swrast_feedback_point( struct gl_context *ctx, const SWvertex *v );
-extern void _swrast_feedback_line( GLcontext *ctx,
+extern void _swrast_feedback_line( struct gl_context *ctx,
const SWvertex *v1, const SWvertex *v2 );
-extern void _swrast_feedback_triangle( GLcontext *ctx, const SWvertex *v0,
+extern void _swrast_feedback_triangle( struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2 );
-extern void _swrast_select_point( GLcontext *ctx, const SWvertex *v );
+extern void _swrast_select_point( struct gl_context *ctx, const SWvertex *v );
-extern void _swrast_select_line( GLcontext *ctx,
+extern void _swrast_select_line( struct gl_context *ctx,
const SWvertex *v1, const SWvertex *v2 );
-extern void _swrast_select_triangle( GLcontext *ctx, const SWvertex *v0,
+extern void _swrast_select_triangle( struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2 );
#endif
diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c
index 689500a613a..d808e2b2a2b 100644
--- a/src/mesa/swrast/s_fog.c
+++ b/src/mesa/swrast/s_fog.c
@@ -35,7 +35,7 @@
* Used to convert current raster distance to a fog factor in [0,1].
*/
GLfloat
-_swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z)
+_swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z)
{
GLfloat d, f;
@@ -129,7 +129,7 @@ else { \
* _PreferPixelFog should be in sync with that state!
*/
void
-_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span )
+_swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span )
{
const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
GLfloat rFog, gFog, bFog;
diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h
index a496746d106..ebc3513f496 100644
--- a/src/mesa/swrast/s_fog.h
+++ b/src/mesa/swrast/s_fog.h
@@ -33,9 +33,9 @@
extern GLfloat
-_swrast_z_to_fogfactor(GLcontext *ctx, GLfloat z);
+_swrast_z_to_fogfactor(struct gl_context *ctx, GLfloat z);
extern void
-_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span );
+_swrast_fog_rgba_span( const struct gl_context *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 9facb44d9bf..e421d218d79 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -62,7 +62,7 @@ swizzle_texel(const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle)
* Called via machine->FetchTexelLod()
*/
static void
-fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
+fetch_texel_lod( struct gl_context *ctx, const GLfloat texcoord[4], GLfloat lambda,
GLuint unit, GLfloat color[4] )
{
const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
@@ -92,7 +92,7 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda,
* otherwise zero.
*/
static void
-fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
+fetch_texel_deriv( struct gl_context *ctx, const GLfloat texcoord[4],
const GLfloat texdx[4], const GLfloat texdy[4],
GLfloat lodBias, GLuint unit, GLfloat color[4] )
{
@@ -140,7 +140,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4],
* \param col which element (column) of the span we'll operate on
*/
static void
-init_machine(GLcontext *ctx, struct gl_program_machine *machine,
+init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
const struct gl_fragment_program *program,
const SWspan *span, GLuint col)
{
@@ -194,7 +194,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine,
* Run fragment program on the pixels in span from 'start' to 'end' - 1.
*/
static void
-run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
+run_program(struct gl_context *ctx, SWspan *span, GLuint start, GLuint end)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
@@ -253,7 +253,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
* in the given span.
*/
void
-_swrast_exec_fragment_program( GLcontext *ctx, SWspan *span )
+_swrast_exec_fragment_program( struct gl_context *ctx, SWspan *span )
{
const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
diff --git a/src/mesa/swrast/s_fragprog.h b/src/mesa/swrast/s_fragprog.h
index 92b9d01e173..689d3fc82e4 100644
--- a/src/mesa/swrast/s_fragprog.h
+++ b/src/mesa/swrast/s_fragprog.h
@@ -32,7 +32,7 @@
extern void
-_swrast_exec_fragment_program(GLcontext *ctx, SWspan *span);
+_swrast_exec_fragment_program(struct gl_context *ctx, SWspan *span);
#endif /* S_FRAGPROG_H */
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index 7db5af4ae1c..95a2a5d96fc 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -38,7 +38,7 @@
* Init the mask[] array to implement a line stipple.
*/
static void
-compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] )
+compute_stipple_mask( struct gl_context *ctx, GLuint len, GLubyte mask[] )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint i;
@@ -60,7 +60,7 @@ compute_stipple_mask( GLcontext *ctx, GLuint len, GLubyte mask[] )
* To draw a wide line we can simply redraw the span N times, side by side.
*/
static void
-draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
+draw_wide_line( struct gl_context *ctx, SWspan *span, GLboolean xMajor )
{
const GLint width = (GLint) CLAMP(ctx->Line.Width,
ctx->Const.MinLineWidth,
@@ -160,7 +160,7 @@ draw_wide_line( GLcontext *ctx, SWspan *span, GLboolean xMajor )
void
-_swrast_add_spec_terms_line(GLcontext *ctx,
+_swrast_add_spec_terms_line(struct gl_context *ctx,
const SWvertex *v0, const SWvertex *v1)
{
SWvertex *ncv0 = (SWvertex *)v0;
@@ -222,7 +222,7 @@ do { \
* tests to this code.
*/
void
-_swrast_choose_line( GLcontext *ctx )
+_swrast_choose_line( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLboolean specular = (ctx->Fog.ColorSumEnabled ||
diff --git a/src/mesa/swrast/s_lines.h b/src/mesa/swrast/s_lines.h
index 22979a02b60..a4c98a8558b 100644
--- a/src/mesa/swrast/s_lines.h
+++ b/src/mesa/swrast/s_lines.h
@@ -30,10 +30,10 @@
#include "swrast.h"
void
-_swrast_choose_line( GLcontext *ctx );
+_swrast_choose_line( struct gl_context *ctx );
void
-_swrast_add_spec_terms_line( GLcontext *ctx,
+_swrast_add_spec_terms_line( struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1 );
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 033431df232..f9f2d293412 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -63,7 +63,7 @@
static void
-NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
+NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 )
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
SWspan span;
diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c
index c36a16e665c..b93b4b7af30 100644
--- a/src/mesa/swrast/s_logic.c
+++ b/src/mesa/swrast/s_logic.c
@@ -158,7 +158,7 @@ do { \
static INLINE void
-logicop_uint1(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
+logicop_uint1(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
const GLubyte mask[])
{
LOGIC_OP_LOOP(ctx->Color.LogicOp, 1);
@@ -166,7 +166,7 @@ logicop_uint1(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
static INLINE void
-logicop_uint2(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
+logicop_uint2(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
const GLubyte mask[])
{
LOGIC_OP_LOOP(ctx->Color.LogicOp, 2);
@@ -174,7 +174,7 @@ logicop_uint2(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
static INLINE void
-logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
+logicop_uint4(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[],
const GLubyte mask[])
{
LOGIC_OP_LOOP(ctx->Color.LogicOp, 4);
@@ -188,7 +188,7 @@ logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[],
* pixel coordinates.
*/
void
-_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
SWspan *span)
{
void *rbPixels;
diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h
index d609513348d..95c7fe3e150 100644
--- a/src/mesa/swrast/s_logic.h
+++ b/src/mesa/swrast/s_logic.h
@@ -31,7 +31,7 @@
#include "s_span.h"
extern void
-_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
SWspan *span);
diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c
index e38d90f199e..2e68f8c4bd7 100644
--- a/src/mesa/swrast/s_masking.c
+++ b/src/mesa/swrast/s_masking.c
@@ -40,7 +40,7 @@
* Apply the color mask to a span of rgba values.
*/
void
-_swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
SWspan *span, GLuint buf)
{
const GLuint n = span->end;
diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h
index cb000da0fd8..3712c82163b 100644
--- a/src/mesa/swrast/s_masking.h
+++ b/src/mesa/swrast/s_masking.h
@@ -32,7 +32,7 @@
extern void
-_swrast_mask_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_mask_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
SWspan *span, GLuint buf);
#endif
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index 12431662c47..06c6ef4ef7a 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -52,7 +52,7 @@
* Must also clamp to user-defined range and implmentation limits.
*/
static INLINE GLfloat
-get_size(const GLcontext *ctx, const SWvertex *vert, GLboolean smoothed)
+get_size(const struct gl_context *ctx, const SWvertex *vert, GLboolean smoothed)
{
GLfloat size;
@@ -80,7 +80,7 @@ get_size(const GLcontext *ctx, const SWvertex *vert, GLboolean smoothed)
* Draw a point sprite
*/
static void
-sprite_point(GLcontext *ctx, const SWvertex *vert)
+sprite_point(struct gl_context *ctx, const SWvertex *vert)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
SWspan span;
@@ -240,7 +240,7 @@ sprite_point(GLcontext *ctx, const SWvertex *vert)
* Draw smooth/antialiased point. RGB or CI mode.
*/
static void
-smooth_point(GLcontext *ctx, const SWvertex *vert)
+smooth_point(struct gl_context *ctx, const SWvertex *vert)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
SWspan span;
@@ -360,7 +360,7 @@ smooth_point(GLcontext *ctx, const SWvertex *vert)
* Draw large (size >= 1) non-AA point. RGB or CI mode.
*/
static void
-large_point(GLcontext *ctx, const SWvertex *vert)
+large_point(struct gl_context *ctx, const SWvertex *vert)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
SWspan span;
@@ -449,7 +449,7 @@ large_point(GLcontext *ctx, const SWvertex *vert)
* Draw size=1, single-pixel point
*/
static void
-pixel_point(GLcontext *ctx, const SWvertex *vert)
+pixel_point(struct gl_context *ctx, const SWvertex *vert)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
/*
@@ -513,7 +513,7 @@ pixel_point(GLcontext *ctx, const SWvertex *vert)
* primary color.
*/
void
-_swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0)
+_swrast_add_spec_terms_point(struct gl_context *ctx, const SWvertex *v0)
{
SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */
GLfloat rSum, gSum, bSum;
@@ -539,7 +539,7 @@ _swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0)
* Examine current state to determine which point drawing function to use.
*/
void
-_swrast_choose_point(GLcontext *ctx)
+_swrast_choose_point(struct gl_context *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLfloat size = CLAMP(ctx->Point.Size,
diff --git a/src/mesa/swrast/s_points.h b/src/mesa/swrast/s_points.h
index 9e39c601efb..0b6550e8018 100644
--- a/src/mesa/swrast/s_points.h
+++ b/src/mesa/swrast/s_points.h
@@ -30,10 +30,10 @@
#include "swrast.h"
extern void
-_swrast_choose_point( GLcontext *ctx );
+_swrast_choose_point( struct gl_context *ctx );
extern void
-_swrast_add_spec_terms_point( GLcontext *ctx,
+_swrast_add_spec_terms_point( struct gl_context *ctx,
const SWvertex *v0 );
#endif
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 1de481248b1..55fa60749e8 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -26,7 +26,6 @@
#include "main/glheader.h"
#include "main/bufferobj.h"
#include "main/colormac.h"
-#include "main/convolve.h"
#include "main/feedback.h"
#include "main/formats.h"
#include "main/image.h"
@@ -44,7 +43,7 @@
* Read pixels for format=GL_DEPTH_COMPONENT.
*/
static void
-read_depth_pixels( GLcontext *ctx,
+read_depth_pixels( struct gl_context *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum type, GLvoid *pixels,
@@ -140,7 +139,7 @@ read_depth_pixels( GLcontext *ctx,
* Read pixels for format=GL_STENCIL_INDEX.
*/
static void
-read_stencil_pixels( GLcontext *ctx,
+read_stencil_pixels( struct gl_context *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum type, GLvoid *pixels,
@@ -178,7 +177,7 @@ read_stencil_pixels( GLcontext *ctx,
* \return GL_TRUE if success, GL_FALSE if unable to do the readpixels
*/
static GLboolean
-fast_read_rgba_pixels( GLcontext *ctx,
+fast_read_rgba_pixels( struct gl_context *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
@@ -298,7 +297,7 @@ adjust_colors(const struct gl_framebuffer *fb, GLuint n, GLfloat rgba[][4])
* Read R, G, B, A, RGB, L, or LA pixels.
*/
static void
-read_rgba_pixels( GLcontext *ctx,
+read_rgba_pixels( struct gl_context *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type, GLvoid *pixels,
@@ -326,57 +325,7 @@ read_rgba_pixels( GLcontext *ctx,
/* width should never be > MAX_WIDTH since we did clipping earlier */
ASSERT(width <= MAX_WIDTH);
- if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
- GLfloat *dest, *src, *tmpImage, *convImage;
- GLint row;
-
- tmpImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!tmpImage) {
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
- return;
- }
- convImage = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
- if (!convImage) {
- free(tmpImage);
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels");
- return;
- }
-
- /* read full RGBA, FLOAT image */
- dest = tmpImage;
- for (row = 0; row < height; row++, y++) {
- _swrast_read_rgba_span(ctx, rb, width, x, y, GL_FLOAT, dest);
- _mesa_apply_rgba_transfer_ops(ctx,
- transferOps & IMAGE_PRE_CONVOLUTION_BITS,
- width, (GLfloat (*)[4]) dest);
- dest += width * 4;
- }
-
- /* do convolution */
- if (ctx->Pixel.Convolution2DEnabled) {
- _mesa_convolve_2d_image(ctx, &width, &height, tmpImage, convImage);
- }
- else {
- ASSERT(ctx->Pixel.Separable2DEnabled);
- _mesa_convolve_sep_image(ctx, &width, &height, tmpImage, convImage);
- }
- free(tmpImage);
-
- /* finish transfer ops and pack the resulting image */
- src = convImage;
- for (row = 0; row < height; row++) {
- GLvoid *dest;
- dest = _mesa_image_address2d(packing, pixels, width, height,
- format, type, row, 0);
- _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) src,
- format, type, dest, packing,
- transferOps & IMAGE_POST_CONVOLUTION_BITS);
- src += width * 4;
- }
- free(convImage);
- }
- else {
- /* no convolution */
+ do {
const GLint dstStride
= _mesa_image_row_stride(packing, width, format, type);
GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
@@ -385,10 +334,6 @@ read_rgba_pixels( GLcontext *ctx,
= (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
format, type, 0, 0);
- /* make sure we don't apply 1D convolution */
- transferOps &= ~(IMAGE_CONVOLUTION_BIT |
- IMAGE_POST_CONVOLUTION_SCALE_BIAS);
-
for (row = 0; row < height; row++, y++) {
/* Get float rgba pixels */
@@ -407,7 +352,7 @@ read_rgba_pixels( GLcontext *ctx,
dst += dstStride;
}
- }
+ } while (0);
}
@@ -417,7 +362,7 @@ read_rgba_pixels( GLcontext *ctx,
* depth and stencil buffers really exist.
*/
static void
-read_depth_stencil_pixels(GLcontext *ctx,
+read_depth_stencil_pixels(struct gl_context *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum type, GLvoid *pixels,
@@ -508,7 +453,7 @@ read_depth_stencil_pixels(GLcontext *ctx,
* By time we get here, all error checking will have been done.
*/
void
-_swrast_ReadPixels( GLcontext *ctx,
+_swrast_ReadPixels( struct gl_context *ctx,
GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *packing,
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 28c82990e08..3240b135774 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -57,7 +57,7 @@
* and glBitmap.
*/
void
-_swrast_span_default_attribs(GLcontext *ctx, SWspan *span)
+_swrast_span_default_attribs(struct gl_context *ctx, SWspan *span)
{
GLchan r, g, b, a;
/* Z*/
@@ -163,7 +163,7 @@ _swrast_span_default_attribs(GLcontext *ctx, SWspan *span)
* should have computed attrStart/Step values for FRAG_ATTRIB_WPOS[3]!
*/
static INLINE void
-interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask)
+interpolate_active_attribs(struct gl_context *ctx, SWspan *span, GLbitfield attrMask)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -210,7 +210,7 @@ interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask)
* color array.
*/
static INLINE void
-interpolate_int_colors(GLcontext *ctx, SWspan *span)
+interpolate_int_colors(struct gl_context *ctx, SWspan *span)
{
const GLuint n = span->end;
GLuint i;
@@ -370,7 +370,7 @@ interpolate_float_colors(SWspan *span)
* Fill in the span.zArray array from the span->z, zStep values.
*/
void
-_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span )
+_swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span )
{
const GLuint n = span->end;
GLuint i;
@@ -460,7 +460,7 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
* texels with (s/q, t/q, r/q).
*/
static void
-interpolate_texcoords(GLcontext *ctx, SWspan *span)
+interpolate_texcoords(struct gl_context *ctx, SWspan *span)
{
const GLuint maxUnit
= (ctx->Texture._EnabledCoordUnits > 1) ? ctx->Const.MaxTextureUnits : 1;
@@ -601,7 +601,7 @@ interpolate_texcoords(GLcontext *ctx, SWspan *span)
* Fill in the arrays->attribs[FRAG_ATTRIB_WPOS] array.
*/
static INLINE void
-interpolate_wpos(GLcontext *ctx, SWspan *span)
+interpolate_wpos(struct gl_context *ctx, SWspan *span)
{
GLfloat (*wpos)[4] = span->array->attribs[FRAG_ATTRIB_WPOS];
GLuint i;
@@ -635,7 +635,7 @@ interpolate_wpos(GLcontext *ctx, SWspan *span)
* Apply the current polygon stipple pattern to a span of pixels.
*/
static INLINE void
-stipple_polygon_span(GLcontext *ctx, SWspan *span)
+stipple_polygon_span(struct gl_context *ctx, SWspan *span)
{
GLubyte *mask = span->array->mask;
@@ -680,7 +680,7 @@ stipple_polygon_span(GLcontext *ctx, SWspan *span)
* GL_FALSE nothing visible
*/
static INLINE GLuint
-clip_span( GLcontext *ctx, SWspan *span )
+clip_span( struct gl_context *ctx, SWspan *span )
{
const GLint xmin = ctx->DrawBuffer->_Xmin;
const GLint xmax = ctx->DrawBuffer->_Xmax;
@@ -807,7 +807,7 @@ clip_span( GLcontext *ctx, SWspan *span )
* Result is float color array (FRAG_ATTRIB_COL0).
*/
static INLINE void
-add_specular(GLcontext *ctx, SWspan *span)
+add_specular(struct gl_context *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLubyte *mask = span->array->mask;
@@ -951,7 +951,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
* Apply fragment shader, fragment program or normal texturing to span.
*/
static INLINE void
-shade_texture_span(GLcontext *ctx, SWspan *span)
+shade_texture_span(struct gl_context *ctx, SWspan *span)
{
GLbitfield inputsRead;
@@ -1029,7 +1029,7 @@ shade_texture_span(GLcontext *ctx, SWspan *span)
* to their original values before returning.
*/
void
-_swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
+_swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
const GLuint *colorMask = (GLuint *) ctx->Color.ColorMask;
@@ -1304,7 +1304,7 @@ end:
* \param rgba the returned colors
*/
void
-_swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_rgba_span( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y, GLenum dstType,
GLvoid *rgba)
{
@@ -1373,7 +1373,7 @@ _swrast_read_rgba_span( GLcontext *ctx, struct gl_renderbuffer *rb,
* values array.
*/
void
-_swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
void *values, GLuint valueSize)
{
@@ -1409,7 +1409,7 @@ _swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb,
* \param valueSize size of each value (pixel) in bytes
*/
void
-_swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_put_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
const GLvoid *values, GLuint valueSize)
{
@@ -1444,7 +1444,7 @@ _swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb,
* \param valueSize size of each value (pixel) in bytes
*/
void
-_swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
GLvoid *values, GLuint valueSize)
{
@@ -1479,7 +1479,7 @@ _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
* \return pointer to the colors we read.
*/
void *
-_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_dest_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
SWspan *span)
{
const GLuint pixelSize = RGBA_PIXEL_SIZE(span->array->ChanType);
diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h
index aaf1fec2a8b..18e275ec8ab 100644
--- a/src/mesa/swrast/s_span.h
+++ b/src/mesa/swrast/s_span.h
@@ -176,10 +176,10 @@ do { \
extern void
-_swrast_span_default_attribs(GLcontext *ctx, SWspan *span);
+_swrast_span_default_attribs(struct gl_context *ctx, SWspan *span);
extern void
-_swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span );
+_swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span );
extern GLfloat
_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
@@ -188,31 +188,31 @@ _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
extern void
-_swrast_write_rgba_span( GLcontext *ctx, SWspan *span);
+_swrast_write_rgba_span( struct gl_context *ctx, SWspan *span);
extern void
-_swrast_read_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba);
extern void
-_swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
void *values, GLuint valueSize);
extern void
-_swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_put_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
const GLvoid *values, GLuint valueSize);
extern void
-_swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
GLvoid *values, GLuint valueSize);
extern void *
-_swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_get_dest_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
SWspan *span);
#endif
diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h
index 2948a90f6bb..8a9485085ef 100644
--- a/src/mesa/swrast/s_spantemp.h
+++ b/src/mesa/swrast/s_spantemp.h
@@ -51,7 +51,7 @@
static void
-NAME(get_row)( GLcontext *ctx, struct gl_renderbuffer *rb,
+NAME(get_row)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y, void *values )
{
#ifdef SPAN_VARS
@@ -69,7 +69,7 @@ NAME(get_row)( GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-NAME(get_values)( GLcontext *ctx, struct gl_renderbuffer *rb,
+NAME(get_values)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[], void *values )
{
#ifdef SPAN_VARS
@@ -86,7 +86,7 @@ NAME(get_values)( GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-NAME(put_row)( GLcontext *ctx, struct gl_renderbuffer *rb,
+NAME(put_row)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
const void *values, const GLubyte mask[] )
{
@@ -115,7 +115,7 @@ NAME(put_row)( GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb,
+NAME(put_row_rgb)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
const void *values, const GLubyte mask[] )
{
@@ -140,7 +140,7 @@ NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-NAME(put_mono_row)( GLcontext *ctx, struct gl_renderbuffer *rb,
+NAME(put_mono_row)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, GLint x, GLint y,
const void *value, const GLubyte mask[] )
{
@@ -169,7 +169,7 @@ NAME(put_mono_row)( GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-NAME(put_values)( GLcontext *ctx, struct gl_renderbuffer *rb,
+NAME(put_values)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
const void *values, const GLubyte mask[] )
{
@@ -190,7 +190,7 @@ NAME(put_values)( GLcontext *ctx, struct gl_renderbuffer *rb,
static void
-NAME(put_mono_values)( GLcontext *ctx, struct gl_renderbuffer *rb,
+NAME(put_mono_values)( struct gl_context *ctx, struct gl_renderbuffer *rb,
GLuint count, const GLint x[], const GLint y[],
const void *value, const GLubyte mask[] )
{
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index aa74b21ee80..5bec71c057b 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -61,7 +61,7 @@ ENDIF
* Output: stencil - modified values
*/
static void
-apply_stencil_op( const GLcontext *ctx, GLenum oper, GLuint face,
+apply_stencil_op( const struct gl_context *ctx, GLenum oper, GLuint face,
GLuint n, GLstencil stencil[], const GLubyte mask[] )
{
const GLstencil ref = ctx->Stencil.Ref[face];
@@ -225,7 +225,7 @@ apply_stencil_op( const GLcontext *ctx, GLenum oper, GLuint face,
* Return: GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
*/
static GLboolean
-do_stencil_test( GLcontext *ctx, GLuint face, GLuint n, GLstencil stencil[],
+do_stencil_test( struct gl_context *ctx, GLuint face, GLuint n, GLstencil stencil[],
GLubyte mask[] )
{
GLubyte fail[MAX_WIDTH];
@@ -418,7 +418,7 @@ compute_pass_fail_masks(GLuint n, const GLubyte origMask[],
*
*/
static GLboolean
-stencil_and_ztest_span(GLcontext *ctx, SWspan *span, GLuint face)
+stencil_and_ztest_span(struct gl_context *ctx, SWspan *span, GLuint face)
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = fb->_StencilBuffer;
@@ -524,7 +524,7 @@ stencil_and_ztest_span(GLcontext *ctx, SWspan *span, GLuint face)
* mask - array [n] of flag: 1=apply operator, 0=don't apply operator
*/
static void
-apply_stencil_op_to_pixels( GLcontext *ctx,
+apply_stencil_op_to_pixels( struct gl_context *ctx,
GLuint n, const GLint x[], const GLint y[],
GLenum oper, GLuint face, const GLubyte mask[] )
{
@@ -698,7 +698,7 @@ apply_stencil_op_to_pixels( GLcontext *ctx,
* \return GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed.
*/
static GLboolean
-stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n,
+stencil_test_pixels( struct gl_context *ctx, GLuint face, GLuint n,
const GLint x[], const GLint y[], GLubyte mask[] )
{
const struct gl_framebuffer *fb = ctx->DrawBuffer;
@@ -897,7 +897,7 @@ stencil_test_pixels( GLcontext *ctx, GLuint face, GLuint n,
* GL_TRUE - one or more fragments passed the testing
*/
static GLboolean
-stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face )
+stencil_and_ztest_pixels( struct gl_context *ctx, SWspan *span, GLuint face )
{
GLubyte passMask[MAX_WIDTH], failMask[MAX_WIDTH], origMask[MAX_WIDTH];
struct gl_framebuffer *fb = ctx->DrawBuffer;
@@ -990,7 +990,7 @@ stencil_and_ztest_pixels( GLcontext *ctx, SWspan *span, GLuint face )
* GL_FALSE = all fragments failed.
*/
GLboolean
-_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span)
+_swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span)
{
const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace;
@@ -1042,7 +1042,7 @@ clip_span(GLuint bufferWidth, GLuint bufferHeight,
* Output: stencil - the array of stencil values
*/
void
-_swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_stencil_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLstencil stencil[])
{
if (y < 0 || y >= (GLint) rb->Height ||
@@ -1079,7 +1079,7 @@ _swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb,
* stencil - the array of stencil values
*/
void
-_swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y,
+_swrast_write_stencil_span(struct gl_context *ctx, GLint n, GLint x, GLint y,
const GLstencil stencil[] )
{
struct gl_framebuffer *fb = ctx->DrawBuffer;
@@ -1128,7 +1128,7 @@ _swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y,
* Clear the stencil buffer.
*/
void
-_swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
+_swrast_clear_stencil_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb )
{
const GLubyte stencilBits = ctx->DrawBuffer->Visual.stencilBits;
const GLuint mask = ctx->Stencil.WriteMask[0];
diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h
index c076ebbe2a1..00f5179e046 100644
--- a/src/mesa/swrast/s_stencil.h
+++ b/src/mesa/swrast/s_stencil.h
@@ -33,21 +33,21 @@
extern GLboolean
-_swrast_stencil_and_ztest_span(GLcontext *ctx, SWspan *span);
+_swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span);
extern void
-_swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb,
+_swrast_read_stencil_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLstencil stencil[]);
extern void
-_swrast_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y,
+_swrast_write_stencil_span( struct gl_context *ctx, GLint n, GLint x, GLint y,
const GLstencil stencil[] );
extern void
-_swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb );
+_swrast_clear_stencil_buffer( struct gl_context *ctx, struct gl_renderbuffer *rb );
#endif
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index 2ac0aaa246d..1775810eff8 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -72,7 +72,7 @@ get_texel_array(SWcontext *swrast, GLuint unit)
* \param rgba incoming/result fragment colors
*/
static void
-texture_combine( GLcontext *ctx, GLuint unit, GLuint n,
+texture_combine( struct gl_context *ctx, GLuint unit, GLuint n,
const float4_array primary_rgba,
const GLfloat *texelBuffer,
GLchan (*rgbaChan)[4] )
@@ -556,7 +556,7 @@ swizzle_texels(GLuint swizzle, GLuint count, float4_array texels)
* Apply texture mapping to a span of fragments.
*/
void
-_swrast_texture_span( GLcontext *ctx, SWspan *span )
+_swrast_texture_span( struct gl_context *ctx, SWspan *span )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLfloat primary_rgba[MAX_WIDTH][4];
diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h
index 4f5dfbe1afe..5f47ebecbf1 100644
--- a/src/mesa/swrast/s_texcombine.h
+++ b/src/mesa/swrast/s_texcombine.h
@@ -31,6 +31,6 @@
#include "s_span.h"
extern void
-_swrast_texture_span( GLcontext *ctx, SWspan *span );
+_swrast_texture_span( struct gl_context *ctx, SWspan *span );
#endif
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 3fc554c5a20..ec281776d0d 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -135,8 +135,11 @@ lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c,
/**
- * If A is a signed integer, A % B doesn't give the right value for A < 0
- * (in terms of texture repeat). Just casting to unsigned fixes that.
+ * Used for GL_REPEAT wrap mode. Using A % B doesn't produce the
+ * right results for A<0. Casting to A to be unsigned only works if B
+ * is a power of two. Adding a bias to A (which is a multiple of B)
+ * avoids the problems with A < 0 (for reasonable A) without using a
+ * conditional.
*/
#define REMAINDER(A, B) (((A) + (B) * 1024) % (B))
@@ -795,7 +798,7 @@ get_border_color(const struct gl_texture_object *tObj,
* Return the texture sample for coordinate (s) using GL_NEAREST filter.
*/
static INLINE void
-sample_1d_nearest(GLcontext *ctx,
+sample_1d_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4], GLfloat rgba[4])
@@ -819,7 +822,7 @@ sample_1d_nearest(GLcontext *ctx,
* Return the texture sample for coordinate (s) using GL_LINEAR filter.
*/
static INLINE void
-sample_1d_linear(GLcontext *ctx,
+sample_1d_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4], GLfloat rgba[4])
@@ -860,7 +863,7 @@ sample_1d_linear(GLcontext *ctx,
static void
-sample_1d_nearest_mipmap_nearest(GLcontext *ctx,
+sample_1d_nearest_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -875,7 +878,7 @@ sample_1d_nearest_mipmap_nearest(GLcontext *ctx,
static void
-sample_1d_linear_mipmap_nearest(GLcontext *ctx,
+sample_1d_linear_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -890,7 +893,7 @@ sample_1d_linear_mipmap_nearest(GLcontext *ctx,
static void
-sample_1d_nearest_mipmap_linear(GLcontext *ctx,
+sample_1d_nearest_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -915,7 +918,7 @@ sample_1d_nearest_mipmap_linear(GLcontext *ctx,
static void
-sample_1d_linear_mipmap_linear(GLcontext *ctx,
+sample_1d_linear_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -941,7 +944,7 @@ sample_1d_linear_mipmap_linear(GLcontext *ctx,
/** Sample 1D texture, nearest filtering for both min/magnification */
static void
-sample_nearest_1d( GLcontext *ctx,
+sample_nearest_1d( struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4] )
@@ -957,7 +960,7 @@ sample_nearest_1d( GLcontext *ctx,
/** Sample 1D texture, linear filtering for both min/magnification */
static void
-sample_linear_1d( GLcontext *ctx,
+sample_linear_1d( struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4] )
@@ -973,7 +976,7 @@ sample_linear_1d( GLcontext *ctx,
/** Sample 1D texture, using lambda to choose between min/magnification */
static void
-sample_lambda_1d( GLcontext *ctx,
+sample_lambda_1d( struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4] )
@@ -1052,7 +1055,7 @@ sample_lambda_1d( GLcontext *ctx,
* Return the texture sample for coordinate (s,t) using GL_NEAREST filter.
*/
static INLINE void
-sample_2d_nearest(GLcontext *ctx,
+sample_2d_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -1085,7 +1088,7 @@ sample_2d_nearest(GLcontext *ctx,
* New sampling code contributed by Lynn Quam <[email protected]>.
*/
static INLINE void
-sample_2d_linear(GLcontext *ctx,
+sample_2d_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -1149,7 +1152,7 @@ sample_2d_linear(GLcontext *ctx,
* We don't have to worry about the texture border.
*/
static INLINE void
-sample_2d_linear_repeat(GLcontext *ctx,
+sample_2d_linear_repeat(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -1182,7 +1185,7 @@ sample_2d_linear_repeat(GLcontext *ctx,
static void
-sample_2d_nearest_mipmap_nearest(GLcontext *ctx,
+sample_2d_nearest_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1196,7 +1199,7 @@ sample_2d_nearest_mipmap_nearest(GLcontext *ctx,
static void
-sample_2d_linear_mipmap_nearest(GLcontext *ctx,
+sample_2d_linear_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1211,7 +1214,7 @@ sample_2d_linear_mipmap_nearest(GLcontext *ctx,
static void
-sample_2d_nearest_mipmap_linear(GLcontext *ctx,
+sample_2d_nearest_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1236,7 +1239,7 @@ sample_2d_nearest_mipmap_linear(GLcontext *ctx,
static void
-sample_2d_linear_mipmap_linear( GLcontext *ctx,
+sample_2d_linear_mipmap_linear( struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4] )
@@ -1261,7 +1264,7 @@ sample_2d_linear_mipmap_linear( GLcontext *ctx,
static void
-sample_2d_linear_mipmap_linear_repeat(GLcontext *ctx,
+sample_2d_linear_mipmap_linear_repeat(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1291,7 +1294,7 @@ sample_2d_linear_mipmap_linear_repeat(GLcontext *ctx,
/** Sample 2D texture, nearest filtering for both min/magnification */
static void
-sample_nearest_2d(GLcontext *ctx,
+sample_nearest_2d(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1307,7 +1310,7 @@ sample_nearest_2d(GLcontext *ctx,
/** Sample 2D texture, linear filtering for both min/magnification */
static void
-sample_linear_2d(GLcontext *ctx,
+sample_linear_2d(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1340,7 +1343,7 @@ sample_linear_2d(GLcontext *ctx,
* Format = GL_RGB
*/
static void
-opt_sample_rgb_2d(GLcontext *ctx,
+opt_sample_rgb_2d(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1381,7 +1384,7 @@ opt_sample_rgb_2d(GLcontext *ctx,
* Format = GL_RGBA
*/
static void
-opt_sample_rgba_2d(GLcontext *ctx,
+opt_sample_rgba_2d(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1416,7 +1419,7 @@ opt_sample_rgba_2d(GLcontext *ctx,
/** Sample 2D texture, using lambda to choose between min/magnification */
static void
-sample_lambda_2d(GLcontext *ctx,
+sample_lambda_2d(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1537,7 +1540,7 @@ sample_lambda_2d(GLcontext *ctx,
* Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter.
*/
static INLINE void
-sample_3d_nearest(GLcontext *ctx,
+sample_3d_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -1569,7 +1572,7 @@ sample_3d_nearest(GLcontext *ctx,
* Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter.
*/
static void
-sample_3d_linear(GLcontext *ctx,
+sample_3d_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -1663,7 +1666,7 @@ sample_3d_linear(GLcontext *ctx,
static void
-sample_3d_nearest_mipmap_nearest(GLcontext *ctx,
+sample_3d_nearest_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4] )
@@ -1677,7 +1680,7 @@ sample_3d_nearest_mipmap_nearest(GLcontext *ctx,
static void
-sample_3d_linear_mipmap_nearest(GLcontext *ctx,
+sample_3d_linear_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1692,7 +1695,7 @@ sample_3d_linear_mipmap_nearest(GLcontext *ctx,
static void
-sample_3d_nearest_mipmap_linear(GLcontext *ctx,
+sample_3d_nearest_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1717,7 +1720,7 @@ sample_3d_nearest_mipmap_linear(GLcontext *ctx,
static void
-sample_3d_linear_mipmap_linear(GLcontext *ctx,
+sample_3d_linear_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1743,7 +1746,7 @@ sample_3d_linear_mipmap_linear(GLcontext *ctx,
/** Sample 3D texture, nearest filtering for both min/magnification */
static void
-sample_nearest_3d(GLcontext *ctx,
+sample_nearest_3d(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -1759,7 +1762,7 @@ sample_nearest_3d(GLcontext *ctx,
/** Sample 3D texture, linear filtering for both min/magnification */
static void
-sample_linear_3d(GLcontext *ctx,
+sample_linear_3d(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1775,7 +1778,7 @@ sample_linear_3d(GLcontext *ctx,
/** Sample 3D texture, using lambda to choose between min/magnification */
static void
-sample_lambda_3d(GLcontext *ctx,
+sample_lambda_3d(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -1930,7 +1933,7 @@ choose_cube_face(const struct gl_texture_object *texObj,
static void
-sample_nearest_cube(GLcontext *ctx,
+sample_nearest_cube(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -1948,7 +1951,7 @@ sample_nearest_cube(GLcontext *ctx,
static void
-sample_linear_cube(GLcontext *ctx,
+sample_linear_cube(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1966,7 +1969,7 @@ sample_linear_cube(GLcontext *ctx,
static void
-sample_cube_nearest_mipmap_nearest(GLcontext *ctx,
+sample_cube_nearest_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -1995,7 +1998,7 @@ sample_cube_nearest_mipmap_nearest(GLcontext *ctx,
static void
-sample_cube_linear_mipmap_nearest(GLcontext *ctx,
+sample_cube_linear_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2014,7 +2017,7 @@ sample_cube_linear_mipmap_nearest(GLcontext *ctx,
static void
-sample_cube_nearest_mipmap_linear(GLcontext *ctx,
+sample_cube_nearest_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2043,7 +2046,7 @@ sample_cube_nearest_mipmap_linear(GLcontext *ctx,
static void
-sample_cube_linear_mipmap_linear(GLcontext *ctx,
+sample_cube_linear_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2073,7 +2076,7 @@ sample_cube_linear_mipmap_linear(GLcontext *ctx,
/** Sample cube texture, using lambda to choose between min/magnification */
static void
-sample_lambda_cube(GLcontext *ctx,
+sample_lambda_cube(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -2147,7 +2150,7 @@ sample_lambda_cube(GLcontext *ctx,
static void
-sample_nearest_rect(GLcontext *ctx,
+sample_nearest_rect(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -2181,7 +2184,7 @@ sample_nearest_rect(GLcontext *ctx,
static void
-sample_linear_rect(GLcontext *ctx,
+sample_linear_rect(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2247,7 +2250,7 @@ sample_linear_rect(GLcontext *ctx,
/** Sample Rect texture, using lambda to choose between min/magnification */
static void
-sample_lambda_rect(GLcontext *ctx,
+sample_lambda_rect(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -2291,7 +2294,7 @@ sample_lambda_rect(GLcontext *ctx,
* Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter.
*/
static void
-sample_2d_array_nearest(GLcontext *ctx,
+sample_2d_array_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -2324,7 +2327,7 @@ sample_2d_array_nearest(GLcontext *ctx,
* Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter.
*/
static void
-sample_2d_array_linear(GLcontext *ctx,
+sample_2d_array_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -2394,7 +2397,7 @@ sample_2d_array_linear(GLcontext *ctx,
static void
-sample_2d_array_nearest_mipmap_nearest(GLcontext *ctx,
+sample_2d_array_nearest_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2409,7 +2412,7 @@ sample_2d_array_nearest_mipmap_nearest(GLcontext *ctx,
static void
-sample_2d_array_linear_mipmap_nearest(GLcontext *ctx,
+sample_2d_array_linear_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2425,7 +2428,7 @@ sample_2d_array_linear_mipmap_nearest(GLcontext *ctx,
static void
-sample_2d_array_nearest_mipmap_linear(GLcontext *ctx,
+sample_2d_array_nearest_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2452,7 +2455,7 @@ sample_2d_array_nearest_mipmap_linear(GLcontext *ctx,
static void
-sample_2d_array_linear_mipmap_linear(GLcontext *ctx,
+sample_2d_array_linear_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2480,7 +2483,7 @@ sample_2d_array_linear_mipmap_linear(GLcontext *ctx,
/** Sample 2D Array texture, nearest filtering for both min/magnification */
static void
-sample_nearest_2d_array(GLcontext *ctx,
+sample_nearest_2d_array(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -2497,7 +2500,7 @@ sample_nearest_2d_array(GLcontext *ctx,
/** Sample 2D Array texture, linear filtering for both min/magnification */
static void
-sample_linear_2d_array(GLcontext *ctx,
+sample_linear_2d_array(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2513,7 +2516,7 @@ sample_linear_2d_array(GLcontext *ctx,
/** Sample 2D Array texture, using lambda to choose between min/magnification */
static void
-sample_lambda_2d_array(GLcontext *ctx,
+sample_lambda_2d_array(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -2601,7 +2604,7 @@ sample_lambda_2d_array(GLcontext *ctx,
* Return the texture sample for coordinate (s,t,r) using GL_NEAREST filter.
*/
static void
-sample_1d_array_nearest(GLcontext *ctx,
+sample_1d_array_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -2631,7 +2634,7 @@ sample_1d_array_nearest(GLcontext *ctx,
* Return the texture sample for coordinate (s,t,r) using GL_LINEAR filter.
*/
static void
-sample_1d_array_linear(GLcontext *ctx,
+sample_1d_array_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
const struct gl_texture_image *img,
const GLfloat texcoord[4],
@@ -2680,7 +2683,7 @@ sample_1d_array_linear(GLcontext *ctx,
static void
-sample_1d_array_nearest_mipmap_nearest(GLcontext *ctx,
+sample_1d_array_nearest_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2695,7 +2698,7 @@ sample_1d_array_nearest_mipmap_nearest(GLcontext *ctx,
static void
-sample_1d_array_linear_mipmap_nearest(GLcontext *ctx,
+sample_1d_array_linear_mipmap_nearest(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2711,7 +2714,7 @@ sample_1d_array_linear_mipmap_nearest(GLcontext *ctx,
static void
-sample_1d_array_nearest_mipmap_linear(GLcontext *ctx,
+sample_1d_array_nearest_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2736,7 +2739,7 @@ sample_1d_array_nearest_mipmap_linear(GLcontext *ctx,
static void
-sample_1d_array_linear_mipmap_linear(GLcontext *ctx,
+sample_1d_array_linear_mipmap_linear(struct gl_context *ctx,
const struct gl_texture_object *tObj,
GLuint n, const GLfloat texcoord[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2762,7 +2765,7 @@ sample_1d_array_linear_mipmap_linear(GLcontext *ctx,
/** Sample 1D Array texture, nearest filtering for both min/magnification */
static void
-sample_nearest_1d_array(GLcontext *ctx,
+sample_nearest_1d_array(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -2778,7 +2781,7 @@ sample_nearest_1d_array(GLcontext *ctx,
/** Sample 1D Array texture, linear filtering for both min/magnification */
static void
-sample_linear_1d_array(GLcontext *ctx,
+sample_linear_1d_array(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
@@ -2794,7 +2797,7 @@ sample_linear_1d_array(GLcontext *ctx,
/** Sample 1D Array texture, using lambda to choose between min/magnification */
static void
-sample_lambda_1d_array(GLcontext *ctx,
+sample_lambda_1d_array(struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -2972,11 +2975,16 @@ choose_depth_texture_level(const struct gl_texture_object *tObj, GLfloat lambda)
{
GLint level;
- lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod);
-
- level = (GLint) lambda;
-
- level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel);
+ if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) {
+ /* no mipmapping - use base level */
+ level = tObj->BaseLevel;
+ }
+ else {
+ /* choose mipmap level */
+ lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod);
+ level = (GLint) lambda;
+ level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel);
+ }
return level;
}
@@ -2987,7 +2995,7 @@ choose_depth_texture_level(const struct gl_texture_object *tObj, GLfloat lambda)
* check for minification vs. magnification, etc.
*/
static void
-sample_depth_texture( GLcontext *ctx,
+sample_depth_texture( struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat texel[][4] )
@@ -3048,6 +3056,9 @@ sample_depth_texture( GLcontext *ctx,
case GL_ALPHA:
ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result);
break;
+ case GL_RED:
+ ASSIGN_4V(texel[i], result, 0.0F, 0.0F, 1.0F);
+ break;
default:
_mesa_problem(ctx, "Bad depth texture mode");
}
@@ -3153,7 +3164,7 @@ sample_depth_texture( GLcontext *ctx,
* Note: fragment programs don't observe the texture enable/disable flags.
*/
static void
-null_sample_func( GLcontext *ctx,
+null_sample_func( struct gl_context *ctx,
const struct gl_texture_object *tObj, GLuint n,
const GLfloat texcoords[][4], const GLfloat lambda[],
GLfloat rgba[][4])
@@ -3176,7 +3187,7 @@ null_sample_func( GLcontext *ctx,
* Choose the texture sampling function for the given texture object.
*/
texture_sample_func
-_swrast_choose_texture_sample_func( GLcontext *ctx,
+_swrast_choose_texture_sample_func( struct gl_context *ctx,
const struct gl_texture_object *t )
{
if (!t || !t->_Complete) {
diff --git a/src/mesa/swrast/s_texfilter.h b/src/mesa/swrast/s_texfilter.h
index eceab59658e..34520f22948 100644
--- a/src/mesa/swrast/s_texfilter.h
+++ b/src/mesa/swrast/s_texfilter.h
@@ -32,7 +32,7 @@
extern texture_sample_func
-_swrast_choose_texture_sample_func( GLcontext *ctx,
+_swrast_choose_texture_sample_func( struct gl_context *ctx,
const struct gl_texture_object *tObj );
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index d1b369bcdf0..85513e1f204 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -49,7 +49,7 @@
* \return GL_TRUE if the triangle is to be culled, GL_FALSE otherwise.
*/
GLboolean
-_swrast_culltriangle( GLcontext *ctx,
+_swrast_culltriangle( struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2 )
@@ -256,7 +256,7 @@ ilerp_2d(GLint ia, GLint ib, GLint v00, GLint v10, GLint v01, GLint v11)
* texture env modes.
*/
static INLINE void
-affine_span(GLcontext *ctx, SWspan *span,
+affine_span(struct gl_context *ctx, SWspan *span,
struct affine_info *info)
{
GLchan sample[4]; /* the filtered texture sample */
@@ -591,7 +591,7 @@ struct persp_info
static INLINE void
-fast_persp_span(GLcontext *ctx, SWspan *span,
+fast_persp_span(struct gl_context *ctx, SWspan *span,
struct persp_info *info)
{
GLchan sample[4]; /* the filtered texture sample */
@@ -903,7 +903,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span,
static void
-nodraw_triangle( GLcontext *ctx,
+nodraw_triangle( struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2 )
@@ -919,7 +919,7 @@ nodraw_triangle( GLcontext *ctx,
* Inefficient, but seldom needed.
*/
void
-_swrast_add_spec_terms_triangle(GLcontext *ctx, const SWvertex *v0,
+_swrast_add_spec_terms_triangle(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2)
{
SWvertex *ncv0 = (SWvertex *)v0; /* drop const qualifier */
@@ -992,7 +992,7 @@ do { \
* remove tests to this code.
*/
void
-_swrast_choose_triangle( GLcontext *ctx )
+_swrast_choose_triangle( struct gl_context *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
diff --git a/src/mesa/swrast/s_triangle.h b/src/mesa/swrast/s_triangle.h
index b81932c7304..46e23d42083 100644
--- a/src/mesa/swrast/s_triangle.h
+++ b/src/mesa/swrast/s_triangle.h
@@ -32,16 +32,16 @@
extern GLboolean
-_swrast_culltriangle( GLcontext *ctx,
+_swrast_culltriangle( struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2);
extern void
-_swrast_choose_triangle( GLcontext *ctx );
+_swrast_choose_triangle( struct gl_context *ctx );
extern void
-_swrast_add_spec_terms_triangle( GLcontext *ctx,
+_swrast_add_spec_terms_triangle( struct gl_context *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2 );
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 0aa8739f4f2..4d6309b82ac 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -108,7 +108,7 @@ do { \
#endif
-static void NAME(GLcontext *ctx, const SWvertex *v0,
+static void NAME(struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2 )
{
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index f224627d50e..4e04691cd76 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -45,7 +45,7 @@
* \return GL_TRUE if any zoomed pixels visible, GL_FALSE if totally clipped
*/
static GLboolean
-compute_zoomed_bounds(GLcontext *ctx, GLint imageX, GLint imageY,
+compute_zoomed_bounds(struct gl_context *ctx, GLint imageX, GLint imageY,
GLint spanX, GLint spanY, GLint width,
GLint *x0, GLint *x1, GLint *y0, GLint *y1)
{
@@ -127,7 +127,7 @@ unzoom_x(GLfloat zoomX, GLint imageX, GLint zx)
* index/depth_span().
*/
static void
-zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
+zoom_span( struct gl_context *ctx, GLint imgX, GLint imgY, const SWspan *span,
const GLvoid *src, GLenum format )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
@@ -320,7 +320,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
void
-_swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_rgba_span(struct gl_context *ctx, GLint imgX, GLint imgY,
const SWspan *span, const GLvoid *rgba)
{
zoom_span(ctx, imgX, imgY, span, rgba, GL_RGBA);
@@ -328,7 +328,7 @@ _swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY,
void
-_swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_rgb_span(struct gl_context *ctx, GLint imgX, GLint imgY,
const SWspan *span, const GLvoid *rgb)
{
zoom_span(ctx, imgX, imgY, span, rgb, GL_RGB);
@@ -336,7 +336,7 @@ _swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY,
void
-_swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_depth_span(struct gl_context *ctx, GLint imgX, GLint imgY,
const SWspan *span)
{
zoom_span(ctx, imgX, imgY, span,
@@ -349,7 +349,7 @@ _swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY,
* No per-fragment operations are applied.
*/
void
-_swrast_write_zoomed_stencil_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_stencil_span(struct gl_context *ctx, GLint imgX, GLint imgY,
GLint width, GLint spanX, GLint spanY,
const GLstencil stencil[])
{
@@ -386,7 +386,7 @@ _swrast_write_zoomed_stencil_span(GLcontext *ctx, GLint imgX, GLint imgY,
* No per-fragment operations are applied.
*/
void
-_swrast_write_zoomed_z_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_z_span(struct gl_context *ctx, GLint imgX, GLint imgY,
GLint width, GLint spanX, GLint spanY,
const GLvoid *z)
{
diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h
index 09f624efad5..581ea178e89 100644
--- a/src/mesa/swrast/s_zoom.h
+++ b/src/mesa/swrast/s_zoom.h
@@ -30,25 +30,25 @@
extern void
-_swrast_write_zoomed_rgba_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_rgba_span(struct gl_context *ctx, GLint imgX, GLint imgY,
const SWspan *span, const GLvoid *rgba);
extern void
-_swrast_write_zoomed_rgb_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_rgb_span(struct gl_context *ctx, GLint imgX, GLint imgY,
const SWspan *span, const GLvoid *rgb);
extern void
-_swrast_write_zoomed_depth_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_depth_span(struct gl_context *ctx, GLint imgX, GLint imgY,
const SWspan *span);
extern void
-_swrast_write_zoomed_stencil_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_stencil_span(struct gl_context *ctx, GLint imgX, GLint imgY,
GLint width, GLint spanX, GLint spanY,
const GLstencil stencil[]);
extern void
-_swrast_write_zoomed_z_span(GLcontext *ctx, GLint imgX, GLint imgY,
+_swrast_write_zoomed_z_span(struct gl_context *ctx, GLint imgX, GLint imgY,
GLint width, GLint spanX, GLint spanY,
const GLvoid *z);
diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h
index c01cf7d1f0b..9b88c70220e 100644
--- a/src/mesa/swrast/swrast.h
+++ b/src/mesa/swrast/swrast.h
@@ -85,32 +85,32 @@ struct swrast_device_driver;
*/
extern GLboolean
-_swrast_CreateContext( GLcontext *ctx );
+_swrast_CreateContext( struct gl_context *ctx );
extern void
-_swrast_DestroyContext( GLcontext *ctx );
+_swrast_DestroyContext( struct gl_context *ctx );
/* Get a (non-const) reference to the device driver struct for swrast.
*/
extern struct swrast_device_driver *
-_swrast_GetDeviceDriverReference( GLcontext *ctx );
+_swrast_GetDeviceDriverReference( struct gl_context *ctx );
extern void
-_swrast_Bitmap( GLcontext *ctx,
+_swrast_Bitmap( struct gl_context *ctx,
GLint px, GLint py,
GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
const GLubyte *bitmap );
extern void
-_swrast_CopyPixels( GLcontext *ctx,
+_swrast_CopyPixels( struct gl_context *ctx,
GLint srcx, GLint srcy,
GLint destx, GLint desty,
GLsizei width, GLsizei height,
GLenum type );
extern void
-_swrast_DrawPixels( GLcontext *ctx,
+_swrast_DrawPixels( struct gl_context *ctx,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
@@ -118,37 +118,37 @@ _swrast_DrawPixels( GLcontext *ctx,
const GLvoid *pixels );
extern void
-_swrast_ReadPixels( GLcontext *ctx,
+_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(GLcontext *ctx,
+_swrast_BlitFramebuffer(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
extern void
-_swrast_Clear(GLcontext *ctx, GLbitfield buffers);
+_swrast_Clear(struct gl_context *ctx, GLbitfield buffers);
extern void
-_swrast_Accum(GLcontext *ctx, GLenum op, GLfloat value);
+_swrast_Accum(struct gl_context *ctx, GLenum op, GLfloat value);
/* Reset the stipple counter
*/
extern void
-_swrast_ResetLineStipple( GLcontext *ctx );
+_swrast_ResetLineStipple( struct gl_context *ctx );
/**
* Indicates front/back facing for subsequent points/lines when drawing
* unfilled polygons. Needed for two-side stencil.
*/
extern void
-_swrast_SetFacing(GLcontext *ctx, GLuint facing);
+_swrast_SetFacing(struct gl_context *ctx, GLuint facing);
/* These will always render the correct point/line/triangle for the
* current state.
@@ -156,54 +156,54 @@ _swrast_SetFacing(GLcontext *ctx, GLuint facing);
* For flatshaded primitives, the provoking vertex is the final one.
*/
extern void
-_swrast_Point( GLcontext *ctx, const SWvertex *v );
+_swrast_Point( struct gl_context *ctx, const SWvertex *v );
extern void
-_swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 );
+_swrast_Line( struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1 );
extern void
-_swrast_Triangle( GLcontext *ctx, const SWvertex *v0,
+_swrast_Triangle( struct gl_context *ctx, const SWvertex *v0,
const SWvertex *v1, const SWvertex *v2 );
extern void
-_swrast_Quad( GLcontext *ctx,
+_swrast_Quad( struct gl_context *ctx,
const SWvertex *v0, const SWvertex *v1,
const SWvertex *v2, const SWvertex *v3);
extern void
-_swrast_flush( GLcontext *ctx );
+_swrast_flush( struct gl_context *ctx );
extern void
-_swrast_render_primitive( GLcontext *ctx, GLenum mode );
+_swrast_render_primitive( struct gl_context *ctx, GLenum mode );
extern void
-_swrast_render_start( GLcontext *ctx );
+_swrast_render_start( struct gl_context *ctx );
extern void
-_swrast_render_finish( GLcontext *ctx );
+_swrast_render_finish( struct gl_context *ctx );
/* Tell the software rasterizer about core state changes.
*/
extern void
-_swrast_InvalidateState( GLcontext *ctx, GLbitfield new_state );
+_swrast_InvalidateState( struct gl_context *ctx, GLbitfield new_state );
/* Configure software rasterizer to match hardware rasterizer characteristics:
*/
extern void
-_swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value );
+_swrast_allow_vertex_fog( struct gl_context *ctx, GLboolean value );
extern void
-_swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value );
+_swrast_allow_pixel_fog( struct gl_context *ctx, GLboolean value );
/* Debug:
*/
extern void
-_swrast_print_vertex( GLcontext *ctx, const SWvertex *v );
+_swrast_print_vertex( struct gl_context *ctx, const SWvertex *v );
extern void
-_swrast_eject_texture_images(GLcontext *ctx);
+_swrast_eject_texture_images(struct gl_context *ctx);
@@ -223,8 +223,8 @@ struct swrast_device_driver {
* these functions. Locking in that case must be organized by the
* driver by other mechanisms.
*/
- void (*SpanRenderStart)(GLcontext *ctx);
- void (*SpanRenderFinish)(GLcontext *ctx);
+ void (*SpanRenderStart)(struct gl_context *ctx);
+ void (*SpanRenderFinish)(struct gl_context *ctx);
};