aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_blit.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium: pass cso_velems_state into cso_context instead of pipe_vertex_elementMarek Olšák2020-02-281-6/+7
| | | | | | | This removes one memcpy from the CSO hashing code. Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-141-1/+1
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-311-1/+1
| | | | | | Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* gallium+mesa: fix tgsi_semantic array typeEric Engestrom2019-07-241-2/+4
| | | | | | Fixes: ed23335a313dfc9cec26 ("gallium: use enums in p_shader_tokens.h (v2)") Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: split depth_clip into depth_clip_near & depth_clip_farMarek Olšák2018-09-061-1/+2
| | | | for AMD_depth_clamp_separate.
* gallium: add storage_sample_count parameter into is_format_supportedMarek Olšák2018-07-311-0/+1
| | | | Tested-by: Dieter Nützel <[email protected]>
* gallium: remove aux_vertex_buffer_slot codeMarek Olšák2018-05-121-3/+2
| | | | | | The slot index is always 0, and is pretty unlikely to change in the future. Reviewed-by: Brian Paul <[email protected]>
* gallium/util: trivial whitespace/formatting fixes in u_blit.cBrian Paul2018-02-081-9/+9
| | | | | Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: replace uint with tgsi enum typesBrian Paul2018-02-071-4/+5
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* u_blit: (trivial) fix bogus argument order for set_fragment_shaderRoland Scheidegger2018-02-071-2/+2
| | | | | Amazingly this still worked sometimes, albeit I'm not even sure why... This fixes d7bec6f7a6a2a35c80be939db8532011af1e9b67.
* u_blit,u_simple_shaders: add shader to convert from xrbias formatRoland Scheidegger2018-02-071-15/+25
| | | | | | | | | | | | | | | We need this to handle some oddball dx10 format (DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM). What you can do with this format is very limited, hence we don't want to add it as a gallium format (we could not express the properties of this format as ordinary format properties neither, so like all special formats it would need specific code for handling it in any case). While here, also nuke the array for different shaders for different writemasks, as it was not actually used (always full masks are passed in for generating shaders). Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium/aux/util/u_blit.c: Fix -Wunused-param warningsGert Wollny2017-11-171-1/+1
| | | | | | | | | Annotate the parameters accordingly. v2: move UNUSED decoration in front of parameter declaration Signed-off-by: Gert Wollny <[email protected]> v1: Reviewed-by: Brian Paul <[email protected]> (v1)
* gallium/util: add _LZ and TXF options to simple shadersMarek Olšák2017-06-071-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* util/blitter: add clamping during SINT <-> UINT blitsNicolai Hähnle2016-11-161-1/+3
| | | | | | | | | | | | Even though glBlitFramebuffer cannot be used for SINT <-> UINT blits, we still need to handle this type of blit here because it can happen as part of texture uploads / downloads, e.g. uploading a GL_RGBA8I texture from GL_UNSIGNED_INT data. Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* gallium: Fix region overlap conditions for rectangles with a shared edgeAnuj Phogat2016-06-101-4/+4
| | | | | | | | | | | | | | | | | | | | | >From OpenGL 4.0 spec, section 4.3.2 "Copying Pixels": "The pixels corresponding to these buffers are copied from the source rectangle bounded by the locations (srcX0, srcY 0) and (srcX1, srcY 1) to the destination rectangle bounded by the locations (dstX0, dstY 0) and (dstX1, dstY 1). The lower bounds of the rectangle are inclusive, while the upper bounds are exclusive." So, the rectangles sharing just an edge shouldn't overlap. ----------- | | ------- --- | | | | | | ------- --- Cc: "12.0" <[email protected]> Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/util: s/Elements/ARRAY_SIZE/Brian Paul2016-04-281-3/+3
| | | | 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]>
* gallium/util: use new cso_save/restore_state() functionsBrian Paul2016-02-161-34/+18
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* gallium/util: use cso_set_samplersMarek Olšák2015-07-231-2/+4
|
* cso: only allow saving and restoring fragment sampler statesMarek Olšák2015-07-221-2/+2
|
* cso: only allow saving and restoring fragment sampler viewsMarek Olšák2015-07-221-2/+2
| | | | Not needed for other shader stages.
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-2/+2
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* util/blitter (and friends): generate appropriate SVIEW declsRob Clark2015-06-211-8/+27
| | | | | | | | Some hardware needs to know the sampler type. Update the blit related shaders to include SVIEW decl. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jose Fonseca <[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]>
* 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/+1
| | | | Tested-by: Nick Sarnie <[email protected]>
* util: use linear formats in util_blit_pixels()Brian Paul2014-09-241-2/+2
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* util: simplify writemask parameters for util_blit_pixels()Brian Paul2014-09-241-9/+16
| | | | | | | Instead of separate color and Z/S writemasks, just have one writemask parameter that takes a mask of the PIPE_MASK_[RGBAZS] flags. Reviewed-by: Charmaine Lee <[email protected]>
* util: s/PIPE_TEX_MIPFILTER/PIPE_TEX_FILTER/ in u_blit codeBrian Paul2014-09-241-5/+5
| | | | | | | | | | PIPE_TEX_MIPFILTER_x is not legal for the pipe_sampler_state:: min/mag_img_filter fields. But PIPE_TEX_MIPFILTER_x == PIPE_TEX_FILTER_x so we were getting lucky. This also makes the code consistent with u_blitter.c. Reviewed-by: Charmaine Lee <[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]>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* u_gen_mipmap: Use untampered cubemap texture coords when generating mipmaps.José Fonseca2013-11-201-1/+2
| | | | | | | | | | | | | | | | | | | It's not necessary to scale down cubemap texture coords when generating mipmaps: we are doing a 2x minification therefore it's guaranteed that the texture coords will always be at least 1 texel away of the edges. Scaling down can actually be harmful, as it may cause artefacts when generating mipmaps with nearest filtering. Sample points will lie exactly in the middle each 2x2 texels, so the scaling factor was causing different texels to be take on each quadrant of the cube face. This is apparent with a 1x1 checkerboard pattern in the base mipmap level: instead of next mipmap level receiving a constant color throughout the face, it will have different colors for each quadrant of the face. The behaviour for blits is left untouched for now, but the cubemap texture coord scaling hack should be reconsidered eventually. Reviewed-by: Brian Paul <[email protected]>
* util/u_blit: Implement util_blit_pixels via pipe_context::blit.José Fonseca2013-09-181-410/+37
| | | | | | | | | This removes a lot of code, but not everything, as util_blit_pixels_tex is still useful when one needs to override pipe_sampler_view::swizzle_?. Reviewed-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* util/u_blit: Support blits from cubemaps.José Fonseca2013-09-181-3/+31
| | | | | | | | | | | | By calling util_map_texcoords2d_onto_cubemap. A new parameter for util_blit_pixels_tex is necessary, as pipe_sampler_view::first_layer is always supposed to point to the first face when sampling from cubemaps. Reviewed-by: Zack Rusin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* util: add casts to silence MSVC warnings in u_blit.cBrian Paul2013-07-121-14/+14
|
* gallium: add condition parameter to render_conditionRoland Scheidegger2013-06-181-1/+1
| | | | | | | | | | | | | For conditional rendering this makes it possible to skip rendering if either the predicate is true or false, as supported by d3d10 (in fact previously it was sort of implied skip rendering if predicate is false for occlusion predicate, and true for so_overflow predicate). There's no cap bit for this as presumably all drivers could do it trivially (but this patch does not implement it for the drivers using true hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL functionality). Reviewed-by: Jose Fonseca <[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]>
* gallium: manage render condition in cso_context and fix postprocessing w/ itMarek Olšák2012-12-121-0/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium: add start_slot parameter to set_vertex_buffersMarek Olšák2012-10-311-8/+11
| | | | | | | | | | | | | | | | | | | | | 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]>
* gallium/u_blitter: implement blitting multisample resourcesMarek Olšák2012-08-151-4/+4
| | | | It can blit only one sample at a time (it should be called in a loop).
* gallium/u_blit: set dst format from pipe_resource, not pipe_surfaceMarek Olšák2012-08-151-1/+1
| | | | | | We use it to decide whether we can use resource_copy_region. NOTE: This is a candidate for the 8.0 branch.
* gallium/u_blit: bail out if src is a multisample textureMarek Olšák2012-08-041-0/+6
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/u_blit: check nr_samples before using resource_copy_regionMarek Olšák2012-08-041-1/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium: set sample mask to ~0 for clear, blit and gen_mipmapMarek Olšák2012-08-041-0/+6
| | | | | | | The sample mask affects single-sampled rendering too (it's orthogonal to the color mask). Reviewed-by: Brian Paul <[email protected]>
* gallium: consolidate CSO sampler and sampler_view functionsBrian Paul2012-08-031-19/+19
| | | | | | | | | | | | | Merge the vertex/fragment versions of the cso_set/save/restore_samplers() functions. Now we pass the shader stage (PIPE_SHADER_x) to the function to indicate vertex/fragment/geometry samplers. For example: cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler); This results in quite a bit of code reduction, fewer CSO functions and support for geometry shaders. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: implement accelerated stencil blitting using shader stencil exportMarek Olšák2012-07-121-35/+171
| | | | Reviewed-by: Alex Deucher <[email protected]>
* st/mesa: set colormask to zero when blitting depthMarek Olšák2012-07-121-4/+8
| | | | Reviewed-by: Alex Deucher <[email protected]>
* gallium/u_blit: remove useless memset callsMarek Olšák2012-07-121-6/+0
| | | | | | the structure is calloc'd. Reviewed-by: Alex Deucher <[email protected]>
* gallium/u_blit: drop not-very-useful wrapper around util_blit_pixels_writemaskMarek Olšák2012-07-121-36/+11
| | | | | | just rename it to util_blit_pixels Reviewed-by: Alex Deucher <[email protected]>