core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

s_fragprog.c File Reference

#include "main/glheader.h"
#include "main/colormac.h"
#include "main/context.h"
#include "main/texstate.h"
#include "shader/prog_instruction.h"
#include "s_fragprog.h"
#include "s_span.h"

Functions

static INLINE void swizzle_texel (const GLfloat texel[4], GLfloat colorOut[4], GLuint swizzle)
 Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel' and return results in 'colorOut'.
static void fetch_texel_lod (GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, GLuint unit, GLfloat color[4])
 Fetch a texel with given lod.
static void fetch_texel_deriv (GLcontext *ctx, const GLfloat texcoord[4], const GLfloat texdx[4], const GLfloat texdy[4], GLfloat lodBias, GLuint unit, GLfloat color[4])
 Fetch a texel with the given partial derivatives to compute a level of detail in the mipmap.
static void init_machine (GLcontext *ctx, struct gl_program_machine *machine, const struct gl_fragment_program *program, const SWspan *span, GLuint col)
 Initialize the virtual fragment program machine state prior to running fragment program on a fragment.
static void run_program (GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
 Run fragment program on the pixels in span from 'start' to 'end' - 1.
void _swrast_exec_fragment_program (GLcontext *ctx, SWspan *span)
 Execute the current fragment program for all the fragments in the given span.


Function Documentation

void _swrast_exec_fragment_program ( GLcontext ctx,
SWspan span 
)

Execute the current fragment program for all the fragments in the given span.

static void fetch_texel_deriv ( GLcontext ctx,
const GLfloat  texcoord[4],
const GLfloat  texdx[4],
const GLfloat  texdy[4],
GLfloat  lodBias,
GLuint  unit,
GLfloat  color[4] 
) [static]

Fetch a texel with the given partial derivatives to compute a level of detail in the mipmap.

Called via machine->FetchTexelDeriv()

Parameters:
lodBias the lod bias which may be specified by a TXB instruction, otherwise zero.

static void fetch_texel_lod ( GLcontext ctx,
const GLfloat  texcoord[4],
GLfloat  lambda,
GLuint  unit,
GLfloat  color[4] 
) [static]

Fetch a texel with given lod.

Called via machine->FetchTexelLod()

static void init_machine ( GLcontext ctx,
struct gl_program_machine *  machine,
const struct gl_fragment_program program,
const SWspan span,
GLuint  col 
) [static]

Initialize the virtual fragment program machine state prior to running fragment program on a fragment.

This involves initializing the input registers, condition codes, etc.

Parameters:
machine the virtual machine state to init
program the fragment program we're about to run
span the span of pixels we'll operate on
col which element (column) of the span we'll operate on

static void run_program ( GLcontext ctx,
SWspan span,
GLuint  start,
GLuint  end 
) [static]

Run fragment program on the pixels in span from 'start' to 'end' - 1.

static INLINE void swizzle_texel ( const GLfloat  texel[4],
GLfloat  colorOut[4],
GLuint  swizzle 
) [static]

Apply texture object's swizzle (X/Y/Z/W/0/1) to incoming 'texel' and return results in 'colorOut'.


Generated on Sun Sep 27 06:48:05 2009 for Mesa Software Rasterization (swrast) by  doxygen 1.5.4