mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2025-02-23 11:42:55 +00:00
Temporarily revert "mesa: remove remaining FEATURE_* defines where protected by API check."
This reverts commit 9f37b405a3de8668a5f74c9681829688475ac3b7. Fixes windows builds.
This commit is contained in:
parent
e78ebbc5f9
commit
b6c2234c22
@ -129,10 +129,12 @@ egl_st_create_api(enum st_api_type api)
|
|||||||
|
|
||||||
switch (api) {
|
switch (api) {
|
||||||
case ST_API_OPENGL:
|
case ST_API_OPENGL:
|
||||||
|
#if FEATURE_GL || FEATURE_ES1 || FEATURE_ES2
|
||||||
#if _EGL_EXTERNAL_GL
|
#if _EGL_EXTERNAL_GL
|
||||||
stapi = egl_st_load_gl();
|
stapi = egl_st_load_gl();
|
||||||
#else
|
#else
|
||||||
stapi = st_gl_api_create();
|
stapi = st_gl_api_create();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case ST_API_OPENVG:
|
case ST_API_OPENVG:
|
||||||
|
@ -353,6 +353,7 @@ updated_drawbuffers(struct gl_context *ctx)
|
|||||||
{
|
{
|
||||||
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
|
||||||
|
|
||||||
|
#if FEATURE_GL
|
||||||
if (ctx->API == API_OPENGL && !ctx->Extensions.ARB_ES2_compatibility) {
|
if (ctx->API == API_OPENGL && !ctx->Extensions.ARB_ES2_compatibility) {
|
||||||
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
||||||
|
|
||||||
@ -361,6 +362,7 @@ updated_drawbuffers(struct gl_context *ctx)
|
|||||||
fb->_Status = 0;
|
fb->_Status = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -952,14 +952,18 @@ _mesa_initialize_context(struct gl_context *ctx,
|
|||||||
|
|
||||||
/* setup the API dispatch tables */
|
/* setup the API dispatch tables */
|
||||||
switch (ctx->API) {
|
switch (ctx->API) {
|
||||||
|
#if FEATURE_GL || FEATURE_ES2
|
||||||
case API_OPENGL:
|
case API_OPENGL:
|
||||||
case API_OPENGL_CORE:
|
case API_OPENGL_CORE:
|
||||||
case API_OPENGLES2:
|
case API_OPENGLES2:
|
||||||
ctx->Exec = _mesa_create_exec_table(ctx);
|
ctx->Exec = _mesa_create_exec_table(ctx);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#if FEATURE_ES1
|
||||||
case API_OPENGLES:
|
case API_OPENGLES:
|
||||||
ctx->Exec = _mesa_create_exec_table_es1();
|
ctx->Exec = _mesa_create_exec_table_es1();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
_mesa_problem(ctx, "unknown or unsupported API");
|
_mesa_problem(ctx, "unknown or unsupported API");
|
||||||
break;
|
break;
|
||||||
|
@ -717,6 +717,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if FEATURE_ES1
|
||||||
case GL_TEXTURE_GEN_STR_OES:
|
case GL_TEXTURE_GEN_STR_OES:
|
||||||
/* disable S, T, and R at the same time */
|
/* disable S, T, and R at the same time */
|
||||||
{
|
{
|
||||||
@ -737,6 +738,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* client-side state */
|
/* client-side state */
|
||||||
case GL_VERTEX_ARRAY:
|
case GL_VERTEX_ARRAY:
|
||||||
@ -1432,7 +1434,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
#if FEATURE_ES1
|
||||||
case GL_TEXTURE_GEN_STR_OES:
|
case GL_TEXTURE_GEN_STR_OES:
|
||||||
{
|
{
|
||||||
const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
|
const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
|
||||||
@ -1445,6 +1447,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||||||
? GL_TRUE : GL_FALSE;
|
? GL_TRUE : GL_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* client-side state */
|
/* client-side state */
|
||||||
case GL_VERTEX_ARRAY:
|
case GL_VERTEX_ARRAY:
|
||||||
@ -1482,10 +1485,12 @@ _mesa_IsEnabled( GLenum cap )
|
|||||||
goto invalid_enum_error;
|
goto invalid_enum_error;
|
||||||
CHECK_EXTENSION(EXT_secondary_color);
|
CHECK_EXTENSION(EXT_secondary_color);
|
||||||
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0);
|
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0);
|
||||||
|
#if FEATURE_ES
|
||||||
case GL_POINT_SIZE_ARRAY_OES:
|
case GL_POINT_SIZE_ARRAY_OES:
|
||||||
if (ctx->API != API_OPENGLES)
|
if (ctx->API != API_OPENGLES)
|
||||||
goto invalid_enum_error;
|
goto invalid_enum_error;
|
||||||
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0);
|
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].Enabled != 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* GL_ARB_texture_cube_map */
|
/* GL_ARB_texture_cube_map */
|
||||||
case GL_TEXTURE_CUBE_MAP_ARB:
|
case GL_TEXTURE_CUBE_MAP_ARB:
|
||||||
|
@ -2707,6 +2707,7 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if FEATURE_ES1
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_GetFixedv(GLenum pname, GLfixed *params)
|
_mesa_GetFixedv(GLenum pname, GLfixed *params)
|
||||||
{
|
{
|
||||||
@ -2792,3 +2793,4 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -827,6 +827,7 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format)
|
|||||||
case GL_ETC1_RGB8_OES:
|
case GL_ETC1_RGB8_OES:
|
||||||
return _mesa_is_gles(ctx)
|
return _mesa_is_gles(ctx)
|
||||||
&& ctx->Extensions.OES_compressed_ETC1_RGB8_texture;
|
&& ctx->Extensions.OES_compressed_ETC1_RGB8_texture;
|
||||||
|
#if FEATURE_ES
|
||||||
case GL_PALETTE4_RGB8_OES:
|
case GL_PALETTE4_RGB8_OES:
|
||||||
case GL_PALETTE4_RGBA8_OES:
|
case GL_PALETTE4_RGBA8_OES:
|
||||||
case GL_PALETTE4_R5_G6_B5_OES:
|
case GL_PALETTE4_R5_G6_B5_OES:
|
||||||
@ -838,6 +839,7 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format)
|
|||||||
case GL_PALETTE8_RGBA4_OES:
|
case GL_PALETTE8_RGBA4_OES:
|
||||||
case GL_PALETTE8_RGB5_A1_OES:
|
case GL_PALETTE8_RGB5_A1_OES:
|
||||||
return ctx->API == API_OPENGLES;
|
return ctx->API == API_OPENGLES;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1430,6 +1430,8 @@ _mesa_ValidateProgramARB(GLhandleARB program)
|
|||||||
validate_program(ctx, program);
|
validate_program(ctx, program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef FEATURE_ES2
|
||||||
|
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
|
_mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
|
||||||
GLint* range, GLint* precision)
|
GLint* range, GLint* precision)
|
||||||
@ -1502,6 +1504,8 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
|
|||||||
_mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__);
|
_mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* FEATURE_ES2 */
|
||||||
|
|
||||||
|
|
||||||
void GLAPIENTRY
|
void GLAPIENTRY
|
||||||
_mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value)
|
_mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value)
|
||||||
|
@ -275,6 +275,7 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if FEATURE_ES1
|
||||||
if (ctx->API == API_OPENGLES) {
|
if (ctx->API == API_OPENGLES) {
|
||||||
if (formats) {
|
if (formats) {
|
||||||
formats[n++] = GL_PALETTE4_RGB8_OES;
|
formats[n++] = GL_PALETTE4_RGB8_OES;
|
||||||
@ -292,6 +293,7 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
|
|||||||
n += 10;
|
n += 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
@ -1954,6 +1954,7 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (internalFormat) {
|
switch (internalFormat) {
|
||||||
|
#if FEATURE_ES
|
||||||
case GL_PALETTE4_RGB8_OES:
|
case GL_PALETTE4_RGB8_OES:
|
||||||
case GL_PALETTE4_RGBA8_OES:
|
case GL_PALETTE4_RGBA8_OES:
|
||||||
case GL_PALETTE4_R5_G6_B5_OES:
|
case GL_PALETTE4_R5_G6_B5_OES:
|
||||||
@ -1996,6 +1997,7 @@ compressed_texture_error_check(struct gl_context *ctx, GLint dimensions,
|
|||||||
*/
|
*/
|
||||||
level = -level;
|
level = -level;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
choose_format = GL_NONE;
|
choose_format = GL_NONE;
|
||||||
@ -2945,11 +2947,12 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
|
|||||||
format, type, width, height, depth, border);
|
format, type, width, height, depth, border);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if FEATURE_ES
|
||||||
/* Here we convert a cpal compressed image into a regular glTexImage2D
|
/* Here we convert a cpal compressed image into a regular glTexImage2D
|
||||||
* call by decompressing the texture. If we really want to support cpal
|
* call by decompressing the texture. If we really want to support cpal
|
||||||
* textures in any driver this would have to be changed.
|
* textures in any driver this would have to be changed.
|
||||||
*/
|
*/
|
||||||
if (ctx->API == API_OPENGLES && compressed && !error && dims == 2) {
|
if (compressed && !error && dims == 2) {
|
||||||
switch (internalFormat) {
|
switch (internalFormat) {
|
||||||
case GL_PALETTE4_RGB8_OES:
|
case GL_PALETTE4_RGB8_OES:
|
||||||
case GL_PALETTE4_RGBA8_OES:
|
case GL_PALETTE4_RGBA8_OES:
|
||||||
@ -2966,6 +2969,7 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (_mesa_is_proxy_texture(target)) {
|
if (_mesa_is_proxy_texture(target)) {
|
||||||
/* Proxy texture: just clear or set state depending on error checking */
|
/* Proxy texture: just clear or set state depending on error checking */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user