Go to the source code of this file.
Functions | |
struct sp_fragment_shader * | softpipe_create_fs_exec (struct softpipe_context *softpipe, const struct pipe_shader_state *templ) |
struct sp_fragment_shader * | softpipe_create_fs_sse (struct softpipe_context *softpipe, const struct pipe_shader_state *templ) |
struct sp_fragment_shader * | softpipe_create_fs_llvm (struct softpipe_context *softpipe, const struct pipe_shader_state *templ) |
void | sp_setup_pos_vector (const struct tgsi_interp_coef *coef, float x, float y, struct tgsi_exec_vector *quadpos) |
Compute quad X,Y,Z,W for the four fragments in a quad. |
struct sp_fragment_shader* softpipe_create_fs_exec | ( | struct softpipe_context * | softpipe, | |
const struct pipe_shader_state * | templ | |||
) | [read] |
Definition at line 129 of file sp_fs_exec.c.
References sp_exec_fragment_shader::base, CALLOC_STRUCT, sp_fragment_shader::delete, exec_delete(), exec_prepare(), exec_run(), sp_fragment_shader::prepare, sp_fragment_shader::run, sp_fragment_shader::shader, tgsi_dup_tokens(), and pipe_shader_state::tokens.
00131 { 00132 struct sp_exec_fragment_shader *shader; 00133 00134 /* Decide whether we'll be codegenerating this shader and if so do 00135 * that now. 00136 */ 00137 00138 shader = CALLOC_STRUCT(sp_exec_fragment_shader); 00139 if (!shader) 00140 return NULL; 00141 00142 /* we need to keep a local copy of the tokens */ 00143 shader->base.shader.tokens = tgsi_dup_tokens(templ->tokens); 00144 shader->base.prepare = exec_prepare; 00145 shader->base.run = exec_run; 00146 shader->base.delete = exec_delete; 00147 00148 return &shader->base; 00149 }
struct sp_fragment_shader* softpipe_create_fs_llvm | ( | struct softpipe_context * | softpipe, | |
const struct pipe_shader_state * | templ | |||
) | [read] |
struct sp_fragment_shader* softpipe_create_fs_sse | ( | struct softpipe_context * | softpipe, | |
const struct pipe_shader_state * | templ | |||
) | [read] |
void sp_setup_pos_vector | ( | const struct tgsi_interp_coef * | coef, | |
float | x, | |||
float | y, | |||
struct tgsi_exec_vector * | quadpos | |||
) |
Compute quad X,Y,Z,W for the four fragments in a quad.
This should really be part of the compiled shader.
Definition at line 54 of file sp_fs_exec.c.
References tgsi_interp_coef::a0, tgsi_interp_coef::dadx, tgsi_interp_coef::dady, tgsi_exec_channel::f, and tgsi_exec_vector::xyzw.
00057 { 00058 uint chan; 00059 /* do X */ 00060 quadpos->xyzw[0].f[0] = x; 00061 quadpos->xyzw[0].f[1] = x + 1; 00062 quadpos->xyzw[0].f[2] = x; 00063 quadpos->xyzw[0].f[3] = x + 1; 00064 00065 /* do Y */ 00066 quadpos->xyzw[1].f[0] = y; 00067 quadpos->xyzw[1].f[1] = y; 00068 quadpos->xyzw[1].f[2] = y + 1; 00069 quadpos->xyzw[1].f[3] = y + 1; 00070 00071 /* do Z and W for all fragments in the quad */ 00072 for (chan = 2; chan < 4; chan++) { 00073 const float dadx = coef->dadx[chan]; 00074 const float dady = coef->dady[chan]; 00075 const float a0 = coef->a0[chan] + dadx * x + dady * y; 00076 quadpos->xyzw[chan].f[0] = a0; 00077 quadpos->xyzw[chan].f[1] = a0 + dadx; 00078 quadpos->xyzw[chan].f[2] = a0 + dady; 00079 quadpos->xyzw[chan].f[3] = a0 + dadx + dady; 00080 } 00081 }