summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
Commit message (Collapse)AuthorAgeFilesLines
* Remove useless checks for NULL before freeingMatt Turner2012-09-054-17/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + free ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - free((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - } @@ expression E; type T; @@ + free ((T) E); - if (unlikely (E != NULL)) { - free ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-058-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* mesa: remove SQRTF, use sqrtf. Convert INV_SQRT() to inline function.Brian Paul2012-09-033-5/+5
| | | | | | | We were already defining sqrtf where we don't have the C99 version. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: s/FREE/free/Brian Paul2012-09-011-5/+5
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: s/CALLOC/calloc/Brian Paul2012-09-012-2/+2
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: s/MALLOC/malloc/Brian Paul2012-09-012-2/+2
| | | | | | | v2: replace instances in dri/common/ dirs Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix-up and use _mesa_delete_renderbuffer()Brian Paul2012-08-311-1/+1
| | | | | | | | _mesa_delete_renderbuffer() should free the mutex (though that may be a no-op) and then free the renderbuffer object itself. Subclasses of gl_renderbuffer can use this function too. Reviewed-by: José Fonseca <[email protected]>
* swrast: fix wrong assignments in _swrast_add_spec_terms_line()Brian Paul2012-08-291-2/+2
|
* swrast: implement cubical depth texture samplingBrian Paul2012-08-241-41/+74
| | | | | | Fixes a few more failures in the piglit copyteximage test. Reviewed-by: Ian Romanick <[email protected]>
* mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for dxt formatsBrian Paul2012-08-241-24/+24
| | | | | | | As with the previous commit. This fixes the last crash in the piglit copyteximage test but there's still some failures.
* mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for latc/rgtc formatsBrian Paul2012-08-241-24/+24
| | | | | | | Fix-up the texel fetch functions so that they handle 3D coords (as used for array textures) and remove the "f_2d" part from their names. Helps fix swrast crashes in piglit's copyteximage test. More to come.
* mesa: new _mesa_num_tex_faces() helperBrian Paul2012-08-241-2/+3
| | | | | Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
* mesa: Kill GL_ARB_shadow_ambient with fireIan Romanick2012-08-141-20/+16
| | | | | | | | | | No driver supports this extension, and it seems unlikely than any driver ever will. I think r300c may have supported it at one time, but that driver has already been removed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Remove unnecessary parameters from AllocTextureImageBufferPauli Nieminen2012-08-122-29/+15
| | | | | | | | | | Size and format information is always stored in gl_texture_image structure. That makes it preferable to remove duplicate information from parameters to make interface easier to understand. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* swrast: Support sampler object for texture fetching statePauli Nieminen2012-08-0110-360/+446
| | | | | | | | | | | | swrast needs to pass sampler object into all texture fetching functions to use correct sampling state when sampler object is bound to the unit. The changes were made using half manual regular expression replace. v2: Fix NULL deref in _swrast_choose_triangle(), because the _Current values aren't set yet, so we need to look at our texObj2D. (anholt) Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Move DepthMode to texture objectPauli Nieminen2012-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on compatibility profile specifications. OpenGL specification 4.1 compatibility 20100725 3.9.2: "... The values accepted in the pname parameter are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_- FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_- LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and in the sampler state in table 6.26 is not part of the sampler state, and remains in the texture object." The list of states is in Table 6.24 "Textures (state per texture object)" instead of 6.25 mentioned in the specification text. Same can be found from 3.3 compatibility specification. Signed-off-by: Pauli Nieminen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa formats: add MESA_FORMAT_ABGR2101010_UINTJordan Justen2012-07-211-1/+7
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* swrast: Fix memory leaks in blit_linear.Vinson Lee2012-04-021-0/+9
| | | | | | | | | Fixes Coverity resource leak defects. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: rework texture completeness testingBrian Paul2012-03-203-4/+10
| | | | | | | | | | | | | | | | | | | Instead of gl_texture_object::_Complete there are now two fields: _BaseComplete and _MipmapComplete. The former indicates whether the base texture level is valid. The later indicates whether the whole mipmap is valid. With sampler objects, a single texture can appear to be both complete and incomplete at the same time. See the GL_ARB_sampler_objects spec for more details. To implement this we now check if the texture is complete with respect to a sampler state. Another benefit of this is we no longer need to invalidate a texture's completeness state when we change the minification/magnification filters with glTexParameter(). Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* swrast: s/_DD_NEW_SEPARATE_SPECULAR/_MESA_NEW_SEPARATE_SPECULAR/Brian Paul2012-03-121-3/+3
| | | | | | | Another step toward removing the _DD_NEW_x flags Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: move more swrast-related #defines out of core MesaBrian Paul2012-02-242-0/+28
|
* mesa: remove MAX_WIDTH from prog_execute.hBrian Paul2012-02-241-0/+2
| | | | | define a PROG_MAX_WIDTH var instead. It has to match MAX_WIDTH in swrast. More elaborate refactoring could fix that (someday).
* swrast: check max renderbuffer size against SWRAST_MAX_WIDTHBrian Paul2012-02-241-0/+2
|
* swrast: define, use SWRAST_MAX_WIDTH/HEIGHTBrian Paul2012-02-2416-46/+55
| | | | We'll get rid of MAX_WIDTH, MAX_HEIGHT soon.
* swrast: remove MAX_WIDTH array in s_span.cBrian Paul2012-02-241-1/+2
|
* swrast: simplify mask array codeBrian Paul2012-02-241-3/+4
|
* swrast: stop using MAX_WIDTH arrays in triangle codeBrian Paul2012-02-241-2/+2
|
* swrast: remove MAX_WIDTH arrays in stencil codeBrian Paul2012-02-243-4/+37
| | | | Use some per-context temporary arrays instead.
* swrast: remove MAX_WIDTH arrays in s_drawpix.cBrian Paul2012-02-241-27/+36
|
* swrast: remove MAX_WIDTH arrays in s_zoom.cBrian Paul2012-02-241-2/+14
|
* swrast: remove MAX_WIDTH arrays in s_depth.cBrian Paul2012-02-241-1/+9
|
* swrast: remove MAX_WIDTH arrays in s_copypix.cBrian Paul2012-02-241-5/+20
|
* mesa: move/fix MAX_WIDTH/HEIGHT-related assertionsBrian Paul2012-02-241-0/+8
| | | | | | Max texture and viewport size is only limited by MAX_WIDTH/HEIGHT for swrast. Reviewed-by: José Fonseca <[email protected]>
* i915: Initialize swrast_texture_image structure fields.Paul Berry2012-02-222-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 980f6f1 (mesa: move gl_texture_image::Width/Height/DepthScale fields to swrast) moved the initialization of the Width, Height, and DepthScale fields to _swrast_alloc_texture_image_buffer(). However, i915 doesn't call this function because it performs its own buffer allocation. As a result, the Width, Height, and DepthScale fields weren't getting initialized properly, and some operations requiring swrast would fail. This patch ensures that Width, Height, and DepthScale are properly initialized by separating the code that sets them into a new function, _swrast_init_texture_image(), which is called by intel_alloc_texture_image_buffer() as well as _swrast_alloc_texture_image_buffer(). It also moves the initialization of _IsPowerOfTwo into this function. Fixes piglit test fbo/fbo-cubemap on i915. Partially fixes https://bugs.freedesktop.org/show_bug.cgi?id=41216 This is a candidate for the 8.0 branch. Reviewed-and-tested-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* swrast: Only avoid empty _TexEnvProgramsIan Romanick2012-02-151-1/+2
| | | | | | | | | | | | | | If the generated shader for _TexEnvProgram is empty, force the use of the fixed-function code. Otherwise, go ahead and use the shader. This works around a mysterious issue on i915 where fixed-function software fallbacks are not working correctly. This isn't really the fix we want, but it works around the issue. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
* swrast: fix span color type selectionBrian Paul2012-02-123-9/+36
| | | | | | | | | | | | | | | | Fixes a regression from commit 660ed923ded3552e023ef8c3dd9f92e6792f1bd2. The basic idea is to look at the format of the dest renderbuffer and choose either GLubyte or GLfloat for colors. The previous code used _mesa_format_to_type_and_comps() which could return a bunch types other than ubyte/float. Determine the datatype at renderbuffer mapping time to avoid frequent calls to the format query functions. NOTE: This is a candidate for the 8.0 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45578 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45577
* mesa: Convert colors if span ChanType and renderbuffer data type don't matchIan Romanick2012-02-021-4/+15
| | | | | | | | | | | | This is a partial revert of f9874fe. It turns out that the types don't always match. Specifically, this can happen when doing glCopyPixels from a float FBO to a RGBA8 FBO. NOTE: This is a candidate for the 8.0 branch. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45429 Reviewed-by: Brian Paul <[email protected]>
* mesa: added swapBytes parameter to _mesa_format_matches_format_and_type()Brian Paul2012-01-271-1/+2
| | | | | | Not actually used yet though. Reviewed-by: Ian Romanick <[email protected]>
* swrast: Fix implicit declaration warningsChad Versace2012-01-271-0/+1
| | | | | | | | | | | | | In a recent commit, commit 1c0f1dd42a50464eeb81de4aad8eecf24b3d6c89 Author: Chad Versace <[email protected]> swrast: Fix fixed-function fragment processing I defined a new function,_swrast_fragment_program, but neglected to #include s_fragprog.h for clients of that function. Note: This is a candidate for the 8.0 branch. Reported-by: Brian Paul <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* swrast: Fix fixed-function fragment processingChad Versace2012-01-279-44/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On i965, _mesa_ir_link_shader is never called. As a consequence, the current fragment program (ctx->FragmentProgram->_Current) exists but is invalid because it has no instructions. Yet swrast continued to attempt to use the empty program. To avoid using the empty program, this patch 1) defines a new function, _swrast_use_fragment_program, which checks if the current fragment program exists and differs from the fixed function fragment program, and, when appropriate, 2) replaces checks of the form if (ctx->FragmentProgram->_Current == NULL) with if (_swrast_use_fragment_program(ctx)) Fixes the following oglconform regressions on i965/gen6: api-fogcoord(basic.allCases.log) api-mtexcoord(basic.allCases.log) api-seccolor(basic.allCases.log) api-texcoord(basic.allCases.log) blend-separate(basic.allCases) colorsum(basic.allCases.log) The tests were ran with the GLXFBConfig: visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat ---------------------------------------------------------------------------- 0x021 24 tc 0 32 0 r y . 8 8 8 8 . . 0 24 8 0 0 0 0 0 0 None (Note: I originally believed that the hunk in _swrast_update_fragment_program was unnecessary. But it is required to fix blend-separate.) Note: This is a candidate for the 8.0 branch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327 Reveiwed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
* swrast: silence uninitialized var warningsBrian Paul2012-01-261-2/+2
|
* swrast: fix uninitialized variable warningBrian Paul2012-01-241-1/+1
|
* swrast: make rowStride variable signed in put_z32_values()Brian Paul2012-01-241-1/+1
| | | | As with commit aed5c8299fe47b8e1728f8140d069bc89d3fa947
* swrast: remove unused StoreTexel codeBrian Paul2012-01-244-1187/+183
| | | | | No longer needed since we do all rendering to texture with the buffer mapping and pixel packing functions.
* swrast: use Map/UnmapTextureImage() in framebuffer map/unmap codeBrian Paul2012-01-241-15/+13
| | | | | | | When we're actually rendering into a texture, map the texture image instead of the corresponding renderbuffer. Before, we just copied a pointer from the texture image to the renderbuffer. This change will make the code usable by hardware drivers.
* mesa: remove ctx->Driver.Map/UnmapTexture() hooksBrian Paul2012-01-241-3/+0
| | | | No longer used anywhere.
* swrast: move some renderbuffer functions to s_renderbuffer.cBrian Paul2012-01-242-121/+121
|
* swrast: remove a few extra _mesa_get_format_bytes() callsBrian Paul2012-01-241-4/+6
|
* swrast: use swrast_renderbuffer instead of gl_renderbufferBrian Paul2012-01-249-41/+62
|
* swrast: allocate swrast_renderbuffers instead of gl_renderbuffersBrian Paul2012-01-242-7/+7
|