aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* readpix: use integer conversion for RGBA/UNSIGNED_BYTEJordan Justen2013-01-041-0/+5
| | | | | | | | If the source read buffer is integer based, and the the read pixels type is RGBA/UNSIGNED_BYTE, then use the integer pixel conversion path. Signed-off-by: Jordan Justen <[email protected]>
* glformats: support _mesa_bytes_per_pixel for 2101010+GL_RGBJordan Justen2013-01-041-1/+2
| | | | Signed-off-by: Jordan Justen <[email protected]>
* copytexture: update error checking for GLES3Jordan Justen2013-01-041-17/+45
| | | | | | Changes based on GTF/gles3 conformance test suite. Signed-off-by: Jordan Justen <[email protected]>
* copytexture: make sure is_srgb(src) == is_srgb(dst)Jordan Justen2013-01-041-0/+29
| | | | Signed-off-by: Jordan Justen <[email protected]>
* framebuffer: add _mesa_get_read_renderbufferJordan Justen2013-01-042-0/+24
| | | | | | | This returns the current read renderbuffer for the specified format type. Signed-off-by: Jordan Justen <[email protected]>
* copytexture: for GLES make sure integer signed vs. unsigned matchesJordan Justen2013-01-041-7/+14
| | | | Signed-off-by: Jordan Justen <[email protected]>
* glformats: add _mesa_base_format_component_countJordan Justen2013-01-042-0/+29
| | | | Signed-off-by: Jordan Justen <[email protected]>
* teximage: use _mesa_es3_error_check_format_and_type for GLES3Matt Turner2013-01-041-6/+13
| | | | Reviewed-by: Jordan Justen <[email protected]>
* glformats: add _mesa_es3_error_check_format_and_typeMatt Turner2013-01-042-0/+444
| | | | | | | | This function checks for ES3 compatible format/type/internalFormat/dimension combinations. [[email protected]: additional tweaks for gles3-gtf] Signed-off-by: Jordan Justen <[email protected]>
* fbobject: add additional fbo completeness checks for GLESJordan Justen2013-01-041-3/+54
| | | | Signed-off-by: Jordan Justen <[email protected]>
* glformats: add functions to detect signed/unsigned integer typesJordan Justen2013-01-042-14/+46
| | | | Signed-off-by: Jordan Justen <[email protected]>
* unpack: support unpacking MESA_FORMAT_ARGB2101010Jordan Justen2013-01-041-0/+18
| | | | Signed-off-by: Jordan Justen <[email protected]>
* pack: adjust clamping for int=>ubyte conversionJordan Justen2013-01-041-1/+1
| | | | | | | | | gles3conform expects than when converting from a signed int to an unsigned byte, the output will be clamped at a max of 0x7f. This impacts conversion from int16_t => uint8_t and int32_t => uint8_t. Signed-off-by: Jordan Justen <[email protected]>
* fbobject: don't allow LUMINANCE/INTENSITY/ALPHA fbo on GLESJordan Justen2013-01-041-1/+1
| | | | Signed-off-by: Jordan Justen <[email protected]>
* Fix-up for "mesa: Rework crazy error code rules in glDrawBuffers()."Kenneth Graunke2013-01-041-1/+2
| | | | | | | | | This should be squashed into the earlier patch when mailing it out for review or merging it to master. The error path was missing a "return" like all the other error paths. Also, we may as well call it glDrawBuffers in the error message since the ARB suffix doesn't exist in ES 3.
* i965: Don't maintain programs for ff state when there is no ffIan Romanick2013-01-041-2/+2
| | | | | | NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Ian Romanick <[email protected]>
* mesa: Don't muck about with ff state when there is no ffIan Romanick2013-01-041-18/+26
| | | | | | NOTE: This is a candidate for the 9.0 branch. Signed-off-by: Ian Romanick <[email protected]>
* egl/dri2: Add plumbing for EGL_OPENGL_ES3_BIT_KHRChad Versace2013-01-046-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes error EGL_BAD_ATTRIBUTE in the tests below on Intel Sandybridge: * piglit egl-create-context-verify-gl-flavor, testcase OpenGL ES 3.0 * gles3conform, revision 19700, when runnning GL3Tests with -fbo This plumbing is added in order to comply with the EGL_KHR_create_context spec. According to the EGL_KHR_create_context spec, it is illegal to call eglCreateContext(EGL_CONTEXT_MAJOR_VERSION_KHR=3) with a config whose EGL_RENDERABLE_TYPE does not contain the EGL_OPENGL_ES3_BIT_KHR. The pertinent portion of the spec is quoted below; the key word is "respectively". * If <config> is not a valid EGLConfig, or does not support the requested client API, then an EGL_BAD_CONFIG error is generated (this includes requesting creation of an OpenGL ES 1.x, 2.0, or 3.0 context when the EGL_RENDERABLE_TYPE attribute of <config> does not contain EGL_OPENGL_ES_BIT, EGL_OPENGL_ES2_BIT, or EGL_OPENGL_ES3_BIT_KHR respectively). To create this patch, I searched for all the ES2 bit plumbing by calling `git grep "ES2_BIT\|DRI_API_GLES2" src/egl`, and then at each location added a case for ES3. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Expose support for DRI_API_GLES3Chad Versace2013-01-041-0/+2
| | | | | | | | | If the hardware/driver combo supports GLES3, then set the GLES3 bit in intel_screen's bitmask of supported DRI API's. Neither the EGL nor GLX layer uses the bit yet. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* dri: Define enum __DRI_API_GLES3Chad Versace2013-01-043-1/+4
| | | | | | | | | | | | | | This enum corresponds to EGL_OPENGL_ES3_BIT_KHR. Neither the GLX nor EGL layer use the enum yet. I don't like the GLES bits. I'd prefer that all GLES APIs be exposed through a single API bit, as is done in GLX_EXT_create_context_es_profile. But, we need this GLES3 enum in order to do the plumbing necessary to correctly support EGL_OPENGL_ES3_BIT_KHR as required by the EGL_KHR_create_context spec. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Move validation of context version into intelInitContextChad Versace2013-01-047-105/+100
| | | | | | | | | | | | | | | | | | | | | Each driver (i830, i915, i965) used independent but similar code to validate the requested context version. With the rececnt arrival of GLES3, that logic has needed an update. Rather than apply identical updates to each drivers validation code, let's just move the validation into the shared routine intelInitContext. This refactor required some incidental changes to functions i830CreateContext and intelInitContext. For each function, this patch: - Adds context version parameters to the signature. - Adds a DRI_CTX_ERROR out param to the signature. - Sets the DRI_CTX_ERROR at each early return. Tested against gen6 with piglit egl-create-context-verify-gl-flavor. Verified that this patch does not change the set of exposed EGL context flavors. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: Set screen's api mask according to hw capabilities (v3)Chad Versace2013-01-042-11/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, intelInitScreen2 set DRIScreen::api_mask with the hacky heuristic below: if (gen >= 3) api_mask = GL | GLES1 | GLES2; else api_mask = 0; This hack was likely broken on gen2 (i830), but I don't care enough to properly investigate. It appears that every EGLConfig on i830 has EGL_RENDERABLE_TYPE=0, and thus eglCreateContext will never succeed. Anyway, moving on to living drivers... With the arrival of EGL_OPENGL_ES3_BIT_KHR, this heuristic is now insufficient. We must enable the GLES3 bit if and only if the driver is capable of creating a GLES3 context. This requires us to determine the maximum supported context version supported by the hardware/driver for each api *during initialization of intel_screen*. Therefore, this patch adds four new fields to intel_screen which indicate the maximum supported context version for each api: max_gl_core_version max_gl_compat_version max_gl_es1_version max_gl_es2_version The api mask is now correctly set as: api_mask = GL; if (max_gl_es1_version > 0) api_mask |= GLES1; if (max_gl_es2_version > 0) api_mask |= GLES2; Tested against gen6 with piglit egl-create-context-verify-gl-flavor. Verified that this patch does not change the set of exposed EGL context flavors. v2: - Replace the if-tree on gen with a switch, for Ian. - Unconditionally enable the DRI_API_OPENGL bit, for Ian. v3: - Drop max gl version to 1.4 on gen3 if !has_occlusion_query, because occlusion queries entered core in 1.5. For Ian. Signed-off-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <ian.d.romanick.intel.com>
* i965: Bump maximum supported ES2 context version to 3.0Chad Versace2013-01-041-1/+1
| | | | | | | | | | Since patch "i965: Validate requested GLES context version in brwCreateContext", we have been able to create ES 3.0 contexts due to the max version check. So...bump the max version. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* i965/Gen6+: Enable ARB_ES3_compatibility extensionPaul Berry2013-01-041-0/+1
| | | | | IMPORTANT: this patch should not be pushed to master until ES3 support is fully implemented on i965/Gen6+.
* i965: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVEIan Romanick2013-01-041-0/+3
| | | | | | | | We just treat this as an alias for GL_ANY_SAMPLES_PASSED. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/es3: Enable ES 3.0 API and shading language versionIan Romanick2013-01-042-2/+25
| | | | Signed-off-by: Ian Romanick <[email protected]>
* glcpp: Reject token pasting operator in GLESMatt Turner2013-01-041-0/+2
| | | | | | | | | The GLSL ES 3.0 spec (Section 12.17) says: "GLSL ES 1.00 removed token pasting and other functionality." NOTE: This is a candidate for the stable branches. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]>
* glcpp: Make undefined macros illegal in #if and #elif for GLES3Carl Worth2013-01-041-0/+2
| | | | | | | | | | | | Simply emitting a nicely-formatted error message if any undefined macro is encountered in a parser context expecting an expression. With this commit, the following piglit test now passes: spec/glsl-es-3.00/compiler/undefined-macro.vert Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glcpp: Add a flag to the parser state to indicate GLES.Carl Worth2013-01-042-11/+16
| | | | | | | | | | | | This can be triggered either by creation of a GLES context (with api == API_OPENGLES2) or else by a #version directive with version value 100 or with a string of "es" following the version value. There's no behavioral change with this commit—just preparation for ES-specific behavior in the preprocessor in the future. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Return INVALID_ENUM for glReadPixels(..., GL_DEPTH_*, ...) on ES 3Matt Turner2013-01-041-9/+13
| | | | | | | | | | | | I'm not sure if this is the correct fix. The _mesa_es_error_check_format_and_type function (used above in the ES 1 and 2 cases) was originally added for glTexImage checking and allows GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8 combinations. Using it in ES 3 causes other tests to regress. Fixes es3conform's packed_depth_stencil_error test. Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Return INVALID_OPERATION when type is known but not allowedMatt Turner2013-01-041-1/+11
| | | | | | | INVALID_ENUM is for when the type is simply not known. Fixes part of es3conform's packed_depth_stencil_error test. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use _mesa_lookup_enum_by_nr in tex*_error_checkMatt Turner2013-01-041-6/+9
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Allow HALF_FLOAT in glVertexAttribPointerMatt Turner2013-01-041-7/+7
| | | | | Fixes es3conform's half_float_max_vertex_dimensions and half_float_textures tests.
* mesa: Reject texture-only formats as renderbuffer formats in ES 3Matt Turner2013-01-041-21/+11
| | | | | | | | | | | ES 3 specifies some formats as texture-only (i.e., not available for renderbuffers). See the "Required Texture Formats" section (pg 126) of the ES 3 spec. Fixes es3conform's color_buffer_unsupported_format test. Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Fix default value of BUFFER_ACCESS_FLAGS.Kenneth Graunke2013-01-041-28/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to both the GL 3.0 and ES 3.0 specifications (table 2.7 for GL and table 2.8 for ES), the default value of BUFFER_ACCESS_FLAGS is supposed to be zero. Note that there are two related quantities: the obsolete BUFFER_ACCESS enum and the new BUFFER_ACCESS_FLAGS bitfield. BUFFER_ACCESS can only be GL_READ_ONLY, GL_WRITE_ONLY, or GL_READ_WRITE; BUFFER_ACCESS_FLAGS can easily represent all three via GL_MAP_WRITE_BIT, GL_MAP_READ_BIT, and their logical or. It also supports more flags. Thus, Mesa only stores the bitfield, and simply computes the old enum when queried, via simplified_access_mode(bufObj->AccessFlags). The tricky part is that, while BUFFER_ACCESS_FLAGS defaults to 0, BUFFER_ACCESS defaults to GL_READ_WRITE for desktop [GL 3.0, table 2.8] and GL_WRITE_ONLY_OES for ES [the GL_EXT_map_buffer_range extension]. Mesa tried to implement this by setting the default AccessFlags to GL_MAP_READ_BIT | GL_MAP_WRITE_BIT on desktop, and GL_MAP_WRITE_BIT on ES. But in all specifications, it needs to be 0. This patch moves that logic into simplified_access_mode(): when AccessFlags == 0, it now returns GL_READ_WRITE for desktop and GL_WRITE_ONLY for ES 1/2. (BUFFER_ACCESS doesn't exist on ES 3.0, so it's irrelevant there.) With that in place, it changes the AccessFlags default to 0. Fixes three es3conform tsets: - copy_buffer_defaults - map_buffer_range_modify_indices - pixel_buffer_object_default_parameters
* mesa: Rework crazy error code rules in glDrawBuffers().Kenneth Graunke2013-01-041-3/+62
| | | | | | | | | | | | | | | | Perhaps most importantly, this patch adds comments quoting the relevant spec paragraphs above each error condition. It also makes three changes: - For FBOs, GL_COLOR_ATTACHMENTm where m >= MaxDrawBuffers is supposed to generate INVALID_OPERATION (not INVALID_ENUM). - Constants that refer to multiple buffers (such as FRONT, BACK, LEFT, RIGHT, and FRONT_AND_BACK) are supposed to generate INVALID_OPERATION, not INVALID_ENUM. - In ES 3.0, for FBOs, buffers[i] must be NONE or GL_COLOR_ATTACHMENTi or else INVALID_OPERATION occurs. (This is a new restriction.) Fixes es3conform's draw-buffers-api test.
* mesa/es3: Add support for GL_PRIMITIVE_RESTART_FIXED_INDEXIan Romanick2013-01-049-19/+67
| | | | | | | | | | | | | This requires some derived state. The cut vertex used is either the value specified by glPrimitiveRestartIndex or it's hard-coded to ~0. The derived state gl_array_attrib::_RestartIndex captures this value. In addition, the derived state gl_array_attrib::_PrimitiveRestart is set whenever either gl_array_attrib::PrimitiveRestart or gl_array_attrib::PrimitiveRestartFixedIndex is set. v2: Use _mesa_is_gles3. Signed-off-by: Ian Romanick <[email protected]>
* mesa/es3: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVE query targetIan Romanick2013-01-042-2/+11
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa/es3: Allow transpose matrix uniforms in GLES3Ian Romanick2013-01-041-1/+2
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa: Rename and wire-up GetInteger64i_vMatt Turner2013-01-044-6/+5
| | | | | | | | | | | | The function was named badly and wasn't in the dispatch table, making it hard to find. Fixes transform_feedback2_states and gets a few other transform feedback tests closer to working in es3conform. Reviewed-by Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Correct glGet{Boolean,Integer}i_v namesMatt Turner2013-01-041-2/+2
| | | | | | Reviewed-by Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow GL_DEPTH_STENCIL_ATTACHMENT in ES 3Matt Turner2013-01-041-1/+1
| | | | | | | Fixes framebuffer_srgb_default_encoding_fbo and 5 packed_depth_stencil tests from es3conform. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Support more glGet enums for ES3Chad Versace2013-01-042-3/+11
| | | | | | | | | | | | | | | | | | For glGetIntegerv, add support for the following in an OpenGL ES 3.0 context: GL_MAJOR_VERSION GL_MINOR_VERSION GL_NUM_EXTENSIONS See Table 6.29 of the OpenGL ES 3.0 spec. Fixes error GL_INVALID_ENUM in piglit egl-create-context-verify-gl-flavor, testcase for OpenGL ES 3.0. Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* mesa: Support querying GL_MAX_ELEMENT_INDEX in ES 3Matt Turner2013-01-044-0/+23
| | | | | | | | | The ES 3 spec says that the minumum allowable value is 2^24-1, but the GL 4.3 and ARB_ES3_compatibility specs require 2^32-1, so return 2^32-1. Fixes es3conform's element_index_uint_constants test. Reviewed-by: Ian Romanick <[email protected]>
* mesa: De-duplicate ES2 queriesMatt Turner2013-01-042-11/+11
| | | | | | | | From GL/GLES/GL_CORE and GLES2 -> GL/GL_CORE/GLES2. Yes, we really were exposing ES2_compatibility queries on ES 1. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries on EXT_texture_lod_bias data in ES 3Matt Turner2013-01-041-3/+7
| | | | | | Fixes the remaining 4 texture_lod_bias failures in es3conform. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries on EXT_framebuffer_blit data in ES 3Matt Turner2013-01-041-4/+4
| | | | | | Fixes 2 framebuffer_blit es3conform tests. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries on ARB_fragment/vertex_shader data in ES 3Matt Turner2013-01-041-4/+6
| | | | | | | Fixes uniform_buffer_object_implementation_dependent_limits in es3conform. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries on ARB_framebuffer_object data in ES 3Matt Turner2013-01-041-3/+3
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries on ARB_transform_feedback2 data in ES 3Matt Turner2013-01-042-6/+11
| | | | | | | | | Fixes the transform_feedback2_init_defaults test from es3conform. The ES 3 spec lists these as TRANSFORM_FEEDBACK_PAUSED and TRANSFORM_FEEDBACK_ACTIVE. Reviewed-by: Ian Romanick <[email protected]>