summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: fix a typo in glDetachShader error messageTapani Pälli2013-12-121-1/+1
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add IsSample bitfield to gl_fragment_programChris Forbes2013-12-071-0/+6
| | | | | | | | Drivers will need to look at this to decide if they need to do per-sample fragment shader dispatch. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Remove support for GL_MESA_texture_arrayIan Romanick2013-12-045-36/+0
| | | | | | | | | | | | | | | | | | This extension enabled the use of texture array with fixed-function and assembly fragment shaders. No applications are known to use this extension. NOTE: This patch regresses GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY cases of the copyteximage piglit test. The test is incorrectly using texture arrays with fixed function while only requiring the GL_EXT_texture_array extension. A fix for the test has been posted to the piglit mailing list. http://lists.freedesktop.org/archives/piglit/2013-November/008639.html Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use a single enable for GL_EXT_texture_array and GL_MESA_texture_arrayIan Romanick2013-12-0411-54/+28
| | | | | | | | | | | Every driver that enables one also enables the other. The difference between the two is MESA adds support for fixed-function and assembly fragment shaders, but EXT only adds support for GLSL. The MESA extension was created back when Mesa did not support GLSL. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Minor clean-up of target_enum_to_indexIan Romanick2013-12-041-6/+6
| | | | | | | | | Constify the gl_context parameter, and remove suffixes from enums that have non-suffix versions. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Silence GCC warning in count_tex_sizeIan Romanick2013-12-041-0/+2
| | | | | | | | | main/texobj.c: In function 'count_tex_size': main/texobj.c:886:23: warning: unused parameter 'key' [-Wunused-parameter] Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Silence GCC warning in _mesa_test_texobj_completenessIan Romanick2013-12-041-1/+1
| | | | | | | | | | | | main/texobj.c: In function '_mesa_test_texobj_completeness': main/texobj.c:553:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] main/texobj.c:553:193: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] main/texobj.c:553:254: warning: signed and unsigned type in conditional expression [-Wsign-compare] main/texobj.c:553:148: warning: signed and unsigned type in conditional expression [-Wsign-compare] Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add missing API check for GL_TEXTURE_3DIan Romanick2013-12-041-1/+1
| | | | | | | | There are no 3D textures in OpenGL ES 1.x. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add missing checks for GL_TEXTURE_CUBE_MAP_ARRAYIan Romanick2013-12-041-1/+2
| | | | | | | | | | | | That enum requires GL_ARB_texture_cube_map_array, and it is only available on desktop GL. It looks like this has been an un-noticed issue since GL_ARB_texture_cube_map_array support was added in commit e0e7e295. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: reduce memory used for short display listsBrian Paul2013-12-041-0/+35
| | | | | | | | | | | | | Display lists allocate memory in chunks of 256 tokens (1KB) at a time. If an app creates many short display lists or uses glXUseXFont() this can waste quite a bit of memory. This patch uses realloc() to trim short lists and reduce the memory used. Also, null/zero-out some list construction fields in _mesa_EndList(). Reviewed-by: Ian Romanick <[email protected]>
* mesa: update/remove display list commentsBrian Paul2013-12-041-16/+5
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove gl_dlist_node::next pointer to reduce dlist memory useBrian Paul2013-12-041-8/+10
| | | | | | | Now, sizeof(gl_dlist_node)==4 even on 64-bit systems. This can halve the memory used by some display lists on 64-bit systems. Reviewed-by: Ian Romanick <[email protected]>
* mesa: begin reducing memory used by display listsBrian Paul2013-12-041-172/+252
| | | | | | | | | | | | | | | | | This is a first step in reducing memory used by display lists on 64-bit systems. On 64-bit systems, the gl_dlist_node union type is 8 bytes because of the 'data' and 'next' fields. This causes every display list node/token to occupy 8 bytes instead of 4 as originally designed. This basically doubles the memory used by some display lists on 64-bit systems. The fix is to remove the 64-bit 'data' and 'next' pointer fields from the union and instead store them as a pair of 32-bit values. Easily done with a few helper functions. The next patch will take care of the 'next' field. Reviewed-by: Ian Romanick <[email protected]>
* mesa: modified _mesa_align_free() to accept NULL pointerSiavash Eliasi2013-12-041-5/+9
| | | | | | | | | | | So that it acts like ordinary free(). This lets us remove a bunch of if statements where the function is called. v2: - Avoiding compile error on MSVC and possible warnings on other compilers. - Added comment regards passing NULL pointer being safe. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't leak performance monitors on context destroyIlia Mirkin2013-12-043-0/+23
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "10.0" <[email protected]>
* mesa: resolve typo DTXn/DXTnEmil Velikov2013-12-031-1/+1
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* mesa: expose AMD_vertex_shader_layer in the core profile onlyMarek Olšák2013-12-031-1/+1
| | | | | | | It needs glFramebufferTexture, which isn't available in the compatibility profile. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Simplify the built-in function linking code.Kenneth Graunke2013-12-012-4/+2
| | | | | | | | | | | | | | | | | | Previously, we stored an array of up to 16 additional shaders to link, as well as a count of how many each shader actually needed. Since the built-in functions rewrite, all the built-ins are stored in a single shader. So all we need is a boolean indicating whether a shader needs to link against built-ins or not. During linking, we can avoid creating the temporary array if none of the shaders being linked need built-ins. Otherwise, it's simply a copy of the array that has one additional element. This is much simpler. This patch saves approximately 128 bytes of memory per gl_shader object. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix mem leak of glPixelMap data in display listBrian Paul2013-11-291-13/+16
| | | | | | And simplify save_PixelMapfv() by using the memdup() function. Reviewed-by: Ian Romanick <[email protected]>
* mesa: added memory-related comment in save_error()Brian Paul2013-11-291-0/+4
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix flags assignment in save_WaitSync()Brian Paul2013-11-291-1/+1
| | | | | | | | The flags value is a bitfield so use the union's 'bf' field, not 'e' (enum) field. There's no actual change in behavior here since both fields of the union are the same size. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove old colortable, histogram, etc. code from dlist.cBrian Paul2013-11-291-551/+0
| | | | | | | Trying to compile any of these functions into a display list now just generates a GL_INVALID_OPERATION error. Reviewed-by: Ian Romanick <[email protected]>
* mesa: have old convolution functions generate GL_INVALID_OPERATIONBrian Paul2013-11-291-12/+12
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: have old glColorTable functions generate GL_INVALID_OPERATIONBrian Paul2013-11-291-10/+10
| | | | | | As is done for the old histogram functions. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add validation helpers for new indirect drawsChris Forbes2013-11-252-0/+218
| | | | | | | | | | | | | | | | | Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series. V3: - Disallow primcount==0 for DrawMulti*Indirect. The spec is unclear on this, but it's silly. We might go back on this later if it turns out to be a problem. - Make it clear that the caller has dealt with stride==0 V4: - Allow primcount==0 again. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add binding point for indirect bufferChris Forbes2013-11-254-0/+22
| | | | | | | | Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add extension scaffolding for ARB_draw_indirectChris Forbes2013-11-253-0/+4
| | | | | | | | | | | We will reuse the same extension flag for ARB_multi_draw_indirect since it can always be supported by looping. Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* glapi: add plumbing for GL_ARB_draw_indirect and GL_ARB_multi_draw_indirectChris Forbes2013-11-251-4/+4
| | | | | | | | Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: initialize gl_renderbuffer::Depth in coreMarek Olšák2013-11-231-0/+1
| | | | | Reviewed-by: Ian Romanick <[email protected]> Tested-by: Ian Romanick <[email protected]>
* mesa: fix indentation in ffvertex_prog.cBrian Paul2013-11-221-12/+14
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Implement GL_FRAMEBUFFER_ATTACHMENT_LAYERED query.Paul Berry2013-11-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | From section 6.1.18 (Renderbuffer Object Queries) of the GL 3.2 spec, under the heading "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is TEXTURE, then": If pname is FRAMEBUFFER_ATTACHMENT_LAYERED, then params will contain TRUE if an entire level of a three-dimesional texture, cube map texture, or one-or two-dimensional array texture is attached. Otherwise, params will contain FALSE. Fixes piglit tests: - spec/!OpenGL 3.2/layered-rendering/framebuffer-layered-attachments - spec/!OpenGL 3.2/layered-rendering/framebuffertexture-defaults Cc: "10.0" <[email protected]> Reviewed-by: Chris Forbes <[email protected]> v2: Don't include "EXT" in the error message, since this query only makes sensen in context versions that have adopted glGetFramebufferAttachmentParameteriv(). Reviewed-by: Ian Romanick <[email protected]>
* mesa: Fix texture target validation for glFramebufferTexture()Paul Berry2013-11-211-12/+47
| | | | | | | | | | | | | | | | | | | Previously we were using the code path for validating glFramebufferTextureLayer(). But glFramebufferTexture() allows additional texture types. Fixes piglit tests: - spec/!OpenGL 3.2/layered-rendering/gl-layer-cube-map - spec/!OpenGL 3.2/layered-rendering/framebuffertexture Cc: "10.0" <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Chris Forbes <[email protected]> v2: Clarify comment above framebuffer_texture(). Reviewed-by: Ian Romanick <[email protected]>
* mesa: Track number of layers in layered framebuffers.Paul Berry2013-11-212-3/+18
| | | | | | | | | | | | | | | | | | | | In order to properly clear layered framebuffers, we need to know how many layers they have. The easiest way to do this is to record it in the gl_framebuffer struct when we check framebuffer completeness. This patch replaces the gl_framebuffer::Layered boolean with a gl_framebuffer::NumLayers integer, which is 0 if the framebuffer is not layered, and equal to the number of layers otherwise. v2: Remove gl_framebuffer::Layered and make gl_framebuffer::NumLayers always have a defined value. Fix factor of 6 error in the number of layers in a cube map array. Cc: "10.0" <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Use IROUND instead of roundf.José Fonseca2013-11-211-1/+1
| | | | roundf is not available on MSVC.
* mesa: enable GL_TEXTURE_LOD_BIAS set/getTapani Pälli2013-11-211-8/+8
| | | | | | | | | | | | | | Earlier comments suggest this was removed from GL core spec but it is still there. Enabling makes 'texture_lod_bias_getter' Khronos conformance tests pass, also removes some errors from Metro Last Light game which is using this API. v2: leave NOTE comment (Ian) Cc: "9.0 9.1 9.2 10.0" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Tapani Pälli <[email protected]>
* mesa: Update MESA_INFO to eliminate errorCourtney Goeltzenleuchter2013-11-213-5/+9
| | | | | | | | | | | | If a user set MESA_INFO and the OpenGL application uses a 3.0 or later context then the MESA_INFO debug output will have an error when it queries for extensions using the deprecated enum GL_EXTENSIONS. Passing context argument allows code to return extension list directly regardless of profile. Commit title updated as recommended by Kenneth Graunke. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/main: Move declaration to beginning of scope.José Fonseca2013-11-181-1/+2
| | | | | | Should fix MSVC build. Trivial.
* mesa: Add API debug logging to TexStorageCourtney Goeltzenleuchter2013-11-171-0/+7
| | | | | | | | Give glTexStorage* equivalent debug logging to glTexImage*. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Handle !m->Ended for performance monitor result availability.Kenneth Graunke2013-11-171-1/+5
| | | | | | | | | If a performance monitor has never ended, then no result can be available. Core Mesa can easily handle this, saving drivers a tiny bit of complexity. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Track whether a performance monitor has ever ended.Kenneth Graunke2013-11-172-1/+13
| | | | | | | | | | | If a monitor has ended, it means a result should eventually become available, pending some flushing. This is distinct from !m->Active; if a monitor has not been started, then m->Active == false and m->Ended == false. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Also initialize gl_performance_monitor::Active.Kenneth Graunke2013-11-171-0/+2
| | | | | | | | The i965 implementation uses calloc, so I missed this. It's best to simply initialize it to avoid requiring a zeroing allocator, though. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Store the performance monitor object's name.Kenneth Graunke2013-11-172-0/+4
| | | | | | | Being able to print monitor->Name is really useful for debugging. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Dynamically allocate the storage for program local parameters.Eric Anholt2013-11-152-2/+15
| | | | | | | | | | | | | | | | The array was 64kb per struct gl_program, plus we statically stored a copy of one on disk for _mesa_DummyProgram. Given that most struct gl_programs we generate are for GLSL shaders that don't have local parameters, this was a waste. Since you can store and fetch parameters beyond what the program actually uses, we do have to do a late allocation if necessary at GetProgramLocalParameter time. Reduces peak memory usage in the dota2 trace I made by 76MB (4.5%) Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove PROGRAM_ENV_PARAM enum.Eric Anholt2013-11-151-5/+3
| | | | | | | | This has been replaced with referring to env parameters using PROGRAM_STATE_VAR and _mesa_load_state_parameters. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove PROGRAM_LOCAL_PARAM enum.Eric Anholt2013-11-151-1/+0
| | | | | | | | This has been replaced with referring to local parameters using PROGRAM_STATE_VAR and _mesa_load_state_parameters. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove duplicated prototypes in varray.hBrian Paul2013-11-151-6/+0
|
* main: Fix MaxUniformComponents for geometry shaders.Paul Berry2013-11-151-1/+1
| | | | | | | | | | | | | | | For both vertex and fragment shaders we default MaxUniformComponents to 4 * MAX_UNIFORMS. It makes sense to do this for geometry shaders too; if back-ends have different limits they can override them as necessary. Fixes piglit test: spec/glsl-1.50/built-in constants/gl_MaxGeometryUniformComponents Cc: "10.0" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* mesa: Fix derived vertex state not being updated in glCallList()Fredrik Höglund2013-11-151-6/+16
| | | | | | | | | | AEcontext::NewState is not always set when the vertex array state is changed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71492 Cc: "10.0" <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: 80-column wrapping, remove trailing whitespace in arrayobj.cBrian Paul2013-11-121-13/+16
|
* mesa: add comment for struct gl_vertex_buffer_bindingBrian Paul2013-11-121-0/+6
|