Permalink
Browse files

GPU: Use software transform for flat shading.

Except on GLES where it works fine with the default provoking index.

This fixes #10969 so that it works everywhere.
  • Loading branch information...
unknownbrackets committed Apr 28, 2018
1 parent dca159c commit 2606365ba4d74ca77597a4a33096fbcdf115992c
Showing with 6 additions and 3 deletions.
  1. +2 −1 GPU/D3D11/DrawEngineD3D11.cpp
  2. +2 −1 GPU/Directx9/ShaderManagerDX9.cpp
  3. +2 −1 GPU/Vulkan/DrawEngineVulkan.cpp
@@ -331,7 +331,8 @@ void DrawEngineD3D11::DoFlush() {
GEPrimitiveType prim = prevPrim_;
ApplyDrawState(prim);
bool useHWTransform = CanUseHardwareTransform(prim);
// Always use software for flat shading to fix the provoking index.
bool useHWTransform = CanUseHardwareTransform(prim) && gstate.getShadeMode() != GE_SHADE_FLAT;
if (useHWTransform) {
ID3D11Buffer *vb_ = nullptr;
@@ -537,7 +537,8 @@ void ShaderManagerDX9::DirtyLastShader() { // disables vertex arrays
}
VSShader *ShaderManagerDX9::ApplyShader(int prim, u32 vertType) {
bool useHWTransform = CanUseHardwareTransform(prim);
// Always use software for flat shading to fix the provoking index.
bool useHWTransform = CanUseHardwareTransform(prim) && gstate.getShadeMode() != GE_SHADE_FLAT;
VShaderID VSID;
if (gstate_c.IsDirty(DIRTY_VERTEXSHADER_STATE)) {
@@ -574,7 +574,8 @@ void DrawEngineVulkan::DoFlush() {
GEPrimitiveType prim = prevPrim_;
bool useHWTransform = CanUseHardwareTransform(prim);
// Always use software for flat shading to fix the provoking index.
bool useHWTransform = CanUseHardwareTransform(prim) && gstate.getShadeMode() != GE_SHADE_FLAT;
VulkanVertexShader *vshader = nullptr;
VulkanFragmentShader *fshader = nullptr;

0 comments on commit 2606365

Please sign in to comment.