mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-24 21:39:35 +00:00
Use hybrid filter for upscale buffer copy and plain bilinear filter for downscale one.
Related to PR #2242
This commit is contained in:
parent
438bcc460f
commit
1cfdb4787d
|
@ -219,9 +219,9 @@ bool ColorBufferToRDRAM::_prepareCopy(u32& _startAddress)
|
|||
blitParams.dstY1 = bufferHeight;
|
||||
blitParams.dstWidth = m_pTexture->width;
|
||||
blitParams.dstHeight = m_pTexture->height;
|
||||
blitParams.filter = textureParameters::FILTER_NEAREST;
|
||||
blitParams.filter = textureParameters::FILTER_LINEAR;
|
||||
blitParams.tex[0] = pInputTexture;
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectCopyProgram();
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectDownscaleCopyProgram();
|
||||
blitParams.readBuffer = readBuffer;
|
||||
blitParams.drawBuffer = m_FBO;
|
||||
blitParams.mask = blitMask::COLOR_BUFFER;
|
||||
|
@ -260,7 +260,7 @@ u16 ColorBufferToRDRAM::_RGBAtoRGBA16(u32 _c, u32 x, u32 y) {
|
|||
|
||||
union RGBA c;
|
||||
c.raw = _c;
|
||||
|
||||
|
||||
if (config.generalEmulation.enableDitheringPattern == 0 || config.frameBufferEmulation.nativeResFactor != 1) {
|
||||
// Apply color dithering
|
||||
switch (config.generalEmulation.rdramImageDitheringMode) {
|
||||
|
@ -286,7 +286,7 @@ u16 ColorBufferToRDRAM::_RGBAtoRGBA16(u32 _c, u32 x, u32 y) {
|
|||
}
|
||||
}
|
||||
|
||||
return ((c.r >> 3) << 11) | ((c.g >> 3) << 6) | ((c.b >> 3) << 1) | (c.a == 0 ? 0 : 1);
|
||||
return ((c.r >> 3) << 11) | ((c.g >> 3) << 6) | ((c.b >> 3) << 1) | (c.a == 0 ? 0 : 1);
|
||||
}
|
||||
|
||||
u32 ColorBufferToRDRAM::_RGBAtoRGBA32(u32 _c, u32 x, u32 y) {
|
||||
|
|
|
@ -111,15 +111,19 @@ void CombinerInfo::init()
|
|||
}
|
||||
|
||||
m_shadowmapProgram.reset(gfxContext.createDepthFogShader());
|
||||
m_texrectCopyProgram.reset(gfxContext.createTexrectCopyShader());
|
||||
m_texrectColorAndDepthCopyProgram.reset(gfxContext.createTexrectColorAndDepthCopyShader());
|
||||
m_texrectUpscaleCopyProgram.reset(gfxContext.createTexrectUpscaleCopyShader());
|
||||
m_texrectColorAndDepthUpscaleCopyProgram.reset(gfxContext.createTexrectColorAndDepthUpscaleCopyShader());
|
||||
m_texrectDownscaleCopyProgram.reset(gfxContext.createTexrectDownscaleCopyShader());
|
||||
m_texrectColorAndDepthDownscaleCopyProgram.reset(gfxContext.createTexrectColorAndDepthDownscaleCopyShader());
|
||||
}
|
||||
|
||||
void CombinerInfo::destroy()
|
||||
{
|
||||
m_shadowmapProgram.reset();
|
||||
m_texrectCopyProgram.reset();
|
||||
m_texrectColorAndDepthCopyProgram.reset();
|
||||
m_texrectUpscaleCopyProgram.reset();
|
||||
m_texrectColorAndDepthUpscaleCopyProgram.reset();
|
||||
m_texrectDownscaleCopyProgram.reset();
|
||||
m_texrectColorAndDepthDownscaleCopyProgram.reset();
|
||||
|
||||
m_pCurrent = nullptr;
|
||||
if (config.generalEmulation.enableShadersStorage != 0)
|
||||
|
@ -315,14 +319,24 @@ void CombinerInfo::setDepthFogCombiner()
|
|||
}
|
||||
}
|
||||
|
||||
ShaderProgram * CombinerInfo::getTexrectCopyProgram()
|
||||
ShaderProgram * CombinerInfo::getTexrectUpscaleCopyProgram()
|
||||
{
|
||||
return m_texrectCopyProgram.get();
|
||||
return m_texrectUpscaleCopyProgram.get();
|
||||
}
|
||||
|
||||
ShaderProgram * CombinerInfo::getTexrectColorAndDepthCopyProgram()
|
||||
ShaderProgram * CombinerInfo::getTexrectColorAndDepthUpscaleCopyProgram()
|
||||
{
|
||||
return m_texrectColorAndDepthCopyProgram.get();
|
||||
return m_texrectColorAndDepthUpscaleCopyProgram.get();
|
||||
}
|
||||
|
||||
ShaderProgram * CombinerInfo::getTexrectDownscaleCopyProgram()
|
||||
{
|
||||
return m_texrectDownscaleCopyProgram.get();
|
||||
}
|
||||
|
||||
ShaderProgram * CombinerInfo::getTexrectColorAndDepthDownscaleCopyProgram()
|
||||
{
|
||||
return m_texrectColorAndDepthDownscaleCopyProgram.get();
|
||||
}
|
||||
|
||||
bool CombinerInfo::isShaderCacheSupported() const
|
||||
|
|
|
@ -127,8 +127,10 @@ public:
|
|||
void updateParameters();
|
||||
|
||||
void setDepthFogCombiner();
|
||||
graphics::ShaderProgram * getTexrectCopyProgram();
|
||||
graphics::ShaderProgram * getTexrectColorAndDepthCopyProgram();
|
||||
graphics::ShaderProgram * getTexrectUpscaleCopyProgram();
|
||||
graphics::ShaderProgram * getTexrectColorAndDepthUpscaleCopyProgram();
|
||||
graphics::ShaderProgram * getTexrectDownscaleCopyProgram();
|
||||
graphics::ShaderProgram * getTexrectColorAndDepthDownscaleCopyProgram();
|
||||
|
||||
graphics::CombinerProgram * getCurrent() const { return m_pCurrent; }
|
||||
bool isChanged() const {return m_bChanged;}
|
||||
|
@ -160,8 +162,10 @@ private:
|
|||
graphics::Combiners m_combiners;
|
||||
|
||||
std::unique_ptr<graphics::ShaderProgram> m_shadowmapProgram;
|
||||
std::unique_ptr<graphics::ShaderProgram> m_texrectCopyProgram;
|
||||
std::unique_ptr<graphics::ShaderProgram> m_texrectColorAndDepthCopyProgram;
|
||||
std::unique_ptr<graphics::ShaderProgram> m_texrectUpscaleCopyProgram;
|
||||
std::unique_ptr<graphics::ShaderProgram> m_texrectColorAndDepthUpscaleCopyProgram;
|
||||
std::unique_ptr<graphics::ShaderProgram> m_texrectDownscaleCopyProgram;
|
||||
std::unique_ptr<graphics::ShaderProgram> m_texrectColorAndDepthDownscaleCopyProgram;
|
||||
};
|
||||
|
||||
inline
|
||||
|
|
|
@ -650,7 +650,9 @@ void Debugger::_drawFrameBuffer(FrameBuffer * _pBuffer)
|
|||
blitParams.filter = filter;
|
||||
blitParams.mask = blitMask::COLOR_BUFFER;
|
||||
blitParams.tex[0] = pBufferTexture;
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectCopyProgram();
|
||||
const bool downscale = blitParams.srcWidth >= blitParams.dstWidth && blitParams.srcHeight >= blitParams.dstHeight;
|
||||
blitParams.combiner = downscale ? CombinerInfo::get().getTexrectDownscaleCopyProgram() :
|
||||
CombinerInfo::get().getTexrectUpscaleCopyProgram();
|
||||
blitParams.readBuffer = readBuffer;
|
||||
|
||||
drawer.blitOrCopyTexturedRect(blitParams);
|
||||
|
@ -751,7 +753,7 @@ void Debugger::_drawTex(f32 _ulx, f32 _uly, f32 _yShift)
|
|||
}
|
||||
const CachedTexture * texture = m_triSel->tex_info[tex]->texture;
|
||||
const gDPLoadTileInfo & texLoadInfo = m_triSel->tex_info[tex]->texLoadInfo;
|
||||
OUTPUT1("CRC: 0x%08x", texture->crc);
|
||||
OUTPUT1("CRC: 0x%llx", texture->crc);
|
||||
OUTPUT1("tex_size: %s", ImageSizeText[texture->size]);
|
||||
OUTPUT1("tex_format: %s", ImageFormatText[texture->format]);
|
||||
OUTPUT1("width: %d", texture->width);
|
||||
|
@ -1044,7 +1046,7 @@ void Debugger::_drawTexture(f32 _ulx, f32 _uly, f32 _lrx, f32 _lry, f32 _yShift)
|
|||
OUTPUT1("line: %d", texture->line);
|
||||
OUTPUT1("lod: %d", texture->max_level);
|
||||
OUTPUT1("framebuffer: %s", FrameBufferType[(u32)texture->frameBufferTexture]);
|
||||
OUTPUT1("crc: %08x", texture->crc);
|
||||
OUTPUT1("crc: %llx", texture->crc);
|
||||
|
||||
const f32 Z = 0.0f;
|
||||
const f32 W = 1.0f;
|
||||
|
|
|
@ -1027,7 +1027,9 @@ void FrameBufferList::_renderScreenSizeBuffer()
|
|||
blitParams.filter = filter;
|
||||
blitParams.mask = blitMask::COLOR_BUFFER;
|
||||
blitParams.tex[0] = pBufferTexture;
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectCopyProgram();
|
||||
const bool downscale = blitParams.srcWidth >= blitParams.dstWidth && blitParams.srcHeight >= blitParams.dstHeight;
|
||||
blitParams.combiner = downscale ? CombinerInfo::get().getTexrectDownscaleCopyProgram() :
|
||||
CombinerInfo::get().getTexrectUpscaleCopyProgram();
|
||||
blitParams.readBuffer = pFilteredBuffer->m_FBO;
|
||||
|
||||
drawer.blitOrCopyTexturedRect(blitParams);
|
||||
|
@ -1349,14 +1351,18 @@ void FrameBufferList::OverscanBuffer::draw(u32 _fullHeight, bool _PAL)
|
|||
blitParams.filter = textureParameters::FILTER_LINEAR;
|
||||
blitParams.mask = blitMask::COLOR_BUFFER;
|
||||
blitParams.tex[0] = m_pTexture;
|
||||
const bool downscale = blitParams.srcWidth >= blitParams.dstWidth && blitParams.srcHeight >= blitParams.dstHeight;
|
||||
if (config.frameBufferEmulation.copyDepthToMainDepthBuffer != 0) {
|
||||
blitParams.tex[1] = m_pDepthTexture;
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectColorAndDepthCopyProgram();
|
||||
blitParams.combiner = downscale ? CombinerInfo::get().getTexrectColorAndDepthDownscaleCopyProgram() :
|
||||
CombinerInfo::get().getTexrectColorAndDepthUpscaleCopyProgram();
|
||||
}
|
||||
if (blitParams.combiner == nullptr) {
|
||||
// copyDepthToMainDepthBuffer not set or not supported
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectCopyProgram();
|
||||
blitParams.combiner = downscale ? CombinerInfo::get().getTexrectDownscaleCopyProgram() :
|
||||
CombinerInfo::get().getTexrectUpscaleCopyProgram();
|
||||
}
|
||||
|
||||
blitParams.readBuffer = m_FBO;
|
||||
blitParams.invertY = false;
|
||||
|
||||
|
@ -1519,13 +1525,16 @@ void FrameBufferList::renderBuffer()
|
|||
blitParams.filter = filter;
|
||||
blitParams.mask = blitMask::COLOR_BUFFER;
|
||||
blitParams.tex[0] = pBufferTexture;
|
||||
const bool downscale = blitParams.srcWidth >= blitParams.dstWidth && blitParams.srcHeight >= blitParams.dstHeight;
|
||||
if (config.frameBufferEmulation.copyDepthToMainDepthBuffer != 0) {
|
||||
blitParams.tex[1] = pBuffer->m_pDepthTexture;
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectColorAndDepthCopyProgram();
|
||||
blitParams.combiner = downscale ? CombinerInfo::get().getTexrectColorAndDepthDownscaleCopyProgram():
|
||||
CombinerInfo::get().getTexrectColorAndDepthUpscaleCopyProgram();
|
||||
}
|
||||
if (blitParams.combiner == nullptr) {
|
||||
// copyDepthToMainDepthBuffer not set or not supported
|
||||
blitParams.combiner = CombinerInfo::get().getTexrectCopyProgram();
|
||||
blitParams.combiner = downscale ? CombinerInfo::get().getTexrectDownscaleCopyProgram() :
|
||||
CombinerInfo::get().getTexrectUpscaleCopyProgram();
|
||||
}
|
||||
blitParams.readBuffer = readBuffer;
|
||||
blitParams.invertY = config.frameBufferEmulation.enableOverscan == 0;
|
||||
|
|
|
@ -280,14 +280,24 @@ ShaderProgram * Context::createTexrectDrawerClearShader()
|
|||
return m_impl->createTexrectDrawerClearShader();
|
||||
}
|
||||
|
||||
ShaderProgram * Context::createTexrectCopyShader()
|
||||
ShaderProgram * Context::createTexrectUpscaleCopyShader()
|
||||
{
|
||||
return m_impl->createTexrectCopyShader();
|
||||
return m_impl->createTexrectUpscaleCopyShader();
|
||||
}
|
||||
|
||||
ShaderProgram * Context::createTexrectColorAndDepthCopyShader()
|
||||
ShaderProgram * Context::createTexrectColorAndDepthUpscaleCopyShader()
|
||||
{
|
||||
return m_impl->createTexrectColorAndDepthCopyShader();
|
||||
return m_impl->createTexrectColorAndDepthUpscaleCopyShader();
|
||||
}
|
||||
|
||||
ShaderProgram * Context::createTexrectDownscaleCopyShader()
|
||||
{
|
||||
return m_impl->createTexrectDownscaleCopyShader();
|
||||
}
|
||||
|
||||
ShaderProgram * Context::createTexrectColorAndDepthDownscaleCopyShader()
|
||||
{
|
||||
return m_impl->createTexrectColorAndDepthDownscaleCopyShader();
|
||||
}
|
||||
|
||||
ShaderProgram * Context::createGammaCorrectionShader()
|
||||
|
|
|
@ -233,9 +233,13 @@ namespace graphics {
|
|||
|
||||
ShaderProgram * createTexrectDrawerClearShader();
|
||||
|
||||
ShaderProgram * createTexrectCopyShader();
|
||||
ShaderProgram * createTexrectUpscaleCopyShader();
|
||||
|
||||
ShaderProgram * createTexrectColorAndDepthCopyShader();
|
||||
ShaderProgram * createTexrectColorAndDepthUpscaleCopyShader();
|
||||
|
||||
ShaderProgram * createTexrectDownscaleCopyShader();
|
||||
|
||||
ShaderProgram * createTexrectColorAndDepthDownscaleCopyShader();
|
||||
|
||||
ShaderProgram * createGammaCorrectionShader();
|
||||
|
||||
|
|
|
@ -57,8 +57,10 @@ namespace graphics {
|
|||
virtual ShaderProgram * createDepthFogShader() = 0;
|
||||
virtual TexrectDrawerShaderProgram * createTexrectDrawerDrawShader() = 0;
|
||||
virtual ShaderProgram * createTexrectDrawerClearShader() = 0;
|
||||
virtual ShaderProgram * createTexrectCopyShader() = 0;
|
||||
virtual ShaderProgram * createTexrectColorAndDepthCopyShader() = 0;
|
||||
virtual ShaderProgram * createTexrectUpscaleCopyShader() = 0;
|
||||
virtual ShaderProgram * createTexrectColorAndDepthUpscaleCopyShader() = 0;
|
||||
virtual ShaderProgram * createTexrectDownscaleCopyShader() = 0;
|
||||
virtual ShaderProgram * createTexrectColorAndDepthDownscaleCopyShader() = 0;
|
||||
virtual ShaderProgram * createGammaCorrectionShader() = 0;
|
||||
virtual ShaderProgram * createOrientationCorrectionShader() = 0;
|
||||
virtual ShaderProgram * createFXAAShader() = 0;
|
||||
|
|
|
@ -427,10 +427,10 @@ namespace glsl {
|
|||
|
||||
/*---------------TexrectCopyShaderPart-------------*/
|
||||
|
||||
class TexrectCopy : public ShaderPart
|
||||
class TexrectUpscaleCopy : public ShaderPart
|
||||
{
|
||||
public:
|
||||
TexrectCopy(const opengl::GLInfo & _glinfo)
|
||||
TexrectUpscaleCopy(const opengl::GLInfo & _glinfo)
|
||||
{
|
||||
if (config.generalEmulation.enableHybridFilter) {
|
||||
m_part = getHybridTextureFilter();
|
||||
|
@ -456,12 +456,29 @@ namespace glsl {
|
|||
}
|
||||
};
|
||||
|
||||
/*---------------TexrectDepthCopyShaderPart-------------*/
|
||||
|
||||
class TexrectColorAndDepthCopy : public ShaderPart
|
||||
class TexrectDownscaleCopy : public ShaderPart
|
||||
{
|
||||
public:
|
||||
TexrectColorAndDepthCopy(const opengl::GLInfo & _glinfo)
|
||||
TexrectDownscaleCopy(const opengl::GLInfo & _glinfo)
|
||||
{
|
||||
m_part =
|
||||
"IN mediump vec2 vTexCoord0; \n"
|
||||
"uniform sampler2D uTex0; \n"
|
||||
"OUT lowp vec4 fragColor; \n"
|
||||
" \n"
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
" fragColor = texture2D(uTex0, vTexCoord0); \n"
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
/*---------------TexrectDepthCopyShaderPart-------------*/
|
||||
|
||||
class TexrectColorAndDepthUpscaleCopy : public ShaderPart
|
||||
{
|
||||
public:
|
||||
TexrectColorAndDepthUpscaleCopy(const opengl::GLInfo & _glinfo)
|
||||
{
|
||||
if (config.generalEmulation.enableHybridFilter) {
|
||||
m_part = getHybridTextureFilter();
|
||||
|
@ -491,6 +508,25 @@ namespace glsl {
|
|||
}
|
||||
};
|
||||
|
||||
class TexrectColorAndDepthDownscaleCopy : public ShaderPart
|
||||
{
|
||||
public:
|
||||
TexrectColorAndDepthDownscaleCopy(const opengl::GLInfo & _glinfo)
|
||||
{
|
||||
m_part =
|
||||
"IN mediump vec2 vTexCoord0; \n"
|
||||
"uniform sampler2D uTex0; \n"
|
||||
"uniform sampler2D uTex1; \n"
|
||||
"OUT lowp vec4 fragColor; \n"
|
||||
" \n"
|
||||
"void main() \n"
|
||||
"{ \n"
|
||||
" fragColor = texture2D(uTex0, vTexCoord0); \n"
|
||||
" gl_FragDepth = texture2D(uTex1, vTexCoord0).r; \n"
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
/*---------------PostProcessorShaderPart-------------*/
|
||||
|
||||
class GammaCorrection : public ShaderPart
|
||||
|
@ -765,17 +801,36 @@ namespace glsl {
|
|||
|
||||
/*---------------TexrectCopyShader-------------*/
|
||||
|
||||
typedef SpecialShader<VertexShaderTexturedRect, TexrectCopy> TexrectCopyShaderBase;
|
||||
typedef SpecialShader<VertexShaderTexturedRect, TexrectUpscaleCopy> TexrectUpscaleCopyShaderBase;
|
||||
|
||||
class TexrectCopyShader : public TexrectCopyShaderBase
|
||||
class TexrectUpscaleCopyShader : public TexrectUpscaleCopyShaderBase
|
||||
{
|
||||
public:
|
||||
TexrectCopyShader(const opengl::GLInfo & _glinfo,
|
||||
TexrectUpscaleCopyShader(const opengl::GLInfo & _glinfo,
|
||||
opengl::CachedUseProgram * _useProgram,
|
||||
const ShaderPart * _vertexHeader,
|
||||
const ShaderPart * _fragmentHeader,
|
||||
const ShaderPart * _fragmentEnd)
|
||||
: TexrectCopyShaderBase(_glinfo, _useProgram, _vertexHeader, _fragmentHeader, _fragmentEnd)
|
||||
: TexrectUpscaleCopyShaderBase(_glinfo, _useProgram, _vertexHeader, _fragmentHeader, _fragmentEnd)
|
||||
{
|
||||
m_useProgram->useProgram(m_program);
|
||||
const int texLoc = glGetUniformLocation(GLuint(m_program), "uTex0");
|
||||
glUniform1i(texLoc, 0);
|
||||
m_useProgram->useProgram(graphics::ObjectHandle::null);
|
||||
}
|
||||
};
|
||||
|
||||
typedef SpecialShader<VertexShaderTexturedRect, TexrectDownscaleCopy> TexrectDownscaleCopyShaderBase;
|
||||
|
||||
class TexrectDownscaleCopyShader : public TexrectDownscaleCopyShaderBase
|
||||
{
|
||||
public:
|
||||
TexrectDownscaleCopyShader(const opengl::GLInfo & _glinfo,
|
||||
opengl::CachedUseProgram * _useProgram,
|
||||
const ShaderPart * _vertexHeader,
|
||||
const ShaderPart * _fragmentHeader,
|
||||
const ShaderPart * _fragmentEnd)
|
||||
: TexrectDownscaleCopyShaderBase(_glinfo, _useProgram, _vertexHeader, _fragmentHeader, _fragmentEnd)
|
||||
{
|
||||
m_useProgram->useProgram(m_program);
|
||||
const int texLoc = glGetUniformLocation(GLuint(m_program), "uTex0");
|
||||
|
@ -786,17 +841,38 @@ namespace glsl {
|
|||
|
||||
/*---------------TexrectColorAndDepthCopyShader-------------*/
|
||||
|
||||
typedef SpecialShader<VertexShaderTexturedRect, TexrectColorAndDepthCopy> TexrectColorAndDepthCopyShaderBase;
|
||||
typedef SpecialShader<VertexShaderTexturedRect, TexrectColorAndDepthUpscaleCopy> TexrectColorAndDepthUpscaleCopyShaderBase;
|
||||
|
||||
class TexrectColorAndDepthCopyShader : public TexrectColorAndDepthCopyShaderBase
|
||||
class TexrectColorAndDepthUpscaleCopyShader : public TexrectColorAndDepthUpscaleCopyShaderBase
|
||||
{
|
||||
public:
|
||||
TexrectColorAndDepthCopyShader(const opengl::GLInfo & _glinfo,
|
||||
TexrectColorAndDepthUpscaleCopyShader(const opengl::GLInfo & _glinfo,
|
||||
opengl::CachedUseProgram * _useProgram,
|
||||
const ShaderPart * _vertexHeader,
|
||||
const ShaderPart * _fragmentHeader,
|
||||
const ShaderPart * _fragmentEnd)
|
||||
: TexrectColorAndDepthCopyShaderBase(_glinfo, _useProgram, _vertexHeader, _fragmentHeader, _fragmentEnd)
|
||||
: TexrectColorAndDepthUpscaleCopyShaderBase(_glinfo, _useProgram, _vertexHeader, _fragmentHeader, _fragmentEnd)
|
||||
{
|
||||
m_useProgram->useProgram(m_program);
|
||||
const int texLoc0 = glGetUniformLocation(GLuint(m_program), "uTex0");
|
||||
glUniform1i(texLoc0, 0);
|
||||
const int texLoc1 = glGetUniformLocation(GLuint(m_program), "uTex1");
|
||||
glUniform1i(texLoc1, 1);
|
||||
m_useProgram->useProgram(graphics::ObjectHandle::null);
|
||||
}
|
||||
};
|
||||
|
||||
typedef SpecialShader<VertexShaderTexturedRect, TexrectColorAndDepthDownscaleCopy> TexrectColorAndDepthDownscaleCopyShaderBase;
|
||||
|
||||
class TexrectColorAndDepthDownscaleCopyShader : public TexrectColorAndDepthDownscaleCopyShaderBase
|
||||
{
|
||||
public:
|
||||
TexrectColorAndDepthDownscaleCopyShader(const opengl::GLInfo & _glinfo,
|
||||
opengl::CachedUseProgram * _useProgram,
|
||||
const ShaderPart * _vertexHeader,
|
||||
const ShaderPart * _fragmentHeader,
|
||||
const ShaderPart * _fragmentEnd)
|
||||
: TexrectColorAndDepthDownscaleCopyShaderBase(_glinfo, _useProgram, _vertexHeader, _fragmentHeader, _fragmentEnd)
|
||||
{
|
||||
m_useProgram->useProgram(m_program);
|
||||
const int texLoc0 = glGetUniformLocation(GLuint(m_program), "uTex0");
|
||||
|
@ -916,17 +992,30 @@ namespace glsl {
|
|||
return new TexrectDrawerShaderClear(m_glinfo, m_useProgram, m_vertexHeader, m_fragmentHeader);
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * SpecialShadersFactory::createTexrectCopyShader() const
|
||||
graphics::ShaderProgram * SpecialShadersFactory::createTexrectUpscaleCopyShader() const
|
||||
{
|
||||
return new TexrectCopyShader(m_glinfo, m_useProgram, m_vertexHeader, m_fragmentHeader, m_fragmentEnd);
|
||||
return new TexrectUpscaleCopyShader(m_glinfo, m_useProgram, m_vertexHeader, m_fragmentHeader, m_fragmentEnd);
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * SpecialShadersFactory::createTexrectColorAndDepthCopyShader() const
|
||||
graphics::ShaderProgram * SpecialShadersFactory::createTexrectColorAndDepthUpscaleCopyShader() const
|
||||
{
|
||||
if (m_glinfo.isGLES2)
|
||||
return nullptr;
|
||||
|
||||
return new TexrectColorAndDepthCopyShader(m_glinfo, m_useProgram, m_vertexHeader, m_fragmentHeader, m_fragmentEnd);
|
||||
return new TexrectColorAndDepthUpscaleCopyShader(m_glinfo, m_useProgram, m_vertexHeader, m_fragmentHeader, m_fragmentEnd);
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * SpecialShadersFactory::createTexrectDownscaleCopyShader() const
|
||||
{
|
||||
return new TexrectDownscaleCopyShader(m_glinfo, m_useProgram, m_vertexHeader, m_fragmentHeader, m_fragmentEnd);
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * SpecialShadersFactory::createTexrectColorAndDepthDownscaleCopyShader() const
|
||||
{
|
||||
if (m_glinfo.isGLES2)
|
||||
return nullptr;
|
||||
|
||||
return new TexrectColorAndDepthDownscaleCopyShader(m_glinfo, m_useProgram, m_vertexHeader, m_fragmentHeader, m_fragmentEnd);
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * SpecialShadersFactory::createGammaCorrectionShader() const
|
||||
|
|
|
@ -28,9 +28,13 @@ namespace glsl {
|
|||
|
||||
graphics::ShaderProgram * createTexrectDrawerClearShader() const;
|
||||
|
||||
graphics::ShaderProgram * createTexrectCopyShader() const;
|
||||
graphics::ShaderProgram * createTexrectUpscaleCopyShader() const;
|
||||
|
||||
graphics::ShaderProgram * createTexrectColorAndDepthCopyShader() const;
|
||||
graphics::ShaderProgram * createTexrectColorAndDepthUpscaleCopyShader() const;
|
||||
|
||||
graphics::ShaderProgram * createTexrectDownscaleCopyShader() const;
|
||||
|
||||
graphics::ShaderProgram * createTexrectColorAndDepthDownscaleCopyShader() const;
|
||||
|
||||
graphics::ShaderProgram * createGammaCorrectionShader() const;
|
||||
|
||||
|
|
|
@ -418,14 +418,24 @@ graphics::ShaderProgram * ContextImpl::createTexrectDrawerClearShader()
|
|||
return m_specialShadersFactory->createTexrectDrawerClearShader();
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * ContextImpl::createTexrectCopyShader()
|
||||
graphics::ShaderProgram * ContextImpl::createTexrectUpscaleCopyShader()
|
||||
{
|
||||
return m_specialShadersFactory->createTexrectCopyShader();
|
||||
return m_specialShadersFactory->createTexrectUpscaleCopyShader();
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * ContextImpl::createTexrectColorAndDepthCopyShader()
|
||||
graphics::ShaderProgram * ContextImpl::createTexrectColorAndDepthUpscaleCopyShader()
|
||||
{
|
||||
return m_specialShadersFactory->createTexrectColorAndDepthCopyShader();
|
||||
return m_specialShadersFactory->createTexrectColorAndDepthUpscaleCopyShader();
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * ContextImpl::createTexrectDownscaleCopyShader()
|
||||
{
|
||||
return m_specialShadersFactory->createTexrectDownscaleCopyShader();
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * ContextImpl::createTexrectColorAndDepthDownscaleCopyShader()
|
||||
{
|
||||
return m_specialShadersFactory->createTexrectColorAndDepthDownscaleCopyShader();
|
||||
}
|
||||
|
||||
graphics::ShaderProgram * ContextImpl::createGammaCorrectionShader()
|
||||
|
|
|
@ -122,9 +122,13 @@ namespace opengl {
|
|||
|
||||
graphics::ShaderProgram * createTexrectDrawerClearShader() override;
|
||||
|
||||
graphics::ShaderProgram * createTexrectCopyShader() override;
|
||||
graphics::ShaderProgram * createTexrectUpscaleCopyShader() override;
|
||||
|
||||
graphics::ShaderProgram * createTexrectColorAndDepthCopyShader() override;
|
||||
graphics::ShaderProgram * createTexrectColorAndDepthUpscaleCopyShader() override;
|
||||
|
||||
graphics::ShaderProgram * createTexrectDownscaleCopyShader() override;
|
||||
|
||||
graphics::ShaderProgram * createTexrectColorAndDepthDownscaleCopyShader() override;
|
||||
|
||||
graphics::ShaderProgram * createGammaCorrectionShader() override;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user