r600: fix rectangle textures
It might be better to add an instruction to normalize the coordinates for rectanglular textures as there are some limitations to wrap modes on unnormalized tex coords. fixes texrect
This commit is contained in:
parent
9a1c336253
commit
86ac0ae0b0
|
@ -1205,7 +1205,7 @@ GLboolean tex_src(r700_AssemblerBase *pAsm)
|
|||
return GL_TRUE;
|
||||
}
|
||||
|
||||
GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm)
|
||||
GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalized)
|
||||
{
|
||||
PVSSRC * texture_coordinate_source;
|
||||
PVSSRC * texture_unit_source;
|
||||
|
@ -1227,10 +1227,18 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm)
|
|||
tex_instruction_ptr->m_Word0.f.resource_id = texture_unit_source->reg;
|
||||
|
||||
tex_instruction_ptr->m_Word1.f.lod_bias = 0x0;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_x = SQ_TEX_NORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_y = SQ_TEX_NORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_z = SQ_TEX_NORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_w = SQ_TEX_NORMALIZED;
|
||||
if (normalized) {
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_x = SQ_TEX_NORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_y = SQ_TEX_NORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_z = SQ_TEX_NORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_w = SQ_TEX_NORMALIZED;
|
||||
} else {
|
||||
/* XXX: UNNORMALIZED tex coords have limited wrap modes */
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_x = SQ_TEX_UNNORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_y = SQ_TEX_UNNORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_z = SQ_TEX_UNNORMALIZED;
|
||||
tex_instruction_ptr->m_Word1.f.coord_type_w = SQ_TEX_UNNORMALIZED;
|
||||
}
|
||||
|
||||
tex_instruction_ptr->m_Word2.f.offset_x = 0x0;
|
||||
tex_instruction_ptr->m_Word2.f.offset_y = 0x0;
|
||||
|
@ -2196,11 +2204,19 @@ GLboolean next_ins(r700_AssemblerBase *pAsm)
|
|||
|
||||
if( GL_TRUE == IsTex(pILInst->Opcode) )
|
||||
{
|
||||
if( GL_FALSE == assemble_tex_instruction(pAsm) )
|
||||
{
|
||||
r700_error(ERROR_ASM_TEXINSTRUCTION, "Error assembling TEX instruction");
|
||||
return GL_FALSE;
|
||||
}
|
||||
if (pILInst->TexSrcTarget == TEXTURE_RECT_INDEX) {
|
||||
if( GL_FALSE == assemble_tex_instruction(pAsm, GL_FALSE) )
|
||||
{
|
||||
r700_error(ERROR_ASM_TEXINSTRUCTION, "Error assembling TEX instruction");
|
||||
return GL_FALSE;
|
||||
}
|
||||
} else {
|
||||
if( GL_FALSE == assemble_tex_instruction(pAsm, GL_TRUE) )
|
||||
{
|
||||
r700_error(ERROR_ASM_TEXINSTRUCTION, "Error assembling TEX instruction");
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //ALU
|
||||
|
|
|
@ -424,7 +424,7 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm,
|
|||
GLboolean assemble_dst(r700_AssemblerBase *pAsm);
|
||||
GLboolean tex_dst(r700_AssemblerBase *pAsm);
|
||||
GLboolean tex_src(r700_AssemblerBase *pAsm);
|
||||
GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm);
|
||||
GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalized);
|
||||
void initialize(r700_AssemblerBase *pAsm);
|
||||
GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr,
|
||||
int source_index,
|
||||
|
|
Loading…
Reference in New Issue