summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/TextureConverter.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2014-11-28 11:45:38 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2014-11-28 11:45:38 -0600
commitce059769f6bf13118366f77fea926727efcf4510 (patch)
tree8ea7f2014f086f1df0f661697863c5b72d633a5b /Source/Core/VideoBackends/OGL/TextureConverter.cpp
parent0e3d20c349ead263a630463beeb4335aaf512e42 (diff)
parent6d51455195e95a1bb97eb263fcd3423c757f59e7 (diff)
Merge pull request #1439 from Armada651/ogl-stereo-3d
OGL: Stereoscopic 3D Support
Diffstat (limited to 'Source/Core/VideoBackends/OGL/TextureConverter.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/TextureConverter.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/VideoBackends/OGL/TextureConverter.cpp b/Source/Core/VideoBackends/OGL/TextureConverter.cpp
index 1404ec92eb..ece33797a6 100644
--- a/Source/Core/VideoBackends/OGL/TextureConverter.cpp
+++ b/Source/Core/VideoBackends/OGL/TextureConverter.cpp
@@ -72,21 +72,21 @@ static void CreatePrograms()
const char *VProgramRgbToYuyv =
"out vec2 uv0;\n"
"uniform vec4 copy_position;\n" // left, top, right, bottom
- "SAMPLER_BINDING(9) uniform sampler2D samp9;\n"
+ "SAMPLER_BINDING(9) uniform sampler2DArray samp9;\n"
"void main()\n"
"{\n"
" vec2 rawpos = vec2(gl_VertexID&1, gl_VertexID&2);\n"
" gl_Position = vec4(rawpos*2.0-1.0, 0.0, 1.0);\n"
- " uv0 = mix(copy_position.xy, copy_position.zw, rawpos) / vec2(textureSize(samp9, 0));\n"
+ " uv0 = mix(copy_position.xy, copy_position.zw, rawpos) / vec2(textureSize(samp9, 0).xy);\n"
"}\n";
const char *FProgramRgbToYuyv =
- "SAMPLER_BINDING(9) uniform sampler2D samp9;\n"
+ "SAMPLER_BINDING(9) uniform sampler2DArray samp9;\n"
"in vec2 uv0;\n"
"out vec4 ocol0;\n"
"void main()\n"
"{\n"
- " vec3 c0 = texture(samp9, (uv0 - dFdx(uv0) * 0.25)).rgb;\n"
- " vec3 c1 = texture(samp9, (uv0 + dFdx(uv0) * 0.25)).rgb;\n"
+ " vec3 c0 = texture(samp9, vec3(uv0 - dFdx(uv0) * 0.25, 0.0)).rgb;\n"
+ " vec3 c1 = texture(samp9, vec3(uv0 + dFdx(uv0) * 0.25, 0.0)).rgb;\n"
" vec3 c01 = (c0 + c1) * 0.5;\n"
" vec3 y_const = vec3(0.257,0.504,0.098);\n"
" vec3 u_const = vec3(-0.148,-0.291,0.439);\n"
@@ -224,17 +224,17 @@ static void EncodeToRamUsingShader(GLuint srcTexture,
// set source texture
glActiveTexture(GL_TEXTURE0+9);
- glBindTexture(GL_TEXTURE_2D, srcTexture);
+ glBindTexture(GL_TEXTURE_2D_ARRAY, srcTexture);
if (linearFilter)
{
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
else
{
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
glViewport(0, 0, (GLsizei)dstWidth, (GLsizei)dstHeight);
@@ -365,7 +365,7 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur
// switch to texture converter frame buffer
// attach destTexture as color destination
FramebufferManager::SetFramebuffer(s_texConvFrameBuffer[1]);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, destTexture, 0);
+ glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, destTexture, 0);
// activate source texture
// set srcAddr as data for source texture