summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
Commit message (Collapse)AuthorAgeFilesLines
* mesa: s/GLint/gl_buffer_index/ for _ColorDrawBufferIndexesBrian Paul2017-11-092-6/+6
| | | | | | | Also fix local variable declarations and replace -1 with BUFFER_NONE. No Piglit changes. Reviewed-by: Charmaine Lee <[email protected]>
* mesa: Add X1B5G5R5 along with A1B5G5R5.Eric Anholt2017-10-101-0/+1
| | | | | | | | | | For supporting RGB5 in hardware with A in the low bit (vc4), we need this format as well. v2: Add proper _mesa_format_matches_format_and_type() support (from Nicolai). Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* mesa: replace VP/FP/ATIfs _Enabled flags with helper functionsMarek Olšák2017-06-223-11/+13
| | | | | | | | These are only used in the GL compatibility profile. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: replace _mesa_update_stencil() with helper functionsMarek Olšák2017-06-223-4/+7
| | | | | | | | | | | | | The idea is to remove the dependency on _mesa_update_state_locked, so that st/mesa can skip it for stencil state updates, and then stop setting _NEW_STENCIL in mesa/main if the driver is st/mesa. The main motivation is to stop invoking _mesa_update_state_locked for certain state groups. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: rename _mesa_add_renderbuffer* functionsTimothy Arceri2017-04-181-7/+7
| | | | | | | These names make it easier to understand what is going on in regards to references. Reviewed-by: Brian Paul <[email protected]>
* swrast: take ownership rather than adding reference for new renderbuffersTimothy Arceri2017-04-101-11/+6
| | | | | | | | | This avoids locking in the reference calls and fixes a leak after the RefCount initialisation was change from 0 to 1. Fixes: 32141e53d1520 (mesa: tidy up renderbuffer RefCount initialisation) Reviewed-by: Emil Velikov <[email protected]>
* mesa: fix renderbuffer leakTimothy Arceri2017-04-071-0/+5
| | | | | | | | | | | We don't need to call _mesa_reference_renderbuffer() for the first assignment as refCount starts at 1. For swrast we work around the fact we will indirectly call _mesa_reference_renderbuffer() by resetting refCount to 0. Fixes: 32141e53d1520 (mesa: tidy up renderbuffer RefCount initialisation) Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* st/mesa/r200/i915/i965: move ARB program fields into a unionTimothy Arceri2016-11-171-1/+1
| | | | | | | | | | | It's common for games to compile 2000 programs or more so at 32bits x 2000 programs x 22 fields x 2 (at least) stages This should give us something like 352 kilobytes in savings once we add some more glsl only fields. Reviewed-by: Emil Velikov <[email protected]>
* r200/glsl/st/mesa: use common outputs written fieldTimothy Arceri2016-10-263-5/+6
| | | | | | | | | And set outputs written directly in shader_info. st/mesa changes where: Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* r200/i915/st/mesa/compiler: use common inputs read fieldTimothy Arceri2016-10-262-2/+2
| | | | | | | | | | | | And set set inputs_read directly in shader_info. To avoid regressions between changes this change is a squashed version of the following patches. st/mesa changes where: Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa/r200/i915/i965: eliminate gl_fragment_programTimothy Arceri2016-10-263-22/+20
| | | | | | | | | | Here we move OriginUpperLeft and PixelCenterInteger into gl_program all other fields have been replace by shader_info. V2: Don't use anonymous union/structs to hold vertex/fragment fields suggested by Ian. Reviewed-by: Jason Ekstrand <[email protected]>
* i965/mesa/st/swrast: set fs shader_info directly and switch to using itTimothy Arceri2016-10-261-1/+1
| | | | | | | Note we access shader_info from the program struct rather than the nir_shader pointer because shader cache won't create a nir_shader. Reviewed-by: Jason Ekstrand <[email protected]>
* swrast: fix active attribs with atifragshaderMiklós Máté2016-08-111-1/+2
| | | | | | | | | | | Only include the ones that can be used by the shader. This fixes texture coordinates, which were completely wrong, because WPOS was included in the list of attribs. It also increases performance noticeably. Signed-off-by: Miklós Máté <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* util: Move format_r11g11b10f.h to src/utilJason Ekstrand2016-08-051-1/+1
| | | | | | | It's used from both mesa main and gallium. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* util: Move format_rgb9e5.h to src/utilJason Ekstrand2016-08-051-1/+1
| | | | | | | It's used from both mesa main and gallium. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* swrast: Avoid aliasing violation.Matt Turner2016-07-261-2/+2
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename CoordReplaceBits back to CoordReplace.Mathias Fröhlich2016-06-161-1/+1
| | | | | | | | It used to be called like that and fits better with 80 columns. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* swrast: Convert swrast to use CoordsReplaceBits.Mathias Fröhlich2016-06-161-2/+2
| | | | | | | | Switch over to use the CoordsReplaceBits bitmask. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* swrast: Add texfetch_funcs entries for astc 3d formatsAnuj Phogat2016-05-031-1/+22
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: replace gl_context->Multisample._Enabled with ↵Bas Nieuwenhuizen2016-03-241-2/+2
| | | | | | | | | | | | _mesa_is_multisample_enabled. This removes any dependency on driver validation of the number of framebuffer samples. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Brian Paul <[email protected]>
* swrast: fix discarded const warning in s_texture.cBrian Paul2016-03-221-1/+1
| | | | Signed-off-by: Brian Paul <[email protected]>
* swrast: Move assert for 'slice' in to check_map_teximageAnuj Phogat2016-03-211-1/+1
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* swrast: fix GL_ANY_SAMPLES_PASSED values in ResultIlia Mirkin2016-03-051-0/+5
| | | | | | | | | | | | | Since commit 922be4eab, the expectation is that the query result contains the correct value. Unfortunately swrast does not distinguish between GL_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED. As a result, we must fix up the query result in a post-draw fixup. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94274 Signed-off-by: Ilia Mirkin <[email protected]> Tested-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]> Cc: "11.2" <[email protected]>
* program: Remove condition-code and precision support.Matt Turner2016-03-011-6/+0
| | | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Brian Paul <[email protected]>
* swrast: move two global defines to the only place where they are usedMiklós Máté2015-12-171-0/+2
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa/formats: 8-bit channel integer formats additionDave Airlie2015-09-021-0/+4
| | | | | | | | | Add enough 8-bit channel formats to handle all the different things CTS throws at us. Cc: "11.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/formats: add some formats from GL3.3Dave Airlie2015-09-021-0/+12
| | | | | | | | | | | | | | | | GL3.3 added GL_ARB_texture_rgb10_a2ui, which specifies a lot more things than just rgb10/a2ui. While playing with ogl conform one of the tests must attempted all valid formats for GL3.3 and hits the unreachable here. This adds the first chunk of formats that hit the assert. Cc: "11.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: fix SwapBytes handling in numerous placesDave Airlie2015-09-021-7/+7
| | | | | | | | | | | | | | | | | | | In a number of places the SwapBytes handling didn't handle cases with GL_(UN)PACK_ALIGNMENT set and 7 byte width cases aligned to 8 bytes. This adds a common routine to swap bytes a 2D image and uses this code in: texture storage texture get readpixels swrast drawpixels. [airlied: updated with Brian's nitpicks]. Cc: "11.0" <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* swrast: add a new macro, FETCH_COMPRESSEDNanley Chery2015-08-261-198/+41
| | | | | | | | | This patch creates a new macro, FETCH_COMPRESSED - similar in nature to the other FETCH_* macros. This reduces repetition in the code that deals with compressed textures. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: define the 2D ASTC formatsNanley Chery2015-08-261-1/+31
| | | | | | | | | | | | | Define the mesa formats and make changes necessary for compilation without errors. Also add support for _mesa_get_srgb_format_linear(). v2. conform the ASTC MESA_FORMAT enums to the existing naming convention. v3. remove ASTC cases for _mesa_get_uncompressed_format(). This function is only used for generating mipmaps - something ASTC formats do not support due to lack of online compression. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* mesa/formats: remove compressed formats from matching functionNanley Chery2015-08-251-1/+1
| | | | | | | | | | | | | | | All compressed formats return GL_FALSE and there isn't any evidence to support that this behaviour would change. Remove all switch cases for compressed formats. v2. Since the exhaustive switch is removed, add a gtest to ensure all formats are handled. v3. Ensure that GL_NO_ERROR is set before returning. v4. Fix an arg to _mesa_uncompressed_format_to_type_and_comps(); fix formatting and misc improvements (Chad). Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* swrast: fix EXT_depth_bounds_testMarek Olšák2015-08-141-2/+12
| | | | | | | | | | | zMin and zMax can't use _DepthMaxF, because the test is done in Z32_UNORM. Probably a useless patch given how popular swrast is nowadays, but it helped create and validate the piglit test. v2: add an explicit cast to GLuint Reviewed-by: Brian Paul <[email protected]>
* swrast: Avoid double promotion.Matt Turner2015-07-2913-50/+50
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* swrast: remove unneeded & operators in _swrast_choose_texture_sample_func()Brian Paul2015-07-211-28/+28
| | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/swrast: Use global function _mesa_regions_overlap()Anuj Phogat2015-06-291-13/+3
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* main: Rename framebuffer renderbuffer software fallback.Laura Ekstrand2015-05-141-1/+1
| | | | | | | | | Rename _mesa_framebuffer_renderbuffer to _mesa_FramebufferRenderbuffer_sw in preparation for adding the ARB_direct_state_access backend function for FramebufferRenderbuffer and NamedFramebufferRenderbuffer to share. Reviewed-by: Fredrik Höglund <[email protected]> Signed-off-by: Fredrik Höglund <[email protected]>
* swrast: Fix rgba_draw_pixels with GL_COLOR_INDEXIago Toral Quiroga2015-05-041-3/+26
| | | | | | | | | | | | | | When we implemented the format conversion rewrite we forgot to handle GL_COLOR_INDEX here, which needs special handling. Fixes the following piglit test: bin/gl-1.0-drawpixels-color-index -auto -fbo Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90213 Tested-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* Fix a few typosZoë Blade2015-04-271-1/+1
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* swrast: replace __FUNCTION__ with __func__Marius Predut2015-04-143-4/+4
| | | | | | | | | | | 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]>
* swrast: Mark MAX_GLUINT literal with u suffix.Matt Turner2015-04-131-1/+1
| | | | | | | | Coverity is confused by the "float < int / 2" expression and suggests casting MAX_GLUINT to unsigned, which I believe it was supposed to have been already. Reviewed-by: Brian Paul <[email protected]>
* swrast: remove unneeded #include of colormac.hBrian Paul2015-04-0117-17/+3
| | | | | Acked-by: Matt Turner <[email protected]> Reviewed-by: Mark Janes <[email protected]>
* swrast: Use BITFIELD64_BIT for arrayAttribs.Jose Fonseca2015-03-181-1/+1
| | | | | | | | | As VARYING_SLOT_MAX can be bigger than 32. I'll probably stop building swrast with MSVC in the near future, but this seems a real bug regardless. Reviewed-by: Brian Paul <[email protected]>
* mesa: remove _ASMAPI, ASMAPIPBrian Paul2015-03-121-1/+1
| | | | Reviewed-by: Ian Romanick <[email protected]>
* swrast: remove _BLENDAPIBrian Paul2015-03-122-16/+13
| | | | | | | _BLENDAPI boils down to __cdecl on Windows, but __cdecl is the default calling convention so this serves no purpose. Reviewed-by: Ian Romanick <[email protected]>
* mesa/swrast: replace Elements() with ARRAY_SIZE()Brian Paul2015-03-022-2/+2
| | | | Acked-by: Ilia Mirkin <[email protected]>
* mesa: remove MAX_GLUSHORT, move MAX_GLUINTBrian Paul2015-02-241-0/+5
| | | | | | The later is only used in one place in swrast. Reviewed-by: Matt Turner <[email protected]>
* mesa: remove logf macroBrian Paul2015-02-241-0/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: replace FABSF with fabsfBrian Paul2015-02-243-13/+15
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: replace LOGF, EXPF with logf, expfBrian Paul2015-02-242-5/+6
| | | | Reviewed-by: Matt Turner <[email protected]>
* swrast: fix a few release build warningsBrian Paul2015-02-242-0/+2
|