diff options
Diffstat (limited to 'src/mesa/es')
-rw-r--r-- | src/mesa/es/Makefile | 5 | ||||
-rw-r--r-- | src/mesa/es/glapi/es_EXT.xml | 3 | ||||
-rw-r--r-- | src/mesa/es/main/APIspec.xml | 39 | ||||
-rw-r--r-- | src/mesa/es/main/mfeatures_es1.h | 116 | ||||
-rw-r--r-- | src/mesa/es/main/mfeatures_es2.h | 116 | ||||
-rw-r--r-- | src/mesa/es/main/specials_es1.c | 5 | ||||
-rw-r--r-- | src/mesa/es/main/specials_es2.c | 5 | ||||
-rw-r--r-- | src/mesa/es/main/stubs.c | 7 | ||||
-rw-r--r-- | src/mesa/es/state_tracker/st_cb_drawtex.c | 27 |
9 files changed, 75 insertions, 248 deletions
diff --git a/src/mesa/es/Makefile b/src/mesa/es/Makefile index fbe67445c93..8b484853afe 100644 --- a/src/mesa/es/Makefile +++ b/src/mesa/es/Makefile @@ -19,9 +19,8 @@ es1: $(ES1_LIBS) es2: $(ES2_LIBS) @rm -f subdirs-stamp-tmp -# force the inclusion of es's mfeatures.h -ES1_CPPFLAGS := -include main/mfeatures_es1.h -D__GL_EXPORTS -ES2_CPPFLAGS := -include main/mfeatures_es2.h -D__GL_EXPORTS +ES1_CPPFLAGS := -DFEATURE_ES1=1 -D__GL_EXPORTS +ES2_CPPFLAGS := -DFEATURE_ES2=1 -D__GL_EXPORTS ES1_OBJ_DIR := objs-es1 ES2_OBJ_DIR := objs-es2 diff --git a/src/mesa/es/glapi/es_EXT.xml b/src/mesa/es/glapi/es_EXT.xml index 629ba90528c..291a53b4b27 100644 --- a/src/mesa/es/glapi/es_EXT.xml +++ b/src/mesa/es/glapi/es_EXT.xml @@ -18,6 +18,9 @@ <enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/> </category> +<!-- 23. GL_OES_EGL_image --> +<xi:include href="../../glapi/gen/OES_EGL_image.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> + <category name="GL_OES_depth24" number="24"> <enum name="DEPTH_COMPONENT24_OES" value="0x81A6"/> </category> diff --git a/src/mesa/es/main/APIspec.xml b/src/mesa/es/main/APIspec.xml index f6f33130b15..17665d8df5b 100644 --- a/src/mesa/es/main/APIspec.xml +++ b/src/mesa/es/main/APIspec.xml @@ -3502,6 +3502,31 @@ </desc> </template> +<template name="EGLImageTargetTexture2D"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="image" type="GLeglImageOES"/> + </proto> + + <desc name="target"> + <value name="GL_TEXTURE_2D"/> + </desc> +</template> + +<template name="EGLImageTargetRenderbufferStorage"> + <proto> + <return type="void"/> + <param name="target" type="GLenum"/> + <param name="image" type="GLeglImageOES"/> + </proto> + + <desc name="target"> + <value name="GL_RENDERBUFFER_OES" category="OES_framebuffer_object"/> + <value name="GL_RENDERBUFFER" category="GLES2.0"/> + </desc> +</template> + <api name="mesa" implementation="true"> <category name="MESA"/> @@ -3770,6 +3795,10 @@ <!-- EXT_multi_draw_arrays --> <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/> <function name="MultiDrawElementsEXT" template="MultiDrawElements"/> + + <!-- OES_EGL_image --> + <function name="EGLImageTargetTexture2DOES" template="EGLImageTargetTexture2D"/> + <function name="EGLImageTargetRenderbufferStorageOES" template="EGLImageTargetRenderbufferStorage"/> </api> <api name="GLES1.1"> @@ -3811,6 +3840,7 @@ <category name="EXT_blend_minmax"/> --> <category name="EXT_multi_draw_arrays"/> + <category name="OES_EGL_image"/> <category name="OES_matrix_palette"/> @@ -4068,6 +4098,10 @@ <!-- EXT_multi_draw_arrays --> <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/> <function name="MultiDrawElementsEXT" template="MultiDrawElements"/> + + <!-- OES_EGL_image --> + <function name="EGLImageTargetTexture2DOES" template="EGLImageTargetTexture2D"/> + <function name="EGLImageTargetRenderbufferStorageOES" template="EGLImageTargetRenderbufferStorage"/> </api> <api name="GLES2.0"> @@ -4095,6 +4129,7 @@ <category name="EXT_blend_minmax"/> --> <category name="EXT_multi_draw_arrays"/> + <category name="OES_EGL_image"/> <function name="CullFace" template="CullFace"/> @@ -4292,6 +4327,10 @@ <!-- EXT_multi_draw_arrays --> <function name="MultiDrawArraysEXT" template="MultiDrawArrays"/> <function name="MultiDrawElementsEXT" template="MultiDrawElements"/> + + <!-- OES_EGL_image --> + <function name="EGLImageTargetTexture2DOES" template="EGLImageTargetTexture2D"/> + <function name="EGLImageTargetRenderbufferStorageOES" template="EGLImageTargetRenderbufferStorage"/> </api> </apispec> diff --git a/src/mesa/es/main/mfeatures_es1.h b/src/mesa/es/main/mfeatures_es1.h deleted file mode 100644 index 6c2ece26080..00000000000 --- a/src/mesa/es/main/mfeatures_es1.h +++ /dev/null @@ -1,116 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -/** - * \file mfeatures.h - * - * The #defines in this file enable/disable Mesa features needed - * for OpenGL ES 1.1. - */ - - -#ifndef MFEATURES_ES1_H -#define MFEATURES_ES1_H - -/* this file replaces main/mfeatures.h */ -#ifdef FEATURES_H -#error "main/mfeatures.h was wrongly included" -#endif -#define FEATURES_H - -#define ASSERT_NO_FEATURE() ASSERT(0) - -/* - * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1. - */ -#ifndef _HAVE_FULL_GL -#define _HAVE_FULL_GL 1 -#endif - -#ifdef IN_DRI_DRIVER -#define FEATURE_remap_table 1 -#else -#define FEATURE_remap_table 0 -#endif - -#define FEATURE_accum 0 -#define FEATURE_arrayelt 0 -#define FEATURE_attrib 0 -#define FEATURE_beginend 0 -#define FEATURE_colortable 0 -#define FEATURE_convolve 0 -#define FEATURE_dispatch 1 -#define FEATURE_dlist 0 -#define FEATURE_draw_read_buffer 0 -#define FEATURE_drawpix 0 -#define FEATURE_eval 0 -#define FEATURE_feedback 0 -#define FEATURE_fixedpt 1 -#define FEATURE_histogram 0 -#define FEATURE_pixel 0 -#define FEATURE_point_size_array 1 -#define FEATURE_queryobj 0 -#define FEATURE_rastpos 0 -#define FEATURE_texgen 1 -#define FEATURE_texture_fxt1 0 -#define FEATURE_texture_s3tc 0 -#define FEATURE_userclip 1 -#define FEATURE_vertex_array_byte 1 -#define FEATURE_es2_glsl 0 - -#define FEATURE_ARB_fragment_program _HAVE_FULL_GL -#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL -#define FEATURE_ARB_vertex_program _HAVE_FULL_GL - -#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL -#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL -#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) -#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects -#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects - -#define FEATURE_EXT_framebuffer_blit 0 -#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL -#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL -#define FEATURE_EXT_texture_sRGB 0 -#define FEATURE_ATI_fragment_shader 0 -#define FEATURE_MESA_program_debug _HAVE_FULL_GL -#define FEATURE_NV_fence 0 -#define FEATURE_NV_fragment_program 0 -#define FEATURE_NV_vertex_program 0 - -#define FEATURE_OES_framebuffer_object 1 -#define FEATURE_OES_draw_texture 1 -#define FEATURE_OES_mapbuffer 1 - -#define FEATURE_extra_context_init 1 - -/*@}*/ - - - - -#endif /* MFEATURES_ES1_H */ diff --git a/src/mesa/es/main/mfeatures_es2.h b/src/mesa/es/main/mfeatures_es2.h deleted file mode 100644 index f34782fedb9..00000000000 --- a/src/mesa/es/main/mfeatures_es2.h +++ /dev/null @@ -1,116 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -/** - * \file mfeatures.h - * - * The #defines in this file enable/disable Mesa features needed - * for OpenGL ES 2.0. - */ - - -#ifndef MFEATURES_ES2_H -#define MFEATURES_ES2_H - -/* this file replaces main/mfeatures.h */ -#ifdef FEATURES_H -#error "main/mfeatures.h was wrongly included" -#endif -#define FEATURES_H - -#define ASSERT_NO_FEATURE() ASSERT(0) - -/* - * Enable/disable features (blocks of code) by setting FEATURE_xyz to 0 or 1. - */ -#ifndef _HAVE_FULL_GL -#define _HAVE_FULL_GL 1 -#endif - -#ifdef IN_DRI_DRIVER -#define FEATURE_remap_table 1 -#else -#define FEATURE_remap_table 0 -#endif - -#define FEATURE_accum 0 -#define FEATURE_arrayelt 0 -#define FEATURE_attrib 0 -#define FEATURE_beginend 0 -#define FEATURE_colortable 0 -#define FEATURE_convolve 0 -#define FEATURE_dispatch 1 -#define FEATURE_dlist 0 -#define FEATURE_draw_read_buffer 0 -#define FEATURE_drawpix 0 -#define FEATURE_eval 0 -#define FEATURE_feedback 0 -#define FEATURE_fixedpt 1 -#define FEATURE_histogram 0 -#define FEATURE_pixel 0 -#define FEATURE_point_size_array 1 -#define FEATURE_queryobj 0 -#define FEATURE_rastpos 0 -#define FEATURE_texgen 1 -#define FEATURE_texture_fxt1 0 -#define FEATURE_texture_s3tc 0 -#define FEATURE_userclip 1 -#define FEATURE_vertex_array_byte 1 -#define FEATURE_es2_glsl 1 - -#define FEATURE_ARB_fragment_program _HAVE_FULL_GL -#define FEATURE_ARB_vertex_buffer_object _HAVE_FULL_GL -#define FEATURE_ARB_vertex_program _HAVE_FULL_GL - -#define FEATURE_ARB_vertex_shader _HAVE_FULL_GL -#define FEATURE_ARB_fragment_shader _HAVE_FULL_GL -#define FEATURE_ARB_shader_objects (FEATURE_ARB_vertex_shader || FEATURE_ARB_fragment_shader) -#define FEATURE_ARB_shading_language_100 FEATURE_ARB_shader_objects -#define FEATURE_ARB_shading_language_120 FEATURE_ARB_shader_objects - -#define FEATURE_EXT_framebuffer_blit 0 -#define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL -#define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL -#define FEATURE_EXT_texture_sRGB 0 -#define FEATURE_ATI_fragment_shader 0 -#define FEATURE_MESA_program_debug _HAVE_FULL_GL -#define FEATURE_NV_fence 0 -#define FEATURE_NV_fragment_program 0 -#define FEATURE_NV_vertex_program 0 - -#define FEATURE_OES_framebuffer_object 1 -#define FEATURE_OES_draw_texture 0 -#define FEATURE_OES_mapbuffer 1 - -#define FEATURE_extra_context_init 1 - -/*@}*/ - - - - -#endif /* MFEATURES_ES2_H */ diff --git a/src/mesa/es/main/specials_es1.c b/src/mesa/es/main/specials_es1.c index c842007c22e..92e24a03fe5 100644 --- a/src/mesa/es/main/specials_es1.c +++ b/src/mesa/es/main/specials_es1.c @@ -153,6 +153,11 @@ make_extension_string(const GLcontext *ctx, char *str) if (ctx->Extensions.EXT_multi_draw_arrays) len += append_extension(&str, "GL_EXT_multi_draw_arrays"); +#if FEATURE_OES_EGL_image + if (ctx->Extensions.OES_EGL_image) + len += append_extension(&str, "GL_OES_EGL_image"); +#endif + return len; } diff --git a/src/mesa/es/main/specials_es2.c b/src/mesa/es/main/specials_es2.c index 10b4f25e0f0..046cda6fc18 100644 --- a/src/mesa/es/main/specials_es2.c +++ b/src/mesa/es/main/specials_es2.c @@ -124,6 +124,11 @@ make_extension_string(const GLcontext *ctx, char *str) if (ctx->Extensions.EXT_multi_draw_arrays) len += append_extension(&str, "GL_EXT_multi_draw_arrays"); +#if FEATURE_OES_EGL_image + if (ctx->Extensions.OES_EGL_image) + len += append_extension(&str, "GL_OES_EGL_image"); +#endif + return len; } diff --git a/src/mesa/es/main/stubs.c b/src/mesa/es/main/stubs.c index e7b8bc780f8..b829543cc01 100644 --- a/src/mesa/es/main/stubs.c +++ b/src/mesa/es/main/stubs.c @@ -37,13 +37,6 @@ _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); \ } while (0) -#if FEATURE_accum -/* This is a sanity check that to be sure we're using the correct mfeatures.h - * header. We don't want to accidentally use the one from mainline Mesa. - */ -#error "The wrong mfeatures.h file is being included!" -#endif - /* silence compiler warnings */ extern void GLAPIENTRY _vbo_Materialf(GLenum face, GLenum pname, GLfloat param); diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.c b/src/mesa/es/state_tracker/st_cb_drawtex.c index 0a5cba9d927..6d387d5ccf1 100644 --- a/src/mesa/es/state_tracker/st_cb_drawtex.c +++ b/src/mesa/es/state_tracker/st_cb_drawtex.c @@ -115,13 +115,17 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, struct st_context *st = ctx->st; struct pipe_context *pipe = st->pipe; struct cso_context *cso = ctx->st->cso_context; - struct pipe_buffer *vbuffer; + struct pipe_resource *vbuffer; + struct pipe_transfer *vbuffer_transfer; GLuint i, numTexCoords, numAttribs; GLboolean emitColor; uint semantic_names[2 + MAX_TEXTURE_UNITS]; uint semantic_indexes[2 + MAX_TEXTURE_UNITS]; + struct pipe_vertex_element velements[2 + MAX_TEXTURE_UNITS]; GLbitfield inputs = VERT_BIT_POS; + st_validate_state(st); + /* determine if we need vertex color */ if (ctx->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL0) emitColor = GL_TRUE; @@ -142,7 +146,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, /* create the vertex buffer */ - vbuffer = pipe_buffer_create(pipe->screen, 32, PIPE_BUFFER_USAGE_VERTEX, + vbuffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER, numAttribs * 4 * 4 * sizeof(GLfloat)); /* load vertex buffer */ @@ -158,8 +162,9 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, } while (0) const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height; - GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe->screen, vbuffer, - PIPE_BUFFER_USAGE_CPU_WRITE); + GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe, vbuffer, + PIPE_TRANSFER_WRITE, + &vbuffer_transfer); GLuint attr; z = CLAMP(z, 0.0f, 1.0f); @@ -224,7 +229,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, } } - pipe_buffer_unmap(pipe->screen, vbuffer); + pipe_buffer_unmap(pipe, vbuffer, vbuffer_transfer); #undef SET_ATTRIB } @@ -232,6 +237,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, cso_save_viewport(cso); cso_save_vertex_shader(cso); + cso_save_vertex_elements(cso); { void *vs = lookup_shader(pipe, numAttribs, @@ -239,6 +245,14 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, cso_set_vertex_shader_handle(cso, vs); } + for (i = 0; i < numAttribs; i++) { + velements[i].src_offset = i * 4 * sizeof(float); + velements[i].instance_divisor = 0; + velements[i].vertex_buffer_index = 0; + velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT; + } + cso_set_vertex_elements(cso, numAttribs, velements); + /* viewport state: viewport matching window dims */ { const struct gl_framebuffer *fb = st->ctx->DrawBuffer; @@ -265,11 +279,12 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, numAttribs); /* attribs/vert */ - pipe_buffer_reference(&vbuffer, NULL); + pipe_resource_reference(&vbuffer, NULL); /* restore state */ cso_restore_viewport(cso); cso_restore_vertex_shader(cso); + cso_restore_vertex_elements(cso); } |