Lines Matching refs:inst
254 struct prog_instruction *newInst, *inst; in _mesa_append_fog_code() local
296 inst = newInst; in _mesa_append_fog_code()
298 if (inst->Opcode == OPCODE_END) in _mesa_append_fog_code()
300 if (inst->DstReg.File == PROGRAM_OUTPUT && in _mesa_append_fog_code()
301 inst->DstReg.Index == FRAG_RESULT_COLOR) { in _mesa_append_fog_code()
303 inst->DstReg.File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
304 inst->DstReg.Index = colorTemp; in _mesa_append_fog_code()
305 inst->Saturate = saturate; in _mesa_append_fog_code()
308 inst++; in _mesa_append_fog_code()
310 assert(inst->Opcode == OPCODE_END); /* we'll overwrite this inst */ in _mesa_append_fog_code()
312 _mesa_init_instructions(inst, 5); in _mesa_append_fog_code()
318 inst->Opcode = OPCODE_MAD; in _mesa_append_fog_code()
319 inst->DstReg.File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
320 inst->DstReg.Index = fogFactorTemp; in _mesa_append_fog_code()
321 inst->DstReg.WriteMask = WRITEMASK_X; in _mesa_append_fog_code()
322 inst->SrcReg[0].File = PROGRAM_INPUT; in _mesa_append_fog_code()
323 inst->SrcReg[0].Index = VARYING_SLOT_FOGC; in _mesa_append_fog_code()
324 inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; in _mesa_append_fog_code()
325 inst->SrcReg[1].File = PROGRAM_STATE_VAR; in _mesa_append_fog_code()
326 inst->SrcReg[1].Index = fogPRefOpt; in _mesa_append_fog_code()
327 inst->SrcReg[1].Swizzle = SWIZZLE_XXXX; in _mesa_append_fog_code()
328 inst->SrcReg[2].File = PROGRAM_STATE_VAR; in _mesa_append_fog_code()
329 inst->SrcReg[2].Index = fogPRefOpt; in _mesa_append_fog_code()
330 inst->SrcReg[2].Swizzle = SWIZZLE_YYYY; in _mesa_append_fog_code()
331 inst->Saturate = GL_TRUE; in _mesa_append_fog_code()
332 inst++; in _mesa_append_fog_code()
339 inst->Opcode = OPCODE_MUL; in _mesa_append_fog_code()
340 inst->DstReg.File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
341 inst->DstReg.Index = fogFactorTemp; in _mesa_append_fog_code()
342 inst->DstReg.WriteMask = WRITEMASK_X; in _mesa_append_fog_code()
343 inst->SrcReg[0].File = PROGRAM_STATE_VAR; in _mesa_append_fog_code()
344 inst->SrcReg[0].Index = fogPRefOpt; in _mesa_append_fog_code()
345 inst->SrcReg[0].Swizzle in _mesa_append_fog_code()
347 inst->SrcReg[1].File = PROGRAM_INPUT; in _mesa_append_fog_code()
348 inst->SrcReg[1].Index = VARYING_SLOT_FOGC; in _mesa_append_fog_code()
349 inst->SrcReg[1].Swizzle = SWIZZLE_XXXX; in _mesa_append_fog_code()
350 inst++; in _mesa_append_fog_code()
353 inst->Opcode = OPCODE_MUL; in _mesa_append_fog_code()
354 inst->DstReg.File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
355 inst->DstReg.Index = fogFactorTemp; in _mesa_append_fog_code()
356 inst->DstReg.WriteMask = WRITEMASK_X; in _mesa_append_fog_code()
357 inst->SrcReg[0].File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
358 inst->SrcReg[0].Index = fogFactorTemp; in _mesa_append_fog_code()
359 inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; in _mesa_append_fog_code()
360 inst->SrcReg[1].File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
361 inst->SrcReg[1].Index = fogFactorTemp; in _mesa_append_fog_code()
362 inst->SrcReg[1].Swizzle = SWIZZLE_XXXX; in _mesa_append_fog_code()
363 inst++; in _mesa_append_fog_code()
366 inst->Opcode = OPCODE_EX2; in _mesa_append_fog_code()
367 inst->DstReg.File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
368 inst->DstReg.Index = fogFactorTemp; in _mesa_append_fog_code()
369 inst->DstReg.WriteMask = WRITEMASK_X; in _mesa_append_fog_code()
370 inst->SrcReg[0].File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
371 inst->SrcReg[0].Index = fogFactorTemp; in _mesa_append_fog_code()
372 inst->SrcReg[0].Negate = NEGATE_XYZW; in _mesa_append_fog_code()
373 inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; in _mesa_append_fog_code()
374 inst->Saturate = GL_TRUE; in _mesa_append_fog_code()
375 inst++; in _mesa_append_fog_code()
378 inst->Opcode = OPCODE_LRP; in _mesa_append_fog_code()
379 inst->DstReg.File = PROGRAM_OUTPUT; in _mesa_append_fog_code()
380 inst->DstReg.Index = FRAG_RESULT_COLOR; in _mesa_append_fog_code()
381 inst->DstReg.WriteMask = WRITEMASK_XYZ; in _mesa_append_fog_code()
382 inst->SrcReg[0].File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
383 inst->SrcReg[0].Index = fogFactorTemp; in _mesa_append_fog_code()
384 inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; in _mesa_append_fog_code()
385 inst->SrcReg[1].File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
386 inst->SrcReg[1].Index = colorTemp; in _mesa_append_fog_code()
387 inst->SrcReg[1].Swizzle = SWIZZLE_NOOP; in _mesa_append_fog_code()
388 inst->SrcReg[2].File = PROGRAM_STATE_VAR; in _mesa_append_fog_code()
389 inst->SrcReg[2].Index = fogColorRef; in _mesa_append_fog_code()
390 inst->SrcReg[2].Swizzle = SWIZZLE_NOOP; in _mesa_append_fog_code()
391 inst++; in _mesa_append_fog_code()
393 inst->Opcode = OPCODE_MOV; in _mesa_append_fog_code()
394 inst->DstReg.File = PROGRAM_OUTPUT; in _mesa_append_fog_code()
395 inst->DstReg.Index = FRAG_RESULT_COLOR; in _mesa_append_fog_code()
396 inst->DstReg.WriteMask = WRITEMASK_W; in _mesa_append_fog_code()
397 inst->SrcReg[0].File = PROGRAM_TEMPORARY; in _mesa_append_fog_code()
398 inst->SrcReg[0].Index = colorTemp; in _mesa_append_fog_code()
399 inst->SrcReg[0].Swizzle = SWIZZLE_NOOP; in _mesa_append_fog_code()
400 inst++; in _mesa_append_fog_code()
402 inst->Opcode = OPCODE_END; in _mesa_append_fog_code()
403 inst++; in _mesa_append_fog_code()
410 fprog->arb.NumInstructions = inst - newInst; in _mesa_append_fog_code()
418 is_texture_instruction(const struct prog_instruction *inst) in is_texture_instruction() argument
420 switch (inst->Opcode) { in is_texture_instruction()
449 const struct prog_instruction *inst = prog->arb.Instructions + i; in _mesa_count_texture_indirections() local
451 if (is_texture_instruction(inst)) { in _mesa_count_texture_indirections()
452 if (((inst->SrcReg[0].File == PROGRAM_TEMPORARY) && in _mesa_count_texture_indirections()
453 (tempsOutput & (1 << inst->SrcReg[0].Index))) || in _mesa_count_texture_indirections()
454 ((inst->Opcode != OPCODE_KIL) && in _mesa_count_texture_indirections()
455 (inst->DstReg.File == PROGRAM_TEMPORARY) && in _mesa_count_texture_indirections()
456 (aluTemps & (1 << inst->DstReg.Index)))) in _mesa_count_texture_indirections()
466 if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) in _mesa_count_texture_indirections()
467 aluTemps |= (1 << inst->SrcReg[j].Index); in _mesa_count_texture_indirections()
469 if (inst->DstReg.File == PROGRAM_TEMPORARY) in _mesa_count_texture_indirections()
470 aluTemps |= (1 << inst->DstReg.Index); in _mesa_count_texture_indirections()
473 if ((inst->Opcode != OPCODE_KIL) && (inst->DstReg.File == PROGRAM_TEMPORARY)) in _mesa_count_texture_indirections()
474 tempsOutput |= (1 << inst->DstReg.Index); in _mesa_count_texture_indirections()
522 struct prog_instruction *inst = prog->arb.Instructions + i; in _mesa_remove_output_reads() local
523 const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); in _mesa_remove_output_reads()
526 if (inst->SrcReg[j].File == type) { in _mesa_remove_output_reads()
528 const GLuint var = inst->SrcReg[j].Index; in _mesa_remove_output_reads()
536 inst->SrcReg[j].File = PROGRAM_TEMPORARY; in _mesa_remove_output_reads()
537 inst->SrcReg[j].Index = outputMap[var]; in _mesa_remove_output_reads()
547 struct prog_instruction *inst = prog->arb.Instructions + i; in _mesa_remove_output_reads() local
548 if (inst->DstReg.File == type && in _mesa_remove_output_reads()
549 outputMap[inst->DstReg.Index] >= 0) { in _mesa_remove_output_reads()
551 inst->DstReg.File = PROGRAM_TEMPORARY; in _mesa_remove_output_reads()
552 inst->DstReg.Index = outputMap[inst->DstReg.Index]; in _mesa_remove_output_reads()
558 struct prog_instruction *inst; in _mesa_remove_output_reads() local
564 struct prog_instruction *inst = prog->arb.Instructions + i; in _mesa_remove_output_reads() local
565 if (inst->Opcode == OPCODE_END) { in _mesa_remove_output_reads()
575 inst = prog->arb.Instructions + endPos; in _mesa_remove_output_reads()
579 inst->Opcode = OPCODE_MOV; in _mesa_remove_output_reads()
580 inst->DstReg.File = type; in _mesa_remove_output_reads()
581 inst->DstReg.Index = var; in _mesa_remove_output_reads()
582 inst->SrcReg[0].File = PROGRAM_TEMPORARY; in _mesa_remove_output_reads()
583 inst->SrcReg[0].Index = outputMap[var]; in _mesa_remove_output_reads()
584 inst++; in _mesa_remove_output_reads()
603 struct prog_instruction *inst = prog->arb.Instructions + i; in _mesa_program_fragment_position_to_sysval() local
604 const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); in _mesa_program_fragment_position_to_sysval()
608 if (inst->SrcReg[j].File == PROGRAM_INPUT && in _mesa_program_fragment_position_to_sysval()
609 inst->SrcReg[j].Index == VARYING_SLOT_POS) { in _mesa_program_fragment_position_to_sysval()
610 inst->SrcReg[j].File = PROGRAM_SYSTEM_VALUE; in _mesa_program_fragment_position_to_sysval()
611 inst->SrcReg[j].Index = SYSTEM_VALUE_FRAG_COORD; in _mesa_program_fragment_position_to_sysval()