summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Delay display list save dispatch setup until Exec is set up.Eric Anholt2013-01-213-11/+8
| | | | | | | | This will let us copy from the Exec dispatch to deal with our commands that don't get compiled into display lists. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make the drivers call a non-code-generated dispatch table setup.Eric Anholt2013-01-213-1/+10
| | | | | | | I want to drive the Save dispatch table setup from this same function. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove the size argument from _mesa_alloc_dispatch_table().Eric Anholt2013-01-213-8/+5
| | | | | | | | All callers are in Mesa core and all use _gloffset_COUNT, so just rely on the already baked-in use of _gloffset_COUNT in the function. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove two of the now unused ASSERT_OUTSIDE_BEGIN_END macros.Eric Anholt2013-01-211-25/+0
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Drop manual checks for outside begin/end.Eric Anholt2013-01-2152-349/+92
| | | | | | | | | | | We now have a separate dispatch table for begin/end that prevent these functions from being entered during that time. The ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to change any return values or introduce new error-only stubs at this point. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Install a minimal dispatch table during glBegin()/glEnd().Eric Anholt2013-01-213-19/+116
| | | | | | | | | | This is a step toward getting rid of ASSERT_OUTSIDE_BEGIN_END() in Mesa. v2: Finish create_beginend_table() comment, move loopback API init into it, and add a const flag. (suggestions by Brian) Reviewed-by: Brian Paul <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]> (v1)
* mesa: Remove the dead PrepareExecBegin() driver hook.Eric Anholt2013-01-211-8/+0
| | | | | | | This was used in i965 for a while, but no more. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Improve a glTexEnv error message by looking up the enum.Eric Anholt2013-01-211-1/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix regression in dlist save primitive tracking.Eric Anholt2013-01-211-8/+1
| | | | | | | | | | | | | My change 7ca4f07b5b77ccac0a9b60dc5ac9082906b5947e caused errors to not be thrown when they should, because the new if statement for ExecuteFlag made the CurrentSavePrimitive not get set. And on further review, we shouldn't be validating our primitive in GL_COMPILE mode, since the command shouldn't be executed yet. Partially fixes piglit gl-1.0-beginend-coverage. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* fbobject: add additional fbo completeness checks for GLESJordan Justen2013-01-201-1/+45
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* framebuffer: update allowed implementation format/typeJordan Justen2013-01-201-3/+23
| | | | | | | | Allow additional format/type combinations based on the color render buffer to fix failures with gles3-gtf. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* readpix: allow implementation format/typeJordan Justen2013-01-201-1/+6
| | | | | | | | | For GLES2/3 allow reading of pixels with format/type based on: * GL_IMPLEMENTATION_COLOR_READ_FORMAT * GL_IMPLEMENTATION_COLOR_READ_TYPE Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* extensions: enable EXT_color_buffer_float for ES3Jordan Justen2013-01-203-9/+20
| | | | | | | | | [mattst88] v2: Enable only for ES3 per spec. [mattst88] v3: Use _mesa_is_gles3 since EXT_color_buffer_float is ES3-only. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* extensions: Add ES3-only extension supportMatt Turner2013-01-201-5/+15
| | | | Reviewed-by: Ian Romanick <[email protected]>
* readpix: check FBO completeness before trying to access the read-bufferJordan Justen2013-01-201-9/+9
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* readpix: add error checking for GLES3Jordan Justen2013-01-201-0/+56
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* copyteximage: update error checking for GLES3Jordan Justen2013-01-201-1/+36
| | | | | | | Changes based on GTF/gles3 conformance test suite. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* copyteximage: check that sRGB usage is valid for GLES3 / GLJordan Justen2013-01-201-0/+39
| | | | | Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Jordan Justen <[email protected]>
* mesa/es3: Allow unsized depth and depth-stencil formats in ES3Ian Romanick2013-01-201-2/+5
| | | | | | | | | They're part of GL_OES_depth_texture_cube_map, and we'll always enable that extension in ES3 contexts. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/es2: Allow depth component cube maps in ES2 if the extension is enabledIan Romanick2013-01-201-1/+2
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add extension bit tracking for GL_OES_depth_texture_cube_mapIan Romanick2013-01-202-0/+2
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Array uniform name length includes length of [0]Ian Romanick2013-01-181-0/+10
| | | | | | | | | | | | | This is required by OpenGL ES 3.0 and desktop OpenGL 4.2. Previous version were ambiguous. This also matches the behavior of NVIDIA's closed-source driver (version 304.64). Fixed gles3conformance test uniform_buffer_object_getactiveuniformsiv and uniform_buffer_object_structure_and_array_element_names (on my in-progress branch that fixes a bunch of other stuff...YMMV). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Array uniform names are supposed to have [0] appendedIan Romanick2013-01-181-0/+31
| | | | | | | | | | | | | | | | This is required by OpenGL ES 3.0 and desktop OpenGL 4.2. Previous version were ambiguous. This also matches the behavior of NVIDIA's closed-source driver (version 304.64). Fixed gles3conformance test uniform_buffer_object_getactiveuniform. Several piglit tests expect glGetActiveUniform to *not* include the [0] on the end. These tests were already failing on NVIDIA, and this change regresses them on Mesa. Patches have been sent to the piglit mailing list to fix the tests. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor getting a uniform's name to a helper functionIan Romanick2013-01-183-3/+16
| | | | | | | | We currently have a bug in this code, and I don't want to fix it in two places. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unused field gl_uniform_buffer_variable::BufferIan Romanick2013-01-181-1/+0
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Skip updating texgen when not doing fixed function.Eric Anholt2013-01-181-31/+39
| | | | | | | | | Between the previous commit and this one, improves GLBenchmark 2.1 offscreen performance by 0.48% +/- 0.24% (n=22, throttling outliers removed). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Don't bother updating ff texture state if we have a fragment shader.Eric Anholt2013-01-181-1/+2
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Drop a comment about ff vertex shading and texturing.Eric Anholt2013-01-181-5/+0
| | | | | | | It's never going to have texture fetches. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix out of bounds writes when uncompressing non-block-aligned ETC1.Eric Anholt2013-01-181-2/+2
| | | | | | Fixes a crash in GLB2.1 offscreen on the glthread branch. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Only mark textures as mipmap incomplete on MAX_LEVEL issues.Kenneth Graunke2013-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the OpenGL 3.2 Core Profile specification, section 3.8.12: "For one-, two-, and three-dimensional and one-and two-dimensional array textures, a texture is mipmap complete if all of the following conditions hold true: - [...] - levelbase <= levelmax [...] Using the preceding definitions, a texture is complete unless any of the following conditions hold true: - [...] - The minification filter requires a mipmap (is neither NEAREST nor LINEAR), and the texture is not mipmap complete." (This text also appears in all GL >= 3.2 specs and the ES 3.0 spec.) From this, we see that levelbase <= levelmax should only affect mipmap completeness, not base-level completeness. Prior versions of GL did not have the notion of mipmap completeness, simply calling the texture incomplete in this case. But I don't think we really care. Fixes es3conform's sgis_texture_lod_basic_completeness test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_typeIan Romanick2013-01-173-12/+3
| | | | | | | | | | Filtering of DEPTH_COMPONENT and DEPTH_STENCIL for TEXTURE_3D is already done in texture_error_check because these combinations aren't allowed on desktop GL either. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Don't allow DEPTH_STENCIL for 3D texturesIan Romanick2013-01-171-1/+2
| | | | | | | | Just like DEPTH_COMPONENT. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: add missing ASSERT_OUTSIDE_BEGIN_END() in _mesa_GetInternalformativ()Brian Paul2013-01-161-0/+3
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add driver method to determine the possible sample countsIan Romanick2013-01-152-4/+43
| | | | | | | | | | | | | | Use this method in _mesa_GetInternalformativ for both GL_SAMPLES and GL_NUM_SAMPLE_COUNTS. v2: internalFormat may not be color renderable by the driver, so zero can be returned as a sample count. Require that drivers supporting the extension provide a QuerySamplesForFormat function. The later was suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add dispatch and extension XML for GL_ARB_internalformat_queryIan Romanick2013-01-151-2/+4
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add extension tracking bit for GL_ARB_internalformat_queryIan Romanick2013-01-152-0/+2
| | | | | | | | | | | | Though, I'm tempted to always expose this extension when GL_ARB_framebuffer_object is exposed. In that case, it would share the same enable bit. v2: Correctly sort extension names. Suggested by Eric Anholt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: Add skeleton implementation of glGetInternalformativIan Romanick2013-01-152-0/+159
| | | | | | | | | | This is for the GL_ARB_internalformat_query extension and GLES 3.0. v2: Generate GL_INVALID_OPERATION if the extension is not supported. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* mesa: move declarations before code to fix MSVC buildBrian Paul2013-01-151-4/+8
|
* mesa: Round float param in glTexparameterf() to nearest integerAnuj Phogat2013-01-151-9/+4
| | | | | | | | | | | | | | | | | | OpenGL 4.2 specification suggests rounding the float data to nearest integer when the type of internal state is integer. Out of range floats should be clamped to {INT_MIN, INT_MAX}. This is not specified anywhere in gl/gles spec but below test expects this behavior. This patch makes gles3 conformance sgis_texture_lod_basic_getter.test pass. A GL spec bug will be raised to include clamping of out of range floats. V2: Round float to nearest integer for all cases where _mesa_Texparameterf() converts float param to int. Use the same block of float to int conversion code for GL_TEXTURE_SWIZZLE_{R,G,B,A}_EXT cases as well. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add error checking in _mesa_BlitFramebuffer() for MRTsAnuj Phogat2013-01-151-47/+62
| | | | | | | | | | | | | | | | | | This patch adds required error checking in _mesa_BlitFramebuffer() when blitting to multiple color render targets. It also fixes a case when blitting to a framebuffer with renderbuffer/texture attached to GL_COLOR_ATTACHMENT{i} (where i!=0). Earlier it skips color blitting if nothing is found attached to GL_COLOR_ATTACHMENT0. V2: Fixed a case when number of draw buffer attachments are zero. V3: Do compatible_color_datatypes() and compatible_resolve_formats() check for all the draw renderbuffers in fbobject.c. Fix debug code at bottom of _mesa_BlitFramebuffer() to handle MRTs. Combine error checking code for linear blits with other color blit error checking. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix GL error generation in _mesa_GetFramebufferAttachmentParameteriv()Anuj Phogat2013-01-151-1/+28
| | | | | | | | | | | | | | This allows query on default framebuffer in glGetFramebufferAttachmentParameteriv() for gles3. Fixes unexpected GL errors in gles3 conformance test case: framebuffer_blit_functionality_multisampled_to_singlesampled_blit V2: Use _mesa_is_gles3() check to restrict allowed attachment types to specific APIs. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix GL error generation in glBlitFramebuffer()Anuj Phogat2013-01-151-15/+49
| | | | | | | | | | | | | | | | V2: If mask has GL_STENCIL_BUFFER_BIT set, the depth formats for readRenderBuffer and drawRenderBuffer must match unless one of the two buffers doesn't have depth, in which case it's not blitted, so the format check should be ignored. Same comment goes for stencil formats in depth renderbuffers if mask has GL_DEPTH_BUFFER_BIT set. v3 (Kayden): Refactor code to be a bit more readable. Signed-off-by: Anuj Phogat <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make ES3 glDrawBuffers() only accept BACK/NONE for the winsys fbo.Kenneth Graunke2013-01-151-5/+17
| | | | | | | | | | | | Nothing was explicitly checking this. v2: Update GL3 spec reference. Signed-off-by: Anuj Phogat <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Signed-off-by: Ian Romanick <[email protected]> [v2] Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> [v1]
* mesa: Handle GL_BACK correctly for ES 3.0 in glDrawBuffers().Kenneth Graunke2013-01-151-4/+19
| | | | | | | | | | | | | | | | | | | | | In ES 3.0, when calling glDrawBuffers() on the window system framebuffer, the only valid targets are GL_NONE or GL_BACK. Since there is no stereo rendering in ES 3.0, this is a single buffer, unlike desktop where it may be two (and thus isn't allowed). For single-buffered configs, GL_BACK ironically means the front (and only) buffer. I'm not sure that it matters, however, as ES shouldn't have front buffer rendering in the first place. Fixes es3conform framebuffer_blit_coverage_default_draw_buffer_binding. v2: Update GLES3 spec reference. Signed-off-by: Anuj Phogat <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Signed-off-by: Ian Romanick <[email protected]> [v2] Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> [v1]
* mesa: Return INVALID_ENUM for glReadPixels(..., GL_DEPTH_*, ...) on ES 3Matt Turner2013-01-151-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]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Return INVALID_OPERATION when type is known but not allowedMatt Turner2013-01-151-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]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Allow HALF_FLOAT in glVertexAttribPointer for GLES3Matt Turner2013-01-151-7/+7
| | | | | | | | Fixes es3conform's half_float_max_vertex_dimensions and half_float_textures tests. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Reject texture-only formats as renderbuffer formats in ES 3Matt Turner2013-01-151-9/+5
| | | | | | | | | | | | | | | | | | | 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. v2: Allow RED and RG float rendering in core profiles The check used to be (version > 30) || (compat profile w/extensions). Just deleting <version > 30) broke 3.0+ core profiles. Fixes es3conform's color_buffer_unsupported_format test. Signed-off-by: Matt Turner <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Acked-by: Kenneth Graunke <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix default value of BUFFER_ACCESS_FLAGS.Kenneth Graunke2013-01-151-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 Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rework crazy error code rules in glDrawBuffers().Kenneth Graunke2013-01-151-3/+63
| | | | | | | | | | | | | | | | | | | | | | | 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. v2: 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. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>