r5xx: Enable fragment.position, partial ARB_shadow.
I don't like PROGRAM_BUILTIN; could we either patch Mesa or just use a different constant?
This commit is contained in:
parent
7413c55d93
commit
f1ae5d4b44
|
@ -65,21 +65,17 @@ static GLboolean transform_TEX(
|
|||
tgt = radeonClauseInsertInstructions(context->compiler, context->dest,
|
||||
context->dest->NumInstructions, 1);
|
||||
|
||||
tgt->Opcode = OPCODE_MAD;
|
||||
tgt->DstReg = inst.DstReg;
|
||||
tgt->Opcode = OPCODE_MOV;
|
||||
tgt->DstReg.File = inst.DstReg.File;
|
||||
tgt->DstReg.Index = inst.DstReg.Index;
|
||||
tgt->DstReg.WriteMask = inst.DstReg.WriteMask;
|
||||
tgt->SrcReg[0].File = PROGRAM_BUILTIN;
|
||||
tgt->SrcReg[0].Swizzle = SWIZZLE_0000;
|
||||
tgt->SrcReg[1].File = PROGRAM_BUILTIN;
|
||||
tgt->SrcReg[1].Swizzle = SWIZZLE_0000;
|
||||
tgt->SrcReg[2].File = PROGRAM_BUILTIN;
|
||||
tgt->SrcReg[2].Swizzle = comparefunc == GL_ALWAYS ? SWIZZLE_1111 : SWIZZLE_0000;
|
||||
tgt->SrcReg[0].Swizzle = comparefunc == GL_ALWAYS ? SWIZZLE_1111 : SWIZZLE_0000;
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
int tempreg = radeonCompilerAllocateTemporary(context->compiler);
|
||||
|
||||
inst.DstReg.File = PROGRAM_TEMPORARY;
|
||||
inst.DstReg.Index = tempreg;
|
||||
inst.DstReg.Index = radeonCompilerAllocateTemporary(context->compiler);
|
||||
inst.DstReg.WriteMask = WRITEMASK_XYZW;
|
||||
}
|
||||
|
||||
|
@ -317,7 +313,7 @@ void r500TranslateFragmentShader(r300ContextPtr r300,
|
|||
|
||||
radeonCompilerInit(&compiler.compiler, r300->radeon.glCtx, &fp->mesa_program.Base);
|
||||
|
||||
/* insert_WPOS_trailer(&compiler); */
|
||||
insert_WPOS_trailer(&compiler);
|
||||
|
||||
struct radeon_program_transformation transformations[1] = {
|
||||
{ &transform_TEX, &compiler }
|
||||
|
|
|
@ -323,6 +323,9 @@ static GLuint make_src(struct r500_pfs_compile_state *cs, struct prog_src_regist
|
|||
reg = emit_const4fv(cs,
|
||||
cs->compiler->fp->mesa_program.Base.Parameters->ParameterValues[src.Index]);
|
||||
break;
|
||||
case PROGRAM_BUILTIN:
|
||||
reg = 0x0;
|
||||
break;
|
||||
default:
|
||||
ERROR("Can't handle src.File %x\n", src.File);
|
||||
reg = 0x0;
|
||||
|
@ -335,18 +338,21 @@ static GLuint make_dest(struct r500_pfs_compile_state *cs, struct prog_dst_regis
|
|||
PROG_CODE;
|
||||
GLuint reg;
|
||||
switch (dest.File) {
|
||||
case PROGRAM_TEMPORARY:
|
||||
reg = dest.Index + code->temp_reg_offset;
|
||||
break;
|
||||
case PROGRAM_OUTPUT:
|
||||
/* Eventually we may need to handle multiple
|
||||
* rendering targets... */
|
||||
reg = dest.Index;
|
||||
break;
|
||||
default:
|
||||
ERROR("Can't handle dest.File %x\n", dest.File);
|
||||
reg = 0x0;
|
||||
break;
|
||||
case PROGRAM_TEMPORARY:
|
||||
reg = dest.Index + code->temp_reg_offset;
|
||||
break;
|
||||
case PROGRAM_OUTPUT:
|
||||
/* Eventually we may need to handle multiple
|
||||
* rendering targets... */
|
||||
reg = dest.Index;
|
||||
break;
|
||||
case PROGRAM_BUILTIN:
|
||||
reg = 0x0;
|
||||
break;
|
||||
default:
|
||||
ERROR("Can't handle dest.File %x\n", dest.File);
|
||||
reg = 0x0;
|
||||
break;
|
||||
}
|
||||
return reg;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue