mirror of https://github.com/PCSX2/pcsx2.git
gsdx ogl: only use geometry shader to convert big enough draw call (#1554)
gsdx ogl: only use geometry shader to convert big enough draw call The purpose of geometry shader is to reduce bandwidth (72 bytes by sprite) and CPU load. Unfortunately it increases CPU load due to extra shader validations. So geometry shader will only be enabled for draw call with more than 16 sprites (arbitrarily, smallest number before shadow hearts plummet) v2: don't disable geometry shader in replayer. It is easier to spot sprite rendering and to manually read vertex info.
This commit is contained in:
parent
2a60264e40
commit
310f13a2f7
|
@ -159,7 +159,22 @@ void GSRendererOGL::SetupIA(const float& sx, const float& sy)
|
|||
break;
|
||||
|
||||
case GS_SPRITE_CLASS:
|
||||
if (GLLoader::found_geometry_shader) {
|
||||
// Heuristics: trade-off
|
||||
// CPU conversion => ofc, more CPU ;) more bandwidth (72 bytes / sprite)
|
||||
// GPU conversion => ofc, more GPU. And also more CPU due to extra shader validation stage.
|
||||
//
|
||||
// Note: severals openGL operation does draw call under the wood like texture upload. So even if
|
||||
// you do 10 consecutive draw with the geometry shader, you will still pay extra validation if new
|
||||
// texture are uploaded. (game Shadow Hearts)
|
||||
//
|
||||
// Note2: Due to MultiThreaded driver, Nvidia suffers less of the previous issue. Still it isn't free
|
||||
// Shadow Heart is 90 fps (gs) vs 113 fps (no gs)
|
||||
|
||||
// If the draw calls contains few primitives. Geometry Shader gain with be rather small versus
|
||||
// the extra validation cost of the extra stage.
|
||||
//
|
||||
// Note: keep Geometry Shader in the replayer to ease debug.
|
||||
if (GLLoader::found_geometry_shader && (m_vertex.next > 32 || GLLoader::in_replayer)) { // <=> 16 sprites (based on Shadow Hearts)
|
||||
m_gs_sel.sprite = 1;
|
||||
|
||||
t = GL_LINES;
|
||||
|
|
Loading…
Reference in New Issue