Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinterpret framebuffer formats as needed. Outrun reflections partial fix #13636

Merged
merged 9 commits into from
Nov 8, 2020
Prev Previous commit
Next Next commit
Fix reinterpret shader for D3D11
  • Loading branch information
hrydgard committed Nov 8, 2020
commit 4e16fcaf1a3594825b383d095773ad4c849e7153
1 change: 1 addition & 0 deletions Common/GPU/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ void ShaderLanguageDesc::Init(ShaderLanguage lang) {
forceMatrix4x4 = false;
coefsFromBuffers = true;
vsOutPrefix = "Out.";
viewportYSign = "-";
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions Common/GPU/Shader.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct ShaderLanguageDesc {
const char *lastFragData = nullptr;
const char *framebufferFetchExtension = nullptr;
const char *vsOutPrefix = "";
const char *viewportYSign = "";
bool glslES30 = false;
bool bitwiseOps = false;
bool forceMatrix4x4 = false;
Expand Down
1 change: 1 addition & 0 deletions GPU/Common/ReinterpretFramebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ bool GenerateReinterpretVertexShader(char *buffer, const ShaderLanguageDesc &lan
writer.C(" float x = -1.0 + float((gl_VertexIndex & 1) << 2);\n");
writer.C(" float y = -1.0 + float((gl_VertexIndex & 2) << 1);\n");
writer.C(" v_texcoord = (vec2(x, y) + vec2(1.0, 1.0)) * 0.5;\n");
writer.F(" y *= %s1.0;\n", lang.viewportYSign);
writer.C(" gl_Position = vec4(x, y, 0.0, 1.0);\n");

writer.EndVSMain(varyings);
Expand Down