summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/atifragshader.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: include dispatch.h lessMarek Olšák2018-04-121-1/+0
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: always compare optype with symbolic name in ATI_fsMiklós Máté2017-12-251-3/+3
| | | | | Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: move ATI_fs state compile changes after the error checksMiklós Máté2017-12-251-54/+53
| | | | | | | | | | Both in setup and arithmetic instructions. Also, remove the useless new_*_inst() functions, and refactor check_arith_arg(), because it did two completely different things. Piglit: spec/ati_fragment_shader/error04-endshader Signed-off-by: Miklós Máté <[email protected]>
* mesa: fix validate for secondary interpolatorMiklós Máté2017-12-251-13/+27
| | | | | | | | | | | | | | | This patch fixes multiple problems: - the interpolator check was duplicated - both had arg instead of argRep - I split it into color and alpha for better readability and error msg - the DOT4 check only applies to color instruction according to the spec - made the DOT4 check fatal, and improved the error msg Piglit: spec/ati_fragment_shader/error08-secondary v2: fixed formatting, added spec quotations Signed-off-by: Miklós Máté <[email protected]>
* mesa: fix typo in ATI_fs dstMod error checkingMiklós Máté2017-12-251-1/+1
| | | | | | | Piglit: spec/ati_fragment_shader/error14-invalidmod Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: fix crash when an ATI_fs pass begins with an alpha instMiklós Máté2017-12-251-3/+7
| | | | | | | | | | | | | This fixes crash when: - first pass begins with alpha inst - first pass ends with color inst, second pass begins with alpha inst Also, use the symbolic name instead of a number. Piglit: spec/ati_fragment_shader/api-alphafirst v2: fixed formatting Signed-off-by: Miklós Máté <[email protected]>
* mesa: fix deleting the dummy ATI_fsMiklós Máté2017-11-071-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DummyShader is used by GenFragmentShadersATI() as a placeholder to mark IDs as allocated. Context cleanup wants to delete everything in ctx->Shared->ATIShaders, and crashes on these placeholders with this backtrace: ==15060== Invalid free() / delete / delete[] / realloc() ==15060== at 0x482F478: free (vg_replace_malloc.c:530) ==15060== by 0x57694F4: _mesa_delete_ati_fragment_shader (atifragshader.c:68) ==15060== by 0x58B33AB: delete_fragshader_cb (shared.c:208) ==15060== by 0x5838836: _mesa_HashDeleteAll (hash.c:295) ==15060== by 0x58B365F: free_shared_state (shared.c:377) ==15060== by 0x58B3BC2: _mesa_reference_shared_state (shared.c:469) ==15060== by 0x578687F: _mesa_free_context_data (context.c:1366) ==15060== by 0x595E9EC: st_destroy_context (st_context.c:642) ==15060== by 0x5987057: st_context_destroy (st_manager.c:772) ==15060== by 0x5B018B6: dri_destroy_context (dri_context.c:217) ==15060== by 0x5B006D3: driDestroyContext (dri_util.c:511) ==15060== by 0x4A1CBE6: dri3_destroy_context (dri3_glx.c:170) ==15060== Address 0x7b5dae0 is 0 bytes inside data symbol "DummyShader" Also, DeleteFragmentShadersATI() should not assert on DummyShader, just remove the hash entry. Normally one would define a shader after GenFragmentShadersATI(), and BindFragmentShaderATI() replaces the placeholder with a real object. However, the specification doesn't say that one has to define a shader for each allocated ID. Signed-off-by: Miklós Máté <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: remove dd_function_table::BindProgramMarek Olšák2017-03-291-3/+0
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Replace uses of Shared->Mutex with hash-table mutexesMatt Turner2016-05-201-1/+5
| | | | | | | | | | | | | | | We were locking the Shared->Mutex and then using calling functions like _mesa_HashInsert that do additional per-hash-table locking internally. Instead just lock each hash-table's mutex and use functions like _mesa_HashInsertLocked and the new _mesa_HashRemoveLocked. In order to do this, we need to remove the locking from _mesa_HashFindFreeKeyBlock since it will always be called with the per-hash-table lock taken. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: optionally associate a gl_program to ATI_fragment_shaderMiklós Máté2016-03-271-1/+12
| | | | | | | | | the state tracker will use it Acked-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Miklós Máté <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: improve debug log in atifragshaderMiklós Máté2015-12-171-0/+3
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: Don't leak ATIfs instructions in DeleteFragmentShaderMiklós Máté2015-12-171-1/+1
| | | | | Reviewed-by: Ian Romanick <[email protected]> Cc: "11.0 11.1" <[email protected]>
* mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke2015-07-201-15/+15
| | | | | | | Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main: replace __FUNCTION__ with __func__Marius Predut2015-04-141-2/+2
| | | | | | | | | | | Consistently just use C99's __func__ everywhere. The patch was verified with Microsoft Visual studio 2013 redistributable package(RTM version number: 18.0.21005.1) Next MSVC versions intends to support __func__. No functional changes. Acked-by: Matt Turner <[email protected]> Signed-off-by: Marius Predut <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-231-1/+1
| | | | Acked-by: Eric Anholt <[email protected]>
* Eliminate several cases of multiplication in arguments to callocCarl Worth2014-09-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | In commit 32f2fd1c5d6088692551c80352b7d6fa35b0cd09, several calls to _mesa_calloc(x) were replaced with calls to calloc(1, x). This is strictly equivalent to what the code was doing previously. But for cases where "x" involves multiplication, now that we are explicitly using the two-argument calloc, we can do one step better and replace: calloc(1, A * B); with: calloc(A, B); The advantage of the latter is that calloc will detect any overflow that would have resulted from the multiplication and will fail the allocation, (whereas the former would return a small allocation). So this fix can change potentially exploitable buffer overruns into segmentation faults. Reviewed-by: Matt Turner <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-171-1/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* dispatch: Delete unused init_dispatch functions.Paul Berry2012-11-061-20/+0
| | | | | | | | | | The new code-generated version of _mesa_create_exec_table() populates the entire dispatch table (except for dynamic functions) by itself; it no longer calls separate functions to initialize parts of the dispatch table. This patch removes those no-longer-needed functions. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: remove FEATURE_ATI_fragment_shader define.Oliver McFadden2012-09-151-4/+0
| | | | | Signed-off-by: Oliver McFadden <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Remove useless checks for NULL before freeingMatt Turner2012-09-051-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: minor whitespace fixesBrian Paul2011-03-241-2/+2
|
* mesa: Directly include mfeatures.h in files that perform feature tests.Vinson Lee2011-01-071-0/+1
|
* mesa: Assert _mesa_DeleteFragmentShaderATI doesn't ever free static DummyShader.Vinson Lee2010-12-231-0/+1
|
* Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg2010-10-131-2/+2
|
* mesa: move atifragshader.[ch] to main/Brian Paul2010-06-101-0/+794