summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* glcpp: Make sure GL_AMD_shader_trinary_minmax is definedIan Romanick2014-01-271-1/+0
| | | | | | | | | | | The define was only available if gl_extensions::AMD_shader_trinary_minmax was set, but no driver set it. Since the extension is advertised by default, remove that field too. Signed-off-by: Ian Romanick <[email protected]> Cc: Maxence Le Doré <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Clean up bad code formatting left from previous commitIan Romanick2014-01-271-13/+10
| | | | | | | Also s/_EXT// on enums that are now part of core. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: GL_EXT_framebuffer_blit is not optionalIan Romanick2014-01-275-36/+5
| | | | | | | | | Every driver supports it. All current and future Gallium drivers always support it, and all existing classic drivers support it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Validate internalFormat with target in glTexStorage pathsIan Romanick2014-01-272-1/+8
| | | | | | | | | Fixes the glTexStorage3D failure in ext_packed_depth_stencil-depth-stencil-texture and oes_packed_depth_stencil-depth-stencil-texture_gles2. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor internalFormat / target checks to a separate functionIan Romanick2014-01-272-40/+78
| | | | | | | | | We need almost identical code in the glTexStorage path. v2: Fix typo in a comment noticed by Topi. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Generate the correct error for a depth format with a 3D textureIan Romanick2014-01-271-3/+17
| | | | | | | | | | | | | | | All versions of the OpenGL spec are quite clear that GL_INVALID_OPERATION should be generated. I added a quotation from the 3.3 core profile spec. Fixes the glTexImage3D subcases of ext_packed_depth_stencil-depth-stencil-texture and oes_packed_depth_stencil-depth-stencil-texture_gles2. The same subtests of oes_packed_depth_stencil-depth-stencil-texture_gles1 fail, but they fail with a different wrong error code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Increment the list pointer while freeing instruction dataIan Romanick2014-01-241-0/+1
| | | | | | | | | | | | | Since the list pointer was never incremented when a OPCODE_PIXEL_MAP opcode was encountered, the data for the instruction would get freed over and over and over... resulting in a crash. Fixes gl-1.0-beginend-coverage. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72214 Reviewed-by: Brian Paul <[email protected]> Cc: Lu Ha <[email protected]>
* mesa: Ensure that transform feedback refers to the correct program.Paul Berry2014-01-232-15/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Previous to this patch, the _mesa_{Begin,Resume}TransformFeedback functions were using ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] to find the program that would be the source of transform feedback data. This isn't correct--if there's a geometry shader present it should be ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY]. (These might be different if separate shader objects are in use). This patch creates a function get_xfb_source(), which figures out the correct program to use based on GL state, and updates _mesa_{Begin,Resume}TransformFeedback to call it. get_xfb_source() is written in terms of the gl_shader_stage enum, so it should not need modification when we add tessellation shaders in the future. It also creates a new driver flag, NewTransformFeedbackProg, which is flagged whenever this program changes. To reduce future confusion, this patch also rewords some comments and error message text to avoid referring to vertex shaders. Cc: 10.0 <[email protected]> v2: make the for loop in get_xfb_source() clearer. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Set gl_constants::MinMapBufferAlignmentIan Romanick2014-01-231-0/+1
| | | | | | | | | | | | Leaving it set to zero isn't really correct since every allocation has at least an alignment of 1 byte. It also caused a problem in the i965 driver after I removed the MAX(64, ...) from the alignment calculation. That's what I get for changing a patch without retesting it. :( Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73907 Reviewed-by: Kenneth Graunke <[email protected]> Cc: Lu Hua <[email protected]>
* mesa: whitespace fixes in glformats.cBrian Paul2014-01-231-75/+51
| | | | | | | Reindent _mesa_get_nongeneric_internalformat() to match other functions. Remove extraneous empty lines in _mesa_get_linear_internalformat(). Trivial.
* mesa: rename unbind_texobj_from_imgunits()Brian Paul2014-01-231-4/+4
| | | | | | | ... to unbind_texobj_from_image_units() and change a local var's type to silence an MSVC warning. Reviewed-by: Marek Olšák <[email protected]>
* mesa: initialize "is_layered" variable to silence warningBrian Paul2014-01-231-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix/add some cases in _mesa_get_linear_internalformat()Brian Paul2014-01-231-1/+7
| | | | | | | | In some cases we were converting generic formats to sized formats and vice versa. The point is to simply convert sRGB formats to corresponding linear formats. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add missing ETC2_SRGB cases in formats.cBrian Paul2014-01-231-0/+12
| | | | | | | In the _mesa_get_format_color_encoding() and _mesa_get_srgb_format_linear() functions. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add ARB_arrays_of_arraysTimothy Arceri2014-01-232-0/+2
| | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Bump MAX_TEXTURE_IMAGE_UNITS to 32.Kenneth Graunke2014-01-221-1/+1
| | | | | | | | This allows drivers to optionally support more than 16 texture units. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa: Change redundant code into loops in texstate.c.Paul Berry2014-01-211-46/+29
| | | | | | | This is possible now that ctx->Shader.CurrentProgram is an array. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Change redundant code into loops in shaderapi.c.Paul Berry2014-01-211-30/+9
| | | | | | | This is possible now that ctx->Shader.CurrentProgram is an array. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove ad-hoc arrays of gl_shader_program.Paul Berry2014-01-211-5/+1
| | | | | | | | Now that we have a ctx->Shader.CurrentProgram array, we can just use it directly. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Fold long lines introduced by the previous patch.Paul Berry2014-01-213-6/+12
| | | | | Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an ↵Paul Berry2014-01-218-51/+50
| | | | | | | | | | | | | | | | | | | | | array. These are replaced with ctx->Shader.CurrentProgram[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}]. In patches to follow, this will allow us to replace a lot of ad-hoc logic with a variable index into the array. With the exception of the changes to mtypes.h, this patch was generated entirely by the command: find src -type f '(' -iname '*.c' -o -iname '*.cpp' ')' \ -print0 | xargs -0 sed -i \ -e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \ -e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \ -e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g' Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: use _mesa_validate_shader_target() more frequently.Paul Berry2014-01-212-4/+4
| | | | | | | | | | | | | This patch replaces code in _mesa_new_shader() and delete_shader_cb() that checks the type of a shader with calls to _mesa_validate_shader_target(). This has two advantages: it allows for a more thorough check (since _mesa_validate_shader_target() doesn't permit shader targets that aren't supported by the back-end), and it reduces the amount of code that will need to be modified when adding new shader stages. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main: Allow ctx == NULL in _mesa_validate_shader_target().Paul Berry2014-01-211-3/+10
| | | | | | | | | This will allow this function to be used in circumstances where there is no context available, such as when building built-in GLSL functions. Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Make validate_shader_target() non-static.Paul Berry2014-01-212-4/+7
| | | | | Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Generate GL_INVALID_OPERATION for unsupported DSA TexStorage functionsIan Romanick2014-01-211-3/+15
| | | | | | | | | We have to make the functions available to work around a GLEW bug (see comments already in the code), but if an application calls one of these functions we should still generate GL_INVALID_OPERATION. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Silence many unused parameter warningsIan Romanick2014-01-211-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | main/texstorage.c: In function '_mesa_alloc_texture_storage': main/texstorage.c:240:53: warning: unused parameter 'width' [-Wunused-parameter] main/texstorage.c:241:37: warning: unused parameter 'height' [-Wunused-parameter] main/texstorage.c:241:53: warning: unused parameter 'depth' [-Wunused-parameter] main/texstorage.c: In function '_mesa_TextureStorage1DEXT': main/texstorage.c:464:34: warning: unused parameter 'texture' [-Wunused-parameter] main/texstorage.c:464:50: warning: unused parameter 'target' [-Wunused-parameter] main/texstorage.c:464:66: warning: unused parameter 'levels' [-Wunused-parameter] main/texstorage.c:465:34: warning: unused parameter 'internalformat' [-Wunused-parameter] main/texstorage.c:466:35: warning: unused parameter 'width' [-Wunused-parameter] main/texstorage.c: In function '_mesa_TextureStorage2DEXT': main/texstorage.c:473:34: warning: unused parameter 'texture' [-Wunused-parameter] main/texstorage.c:473:50: warning: unused parameter 'target' [-Wunused-parameter] main/texstorage.c:473:66: warning: unused parameter 'levels' [-Wunused-parameter] main/texstorage.c:474:34: warning: unused parameter 'internalformat' [-Wunused-parameter] main/texstorage.c:475:35: warning: unused parameter 'width' [-Wunused-parameter] main/texstorage.c:475:50: warning: unused parameter 'height' [-Wunused-parameter] main/texstorage.c: In function '_mesa_TextureStorage3DEXT': main/texstorage.c:483:34: warning: unused parameter 'texture' [-Wunused-parameter] main/texstorage.c:483:50: warning: unused parameter 'target' [-Wunused-parameter] main/texstorage.c:483:66: warning: unused parameter 'levels' [-Wunused-parameter] main/texstorage.c:484:34: warning: unused parameter 'internalformat' [-Wunused-parameter] main/texstorage.c:485:35: warning: unused parameter 'width' [-Wunused-parameter] main/texstorage.c:485:50: warning: unused parameter 'height' [-Wunused-parameter] main/texstorage.c:485:66: warning: unused parameter 'depth' [-Wunused-parameter] Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: rename PreferDP4 to OptimizeForAOS.Matt Turner2014-01-212-4/+7
| | | | | | | | | This flag was really just a proxy for determining whether the backend was vector (AOS) or scalar (SOA). It will be used to apply a future optimization only for vector backends. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add STRINGIFY macro.Matt Turner2014-01-211-0/+2
| | | | Reviewed-by: Jordan Justen <[email protected]>
* mesa: add missing TYPE_DOUBLEN_2 cases in get.cBrian Paul2014-01-211-0/+12
| | | | | | | | | | | | The new TYPE_DOUBLEN_2 type was added in 0e60d850 but the code to return values of that type wasn't completed. Fixes conform's default state test. glGetFloatv(GL_DEPTH_RANGE) wasn't returning anything. v2: remove stray 'break' statements. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: Refactor bounding-box calculation out of _mesa_update_draw_buffer_boundsIan Romanick2014-01-202-29/+61
| | | | | | | | | | | | Drivers that currently use _Xmin and friends to set their scissor rectangle will need to use this code directly once they are updated for GL_ARB_viewport_array. v2: Use different bit-test idiom and fix mixed tabs and spaces. Both were suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add ARB_viewport_array plumbingCourtney Goeltzenleuchter2014-01-203-10/+18
| | | | | | | | | | | | | | | | Define API connections to extension entry points added in previous commits. Update entry points to use floating point arguments as required by the extension. Add get tokens for ARB_viewport_array state. v2: Include review feedback. v3 (idr): Fix 'make check'. Add missing Get infrastructure (some was culled from other pathces). Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add varying slot for viewport indexIan Romanick2014-01-201-0/+2
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add new viewport and depth-range entry points for GL_ARB_viewport_arrayCourtney Goeltzenleuchter2014-01-202-0/+178
| | | | | | | | | | | | | | | | | | | v2 (idr): Use set_viewport_no_notify / set_depth_range_no_notify (and manually notify the driver) instead of calling _mesa_set_viewporti / _mesa_set_depthrangei. Refactor bodies of _mesa_ViewportIndexed and _mesa_ViewportIndexedv into a shared function. Remove spurious CLAMP calls in _mesa_DepthRangeArrayv and _mesa_DepthRangeIndexed. v3 (idr): Add some missing return-statements after calls to _mesa_error. v4 (idr): Only perform the ViewportBounds.Min / ViewportBounds.Max clamping in set_viewport_no_notify if GL_ARB_viewport_array is enabled. Otherwise the driver may not have set ViewportBounds, and the clamping will do bad things. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add new scissor entry points for GL_ARB_viewport_arrayCourtney Goeltzenleuchter2014-01-202-0/+101
| | | | | | | | | | | | | v2 (idr): Use set_scissor_no_notify (and manually notify the driver) instead of calling _mesa_set_scissori. Refactory bodies of _mesa_ScissorIndexed and _mesa_ScissorIndexedv into a shared function. Perform parameter validation in the same order in all three functions. Pull MaxViewports comparison fix (in _mesa_ScissorArrayv) from the next patch to this patch. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add custom get function for SCISSOR_TEST to _mesa_IsEnablediCourtney Goeltzenleuchter2014-01-201-0/+7
| | | | | | | | | Now that the scissor enable state is a bitfield need a custom function to extract the correct value from gl_context. Modeled Scissor.EnableFlags after Color.BlendEnabled. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add new get entrypoints for ARB_viewport_arrayCourtney Goeltzenleuchter2014-01-202-0/+195
| | | | | | | | | v2 (idr): Fix several "comparison between signed and unsigned integer expressions" warnings. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Change parameter to _mesa_set_viewport to floatIan Romanick2014-01-202-8/+9
| | | | | | | | This matches the expectations of GL_ARB_viewport_array and the storage type where the values will land. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Set all scissor rectsIan Romanick2014-01-202-4/+28
| | | | | | | | | | | In _mesa_Scissor, make sure that ctx->Driver.Scissor is only called once instead of once per scissor rectangle. v2: Use MAX_VIEWPORTS instead of ctx->Const.MaxViewports because the driver may not set ctx->Const.MaxViewports yet. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Set all viewports from _mesa_Viewport and _mesa_DepthRangeIan Romanick2014-01-201-2/+28
| | | | | | | | | | | | In _mesa_Viewport and _mesa_DepthRange, make sure that ctx->Driver.Viewport is only called once instead of once per viewport or depth range. v2: Make _mesa_DepthRange actually set all of the depth ranges (instead of just index 0). Noticed by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Restore all the viewports in _mesa_PopAttribIan Romanick2014-01-201-2/+7
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Restore all the scissor rectangles in _mesa_PopAttribIan Romanick2014-01-201-6/+10
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Initialize all the viewportsIan Romanick2014-01-203-26/+49
| | | | | | | | | | | | | v2: Use MAX_VIEWPORTS instead of ctx->Const.MaxViewports because the driver may not set ctx->Const.MaxViewports yet. v3: Handle all viewport entries in update_viewport_matrix and _mesa_copy_context too. This was previously in an earlier patch. Having the code in the earlier patch could cause _mesa_copy_context to access a matrix that hadn't been constructed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> [v2]
* mesa: Add an index parameter to _mesa_set_scissorIan Romanick2014-01-204-6/+6
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor scissor rectangle setting even moreIan Romanick2014-01-201-15/+27
| | | | | | | | | | Create an internal function that just writes data into the scissor rectangle. In future patches this will see more use because we only want to call dd_function_table::Scissor once after setting all of the scissor rectangles instead of once per scissor rectangle. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor viewport setting even moreIan Romanick2014-01-201-25/+38
| | | | | | | | | | Create an internal function that just writes data into the viewport. In future patches this will see more use because we only want to call dd_function_table::Viewport once after setting all of the viewport instead of once per viewport. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor depth range setting even moreIan Romanick2014-01-202-19/+41
| | | | | | | | | | Create an internal function that just writes data into the depth range. In future patches this will see more use because we only want to call dd_function_table::DepthRange once after setting all of the depth ranges instead of once per depth range. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add an index parameter to _mesa_set_viewportIan Romanick2014-01-203-12/+16
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Convert gl_context::Viewport to gl_context::ViewportArrayCourtney Goeltzenleuchter2014-01-207-48/+54
| | | | | | | | | | | Only element 0 of the array is used anywhere at this time, so there should be no changes. v4: Split out from a single megapatch. Suggested by Ken. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Converty gl_viewport_attrib::X, ::Y, ::Width, and ::Height to floatCourtney Goeltzenleuchter2014-01-203-7/+7
| | | | | | | | | | v4: Split out from a single megapatch. Suggested by Ken. Also make meta's save_state::ViewportX, ::ViewportY, ::ViewportW, and ::ViewportH to match gl_viewport_attrib. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Convert gl_viewport_attrib::Near and ::Far to doubleCourtney Goeltzenleuchter2014-01-204-4/+9
| | | | | | | v4: Split out from a single megapatch. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>