Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoCommon: Merge LineGeometryShader into GeometryShaderGen. #1706

Merged
merged 24 commits into from
Dec 19, 2014

Conversation

CrossVR
Copy link
Contributor

@CrossVR CrossVR commented Dec 15, 2014

This adds line-width emulation support to OpenGL, with stereoscopy support to boot!

To-Do

  • Disable the geometry shader stage if it is not needed.
  • Check for geometry shader support in the API (OpenGL ES).


D3D::stateman->SetGeometryShader(nullptr);
}
D3D::stateman->SetGeometryShader(nullptr);
}

This comment was marked as off-topic.

This comment was marked as off-topic.

"triangle"
};

template<class T> static inline void EmitVertex(T& out, const char *vertex, API_TYPE ApiType);

This comment was marked as off-topic.

@magumagu
Copy link
Contributor

"Check for geometry shader support in the API (OpenGL ES)." And what do we do if a game tries to draw a line or point without geometry shader support? Draw nothing? Do vertex processing on the CPU? Something else? Or should Dolphin just refuse to start without geometry shader support?

@CrossVR
Copy link
Contributor Author

CrossVR commented Dec 15, 2014

IIRC OpenGL ES didn't support the old method either, so we just don't draw anything which is what happens now when you try to draw lines or points on OpenGL ES.

@degasus
Copy link
Member

degasus commented Dec 15, 2014

@Armada651 No, we just don't use the geometry shader and hope that no feature will be used. It's very often wrong for points, but lines usually works fine.

@CrossVR
Copy link
Contributor Author

CrossVR commented Dec 15, 2014

@degasus Also good, either way nothing changes in the to-do list. ;)

@CrossVR CrossVR force-pushed the line-width branch 2 times, most recently from 51606b3 to bf1ee9e Compare December 16, 2014 01:24
@@ -97,13 +97,17 @@ void VertexManager::Draw(u32 stride)
u32 max_index = IndexGenerator::GetNumVerts();
GLenum primitive_mode = 0;

glPushAttrib(GL_CULL_FACE);

This comment was marked as off-topic.

This comment was marked as off-topic.

@CrossVR
Copy link
Contributor Author

CrossVR commented Dec 16, 2014

@Sonicadvance1 Please test if OpenGL ES is currently compatible with this branch.

@CrossVR CrossVR force-pushed the line-width branch 2 times, most recently from 333e3e5 to d5ccb7e Compare December 17, 2014 08:39
}
else
{
constants.stereoparams[0] = constants.stereoparams[1] = 0;

This comment was marked as off-topic.

This comment was marked as off-topic.

@degasus
Copy link
Member

degasus commented Dec 17, 2014

code LGTM, but I still want to test it first.

@JMC47
Copy link
Contributor

JMC47 commented Dec 17, 2014

NVM, I'm an idiot of course the savestates would be different, I think.

LGTM again on testing otherwise.

#include "VideoCommon/XFMemory.h"

// track changes
static bool s_projection_changed, s_viewport_changed, s_lineptwidth_changed;

This comment was marked as off-topic.

@degasus
Copy link
Member

degasus commented Dec 17, 2014

damn mesa: http://pastie.org/

}
else if (strstr(g_ogl_config.glsl_version, "1.40"))
{
g_ogl_config.eSupportedGLSLVersion = GLSL_140;
g_Config.backend_info.bSupportsEarlyZ = false; // layout keyword is only supported on glsl150+
g_Config.backend_info.bSupportsStereoscopy = false; // geometry shaders are only supported on glsl150+
g_Config.backend_info.bSupportsGeometryShaders = false; // geometry shaders are only supported on glsl150+
}
else

This comment was marked as off-topic.

This comment was marked as off-topic.

@CrossVR
Copy link
Contributor Author

CrossVR commented Dec 19, 2014

This branch is ready for merge.

Sonicadvance1 added a commit that referenced this pull request Dec 19, 2014
VideoCommon: Merge LineGeometryShader into GeometryShaderGen.
@Sonicadvance1 Sonicadvance1 merged commit 02f2215 into dolphin-emu:master Dec 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants