summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/es3: Add support for GL_PRIMITIVE_RESTART_FIXED_INDEXIan Romanick2013-01-115-4/+52
| | | | | | | | | | | | | 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-111-2/+10
| | | | Signed-off-by: Ian Romanick <[email protected]>
* mesa/es3: Allow transpose matrix uniforms in GLES3Ian Romanick2013-01-111-1/+2
| | | | Signed-off-by: Ian Romanick <[email protected]>
* Clean up .gitignore filesMatt Turner2013-01-102-2/+0
|
* mesa: Rename and wire-up GetInteger64i_vMatt Turner2013-01-103-5/+4
| | | | | | | | | | | | 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-101-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-101-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-102-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-104-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-102-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-101-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-101-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-101-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-101-3/+3
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries on ARB_transform_feedback2 data in ES 3Matt Turner2013-01-102-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]>
* mesa: Allow glGet* queries on EXT_transform_feedback data in ES 3Matt Turner2013-01-101-7/+7
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries on ARB_sync data in ES 3Matt Turner2013-01-101-3/+3
| | | | | | Fixes the sync_coverage_max_server_wait_timeout test in es3conform. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries of EXT_pbo data in ES 3Matt Turner2013-01-101-4/+4
| | | | | | | Fixes pixel_buffer_object_default_binding and gets other tests in es3conform closer to passing. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow glGet* queries of select ARB_ubo data in ES 3Matt Turner2013-01-101-9/+14
| | | | | | Fixes 5 uniform_buffer_object tests in es3conform. Reviewed-by: Ian Romanick <[email protected]>
* Add ES 3 handling to get.c and get_hash_generator.pyMatt Turner2013-01-103-1/+24
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa/tests: Add ARB_ES3_compatibility enumsMatt Turner2013-01-101-0/+14
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add ALIGN() macro to main/macros.h.Paul Berry2013-01-082-2/+14
| | | | | | | | | Previously this macro existed in 3 separate places, some inside the intel driver and some outside of it. It makes more sense to have it in main/macros.h Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Disallow R, RG, or RGB integer and unsigned formats in OpenGL ES 3.0Ian Romanick2013-01-041-4/+2
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Disallow SNORM formats for renderbuffers in OpenGL ESIan Romanick2013-01-041-16/+4
| | | | | | | | | | v2: Move {RED,RG,RGB,RGBA}_SNORM changes from the previous commit to this commit. Based on suggestions from Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Disallow deprecated SNORM formats for renderbuffersIan Romanick2013-01-041-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The OpenGL 3.2 core profile spec says: "The following base internal formats from table 3.11 are color-renderable: RED, RG, RGB, and RGBA. The sized internal formats from table 3.12 that have a color-renderable base internal format are also color-renderable. No other formats, including compressed internal formats, are color-renderable." The OpenGL 3.2 compatibility profile spec says (only ALPHA is added): "The following base internal formats from table 3.16 are color-renderable: ALPHA, RED, RG, RGB, and RGBA. The sized internal formats from table 3.17 that have a color-renderable base internal format are also color-renderable. No other formats, including compressed internal formats, are color-renderable." Table 3.12 in the core profile spec and table 3.17 in the compatibility profile spec list SNORM formats as having a base internal format of RED, RG, RGB, or RGBA. From this we infer that they should also be color renderable. The OpenGL ES 3.0 spec says: "An internal format is color-renderable if it is one of the formats from table 3.12 noted as color-renderable or if it is unsized format RGBA or RGB. No other formats, including compressed internal formats, are color-renderable." In the OpenGL ES 3.0 spec, none of the SNORM formats have "color- renderable" marked in table 3.12. The RGB I and UI formats also are not color-renderable in ES3, but we'll save that change for another patch. Both NVIDIA's closed-source driver (version 304.64) and AMD's closed-source driver (Catalyst 12.6 on HD 3650) reject *all* SNORM formats for renderbuffers in OpenGL 3.3 compatibility profiles. v2: Move {RED,RG,RGB,RGBA}_SNORM changes from the this commit to the next commit. Based on suggestions from Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: allow TEXTURE_CUBE_MAP_ARRAY in GetTexImageMarek Olšák2013-01-041-0/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to GetSamplerParameter*Matt Turner2013-01-021-0/+8
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to SamplerParameter*Matt Turner2013-01-021-0/+8
| | | | | | | Commit f22d49de added the SamplerParamter* functions but only used ASSERT_OUTSIDE_BEGIN_END inside the -f and -fv versions. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Mark _mesa_{init,delete}_sampler_object as staticMatt Turner2013-01-022-9/+2
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Implement compressed 2D array textures.Paul Berry2013-01-022-30/+40
| | | | | | | | | | | | | This patch adds functionality to Mesa to upload compressed 2-dimensional array textures, using the glCompressedTexImage3D and glCompressedTexSubImage3D calls. Fixes piglit tests "EXT_texture_array/compressed *" and "!OpenGL ES 3.0/ext_texture_array-compressed_gles3 *". Also partially fixes GLES3 conformance test "CoverageES30.test". Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Fix error reporting in _mesa_invalidate_pbo_{compressed_,}teximage.Paul Berry2013-01-023-8/+14
| | | | | | | | | | | The old error reporting was completely bogus, passing _mesa_error() a format string that didn't even match the remaining arguments. Also, in many cases the number of dimensions in the TexImage call was not preserved in the error message (e.g. an error in glTexImage2D was reported simply as an error in glTexImage). Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: fix signed/unsignd mix-up in fetch_signed_l_latc1()Brian Paul2013-01-021-2/+3
| | | | Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58844
* glsl: add cast to silence signed/unsigned comparision warningBrian Paul2013-01-011-1/+1
|
* mesa: add missing texel fetch code for sRGB DXT formatsBrian Paul2012-12-262-0/+86
| | | | Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58548
* Make IsVertexArray() return false before BindVertexArray()Matt Turner2012-12-212-4/+6
| | | | | | | | | | | | | | | | | | | | | Rename existing _Used flag to EverBound. The GL 4.3 and ES 3.0 specs say These names are marked as used, for the purposes of GenVertexArrays only, but they do not acquire array state until they are first bound. This also affects Apple VAOs, which is fine since the APPLE_vertex_array_object spec says A vertex array object is created by binding an unused name. This binding is accomplished by calling BindVertexArrayAPPLE with id set to the name of the new vertex array object. Fixes arb_vertex_array_object_isvertexarray. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Make IsTransformFeedback() return false before BindTransformFeedback()Matt Turner2012-12-212-3/+11
| | | | | | | | | | | | | | The GL 4.3 an ES 3.0 specs say A transform feedback object is created by binding a name returned by GenTransformFeedbacks with the command void BindTransformFeedback( enum target, uint id ); Fixes arb_transform_feedback2-istransformfeedback and part of es3conform's CoverageES30.test. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add bounds checking for uniform array accessFrank Henigman2012-12-211-13/+13
| | | | | | | | | | | | | | | | | | No piglit regressions and now passes glsl-uniform-out-of-bounds-2. validate_uniform_parameters now checks that the array index is valid. This means if an index is out of bounds, glGetUniform* now fails with GL_INVALID_OPERATION, as it should. _mesa_uniform and _mesa_uniform_matrix also call validate_uniform_parameters so the bounds checks there became redundant and were removed. The test in glGetUniformLocation is modified to check array bounds so it now returns GL_INVALID_INDEX (-1) if you ask for the location of a non-existent array element, as it should. Signed-off-by: Frank Henigman <[email protected]> Reviewed-by: Stéphane Marchesin <[email protected]>
* mesa: Allow glReadBuffer(GL_NONE) for winsys framebuffers.Paul Berry2012-12-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | Previously, Mesa code assumed that glReadBuffer(GL_NONE) was only valid for user-created framebuffer objects. However, the spec is quite clear that is should also be valid for the default framebuffer. From section 18.2.1 ("Obtaining Pixels from the Framebuffer") of the GL 4.3 spec: "When READ_FRAMEBUFFER_BINDING is zero, i.e. the default framebuffer, src must be one of the values listed in table 17.4, including NONE." Similar language exists in the GLES 3.0 spec, and in desktop GL all the way back to ARB_framebuffer_object. Partially fixes GLES3 conformance test "CoverageES30.test". NOTE: This is a candidate for stable branches. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make a function is_transform_feedback_active_and_unpaused.Paul Berry2012-12-184-21/+21
| | | | | | | | | | The rather unweildy logic for determining this condition was repeated in a large number of places. This patch consolidates it to a single inline function. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix corner cases of BindBufferBase with transform feedback.Paul Berry2012-12-183-17/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the following behaviours, which are mandated by the GL 4.3 and GLES3 specs. 1. Regarding the GL_TRANSFORM_FEEDBACK_BUFFER_SIZE query: "If the ... size was not specified when the buffer object was bound (e.g. if it was bound with BindBufferBase), ... zero is returned." (GL 4.3 section 6.7.1 "Indexed Buffer Object Limits and Binding Queries"). 2. "BindBufferBase binds the entire buffer, even when the size of the buffer is changed after the binding is established. It is equivalent to calling BindBufferRange with offset zero, while size is determined by the size of the bound buffer at the time the binding is used." (GL 4.3 section 6.1.1 "Binding Buffer Objects to Indexed Targets"). I interpret "at the time the binding is used" to mean "at the time of the call to glBeginTransformFeedback". 3. "Regardless of the size specified with BindBufferRange, or indirectly with BindBufferBase, the GL will never read or write beyond the end of a bound buffer. In some cases this constraint may result in visibly different behavior when a buffer overflow would otherwise result, such as described for transform feedback operations in section 13.2.2." (GL 4.3 section 6.1.1 "Binding Buffer Objects to Indexed Targets"). Item 1 has been part of the spec all the way back to the inception of the EXT_transform_feedback extension. Items 2 and 3 were added in GL 4.2 and GLES 3. Prior to GL 4.2, in place of items 2 and 3, the spec simply said "BindBufferBase is equivalent to calling BindBufferRange with offset zero and size equal to the size of buffer." For transform feedback, Mesa behaved as though this meant "...equal to the size of buffer at the time of the call to BindBufferBase". However, this was problematic because it left it ambiguous what to do if the buffer is shrunk between the call to BindBuffer{Base,Range} and the call to BeginTransformFeedback. Prior to this patch, Mesa's behaviour was to try to write beyond the end of the buffer, likely resulting in memory corruption. In light of this, I'm interpreting the spec change as a clarification, not an intended behavioural change, so I'm making the change apply regardless of API version. Fixes GLES3 conformance test transform_feedback2_pause_resume.test. Reviewed-by: Jordan Justen <[email protected]>
* mesa/gles3: Generate error on draw call if transform feedback would overflow.Paul Berry2012-12-183-1/+80
| | | | | | | | | | | | | | | | | In desktop GL, if a draw call would cause transform feedback buffers to overflow, the draw call should succeed, and the extra primitives should simply not be recorded in the transform feedback buffers. In GLES3, however, if a draw call would cause transform feedback buffers to overflow, the draw call is supposed to produce an INVALID_OPERATION error and no drawing should occur. This patch implements the GLES3-required behaviour. Fixes GLES3 conformance test "transform_feedback_overflow.test". Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa/gles3: Generate error on DrawElements* calls if transform feedback active.Paul Berry2012-12-181-0/+45
| | | | | | | | In GLES3, only glDrawArrays() and glDrawArraysInstanced() calls are allowed when transform feedback is active. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: refactor _mesa_compute_max_transform_feedback_vertices from i965.Paul Berry2012-12-182-0/+34
| | | | | | | | | | | | | | | | | Previously, the i965 driver contained code to compute the maximum number of vertices that could be written without overflowing any transform feedback buffers. This code wasn't driver-specific, and for GLES3 support we're going to need to use it in core mesa. So this patch moves the code into a core mesa function, _mesa_compute_max_transform_feedback_vertices(). Reviewed-by: Ian Romanick <[email protected]> v2: Eliminate C++-style variable declarations, since these won't work with MSVC. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: assert if driver did not compute the versionJordan Justen2012-12-162-1/+3
| | | | | | | | | | Make sure drivers initialize the version before: * _mesa_initialize_exec_table is called * _mesa_initialize_exec_table_vbo is called * A context is made current Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't initialize VBO vtxfmt in _vbo_CreateContextJordan Justen2012-12-161-1/+0
| | | | | | | | The driver should call _mesa_initialize_vbo_vtxfmt after computing the context version. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: don't initialize exec dispatch tables in _mesa_initialize_contextJordan Justen2012-12-161-3/+0
| | | | | | | | Drivers must compute the context version, and then call _mesa_initialize_exec_table themselves. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa dispatch_sanity: call new functions to initialize exec tableJordan Justen2012-12-161-1/+6
| | | | | | | | | | | In a future patch the exec functions will no longer set up by _mesa_initialize_context and _vbo_CreateContext. Therefore we must call _mesa_initialize_exec_table and _mesa_initialize_exec_table_vbo. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* vbo: add _mesa_initialize_vbo_vtxfmtJordan Justen2012-12-162-0/+19
| | | | | | | | This function initializes the exec/save dispatch tables for VBO vtxfmt. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: separate exec allocation from initializationJordan Justen2012-12-162-4/+7
| | | | | | | | | | | | | | | | | | | In glapi/gl_genexec.py: * Remove _mesa_alloc_dispatch_table call In glapi/gl_genexec.py and api_exec.h: * Rename _mesa_create_exec_table to _mesa_initialize_exec_table In context.c: * Call _mesa_alloc_dispatch_table instead of _mesa_create_exec_table * Call _mesa_initialize_exec_table (this is temporary) Once all drivers have been modified to call _mesa_initialize_exec_table, then the call to _mesa_initialize_context can be removed from context.c. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add support for ARB_texture_buffer_object_rgb32Dave Airlie2012-12-163-0/+15
| | | | | | | | | | This adds the extensions + the tex buffer support for checking the formats. There is a piglit test enhancement sent to that list. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Dave Airlie <[email protected]>