summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_clear.c
Commit message (Collapse)AuthorAgeFilesLines
* state_tracker: Fix check for scissor enabled when < 0.Eric Anholt2016-10-161-2/+2
| | | | | | | | | | | | | DEQP's clear tests like to give us x + w < 0 or y + h < 0. Since we were comparing to an unsigned, it would get promoted to unsigned and come out as bignum >= width or height and we would clear the whole fb instead of none of the fb. Fixes 10 tests under deqp-gles2/functional/color_clear. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* st/mesa: fix is_scissor_enabled when X/Y are negativeIlia Mirkin2016-09-121-4/+6
| | | | | | | | | | | | | | Similar to commit 49c24d8a24 ("i965: fix noop_scissor range issue on width/height") - take the X/Y into account to determine whether the scissor covers the whole area or not. Fixes the recently-added gl-1.0-scissor-depth-clear-negative-xy piglit test. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Cc: <mesa-stable@lists.freedesktop.org>
* st/mesa: invalidate readpixels cacheNicolai Hähnle2016-06-211-0/+1
| | | | | | | Whenever a draw happens or some other function call might change the result of future glReadPixels calls, we must invalidate the cache. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* st/mesa: add support for GL_EXT_window_rectanglesIlia Mirkin2016-06-181-1/+16
| | | | | | | | Make sure to pass the requisite information in draws, blits, and clears that work on the context's draw buffer. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* gallium: pause queries for all meta opsMarek Olšák2016-04-121-0/+1
| | | | | Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* st/mesa: use new CSO_BITS_ALL_SHADERSBrian Paul2016-02-161-6/+2
| | | | Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* st/mesa: simplify st->ctx, ctx->st usage in a various placesBrian Paul2016-02-161-1/+1
|
* st/mesa: use new cso_save/restore_state() functionsBrian Paul2016-02-161-30/+16
| | | | Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* st/mesa: use new cso_set_viewport_dims() helperBrian Paul2016-02-161-11/+2
| | | | Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* st/mesa: use 'cso' local var instead of st->cso_contextBrian Paul2016-02-161-41/+42
| | | | | | Just a little cleaner. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* st/mesa: consolidate quad drawing codeBrian Paul2016-02-161-77/+14
| | | | | | | The glClear, glBitmap and glDrawPixels code now use a new st_draw_quad() helper function. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* st/mesa: overhaul vertex setup for clearing, glDrawPixels, glBitmapBrian Paul2016-02-161-30/+39
| | | | | | | | | | | | Define a new st_util_vertex structure which is a bit smaller (9 floats versus the previous 12 floats per vertex). Clean up the glClear, glDrawPixels and glBitmap code that sets up the vertex data and does the drawing so it's all very similar. This can lead to more consolidation. v2: add assertion that vertex buffer slot == 0 to catch possible future change in cso_get_aux_vertex_buffer_slot() behavior. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* st/mesa: add a second pipeline for computeSamuel Pitoiset2016-02-131-1/+1
| | | | | | | | | | | | | Compute needs a new and different validation path. Changes from v2: - make use of unreachable() instead of assert() when the pipeline is invalid - move the st_pipeline enumeration to st_context.h instead of st_api.h Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* st/mesa: move bitmap cache flushing out of state validationBrian Paul2016-01-061-0/+3
| | | | | | Just do it where needed (before drawing, clearing, etc). Reviewed-by: José Fonseca <jfonseca@vmware.com>
* u_upload_mgr: pass alignment to u_upload_alloc manuallyMarek Olšák2016-01-021-1/+1
| | | | | | | | | | The fixed alignment of u_upload_mgr will go away. This is the first step. The motivation is that one u_upload_mgr can have multiple users, each allocating from the same buffer, but requiring a different alignment. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* u_upload_mgr: remove the return value from u_upload_allocMarek Olšák2015-09-031-3/+4
| | | | | | The return buffer or the returned pointer can be used instead. Reviewed-by: Brian Paul <brianp@vmware.com>
* gallium: disable tessellation shaders for meta opsMarek Olšák2015-05-161-0/+6
| | | | | Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Marek Olšák <marek.olsak@amd.com>
* state_tracker: replace __FUNCTION__ with __func__Marius Predut2015-04-141-1/+1
| | | | | | | | | | | 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 <mattst88@gmail.com> Signed-off-by: Marius Predut <marius.predut@intel.com>
* st/mesa: replace INLINE with inlineBrian Paul2015-02-261-7/+7
| | | | Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* st/mesa: add a fallback for clear_with_quad when no vs_layerIlia Mirkin2014-11-171-5/+20
| | | | | | | | | | | | | | | | | Not all drivers can set gl_Layer from VS. Add a fallback that passes the instance id from VS to GS, and then uses the GS to set the layer. Tested by adding quad_buffers |= clear_buffers; clear_buffers = 0; to the st_Clear logic, and forcing set_vertex_shader_layered in all cases. No piglit regressions (on piglits with 'clear' in the name). Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Cc: "10.4 10.3" <mesa-stable@lists.freedesktop.org>
* gallium: remove unused pipe_viewport_state::translate[3] and scale[3]Marek Olšák2014-11-161-2/+0
| | | | Almost all drivers ignore them.
* gallium/util: add a window_space option to the passthrough vertex shaderMarek Olšák2014-11-161-1/+2
| | | | Tested-by: Nick Sarnie <commendsarnex@gmail.com>
* st/mesa: adjust Z coordinates for quad clearingBrian Paul2014-08-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | Specify the quad's Z position in clip coordinate space, not normalized Z space. Use viewport scale, translation = 0.5, 0.5. Before, we were specifying the quad's Z position in [0,1] and using viewport scale=1.0, translate=0.0. That works fine, unless your driver needs to work in clip coordinate space and needs to reconstruct viewport near/far values from the scale/translation factors. The VMware svga driver falls into that category. When we did that reconstruction we wound up with near=-1 and far=1 which are outside the limits of [0,1]. In some cases, this caused the quad to be drawn at the wrong depth. In other cases it was clipped away. Fixes some scissored depth clears with VMware driver. This should have no effect on other drivers. We're already using these values for the glBitmap and glDraw/CopyPixels code. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
* gallium: rename PIPE_CAP_TGSI_VS_LAYER to also have _VIEWPORTIlia Mirkin2014-07-031-1/+1
| | | | | | | | | Now that this cap is used to determine the availability of both, adjust its name to reflect the new reality. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa/st: add support for ARB_sample_shadingIlia Mirkin2014-04-261-0/+3
| | | | | | Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
* gallium: allow setting of the internal stream output offsetZack Rusin2014-03-071-1/+1
| | | | | | | | | | | | | | | | D3D10 allows setting of the internal offset of a buffer, which is in general only incremented via actual stream output writes. By allowing setting of the internal offset draw_auto is capable of rendering from buffers which have not been actually streamed out to. Our interface didn't allow. This change functionally shouldn't make any difference to OpenGL where instead of an append_bitmask you just get a real array where -1 means append (like in D3D) and 0 means do not append. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* mesa: Update gl_scissor_attrib to support ARB_viewport_arrayCourtney Goeltzenleuchter2014-01-201-5/+5
| | | | | | | | | | | | | | | | | | Update Mesa and drivers to access updated gl_scissor_attrib. Now have an enable bitfield and array of gl_scissor_rects. Drivers have been updated to the new scissor enable state attribute (gl_context.scissor.EnableFlags) but still treat it as a single boolean which is okay as mesa will only use bit 0 when communicating with a driver that does not support ARB_viewport_array. v2 (idr): Rebase fixes. v3 (idr): Small code formatting fix suggsted by Ken. Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/alanh@tungstengraphics.com/alanh@vmware.com/ s/jens@tungstengraphics.com/jowen@vmware.com/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g s/keithw\?@tungstengraphics.com/keithw@vmware.com/g s/michel@tungstengraphics.com/daenzer@vmware.com/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/zack@tungstengraphics.com/zackr@vmware.com/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: use signed temporary variable to store _ColorDrawBufferIndexesEmil Velikov2014-01-151-1/+1
| | | | | | | | | | | The temporary variable used to store _ColorDrawBufferIndexes must be signed (GLint), otherwise the following conditional will be incorrectly evaluated. Leading to crashes in the driver/mesa or accessing/writing to arbitrary memory location. The bug dates back to 2009. Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* st/mesa: bind NULL colorbuffers as specified by glDrawBuffersMarek Olšák2014-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | An example why it is required: Let's say there's a fragment shader writing to gl_FragData[0..1]. The user calls: glDrawBuffers(2, {GL_NONE, GL_COLOR_ATTACHMENT0}); That means gl_FragData[0] is unused and gl_FragData[1] is written to GL_COLOR_ATTACHMENT0. st/mesa was skipping the GL_NONE draw buffer, therefore gl_FragData[0] was written to GL_COLOR_ATTACHMENT0, which was wrong. This commit fixes it, but drivers must also be fixed not to crash when binding NULL colorbuffers. There is also a new set of piglit tests for this. The MSAA state also had to be fixed not to crash when reading fb->cbufs[0]. Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: check depth and stencil writemask before clearingMarek Olšák2014-01-131-2/+15
|
* st/mesa: always prefer pipe->clear over clear_with_quad (v2)Marek Olšák2014-01-131-5/+14
| | | | v2: clear depth and stencil together
* st/mesa: set correct PIPE_CLEAR_COLORn flagsMarek Olšák2013-12-121-11/+26
| | | | This also fixes the clear_with_quad function for glClearBuffer.
* st/mesa: fix glClear with multiple colorbuffers and different formatsMarek Olšák2013-12-121-24/+9
| | | | Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
* st/mesa: implement layered framebuffer clear for the clear_with_quad fallbackMarek Olšák2013-12-031-16/+42
| | | | Same approach as in u_blitter.
* st/mesa: add casts to silence MSVC warningsBrian Paul2013-06-261-2/+2
|
* gallium/util: make WRITES_ALL_CBUFS optional in the passthrough fragment shaderMarek Olšák2013-06-131-1/+2
| | | | Reviewed-by: Brian Paul <brianp@vmware.com>
* gallium: Replace gl_rasterization_rules with lower_left_origin and ↵José Fonseca2013-04-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | half_pixel_center. Squashed commit of the following: commit 04c5fa2cbb8e89d6f2fa5a75af1cca03b1f6b852 Author: José Fonseca <jfonseca@vmware.com> Date: Tue Apr 23 17:37:18 2013 +0100 gallium: s/lower_left_origin/bottom_edge_rule/ commit 4dff4f64fa83b9737def136fffd161d55e4f1722 Author: José Fonseca <jfonseca@vmware.com> Date: Tue Apr 23 17:35:04 2013 +0100 gallium: Move diagram to docs. commit 442a63012c8c3c3797f45e03f2ca20ad5f399832 Author: James Benton <jbenton@vmware.com> Date: Fri May 11 17:50:55 2012 +0100 gallium: Replace gl_rasterization_rules with lower_left_origin and half_pixel_center. This change is necessary to achieve correct results when using OpenGL FBOs. Reviewed-by: Marek Olšák <maraeo@gmail.com>
* st/mesa: do proper error checking for u_upload_alloc() callsBrian Paul2013-01-251-3/+2
| | | | | | | | | We weren't properly checking the return value of these calls (and calls to u_upload_data()) to detect OOM errors. Note: This is a candidate for the 9.0 branch. Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* st/mesa: use a generic varying to pass the clear color to the FSMarek Olšák2013-01-151-2/+2
| | | | | | The color varying may have reduced precision or be even clamped. Reviewed-by: Brian Paul <brianp@vmware.com>
* gallium/util: fix glClear with MRT by making the FS write to all cbufsMarek Olšák2013-01-151-1/+3
| | | | Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: remove dead conditional in ClearMarek Olšák2013-01-151-12/+0
| | | | | | | | | I think the conditional always evaluates to false. If I understand the code in core Mesa correctly, depthBits or stencilBits is 0 if the depth or stencil renderbuffer is NULL, respectively. Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: simplify conditionals in ClearMarek Olšák2013-01-151-30/+12
| | | | | | just check depth and stencil separately, the outcome is the same Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: fix glClear with different colormask for each colorbufferMarek Olšák2013-01-151-18/+25
| | | | Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: always assume separate depth and stencil clear is supportedMarek Olšák2013-01-151-96/+22
| | | | | | All drivers implement it now. Reviewed-by: Brian Paul <brianp@vmware.com>
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-3/+5
| | | | | | | | | | | | | | | | | | | | | This allows updating only a subrange of buffer bindings. set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that range. Binding NULL resources unbinds buffers too (both buffer and user_buffer must be NULL). The meta ops are adapted to only save, change, and restore the single slot they use. The cso_context can save and restore only one vertex buffer slot. The clients can query which one it is using cso_get_aux_vertex_buffer_slot. It's currently set to 0. (the Draw module breaks if it's set to non-zero) It should decrease the CPU overhead when using a lot of meta ops, but the drivers must be able to treat each vertex buffer slot as a separate state (only r600g does so at the moment). I can imagine this also being useful for optimizing some OpenGL use cases. Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: fix integer texture border color for some formats (v2)Marek Olšák2012-10-151-5/+14
| | | | | | | | | | | | And the clear color too, though that may be an issue only with GL_RGB if it's actually RGBA in the driver. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <brianp@vmware.com> v2: The types of st_translate_color parameters were changed to gl_color_union and pipe_color_union as per Brian's comment.
* gallium: set sample mask to ~0 for clear, blit and gen_mipmapMarek Olšák2012-08-041-1/+3
| | | | | | | The sample mask affects single-sampled rendering too (it's orthogonal to the color mask). Reviewed-by: Brian Paul <brianp@vmware.com>
* st/mesa: write vertices directly into the buffer for glClear fallbackMarek Olšák2012-04-181-19/+21
|
* st/mesa: use u_upload_mgr to upload vertices for glClear fallbackMarek Olšák2012-04-181-60/+11
|