mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add some extra checking for valid stereo shader.
This commit is contained in:
parent
ab1cebec51
commit
10eb21d3b3
1 changed files with 13 additions and 4 deletions
|
@ -233,6 +233,7 @@ bool PresentationCommon::UpdatePostShader() {
|
||||||
|
|
||||||
if (gstate_c.Use(GPU_USE_SIMPLE_STEREO_PERSPECTIVE)) {
|
if (gstate_c.Use(GPU_USE_SIMPLE_STEREO_PERSPECTIVE)) {
|
||||||
const ShaderInfo *stereoShaderInfo = GetPostShaderInfo(g_Config.sStereoToMonoShader);
|
const ShaderInfo *stereoShaderInfo = GetPostShaderInfo(g_Config.sStereoToMonoShader);
|
||||||
|
if (stereoShaderInfo) {
|
||||||
bool result = CompilePostShader(stereoShaderInfo, &stereoPipeline_);
|
bool result = CompilePostShader(stereoShaderInfo, &stereoPipeline_);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
// We won't have a stereo shader. We have to check for this later.
|
// We won't have a stereo shader. We have to check for this later.
|
||||||
|
@ -242,6 +243,12 @@ bool PresentationCommon::UpdatePostShader() {
|
||||||
} else {
|
} else {
|
||||||
stereoShaderInfo_ = new ShaderInfo(*stereoShaderInfo);
|
stereoShaderInfo_ = new ShaderInfo(*stereoShaderInfo);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// We won't have a stereo shader. We have to check for this later.
|
||||||
|
delete stereoShaderInfo_;
|
||||||
|
stereoShaderInfo_ = nullptr;
|
||||||
|
stereoPipeline_ = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<const ShaderInfo *> shaderInfo;
|
std::vector<const ShaderInfo *> shaderInfo;
|
||||||
|
@ -296,6 +303,8 @@ bool PresentationCommon::UpdatePostShader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PresentationCommon::CompilePostShader(const ShaderInfo *shaderInfo, Draw::Pipeline **outPipeline) const {
|
bool PresentationCommon::CompilePostShader(const ShaderInfo *shaderInfo, Draw::Pipeline **outPipeline) const {
|
||||||
|
_assert_(shaderInfo);
|
||||||
|
|
||||||
std::string vsSourceGLSL = ReadShaderSrc(shaderInfo->vertexShaderFile);
|
std::string vsSourceGLSL = ReadShaderSrc(shaderInfo->vertexShaderFile);
|
||||||
std::string fsSourceGLSL = ReadShaderSrc(shaderInfo->fragmentShaderFile);
|
std::string fsSourceGLSL = ReadShaderSrc(shaderInfo->fragmentShaderFile);
|
||||||
if (vsSourceGLSL.empty() || fsSourceGLSL.empty()) {
|
if (vsSourceGLSL.empty() || fsSourceGLSL.empty()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue