diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2017-10-02 05:08:03 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2017-10-05 18:06:36 +0200 |
commit | f3adf5f5c2136a538893f9f29bbe2e384d3b11ed (patch) | |
tree | 4bae47d94ab27a142fa599522e89a2b3e2f77d50 | |
parent | fb001182895d50ccf0270fc374c0beda5fb8a306 (diff) |
VP: fix VTB (OSX) after OpenGL migration
3 files changed, 9 insertions, 17 deletions
diff --git a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl index 6b9f9b4161..a9c37dd486 100644 --- a/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl +++ b/system/shaders/GL/1.5/gl_yuv2rgb_basic.glsl @@ -1,7 +1,6 @@ #version 150 #if(XBMC_texture_rectangle) -# extension GL_ARB_texture_rectangle : enable # define texture2D texture2DRect # define sampler2D sampler2DRect #endif @@ -57,21 +56,14 @@ vec4 process() , texture(m_sampV, stretch(m_cordV)).g , 1.0 ); rgb = m_yuvmat * yuv; - rgb.a = gl_Color.a; + rgb.a = fragColor.a; #elif defined(XBMC_YUY2) || defined(XBMC_UYVY) -#if(XBMC_texture_rectangle) - vec2 stepxy = vec2(1.0, 1.0); - vec2 pos = stretch(m_cordY); - pos = vec2(pos.x - 0.25, pos.y); - vec2 f = fract(pos); -#else vec2 stepxy = m_step; vec2 pos = stretch(m_cordY); pos = vec2(pos.x - stepxy.x * 0.25, pos.y); vec2 f = fract(pos / stepxy); -#endif //y axis will be correctly interpolated by opengl //x axis will not, so we grab two pixels at the center of two columns and interpolate ourselves diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp index 2752f5513e..7a12ae7529 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererVTBGL.cpp @@ -78,7 +78,7 @@ void CRendererVTB::ReleaseBuffer(int idx) EShaderFormat CRendererVTB::GetShaderFormat() { - return SHADER_YV12; + return SHADER_NV12_RRG; } bool CRendererVTB::LoadShadersHook() @@ -187,8 +187,8 @@ bool CRendererVTB::UploadTexture(int index) glBindTexture(m_textureTarget, planes[0].id); - CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_LUMINANCE, - widthY, heightY, GL_LUMINANCE, GL_UNSIGNED_BYTE, surface, 0); + CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_RED, + widthY, heightY, GL_RED, GL_UNSIGNED_BYTE, surface, 0); glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); @@ -196,8 +196,8 @@ bool CRendererVTB::UploadTexture(int index) glBindTexture(m_textureTarget, planes[1].id); - CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_LUMINANCE_ALPHA, - widthUV, heightUV, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, surface, 1); + CGLTexImageIOSurface2D(cgl_ctx, m_textureTarget, GL_RG, + widthUV, heightUV, GL_RG, GL_UNSIGNED_BYTE, surface, 1); glTexParameteri(m_textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(m_textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp index cf3a17833c..1165558639 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp @@ -224,9 +224,9 @@ bool CLinuxRendererGL::ValidateRenderTarget() return false; if (m_textureTarget == GL_TEXTURE_RECTANGLE_ARB) - CLog::Log(LOGNOTICE,"Using GL_TEXTURE_RECTANGLE_ARB"); + CLog::Log(LOGNOTICE, "Using GL_TEXTURE_RECTANGLE_ARB"); else - CLog::Log(LOGNOTICE,"Using GL_TEXTURE_2D"); + CLog::Log(LOGNOTICE, "Using GL_TEXTURE_2D"); for (int i = 0 ; i < m_NumYV12Buffers ; i++) CreateTexture(i); @@ -893,7 +893,7 @@ void CLinuxRendererGL::LoadShaders(int field) m_CLUTsize); } EShaderFormat shaderFormat = GetShaderFormat(); - m_pYUVShader = new YUV2RGBProgressiveShader(m_textureTarget==GL_TEXTURE_RECTANGLE_ARB, m_iFlags, shaderFormat, + m_pYUVShader = new YUV2RGBProgressiveShader(m_textureTarget == GL_TEXTURE_RECTANGLE_ARB, m_iFlags, shaderFormat, m_nonLinStretch && m_renderQuality == RQ_SINGLEPASS, out); if (!m_cmsOn) |