From e95084f138c8857609a1c67bad084b48a8322aa5 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sun, 17 Jul 2022 15:54:42 +0300 Subject: [PATCH] gl: Use DSA for imageview configuration and avoid needless bind operations --- rpcs3/Emu/RSX/GL/GLProcTable.h | 5 +++++ rpcs3/Emu/RSX/GL/GLTextureCache.h | 2 +- rpcs3/Emu/RSX/GL/glutils/image.cpp | 6 ++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/RSX/GL/GLProcTable.h b/rpcs3/Emu/RSX/GL/GLProcTable.h index 28281c9e24..62c69cd712 100644 --- a/rpcs3/Emu/RSX/GL/GLProcTable.h +++ b/rpcs3/Emu/RSX/GL/GLProcTable.h @@ -199,6 +199,11 @@ OPENGL_PROC(PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC, CompressedTextureSubImage2D OPENGL_PROC(PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC, CompressedTextureSubImage3D); OPENGL_PROC(PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC, CompressedTextureSubImage3DEXT); +OPENGL_PROC(PFNGLTEXTUREPARAMETERIPROC, TextureParameteri); +OPENGL_PROC(PFNGLTEXTUREPARAMETERIEXTPROC, TextureParameteriEXT); +OPENGL_PROC(PFNGLTEXTUREPARAMETERIVPROC, TextureParameteriv); +OPENGL_PROC(PFNGLTEXTUREPARAMETERIVEXTPROC, TextureParameterivEXT); + OPENGL_PROC(PFNGLCLEARBUFFERFVPROC, ClearBufferfv); OPENGL_PROC(PFNGLCOPYNAMEDBUFFERSUBDATAPROC, CopyNamedBufferSubData); diff --git a/rpcs3/Emu/RSX/GL/GLTextureCache.h b/rpcs3/Emu/RSX/GL/GLTextureCache.h index ba1d152832..1cff596b93 100644 --- a/rpcs3/Emu/RSX/GL/GLTextureCache.h +++ b/rpcs3/Emu/RSX/GL/GLTextureCache.h @@ -420,7 +420,7 @@ namespace gl gl::texture_view* get_raw_view() { - return vram_texture->get_view(0xAAE4, rsx::default_remap_vector); + return vram_texture->get_view(GL_REMAP_IDENTITY, rsx::default_remap_vector); } bool is_depth_texture() const diff --git a/rpcs3/Emu/RSX/GL/glutils/image.cpp b/rpcs3/Emu/RSX/GL/glutils/image.cpp index 877177b8b7..bf9ef4b0ad 100644 --- a/rpcs3/Emu/RSX/GL/glutils/image.cpp +++ b/rpcs3/Emu/RSX/GL/glutils/image.cpp @@ -252,8 +252,7 @@ namespace gl component_swizzle[2] = argb_swizzle[3]; component_swizzle[3] = argb_swizzle[0]; - gl::get_command_context()->bind_texture(GL_TEMP_IMAGE_SLOT, m_target, m_id, GL_TRUE); - glTexParameteriv(m_target, GL_TEXTURE_SWIZZLE_RGBA, reinterpret_cast(component_swizzle)); + DSA_CALL(TextureParameteriv, m_id, m_target, GL_TEXTURE_SWIZZLE_RGBA, reinterpret_cast(component_swizzle)); } else { @@ -268,8 +267,7 @@ namespace gl constexpr u32 depth_stencil_mask = (image_aspect::depth | image_aspect::stencil); ensure((range.aspect_mask & depth_stencil_mask) != depth_stencil_mask); // "Invalid aspect mask combination" - gl::get_command_context()->bind_texture(GL_TEMP_IMAGE_SLOT, m_target, m_id, GL_TRUE); - glTexParameteri(m_target, GL_DEPTH_STENCIL_TEXTURE_MODE, GL_STENCIL_INDEX); + DSA_CALL(TextureParameteri, m_id, m_target, GL_DEPTH_STENCIL_TEXTURE_MODE, GL_STENCIL_INDEX); } }