Skip to content

Commit

Permalink
Dirty vertexshader state on hw bezier/spline.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets authored and hrydgard committed Aug 14, 2017
1 parent 56cd991 commit c84efcf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions GPU/D3D11/GPU_D3D11.cpp
Expand Up @@ -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);
Expand All @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand Down
10 changes: 8 additions & 2 deletions GPU/GLES/GPU_GLES.cpp
Expand Up @@ -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);
Expand All @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions GPU/Vulkan/GPU_Vulkan.cpp
Expand Up @@ -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);
Expand All @@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand Down

0 comments on commit c84efcf

Please sign in to comment.