Skip to content

Commit

Permalink
Revert "[PR 114] RetroPlayer: OpenGL back-end for shaders"
Browse files Browse the repository at this point in the history
This reverts commit 06452ea.
  • Loading branch information
garbear committed Jan 21, 2023
1 parent f074754 commit 4493837
Show file tree
Hide file tree
Showing 17 changed files with 2 additions and 1,448 deletions.
1 change: 0 additions & 1 deletion cmake/treedata/linux/subdirs.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
xbmc/cores/RetroPlayer/shaders/gl cores/RetroPlayer/shaders/gl
xbmc/input/touch input/touch
xbmc/input/touch/generic input/touch/generic
xbmc/platform/common/speech platform/common/speech
Expand Down
1 change: 0 additions & 1 deletion cmake/treedata/osx/subdirs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
xbmc/cores/RetroPlayer/process/osx cores/RetroPlayer/process/osx
xbmc/cores/RetroPlayer/shaders/gl cores/RetroPlayer/shaders/gl
xbmc/cores/VideoPlayer/Process/osx cores/VideoPlayer/Process/osx
xbmc/platform/darwin platform/darwin
xbmc/platform/darwin/network platform/darwin/network
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "cores/RetroPlayer/buffers/RenderBufferOpenGL.h"
#include "cores/RetroPlayer/buffers/RenderBufferPoolOpenGL.h"
#include "cores/RetroPlayer/rendering/RenderContext.h"
#include "cores/RetroPlayer/shaders/gl/ShaderPresetGL.h"
#include "utils/GLUtils.h"
#include "utils/log.h"

Expand Down Expand Up @@ -47,9 +46,6 @@ CRPRendererOpenGL::CRPRendererOpenGL(const CRenderSettings& renderSettings,
std::shared_ptr<IRenderBufferPool> bufferPool)
: CRPBaseRenderer(renderSettings, context, std::move(bufferPool))
{
// Initialize CRPBaseRenderer
m_shaderPreset.reset(new SHADER::CShaderPresetGL(m_context));

// Initialize CRPRendererOpenGL
m_clearColour = m_context.UseLimitedColor() ? (16.0f / 0xff) : 0.0f;

Expand Down Expand Up @@ -282,57 +278,16 @@ void CRPRendererOpenGL::Render(uint8_t alpha)

const uint32_t color = (alpha << 24) | 0xFFFFFF;

RenderBufferTextures* rbTextures;
const auto it = m_RBTexturesMap.find(renderBuffer);
if (it != m_RBTexturesMap.end())
{
rbTextures = it->second.get();
}
else
{
// We can't copy or move CGLTexture, so construct source/target in-place
rbTextures = new RenderBufferTextures{{// source texture
static_cast<unsigned int>(renderBuffer->GetWidth()),
static_cast<unsigned int>(renderBuffer->GetHeight()),
GL_RGB, renderBuffer->TextureID()},
{// target texture
static_cast<unsigned int>(m_context.GetScreenWidth()),
static_cast<unsigned int>(m_context.GetScreenHeight())}};
m_RBTexturesMap.emplace(renderBuffer, rbTextures);
}

const auto sourceTexture = &rbTextures->source;
const auto targetTexture = &rbTextures->target;

glBindTexture(m_textureTarget, sourceTexture->getMTexture());
glBindTexture(m_textureTarget, renderBuffer->TextureID());

GLint filter = GL_NEAREST;
if (GetRenderSettings().VideoSettings().GetScalingMethod() == SCALINGMETHOD::LINEAR)
filter = GL_LINEAR;

glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, filter);
glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

Updateshaders();

if (m_bUseShaderPreset)
{
const CPoint destPoints[4] = {m_rotatedDestCoords[0], m_rotatedDestCoords[1],
m_rotatedDestCoords[2], m_rotatedDestCoords[3]};

targetTexture->CreateTextureObject();

SHADER::CShaderTextureGL source(*sourceTexture);
SHADER::CShaderTextureGL target(*targetTexture);
if (!m_shaderPreset->RenderUpdate(destPoints, &source, &target))
{
m_shadersNeedUpdate = false;
m_bUseShaderPreset = false;
}
}
else
{
m_context.EnableGUIShader(GL_SHADER_METHOD::TEXTURE);

Expand Down
12 changes: 0 additions & 12 deletions xbmc/cores/RetroPlayer/rendering/VideoRenderers/RPRendererOpenGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

#include "RPBaseRenderer.h"
#include "cores/RetroPlayer/process/RPProcessInfo.h"
#include "guilib/TextureGL.h"

#include <map>
#include <memory>

#include "system_gl.h"

Expand All @@ -22,7 +18,6 @@ namespace KODI
namespace RETRO
{
class CRenderContext;
class CRenderBufferOpenGL;

class CRendererFactoryOpenGL : public IRendererFactory
{
Expand Down Expand Up @@ -63,11 +58,6 @@ class CRPRendererOpenGL : public CRPBaseRenderer
float y;
float z;
};
struct RenderBufferTextures
{
CGLTexture source;
CGLTexture target;
};

// implementation of CRPBaseRenderer
void RenderInternal(bool clear, uint8_t alpha) override;
Expand All @@ -88,8 +78,6 @@ class CRPRendererOpenGL : public CRPBaseRenderer

virtual void Render(uint8_t alpha);

std::map<CRenderBufferOpenGL*, std::unique_ptr<RenderBufferTextures>> m_RBTexturesMap;

GLuint m_mainVAO;
GLuint m_mainVertexVBO;
GLuint m_mainIndexVBO;
Expand Down
16 changes: 0 additions & 16 deletions xbmc/cores/RetroPlayer/shaders/gl/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 4493837

Please sign in to comment.