Skip to content

Commit

Permalink
Fix reinterpret shader for D3D11
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Nov 7, 2020
1 parent a4a8216 commit 2644d16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
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 @@ -43,6 +43,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

0 comments on commit 2644d16

Please sign in to comment.