Go to the source code of this file.
Data Structures | |
union | tgsi_exec_channel |
Registers may be treated as float, signed int or unsigned int. More... | |
struct | tgsi_exec_vector |
A vector[RGBA] of channels[4 pixels]. More... | |
struct | tgsi_interp_coef |
For fragment programs, information for computing fragment input values from plane equation of the triangle/line. More... | |
struct | tgsi_sampler |
Opaque to TGSI. More... | |
struct | tgsi_exec_labels |
For branching/calling subroutines. More... | |
struct | tgsi_call_record |
function call/activation record More... | |
struct | tgsi_exec_machine |
Run-time virtual machine state for executing TGSI shader. More... | |
Defines | |
#define | MAX_LABELS 1024 |
#define | NUM_CHANNELS 4 |
#define | QUAD_SIZE 4 |
#define | TGSI_EXEC_NUM_TEMPS 128 |
#define | TGSI_EXEC_NUM_TEMP_EXTRAS 6 |
#define | TGSI_EXEC_NUM_IMMEDIATES 256 |
#define | TGSI_EXEC_TEMP_00000000_I (TGSI_EXEC_NUM_TEMPS + 0) |
#define | TGSI_EXEC_TEMP_00000000_C 0 |
#define | TGSI_EXEC_TEMP_7FFFFFFF_I (TGSI_EXEC_NUM_TEMPS + 0) |
#define | TGSI_EXEC_TEMP_7FFFFFFF_C 1 |
#define | TGSI_EXEC_TEMP_80000000_I (TGSI_EXEC_NUM_TEMPS + 0) |
#define | TGSI_EXEC_TEMP_80000000_C 2 |
#define | TGSI_EXEC_TEMP_FFFFFFFF_I (TGSI_EXEC_NUM_TEMPS + 0) |
#define | TGSI_EXEC_TEMP_FFFFFFFF_C 3 |
#define | TGSI_EXEC_TEMP_ONE_I (TGSI_EXEC_NUM_TEMPS + 1) |
#define | TGSI_EXEC_TEMP_ONE_C 0 |
#define | TGSI_EXEC_TEMP_TWO_I (TGSI_EXEC_NUM_TEMPS + 1) |
#define | TGSI_EXEC_TEMP_TWO_C 1 |
#define | TGSI_EXEC_TEMP_128_I (TGSI_EXEC_NUM_TEMPS + 1) |
#define | TGSI_EXEC_TEMP_128_C 2 |
#define | TGSI_EXEC_TEMP_MINUS_128_I (TGSI_EXEC_NUM_TEMPS + 1) |
#define | TGSI_EXEC_TEMP_MINUS_128_C 3 |
#define | TGSI_EXEC_TEMP_KILMASK_I (TGSI_EXEC_NUM_TEMPS + 2) |
#define | TGSI_EXEC_TEMP_KILMASK_C 0 |
#define | TGSI_EXEC_TEMP_OUTPUT_I (TGSI_EXEC_NUM_TEMPS + 2) |
#define | TGSI_EXEC_TEMP_OUTPUT_C 1 |
#define | TGSI_EXEC_TEMP_PRIMITIVE_I (TGSI_EXEC_NUM_TEMPS + 2) |
#define | TGSI_EXEC_TEMP_PRIMITIVE_C 2 |
#define | TGSI_EXEC_CC_GT 0x01 |
#define | TGSI_EXEC_CC_EQ 0x02 |
#define | TGSI_EXEC_CC_LT 0x04 |
#define | TGSI_EXEC_CC_UN 0x08 |
#define | TGSI_EXEC_CC_X_MASK 0x000000ff |
#define | TGSI_EXEC_CC_X_SHIFT 0 |
#define | TGSI_EXEC_CC_Y_MASK 0x0000ff00 |
#define | TGSI_EXEC_CC_Y_SHIFT 8 |
#define | TGSI_EXEC_CC_Z_MASK 0x00ff0000 |
#define | TGSI_EXEC_CC_Z_SHIFT 16 |
#define | TGSI_EXEC_CC_W_MASK 0xff000000 |
#define | TGSI_EXEC_CC_W_SHIFT 24 |
#define | TGSI_EXEC_TEMP_CC_I (TGSI_EXEC_NUM_TEMPS + 2) |
#define | TGSI_EXEC_TEMP_CC_C 3 |
#define | TGSI_EXEC_TEMP_THREE_I (TGSI_EXEC_NUM_TEMPS + 3) |
#define | TGSI_EXEC_TEMP_THREE_C 0 |
#define | TGSI_EXEC_TEMP_HALF_I (TGSI_EXEC_NUM_TEMPS + 3) |
#define | TGSI_EXEC_TEMP_HALF_C 1 |
#define | TGSI_EXEC_MASK_I (TGSI_EXEC_NUM_TEMPS + 3) |
#define | TGSI_EXEC_MASK_C 2 |
#define | TGSI_EXEC_TEMP_R0 (TGSI_EXEC_NUM_TEMPS + 4) |
#define | TGSI_EXEC_TEMP_ADDR (TGSI_EXEC_NUM_TEMPS + 5) |
#define | TGSI_EXEC_MAX_COND_NESTING 20 |
#define | TGSI_EXEC_MAX_LOOP_NESTING 20 |
#define | TGSI_EXEC_MAX_CALL_NESTING 20 |
Functions | |
void | tgsi_exec_machine_init (struct tgsi_exec_machine *mach) |
void | tgsi_exec_machine_bind_shader (struct tgsi_exec_machine *mach, const struct tgsi_token *tokens, uint numSamplers, struct tgsi_sampler *samplers) |
Initialize machine state by expanding tokens to full instructions, allocating temporary storage, setting up constants, etc. | |
uint | tgsi_exec_machine_run (struct tgsi_exec_machine *mach) |
Run TGSI interpreter. | |
void | tgsi_exec_machine_free_data (struct tgsi_exec_machine *mach) |
static void | tgsi_set_kill_mask (struct tgsi_exec_machine *mach, unsigned mask) |
static void | tgsi_set_exec_mask (struct tgsi_exec_machine *mach, boolean ch0, boolean ch1, boolean ch2, boolean ch3) |
Set execution mask values prior to executing the shader. |
#define MAX_LABELS 1024 |
Definition at line 37 of file tgsi_exec.h.
#define NUM_CHANNELS 4 |
Definition at line 39 of file tgsi_exec.h.
#define QUAD_SIZE 4 |
Definition at line 40 of file tgsi_exec.h.
#define TGSI_EXEC_CC_EQ 0x02 |
Definition at line 146 of file tgsi_exec.h.
#define TGSI_EXEC_CC_GT 0x01 |
Definition at line 145 of file tgsi_exec.h.
#define TGSI_EXEC_CC_LT 0x04 |
Definition at line 147 of file tgsi_exec.h.
#define TGSI_EXEC_CC_UN 0x08 |
Definition at line 148 of file tgsi_exec.h.
#define TGSI_EXEC_CC_W_MASK 0xff000000 |
Definition at line 156 of file tgsi_exec.h.
#define TGSI_EXEC_CC_W_SHIFT 24 |
Definition at line 157 of file tgsi_exec.h.
#define TGSI_EXEC_CC_X_MASK 0x000000ff |
Definition at line 150 of file tgsi_exec.h.
#define TGSI_EXEC_CC_X_SHIFT 0 |
Definition at line 151 of file tgsi_exec.h.
#define TGSI_EXEC_CC_Y_MASK 0x0000ff00 |
Definition at line 152 of file tgsi_exec.h.
#define TGSI_EXEC_CC_Y_SHIFT 8 |
Definition at line 153 of file tgsi_exec.h.
#define TGSI_EXEC_CC_Z_MASK 0x00ff0000 |
Definition at line 154 of file tgsi_exec.h.
#define TGSI_EXEC_CC_Z_SHIFT 16 |
Definition at line 155 of file tgsi_exec.h.
#define TGSI_EXEC_MASK_C 2 |
Definition at line 170 of file tgsi_exec.h.
#define TGSI_EXEC_MASK_I (TGSI_EXEC_NUM_TEMPS + 3) |
Definition at line 169 of file tgsi_exec.h.
#define TGSI_EXEC_MAX_CALL_NESTING 20 |
Definition at line 179 of file tgsi_exec.h.
#define TGSI_EXEC_MAX_COND_NESTING 20 |
Definition at line 177 of file tgsi_exec.h.
#define TGSI_EXEC_MAX_LOOP_NESTING 20 |
Definition at line 178 of file tgsi_exec.h.
#define TGSI_EXEC_NUM_IMMEDIATES 256 |
Definition at line 105 of file tgsi_exec.h.
#define TGSI_EXEC_NUM_TEMP_EXTRAS 6 |
Definition at line 104 of file tgsi_exec.h.
#define TGSI_EXEC_NUM_TEMPS 128 |
Definition at line 103 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_00000000_C 0 |
Definition at line 111 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_00000000_I (TGSI_EXEC_NUM_TEMPS + 0) |
Definition at line 110 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_128_C 2 |
Definition at line 129 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_128_I (TGSI_EXEC_NUM_TEMPS + 1) |
Definition at line 128 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_7FFFFFFF_C 1 |
Definition at line 114 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_7FFFFFFF_I (TGSI_EXEC_NUM_TEMPS + 0) |
Definition at line 113 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_80000000_C 2 |
Definition at line 117 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_80000000_I (TGSI_EXEC_NUM_TEMPS + 0) |
Definition at line 116 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_ADDR (TGSI_EXEC_NUM_TEMPS + 5) |
Definition at line 174 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_CC_C 3 |
Definition at line 160 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_CC_I (TGSI_EXEC_NUM_TEMPS + 2) |
Definition at line 159 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_FFFFFFFF_C 3 |
Definition at line 120 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_FFFFFFFF_I (TGSI_EXEC_NUM_TEMPS + 0) |
Definition at line 119 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_HALF_C 1 |
Definition at line 166 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_HALF_I (TGSI_EXEC_NUM_TEMPS + 3) |
Definition at line 165 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_KILMASK_C 0 |
Definition at line 135 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_KILMASK_I (TGSI_EXEC_NUM_TEMPS + 2) |
Definition at line 134 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_MINUS_128_C 3 |
Definition at line 132 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_MINUS_128_I (TGSI_EXEC_NUM_TEMPS + 1) |
Definition at line 131 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_ONE_C 0 |
Definition at line 123 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_ONE_I (TGSI_EXEC_NUM_TEMPS + 1) |
Definition at line 122 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_OUTPUT_C 1 |
Definition at line 138 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_OUTPUT_I (TGSI_EXEC_NUM_TEMPS + 2) |
Definition at line 137 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_PRIMITIVE_C 2 |
Definition at line 141 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_PRIMITIVE_I (TGSI_EXEC_NUM_TEMPS + 2) |
Definition at line 140 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_R0 (TGSI_EXEC_NUM_TEMPS + 4) |
Definition at line 172 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_THREE_C 0 |
Definition at line 163 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_THREE_I (TGSI_EXEC_NUM_TEMPS + 3) |
Definition at line 162 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_TWO_C 1 |
Definition at line 126 of file tgsi_exec.h.
#define TGSI_EXEC_TEMP_TWO_I (TGSI_EXEC_NUM_TEMPS + 1) |
Definition at line 125 of file tgsi_exec.h.
void tgsi_exec_machine_bind_shader | ( | struct tgsi_exec_machine * | mach, | |
const struct tgsi_token * | tokens, | |||
uint | numSamplers, | |||
struct tgsi_sampler * | samplers | |||
) |
Initialize machine state by expanding tokens to full instructions, allocating temporary storage, setting up constants, etc.
After this, we can call tgsi_exec_machine_run() many times.
Definition at line 132 of file tgsi_exec.c.
References assert, tgsi_exec_labels::count, debug_printf(), tgsi_exec_machine::Declarations, tgsi_immediate_float32::Float, FREE, tgsi_full_token::FullDeclaration, tgsi_parse_context::FullHeader, tgsi_full_token::FullImmediate, tgsi_full_token::FullInstruction, tgsi_parse_context::FullToken, tgsi_full_immediate::Immediate, tgsi_full_immediate::ImmediateFloat32, tgsi_exec_machine::ImmLimit, tgsi_exec_machine::Imms, tgsi_exec_machine::Instructions, tgsi_exec_machine::Labels, tgsi_exec_labels::labels, MALLOC, MAX_LABELS, tgsi_exec_machine::NumDeclarations, tgsi_exec_machine::NumInstructions, tgsi_parse_context::Position, tgsi_processor::Processor, tgsi_full_header::Processor, tgsi_exec_machine::Processor, REALLOC, tgsi_exec_machine::Samplers, tgsi_immediate::Size, tgsi_dump(), TGSI_EXEC_NUM_IMMEDIATES, tgsi_parse_end_of_tokens(), tgsi_parse_free(), tgsi_parse_init(), TGSI_PARSE_OK, tgsi_parse_token(), TGSI_TOKEN_TYPE_DECLARATION, TGSI_TOKEN_TYPE_IMMEDIATE, TGSI_TOKEN_TYPE_INSTRUCTION, tgsi_full_token::Token, tgsi_exec_machine::Tokens, tgsi_token::Type, tgsi_full_immediate::u, and util_init_math().
00137 { 00138 uint k; 00139 struct tgsi_parse_context parse; 00140 struct tgsi_exec_labels *labels = &mach->Labels; 00141 struct tgsi_full_instruction *instructions; 00142 struct tgsi_full_declaration *declarations; 00143 uint maxInstructions = 10, numInstructions = 0; 00144 uint maxDeclarations = 10, numDeclarations = 0; 00145 uint instno = 0; 00146 00147 #if 0 00148 tgsi_dump(tokens, 0); 00149 #endif 00150 00151 util_init_math(); 00152 00153 mach->Tokens = tokens; 00154 mach->Samplers = samplers; 00155 00156 k = tgsi_parse_init (&parse, mach->Tokens); 00157 if (k != TGSI_PARSE_OK) { 00158 debug_printf( "Problem parsing!\n" ); 00159 return; 00160 } 00161 00162 mach->Processor = parse.FullHeader.Processor.Processor; 00163 mach->ImmLimit = 0; 00164 labels->count = 0; 00165 00166 declarations = (struct tgsi_full_declaration *) 00167 MALLOC( maxDeclarations * sizeof(struct tgsi_full_declaration) ); 00168 00169 if (!declarations) { 00170 return; 00171 } 00172 00173 instructions = (struct tgsi_full_instruction *) 00174 MALLOC( maxInstructions * sizeof(struct tgsi_full_instruction) ); 00175 00176 if (!instructions) { 00177 FREE( declarations ); 00178 return; 00179 } 00180 00181 while( !tgsi_parse_end_of_tokens( &parse ) ) { 00182 uint pointer = parse.Position; 00183 uint i; 00184 00185 tgsi_parse_token( &parse ); 00186 switch( parse.FullToken.Token.Type ) { 00187 case TGSI_TOKEN_TYPE_DECLARATION: 00188 /* save expanded declaration */ 00189 if (numDeclarations == maxDeclarations) { 00190 declarations = REALLOC(declarations, 00191 maxDeclarations 00192 * sizeof(struct tgsi_full_declaration), 00193 (maxDeclarations + 10) 00194 * sizeof(struct tgsi_full_declaration)); 00195 maxDeclarations += 10; 00196 } 00197 memcpy(declarations + numDeclarations, 00198 &parse.FullToken.FullDeclaration, 00199 sizeof(declarations[0])); 00200 numDeclarations++; 00201 break; 00202 00203 case TGSI_TOKEN_TYPE_IMMEDIATE: 00204 { 00205 uint size = parse.FullToken.FullImmediate.Immediate.Size - 1; 00206 assert( size % 4 == 0 ); 00207 assert( mach->ImmLimit + size / 4 <= TGSI_EXEC_NUM_IMMEDIATES ); 00208 00209 for( i = 0; i < size; i++ ) { 00210 mach->Imms[mach->ImmLimit + i / 4][i % 4] = 00211 parse.FullToken.FullImmediate.u.ImmediateFloat32[i].Float; 00212 } 00213 mach->ImmLimit += size / 4; 00214 } 00215 break; 00216 00217 case TGSI_TOKEN_TYPE_INSTRUCTION: 00218 assert( labels->count < MAX_LABELS ); 00219 00220 labels->labels[labels->count][0] = instno; 00221 labels->labels[labels->count][1] = pointer; 00222 labels->count++; 00223 00224 /* save expanded instruction */ 00225 if (numInstructions == maxInstructions) { 00226 instructions = REALLOC(instructions, 00227 maxInstructions 00228 * sizeof(struct tgsi_full_instruction), 00229 (maxInstructions + 10) 00230 * sizeof(struct tgsi_full_instruction)); 00231 maxInstructions += 10; 00232 } 00233 memcpy(instructions + numInstructions, 00234 &parse.FullToken.FullInstruction, 00235 sizeof(instructions[0])); 00236 numInstructions++; 00237 break; 00238 00239 default: 00240 assert( 0 ); 00241 } 00242 } 00243 tgsi_parse_free (&parse); 00244 00245 if (mach->Declarations) { 00246 FREE( mach->Declarations ); 00247 } 00248 mach->Declarations = declarations; 00249 mach->NumDeclarations = numDeclarations; 00250 00251 if (mach->Instructions) { 00252 FREE( mach->Instructions ); 00253 } 00254 mach->Instructions = instructions; 00255 mach->NumInstructions = numInstructions; 00256 }
void tgsi_exec_machine_free_data | ( | struct tgsi_exec_machine * | mach | ) |
Definition at line 285 of file tgsi_exec.c.
References tgsi_exec_machine::Declarations, FREE, tgsi_exec_machine::Instructions, tgsi_exec_machine::NumDeclarations, and tgsi_exec_machine::NumInstructions.
00286 { 00287 if (mach->Instructions) { 00288 FREE(mach->Instructions); 00289 mach->Instructions = NULL; 00290 mach->NumInstructions = 0; 00291 } 00292 if (mach->Declarations) { 00293 FREE(mach->Declarations); 00294 mach->Declarations = NULL; 00295 mach->NumDeclarations = 0; 00296 } 00297 }
void tgsi_exec_machine_init | ( | struct tgsi_exec_machine * | mach | ) |
Definition at line 260 of file tgsi_exec.c.
References tgsi_exec_machine::_Temps, tgsi_exec_machine::Addrs, tgsi_exec_channel::f, TEMP_0_C, TEMP_0_I, TEMP_128_C, TEMP_128_I, TEMP_1_C, TEMP_1_I, TEMP_2_C, TEMP_2_I, TEMP_3_C, TEMP_3_I, TEMP_7F_C, TEMP_7F_I, TEMP_80_C, TEMP_80_I, TEMP_FF_C, TEMP_FF_I, TEMP_HALF_C, TEMP_HALF_I, TEMP_M128_C, TEMP_M128_I, tgsi_exec_machine::Temps, tgsi_align_128bit(), TGSI_EXEC_TEMP_ADDR, tgsi_exec_channel::u, and tgsi_exec_vector::xyzw.
00262 { 00263 uint i; 00264 00265 mach->Temps = (struct tgsi_exec_vector *) tgsi_align_128bit( mach->_Temps); 00266 mach->Addrs = &mach->Temps[TGSI_EXEC_TEMP_ADDR]; 00267 00268 /* Setup constants. */ 00269 for( i = 0; i < 4; i++ ) { 00270 mach->Temps[TEMP_0_I].xyzw[TEMP_0_C].u[i] = 0x00000000; 00271 mach->Temps[TEMP_7F_I].xyzw[TEMP_7F_C].u[i] = 0x7FFFFFFF; 00272 mach->Temps[TEMP_80_I].xyzw[TEMP_80_C].u[i] = 0x80000000; 00273 mach->Temps[TEMP_FF_I].xyzw[TEMP_FF_C].u[i] = 0xFFFFFFFF; 00274 mach->Temps[TEMP_1_I].xyzw[TEMP_1_C].f[i] = 1.0f; 00275 mach->Temps[TEMP_2_I].xyzw[TEMP_2_C].f[i] = 2.0f; 00276 mach->Temps[TEMP_128_I].xyzw[TEMP_128_C].f[i] = 128.0f; 00277 mach->Temps[TEMP_M128_I].xyzw[TEMP_M128_C].f[i] = -128.0f; 00278 mach->Temps[TEMP_3_I].xyzw[TEMP_3_C].f[i] = 3.0f; 00279 mach->Temps[TEMP_HALF_I].xyzw[TEMP_HALF_C].f[i] = 0.5f; 00280 } 00281 }
uint tgsi_exec_machine_run | ( | struct tgsi_exec_machine * | mach | ) |
Run TGSI interpreter.
Definition at line 3006 of file tgsi_exec.c.
03011 { 03012 uint i; 03013 int pc = 0; 03014 03015 mach->CondMask = 0xf; 03016 mach->LoopMask = 0xf; 03017 mach->ContMask = 0xf; 03018 mach->FuncMask = 0xf; 03019 mach->ExecMask = 0xf; 03020 03021 mach->CondStackTop = 0; 03022 mach->LoopStackTop = 0; 03023 mach->ContStackTop = 0; 03024 mach->CallStackTop = 0; 03025 03026 mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] = 0; 03027 mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] = 0; 03028 03029 if( mach->Processor == TGSI_PROCESSOR_GEOMETRY ) { 03030 mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0] = 0; 03031 mach->Primitives[0] = 0; 03032 } 03033 03034 for (i = 0; i < QUAD_SIZE; i++) { 03035 mach->Temps[TEMP_CC_I].xyzw[TEMP_CC_C].u[i] = 03036 (TGSI_EXEC_CC_EQ << TGSI_EXEC_CC_X_SHIFT) | 03037 (TGSI_EXEC_CC_EQ << TGSI_EXEC_CC_Y_SHIFT) | 03038 (TGSI_EXEC_CC_EQ << TGSI_EXEC_CC_Z_SHIFT) | 03039 (TGSI_EXEC_CC_EQ << TGSI_EXEC_CC_W_SHIFT); 03040 } 03041 03042 /* execute declarations (interpolants) */ 03043 for (i = 0; i < mach->NumDeclarations; i++) { 03044 exec_declaration( mach, mach->Declarations+i ); 03045 } 03046 03047 /* execute instructions, until pc is set to -1 */ 03048 while (pc != -1) { 03049 assert(pc < (int) mach->NumInstructions); 03050 exec_instruction( mach, mach->Instructions + pc, &pc ); 03051 } 03052 03053 assert(mach->CondStackTop == 0); 03054 assert(mach->LoopStackTop == 0); 03055 assert(mach->ContStackTop == 0); 03056 assert(mach->CallStackTop == 0); 03057 03058 #if 0 03059 /* we scale from floats in [0,1] to Zbuffer ints in sp_quad_depth_test.c */ 03060 if (mach->Processor == TGSI_PROCESSOR_FRAGMENT) { 03061 /* 03062 * Scale back depth component. 03063 */ 03064 for (i = 0; i < 4; i++) 03065 mach->Outputs[0].xyzw[2].f[i] *= ctx->DrawBuffer->_DepthMaxF; 03066 }
static void tgsi_set_exec_mask | ( | struct tgsi_exec_machine * | mach, | |
boolean | ch0, | |||
boolean | ch1, | |||
boolean | ch2, | |||
boolean | ch3 | |||
) | [static] |
Set execution mask values prior to executing the shader.
Definition at line 301 of file tgsi_exec.h.
References tgsi_exec_channel::i, tgsi_exec_machine::Temps, TGSI_EXEC_MASK_C, TGSI_EXEC_MASK_I, and tgsi_exec_vector::xyzw.
00303 { 00304 int *mask = mach->Temps[TGSI_EXEC_MASK_I].xyzw[TGSI_EXEC_MASK_C].i; 00305 mask[0] = ch0 ? ~0 : 0; 00306 mask[1] = ch1 ? ~0 : 0; 00307 mask[2] = ch2 ? ~0 : 0; 00308 mask[3] = ch3 ? ~0 : 0; 00309 }
static void tgsi_set_kill_mask | ( | struct tgsi_exec_machine * | mach, | |
unsigned | mask | |||
) | [static] |
Definition at line 292 of file tgsi_exec.h.
References tgsi_exec_machine::Temps, TGSI_EXEC_TEMP_KILMASK_C, TGSI_EXEC_TEMP_KILMASK_I, tgsi_exec_channel::u, and tgsi_exec_vector::xyzw.
00293 { 00294 mach->Temps[TGSI_EXEC_TEMP_KILMASK_I].xyzw[TGSI_EXEC_TEMP_KILMASK_C].u[0] = 00295 mask; 00296 }