Commit ca8ea0a4 by Clemen Deng Committed by Commit Bot

Get Desktop GL games running on desktop frontend

Games: SkyEngine: Open source on github The Deep Deep: Geoff's game Bug: angleproject:3620 Change-Id: I5feee91a94648b385708cafe8d7412e86704ecd0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1721189 Commit-Queue: Clemen Deng <clemendeng@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent ddbc8e44
...@@ -52,6 +52,7 @@ enum class BlockType ...@@ -52,6 +52,7 @@ enum class BlockType
// Required in OpenGL ES 3.1 extension GL_OES_shader_io_blocks. // Required in OpenGL ES 3.1 extension GL_OES_shader_io_blocks.
// TODO(jiawei.shao@intel.com): add BLOCK_OUT. // TODO(jiawei.shao@intel.com): add BLOCK_OUT.
// Also used in GLSL
BLOCK_IN BLOCK_IN
}; };
......
...@@ -408,20 +408,23 @@ extern void yyerror(YYLTYPE* yylloc, TParseContext* context, void *scanner, cons ...@@ -408,20 +408,23 @@ extern void yyerror(YYLTYPE* yylloc, TParseContext* context, void *scanner, cons
} \ } \
} while (0) } while (0)
// TODO(http://anglebug.com/3819): Update for GL version specific validation
#define ES2_ONLY(S, L) do { \ #define ES2_ONLY(S, L) do { \
if (context->getShaderVersion() != 100) { \ if (context->getShaderVersion() != 100 && !IsDesktopGLSpec(context->getShaderSpec())) { \
context->error(L, " supported in GLSL ES 1.00 only", S); \ context->error(L, " supported in GLSL ES 1.00 only", S); \
} \ } \
} while (0) } while (0)
// TODO(http://anglebug.com/3819): Update for GL version specific validation
#define ES3_OR_NEWER(TOKEN, LINE, REASON) do { \ #define ES3_OR_NEWER(TOKEN, LINE, REASON) do { \
if (context->getShaderVersion() < 300) { \ if (context->getShaderVersion() < 300 && !IsDesktopGLSpec(context->getShaderSpec())) { \
context->error(LINE, REASON " supported in GLSL ES 3.00 and above only", TOKEN); \ context->error(LINE, REASON " supported in GLSL ES 3.00 and above only", TOKEN); \
} \ } \
} while (0) } while (0)
// TODO(http://anglebug.com/3819): Update for GL version specific validation
#define ES3_1_ONLY(TOKEN, LINE, REASON) do { \ #define ES3_1_ONLY(TOKEN, LINE, REASON) do { \
if (context->getShaderVersion() != 310) { \ if (context->getShaderVersion() != 310 && !IsDesktopGLSpec(context->getShaderSpec())) { \
context->error(LINE, REASON " supported in GLSL ES 3.10 only", TOKEN); \ context->error(LINE, REASON " supported in GLSL ES 3.10 only", TOKEN); \
} \ } \
} while (0) } while (0)
......
...@@ -65,8 +65,9 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const State &state) ...@@ -65,8 +65,9 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const State &state)
mOutputType(mImplementation->getTranslatorOutputType()), mOutputType(mImplementation->getTranslatorOutputType()),
mResources() mResources()
{ {
// TODO(http://anglebug.com/3819): Update for GL version specific validation
ASSERT(state.getClientMajorVersion() == 1 || state.getClientMajorVersion() == 2 || ASSERT(state.getClientMajorVersion() == 1 || state.getClientMajorVersion() == 2 ||
state.getClientMajorVersion() == 3); state.getClientMajorVersion() == 3 || state.getClientMajorVersion() == 4);
const gl::Caps &caps = state.getCaps(); const gl::Caps &caps = state.getCaps();
const gl::Extensions &extensions = state.getExtensions(); const gl::Extensions &extensions = state.getExtensions();
......
...@@ -70,12 +70,14 @@ int GL_APIENTRY wglDescribePixelFormat(HDC hdc, int ipfd, UINT cjpfd, PIXELFORMA ...@@ -70,12 +70,14 @@ int GL_APIENTRY wglDescribePixelFormat(HDC hdc, int ipfd, UINT cjpfd, PIXELFORMA
ppfd->dwFlags = ppfd->dwFlags | PFD_GENERIC_ACCELERATED; ppfd->dwFlags = ppfd->dwFlags | PFD_GENERIC_ACCELERATED;
ppfd->dwFlags = ppfd->dwFlags | PFD_DOUBLEBUFFER; ppfd->dwFlags = ppfd->dwFlags | PFD_DOUBLEBUFFER;
ppfd->iPixelType = PFD_TYPE_RGBA; ppfd->iPixelType = PFD_TYPE_RGBA;
ppfd->cColorBits = 24;
ppfd->cRedBits = 8; ppfd->cRedBits = 8;
ppfd->cGreenBits = 8; ppfd->cGreenBits = 8;
ppfd->cBlueBits = 8; ppfd->cBlueBits = 8;
ppfd->cAlphaBits = 8; ppfd->cAlphaBits = 8;
ppfd->cDepthBits = 24; ppfd->cDepthBits = 24;
ppfd->cStencilBits = 8; ppfd->cStencilBits = 8;
ppfd->nVersion = 1;
} }
return 1; return 1;
} }
...@@ -159,7 +161,7 @@ HGLRC GL_APIENTRY wglCreateContext(HDC hDc) ...@@ -159,7 +161,7 @@ HGLRC GL_APIENTRY wglCreateContext(HDC hDc)
"wglCreateContext", display, nullptr); "wglCreateContext", display, nullptr);
// Initialize context // Initialize context
EGLint contextAttibutes[] = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL_CONTEXT_MINOR_VERSION, 3, EGLint contextAttibutes[] = {EGL_CONTEXT_CLIENT_VERSION, 4, EGL_CONTEXT_MINOR_VERSION, 6,
EGL_NONE}; EGL_NONE};
gl::Context *sharedGLContext = static_cast<gl::Context *>(nullptr); gl::Context *sharedGLContext = static_cast<gl::Context *>(nullptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment