From c84efcfc977f732038cfc5fbf40e8d68dbcfdf86 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 19 Mar 2017 10:31:37 -0700 Subject: [PATCH] Dirty vertexshader state on hw bezier/spline. --- GPU/D3D11/GPU_D3D11.cpp | 6 ++++++ GPU/GLES/GPU_GLES.cpp | 10 ++++++++-- GPU/Vulkan/GPU_Vulkan.cpp | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/GPU/D3D11/GPU_D3D11.cpp b/GPU/D3D11/GPU_D3D11.cpp index e0c344dba83f..a6d41fc6b928 100644 --- a/GPU/D3D11/GPU_D3D11.cpp +++ b/GPU/D3D11/GPU_D3D11.cpp @@ -588,6 +588,7 @@ void GPU_D3D11::Execute_Bezier(u32 op, u32 diff) { bool patchFacing = gstate.patchfacing & 1; if (g_Config.bHardwareTessellation && g_Config.bHardwareTransform && !g_Config.bSoftwareRendering) { + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.bezier = true; if (gstate_c.spline_count_u != bz_ucount) { gstate_c.Dirty(DIRTY_BEZIERSPLINE); @@ -598,6 +599,8 @@ void GPU_D3D11::Execute_Bezier(u32 op, u32 diff) { int bytesRead = 0; drawEngine_.SubmitBezier(control_points, indices, gstate.getPatchDivisionU(), gstate.getPatchDivisionV(), bz_ucount, bz_vcount, patchPrim, computeNormals, patchFacing, gstate.vertType, &bytesRead); + if (gstate_c.bezier) + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.bezier = false; // After drawing, we advance pointers - see SubmitPrim which does the same. @@ -649,6 +652,7 @@ void GPU_D3D11::Execute_Spline(u32 op, u32 diff) { u32 vertType = gstate.vertType; if (g_Config.bHardwareTessellation && g_Config.bHardwareTransform && !g_Config.bSoftwareRendering) { + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.spline = true; bool countsChanged = gstate_c.spline_count_u != sp_ucount || gstate_c.spline_count_v != sp_vcount; bool typesChanged = gstate_c.spline_type_u != sp_utype || gstate_c.spline_type_v != sp_vtype; @@ -663,6 +667,8 @@ void GPU_D3D11::Execute_Spline(u32 op, u32 diff) { int bytesRead = 0; drawEngine_.SubmitSpline(control_points, indices, gstate.getPatchDivisionU(), gstate.getPatchDivisionV(), sp_ucount, sp_vcount, sp_utype, sp_vtype, patchPrim, computeNormals, patchFacing, vertType, &bytesRead); + if (gstate_c.spline) + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.spline = false; // After drawing, we advance pointers - see SubmitPrim which does the same. diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index ab784b0a14f6..5058603a7b16 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -762,6 +762,7 @@ void GPU_GLES::Execute_Bezier(u32 op, u32 diff) { bool patchFacing = gstate.patchfacing & 1; if (g_Config.bHardwareTessellation && g_Config.bHardwareTransform && !g_Config.bSoftwareRendering) { + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.bezier = true; if (gstate_c.spline_count_u != bz_ucount) { gstate_c.Dirty(DIRTY_BEZIERSPLINE); @@ -771,7 +772,9 @@ void GPU_GLES::Execute_Bezier(u32 op, u32 diff) { int bytesRead = 0; drawEngine_.SubmitBezier(control_points, indices, gstate.getPatchDivisionU(), gstate.getPatchDivisionV(), bz_ucount, bz_vcount, patchPrim, computeNormals, patchFacing, gstate.vertType, &bytesRead); - + + if (gstate_c.bezier) + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.bezier = false; // After drawing, we advance pointers - see SubmitPrim which does the same. @@ -823,6 +826,7 @@ void GPU_GLES::Execute_Spline(u32 op, u32 diff) { u32 vertType = gstate.vertType; if (g_Config.bHardwareTessellation && g_Config.bHardwareTransform && !g_Config.bSoftwareRendering) { + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.spline = true; bool countsChanged = gstate_c.spline_count_u != sp_ucount || gstate_c.spline_count_v != sp_vcount; bool typesChanged = gstate_c.spline_type_u != sp_utype || gstate_c.spline_type_v != sp_vtype; @@ -837,7 +841,9 @@ void GPU_GLES::Execute_Spline(u32 op, u32 diff) { int bytesRead = 0; drawEngine_.SubmitSpline(control_points, indices, gstate.getPatchDivisionU(), gstate.getPatchDivisionV(), sp_ucount, sp_vcount, sp_utype, sp_vtype, patchPrim, computeNormals, patchFacing, vertType, &bytesRead); - + + if (gstate_c.spline) + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.spline = false; // After drawing, we advance pointers - see SubmitPrim which does the same. diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 9e11902afbda..cbcebe6e0649 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -591,6 +591,7 @@ void GPU_Vulkan::Execute_Bezier(u32 op, u32 diff) { int bytesRead = 0; if (g_Config.bHardwareTessellation && g_Config.bHardwareTransform && !g_Config.bSoftwareRendering) { + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.bezier = true; if (gstate_c.spline_count_u != bz_ucount) { gstate_c.Dirty(DIRTY_BEZIERSPLINE); @@ -600,6 +601,8 @@ void GPU_Vulkan::Execute_Bezier(u32 op, u32 diff) { drawEngine_.SubmitBezier(control_points, indices, gstate.getPatchDivisionU(), gstate.getPatchDivisionV(), bz_ucount, bz_vcount, patchPrim, computeNormals, patchFacing, gstate.vertType, &bytesRead); + if (gstate_c.bezier) + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.bezier = false; // After drawing, we advance pointers - see SubmitPrim which does the same. @@ -651,6 +654,7 @@ void GPU_Vulkan::Execute_Spline(u32 op, u32 diff) { u32 vertType = gstate.vertType; if (g_Config.bHardwareTessellation && g_Config.bHardwareTransform && !g_Config.bSoftwareRendering) { + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.spline = true; bool countsChanged = gstate_c.spline_count_u != sp_ucount || gstate_c.spline_count_v != sp_vcount; bool typesChanged = gstate_c.spline_type_u != sp_utype || gstate_c.spline_type_v != sp_vtype; @@ -666,6 +670,8 @@ void GPU_Vulkan::Execute_Spline(u32 op, u32 diff) { int bytesRead = 0; drawEngine_.SubmitSpline(control_points, indices, gstate.getPatchDivisionU(), gstate.getPatchDivisionV(), sp_ucount, sp_vcount, sp_utype, sp_vtype, patchPrim, computeNormals, patchFacing, vertType, &bytesRead); + if (gstate_c.spline) + gstate_c.Dirty(DIRTY_VERTEXSHADER_STATE); gstate_c.spline = false; // After drawing, we advance pointers - see SubmitPrim which does the same.