aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_cb_clear.c
Commit message (Collapse)AuthorAgeFilesLines
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: pause queries for all meta opsMarek Olšák2016-04-121-0/+1
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use new CSO_BITS_ALL_SHADERSBrian Paul2016-02-161-6/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* 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 <[email protected]>
* st/mesa: use new cso_set_viewport_dims() helperBrian Paul2016-02-161-11/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: use 'cso' local var instead of st->cso_contextBrian Paul2016-02-161-41/+42
| | | | | | Just a little cleaner. Reviewed-by: Jose Fonseca <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* gallium: disable tessellation shaders for meta opsMarek Olšák2015-05-161-0/+6
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* 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 <[email protected]> Signed-off-by: Marius Predut <[email protected]>
* st/mesa: replace INLINE with inlineBrian Paul2015-02-261-7/+7
| | | | Reviewed-by: Alex Deucher <[email protected]>
* 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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: "10.4 10.3" <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: add support for ARB_sample_shadingIlia Mirkin2014-04-261-0/+3
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* 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 <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* 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 <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* 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/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Date: Tue Apr 23 17:37:18 2013 +0100 gallium: s/lower_left_origin/bottom_edge_rule/ commit 4dff4f64fa83b9737def136fffd161d55e4f1722 Author: José Fonseca <[email protected]> Date: Tue Apr 23 17:35:04 2013 +0100 gallium: Move diagram to docs. commit 442a63012c8c3c3797f45e03f2ca20ad5f399832 Author: James Benton <[email protected]> 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* gallium/util: fix glClear with MRT by making the FS write to all cbufsMarek Olšák2013-01-151-1/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* st/mesa: fix glClear with different colormask for each colorbufferMarek Olšák2013-01-151-18/+25
| | | | Reviewed-by: Brian Paul <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> 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 <[email protected]>
* 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
|
* st/mesa: improve assertion/check for stencil formatBrian Paul2012-02-151-8/+2
|
* Squash-merge branch 'gallium-clip-state'Marek Olšák2012-01-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gallium/auxiliary/tgsi/tgsi_strings.c src/mesa/state_tracker/st_atom_clip.c commit d919791f2742e913173d6b335128e7d4c63c0840 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 17:59:22 2012 +0100 d3d1x: adapt to new clip state commit cfec82bca3fefcdefafca3f4555285ec1d1ae421 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:16:51 2012 +0100 gallium/docs: update for clip state changes commit c02bfeb81ad9f62041a2285ea6373bbbd602912a Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:21:43 2012 +0100 tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS commit d4e0a785a6a23ad2f6819fd72e236acb9750028d Author: Brian Paul <[email protected]> Date: Thu Jan 5 08:30:00 2012 -0700 tgsi: consolidate TGSI string arrays in new tgsi_strings.h There was some duplication between the tgsi_dump.c and tgsi_text.c files. Also use some static assertions to help catch errors when adding new TGSI values. v2: put strings in tgsi_strings.c file instead of the .h file. Reviewed-by: Dave Airlie <[email protected]> commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 12:48:09 2012 +0100 gallium: extend user_clip_plane_enable to apply to clip distances commit f1d5016c07f786229ed057effbe55fbfd160b019 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 02:39:09 2012 +0100 nvfx: adapt to new clip state commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 01:41:39 2012 +0100 st/mesa: fix DrawPixels with GL_DEPTH_CLAMP commit c86ad730aa1c017788ae88a55f54071bf222be12 Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:51:30 2012 +0100 nv50: adapt to new clip state commit 3a8ae6ac243bae5970729dc4057fe02d992543dc Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:32:36 2012 +0100 nvc0: adapt to new clip state commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11 Author: Marek Olšák <[email protected]> Date: Thu Dec 29 01:32:51 2011 +0100 draw: initalize pt.user.planes in draw_init This fixes a crash in glean/fpexceptions. commit e3056524b19b56d473f4faff84ffa0eb41497408 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:26:55 2011 +0100 svga: adapt to new clip state commit c5bfa8b37d6d489271df457229081d6bbb51b4b7 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:11:51 2011 +0100 r600g: adapt to new clip state commit f11890905362f62627c4a28a8255b76eb7de7df2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:10:26 2011 +0100 r300g: adapt to new clip state commit e37465327c79a01112f15f6278d9accc5bf3103f Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:39:16 2011 +0100 draw: adapt to new clip state This adds a regression in the LLVM clipping path. Can anybody see anything wrong with the code? It works for every other case, just glean/fpexceptions crashes when doing the "Infinite clip plane test". commit b474d2b18c72d965eefae4e427c269cba5ce6ba2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:14:59 2011 +0100 u_blitter: don't save/set/restore clip state commit 9dd240ea91f523a677af45e8d0adb9e661e28602 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:11:56 2011 +0100 gallium: don't cso_save/set/restore clip state The enable bits are in the rasterizer state. commit a4f7031179f5f4ad524b34b394214b984ac950f6 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:58:55 2011 +0100 gallium: default depth_clip to 1 depth_clip = !depth_clamp commit fe21147a00ab90e549d63fe12ee4625c9c2ffcc3 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:14:19 2011 +0100 trace,util: update state logging to new clip state Also dump the other missing flags. commit 2a3b96e84ac872dcc5bc1de049fe76bb58d64b23 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 10:43:43 2011 +0100 st/mesa: adapt to new clip state commit b7b656a42fca19d7c85267f42649a206a85a2c72 Author: Marek Olšák <[email protected]> Date: Sat Dec 17 15:45:19 2011 +0100 gallium: move state enable bits from clip_state to rasterizer_state