Commit 49e3cb5f by Nicolas Capens

Fix projected texture mapping with lod or bias.

parent 7381c994
#define MAJOR_VERSION 3
#define MINOR_VERSION 2
#define BUILD_VERSION 6
#define BUILD_REVISION 45159
#define BUILD_REVISION 47125
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -785,18 +785,17 @@ namespace sh
else if(argumentCount == 3) // bias
{
Temporary proj(this);
emit(sw::Shader::OPCODE_MOV, &proj, arg[1]);
if(t->getNominalSize() == 3)
{
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, &proj);
div->src[0].swizzle = 0xAA;
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, arg[1], arg[1]);
div->src[1].swizzle = 0xAA;
div->dst.mask = 0x3;
}
else if(t->getNominalSize() == 4)
{
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, &proj);
div->src[0].swizzle = 0xFF;
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, arg[1], arg[1]);
div->src[1].swizzle = 0xFF;
div->dst.mask = 0x3;
}
else UNREACHABLE();
......@@ -821,20 +820,18 @@ namespace sh
else if(name == "texture2DProjLod")
{
TIntermTyped *t = arg[1]->getAsTyped();
Temporary proj(this);
emit(sw::Shader::OPCODE_MOV, &proj, arg[1]);
if(t->getNominalSize() == 3)
{
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, &proj);
div->src[0].swizzle = 0xAA;
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, arg[1], arg[1]);
div->src[1].swizzle = 0xAA;
div->dst.mask = 0x3;
}
else if(t->getNominalSize() == 4)
{
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, &proj);
div->src[0].swizzle = 0xFF;
Instruction *div = emit(sw::Shader::OPCODE_DIV, &proj, arg[1], arg[1]);
div->src[1].swizzle = 0xFF;
div->dst.mask = 0x3;
}
else UNREACHABLE();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment