mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
D3D: Remove now-redundant texture coord scaling now that we decode the 8-bit and 16-bit formats in the vertex decoder
This commit is contained in:
parent
422ae62b63
commit
8ef326e531
@ -369,10 +369,8 @@ void LinkedShaderDX9::updateUniforms() {
|
||||
float heightFactor = (float)h / (float)gstate_c.curTextureHeight;
|
||||
// Not sure what GE_TEXMAP_UNKNOWN is, but seen in Riviera. Treating the same as GE_TEXMAP_TEXTURE_COORDS works.
|
||||
if (gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_COORDS || gstate.getUVGenMode() == GE_TEXMAP_UNKNOWN) {
|
||||
static const float rescale[4] = {1.0f, 2*127.5f/128.f, 2*32767.5f/32768.f, 1.0f};
|
||||
float factor = rescale[(gstate.vertType & GE_VTYPE_TC_MASK) >> GE_VTYPE_TC_SHIFT];
|
||||
uvscaleoff[0] = gstate_c.uv.uScale * factor * widthFactor;
|
||||
uvscaleoff[1] = gstate_c.uv.vScale * factor * heightFactor;
|
||||
uvscaleoff[0] = gstate_c.uv.uScale * widthFactor;
|
||||
uvscaleoff[1] = gstate_c.uv.vScale * heightFactor;
|
||||
uvscaleoff[2] = gstate_c.uv.uOff * widthFactor;
|
||||
uvscaleoff[3] = gstate_c.uv.vOff * heightFactor;
|
||||
} else {
|
||||
|
@ -553,9 +553,7 @@ void GenerateVertexShaderDX9(int prim, char *buffer, bool useHWTransform) {
|
||||
case GE_PROJMAP_UV: // Use unscaled UV as source
|
||||
{
|
||||
if (hasTexcoord) {
|
||||
static const char *rescaleuv[4] = {"", " * 1.9921875", " * 1.999969482421875", ""}; // 2*127.5f/128.f, 2*32767.5f/32768.f, 1.0f};
|
||||
const char *factor = rescaleuv[(vertType & GE_VTYPE_TC_MASK) >> GE_VTYPE_TC_SHIFT];
|
||||
temp_tc = StringFromFormat("float4(In.texcoord.xy %s, 0.0, 1.0)", factor);
|
||||
temp_tc = StringFromFormat("float4(In.texcoord.xy, 0.0, 1.0)");
|
||||
} else {
|
||||
temp_tc = "float4(0.0, 0.0, 0.0, 1.0)";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user