Skip to content

Commit

Permalink
Fix bugs. DBZ now shows outlines, though doesn't apply them correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Feb 17, 2017
1 parent f8305e8 commit ba04055
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion GPU/D3D11/FramebufferManagerD3D11.cpp
Expand Up @@ -361,7 +361,7 @@ void FramebufferManagerD3D11::ReformatFramebufferFrom(VirtualFramebuffer *vfb, G
D3D11_VIEWPORT vp{ 0.0f, 0.0f, (float)vfb->renderWidth, (float)vfb->renderHeight, 0.0f, 1.0f };
context_->RSSetViewports(1, &vp);
context_->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
context_->Draw(2, 0);
context_->Draw(4, 0);
}

RebindFramebuffer();
Expand Down
21 changes: 11 additions & 10 deletions GPU/D3D11/TextureCacheD3D11.cpp
Expand Up @@ -436,14 +436,14 @@ class TextureShaderApplierD3D11 {
static const Pos pos[4] = {
{ -1, 1, 0 },
{ 1, 1, 0 },
{ 1, -1, 0 },
{ -1, -1, 0 },
{ 1, -1, 0 },
};
static const UV uv[4] = {
{ 0, 0 },
{ 1, 0 },
{ 1, 1 },
{ 0, 1 },
{ 1, 1 },
};

for (int i = 0; i < 4; ++i) {
Expand Down Expand Up @@ -477,11 +477,12 @@ class TextureShaderApplierD3D11 {
const float right = u2 * invHalfWidth - 1.0f + xoff;
const float top = v1 * invHalfHeight - 1.0f + yoff;
const float bottom = v2 * invHalfHeight - 1.0f + yoff;
// Points are: BL, BR, TR, TL.
verts_[0].pos = Pos(left, bottom, -1.0f);
verts_[1].pos = Pos(right, bottom, -1.0f);
verts_[2].pos = Pos(right, top, -1.0f);
verts_[3].pos = Pos(left, top, -1.0f);
float z = 0.0f; // was -1.0f for some reason
// Points are: BL, BR, TL, TR.
verts_[0].pos = Pos(left, bottom, z);
verts_[1].pos = Pos(right, bottom, z);
verts_[2].pos = Pos(left, top, z);
verts_[3].pos = Pos(right, top, z);

// And also the UVs, same order.
const float uvleft = u1 * invWidth;
Expand All @@ -490,8 +491,8 @@ class TextureShaderApplierD3D11 {
const float uvbottom = v2 * invHeight;
verts_[0].uv = UV(uvleft, uvbottom);
verts_[1].uv = UV(uvright, uvbottom);
verts_[2].uv = UV(uvright, uvtop);
verts_[3].uv = UV(uvleft, uvtop);
verts_[2].uv = UV(uvleft, uvtop);
verts_[3].uv = UV(uvright, uvtop);
}
}

Expand All @@ -509,7 +510,7 @@ class TextureShaderApplierD3D11 {
context_->RSSetViewports(1, &vp);
context_->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
context_->IASetVertexBuffers(0, 1, &vbuffer_, &stride_, &offset_);
context_->Draw(2, 0);
context_->Draw(4, 0);
}

protected:
Expand Down

0 comments on commit ba04055

Please sign in to comment.