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

s_atifragshader.c File Reference

#include "main/glheader.h"
#include "main/colormac.h"
#include "main/context.h"
#include "main/macros.h"
#include "shader/program.h"
#include "shader/atifragshader.h"
#include "swrast/s_atifragshader.h"

Data Structures

struct  atifs_machine
 State for executing ATI fragment shader. More...

Defines

#define SETUP_SRC_REG(optype, i, x)

Functions

static void fetch_texel (GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, GLuint unit, GLfloat color[4])
 Fetch a texel.
static void apply_swizzle (GLfloat values[4], GLuint swizzle)
static void apply_src_rep (GLint optype, GLuint rep, GLfloat *val)
static void apply_src_mod (GLint optype, GLuint mod, GLfloat *val)
static void apply_dst_mod (GLuint optype, GLuint mod, GLfloat *val)
static void write_dst_addr (GLuint optype, GLuint mod, GLuint mask, GLfloat *src, GLfloat *dst)
static void finish_pass (struct atifs_machine *machine)
static void handle_pass_op (struct atifs_machine *machine, struct atifs_setupinst *texinst, const SWspan *span, GLuint column, GLuint idx)
static void handle_sample_op (GLcontext *ctx, struct atifs_machine *machine, struct atifs_setupinst *texinst, const SWspan *span, GLuint column, GLuint idx)
static void execute_shader (GLcontext *ctx, const struct ati_fragment_shader *shader, struct atifs_machine *machine, const SWspan *span, GLuint column)
 Execute the given fragment shader.
static void init_machine (GLcontext *ctx, struct atifs_machine *machine, const struct ati_fragment_shader *shader, const SWspan *span, GLuint col)
 Init fragment shader virtual machine state.
void _swrast_exec_fragment_shader (GLcontext *ctx, SWspan *span)
 Execute the current ATI shader program, operating on the given span.

Variables

struct ati_fs_opcode_st ati_fs_opcodes []


Define Documentation

#define SETUP_SRC_REG ( optype,
i,
 ) 

Value:

do {                                            \
   COPY_4V(src[optype][i], x);                  \
} while (0)


Function Documentation

void _swrast_exec_fragment_shader ( GLcontext ctx,
SWspan span 
)

Execute the current ATI shader program, operating on the given span.

static void apply_dst_mod ( GLuint  optype,
GLuint  mod,
GLfloat *  val 
) [static]

static void apply_src_mod ( GLint  optype,
GLuint  mod,
GLfloat *  val 
) [static]

static void apply_src_rep ( GLint  optype,
GLuint  rep,
GLfloat *  val 
) [static]

static void apply_swizzle ( GLfloat  values[4],
GLuint  swizzle 
) [static]

static void execute_shader ( GLcontext ctx,
const struct ati_fragment_shader shader,
struct atifs_machine machine,
const SWspan span,
GLuint  column 
) [static]

Execute the given fragment shader.

NOTE: we do everything in single-precision floating point

Parameters:
ctx - rendering context
shader - the shader to execute
machine - virtual machine state
span - the SWspan we're operating on
column - which pixel [i] we're operating on in the span

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

Fetch a texel.

static void finish_pass ( struct atifs_machine machine  )  [static]

static void handle_pass_op ( struct atifs_machine machine,
struct atifs_setupinst *  texinst,
const SWspan span,
GLuint  column,
GLuint  idx 
) [static]

static void handle_sample_op ( GLcontext ctx,
struct atifs_machine machine,
struct atifs_setupinst *  texinst,
const SWspan span,
GLuint  column,
GLuint  idx 
) [static]

static void init_machine ( GLcontext ctx,
struct atifs_machine machine,
const struct ati_fragment_shader shader,
const SWspan span,
GLuint  col 
) [static]

Init fragment shader virtual machine state.

static void write_dst_addr ( GLuint  optype,
GLuint  mod,
GLuint  mask,
GLfloat *  src,
GLfloat *  dst 
) [static]


Variable Documentation

struct ati_fs_opcode_st ati_fs_opcodes[]

Initial value:

 {
   {GL_ADD_ATI, 2},
   {GL_SUB_ATI, 2},
   {GL_MUL_ATI, 2},
   {GL_MAD_ATI, 3},
   {GL_LERP_ATI, 3},
   {GL_MOV_ATI, 1},
   {GL_CND_ATI, 3},
   {GL_CND0_ATI, 3},
   {GL_DOT2_ADD_ATI, 3},
   {GL_DOT3_ATI, 2},
   {GL_DOT4_ATI, 2}
}


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