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

Greg/gsdx gl #2837

Merged
merged 12 commits into from Feb 7, 2019

Conversation

Projects
None yet
2 participants
@gregory38
Copy link
Contributor

commented Feb 1, 2019

Misc PR that mostly clean the loading of GL function. It should allow to code new stuff without bothering with the GL boilerplate.

I also remove 1 layer for texture creation.

Please test GL on windows (intel too).

@gregory38 gregory38 force-pushed the greg/gsdx-gl branch from 04865f7 to d36e333 Feb 4, 2019

@@ -0,0 +1,554 @@
// FIX compilation issue with older Mesa 10 on older distribution
// Ubuntu 16.04 requires at least the GL45 and GL46 parts
// imported from glcorearb.h

This comment has been minimized.

Copy link
@lightningterror

lightningterror Feb 4, 2019

Member

Feels odd for these comments to be above the copyright header instead of below just before the code starts.

This comment has been minimized.

Copy link
@gregory38

gregory38 Feb 5, 2019

Author Contributor

I prefer this way so we see it isn't a file from us and why I put it here.

@gregory38 gregory38 force-pushed the greg/gsdx-gl branch from d36e333 to e463081 Feb 5, 2019

@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Feb 5, 2019

I added the fix + some stuff for sparse.

Is it possible to resolve conservation ? Or only me can do it ?

@lightningterror

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

Is it possible to resolve conservation ? Or only me can do it ?

Nah, any member can do it.

my $y = `date +%Y`;
chomp $y;
if ($y ne "2019") {
$y = "2019-$y";

This comment has been minimized.

Copy link
@lightningterror

lightningterror Feb 5, 2019

Member

You can adjust the script as well so it adds only one year.

@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Feb 5, 2019

So you shall resolve discussion when you are happy with the fix

gregory38 added some commits Jan 29, 2019

gsdx-ogl: generate nearly all gl entries function pointers
I used glcorearb.h as input file

Code is limited to core gl + KHR/ARB extension
GL1.X must be handled manually (need only 3 functions)
I think the solution would be to migrate gl.h/glext.h to the
single glcorearb.h. However we might need to update the code to fetch
pointer accordingly

Note: we don't check the null ptr anymore on GSwnd. It isn't important
as we check the extension.

v2: update copyright
v3: update copyright space
v4: update copyright of script

fix copyright
gsdx-ogl: use only core debug extension
There are 2 extensions GL_ARB_debug_output (promoted from amd extension)
and GL_KHR_debug (the core extension, promoted from GL_ARB_debug_output)

As we use the callback we could drop the manual query of errors.
And save us the load of the GL_ARB_debug_output extension function pointer.
3rdpary: import GL/glcorearb.h
It will replace glext.h in the future

v2: add requirement in gsdx
gsdx-ogl: clean partially the GL1 mess
Remaining will require a move to glcorearb.h
gsdx-ogl: add missing define of glcorearb.h
Migration isn't expected soon but it should ease the process
gsdx-ogl: add a separate glext.h file
Allow to compile on distribution that still ship an older file
The file is only a patchup of the missing 4.3/4.4/4.5/4.6 define

v2: rename the file and add khronos copyright
gsdx ogl: use a set to store the supported extension
Split mandatory/optional extensions

Note: set is nice but likely much slower than reading a boolean
So both are kept
gsdx-ogl: add extensions check that might be useful in the future
Namely
* GL_ARB_multi_bind
* GL_ARB_vertex_attrib_binding
* GL_ARB_shader_storage_buffer_object
* GL_ARB_sparse_texture
* GL_ARB_sparse_texture2
* GL_ARB_compute_shader
* GL_ARB_texture_view

v2: add default option value
gsdx-ogl: add sparse format detection
v2: fix wrong variable name

@gregory38 gregory38 force-pushed the greg/gsdx-gl branch from e463081 to 3cce09b Feb 5, 2019

@lightningterror lightningterror added this to the Release 1.6 milestone Feb 6, 2019

gsdx ogl: load GL_EXT_direct_state_access for sparse texture
They forgot to add is to the ARB extension...
gsdx ogl: remove boilerplate of extension check
* Use GLExtension::Has in cold path
* Throw error at first error
* Remove aniso check, all hardware support it. Bonus add GL4.6 extension support
* Remove viewport array check. We replace the function pointer anyway

@gregory38 gregory38 merged commit 6282c3d into master Feb 7, 2019

2 of 4 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@lightningterror lightningterror deleted the greg/gsdx-gl branch Feb 7, 2019

@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Feb 26, 2019

@lightningterror could you test those changes on your AMD driver

diff --git a/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp b/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp
index 445dc76e5..224175193 100644
--- a/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp
+++ b/plugins/GSdx/Renderers/OpenGL/GSTextureOGL.cpp
@@ -303,6 +303,7 @@ GSTextureOGL::GSTextureOGL(int type, int w, int h, int format, GLuint fbo_read,
                    old_size.x, old_size.y, m_gpu_page_size.x, m_gpu_page_size.y);
        }
        glTextureParameteri(m_texture_id, GL_TEXTURE_SPARSE_ARB, true);
+       glTextureParameteri(m_texture_id, GL_VIRTUAL_PAGE_SIZE_INDEX_ARB, 0);
    } else {
        m_committed_size = m_size;
    }
@@ -530,7 +531,9 @@ void GSTextureOGL::CommitPages(const GSVector2i& region, bool commit)
    m_mem_usage = (m_committed_size.x * m_committed_size.y) << m_int_shift;
    GLState::available_vram -= m_mem_usage;
 
-   glTexturePageCommitmentEXT(m_texture_id, GL_TEX_LEVEL_0, 0, 0, 0, m_committed_size.x, m_committed_size.y, 1, commit);
+   //glTexturePageCommitmentEXT(m_texture_id, GL_TEX_LEVEL_0, 0, 0, 0, m_committed_size.x, m_committed_size.y, 1, commit);
+   glBindTexture(GL_TEXTURE_2D, m_texture_id);
+   glTexPageCommitmentARB(GL_TEXTURE_2D, GL_TEX_LEVEL_0, 0, 0, 0, m_committed_size.x, m_committed_size.y, 1, commit);
 }
 
 bool GSTextureOGL::Save(const std::string& fn)
@gregory38

This comment has been minimized.

Copy link
Contributor Author

commented Feb 26, 2019

Note: be sure to force enable sparse in the GUI as I disabled the detection by default.

@lightningterror lightningterror referenced this pull request Feb 27, 2019

Merged

Greg/gsdx sparse #2843

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.