aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_framebuffer.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium: Add new PIPE_CAP_SURFACE_SAMPLE_COUNTKristian H. Kristensen2018-12-061-2/+8
| | | | | | | | | | | This new pipe cap and the new nr_samples field in pipe_surface lets a state tracker bind a render target with a different sample count than the resource. This allows for implementing EXT_multisampled_render_to_texture and EXT_multisampled_render_to_texture2. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Kristian H. Kristensen <[email protected]>
* gallium: add support for programmable sample locationsRhys Perry2018-06-141-0/+30
| | | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Brian Paul <[email protected]> (v2) Reviewed-by: Marek Olšák <[email protected]> (v2)
* gallium/util: make util_copy_framebuffer_state(src=NULL) workRob Clark2016-07-061-11/+26
| | | | | | | | Be more consistent with the other u_inlines util_copy_xyz_state() helpers and support NULL src. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium,utils: Fix trivial sign compare warningsJan Vesely2016-05-031-1/+1
| | | | | | | Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Jakob Sinclair <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium/util: s/Elements/ARRAY_SIZE/Brian Paul2016-04-281-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium: Put no.of {samples,layers} into pipe_framebuffer_stateEdward O'Callaghan2016-04-071-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we store the number of samples and layers directly in the pipe_framebuffer_state so that in the case of ARB_framebuffer_no_attachment we may make use of them directly. Further, we adjust various gallium/auxiliary helper functions accordingly. V2: Convert branches in util_framebuffer_get_num_layers() and util_framebuffer_get_num_samples() to their canonical form. V3: 'git stash pop' the typo fix of 'cbufs' which should be 'nr_cbufs' that was missing in V2, woops! Thanks Marek for pointing this out yet again. V4: Squash in the following patch: 'gallium/util: Ensure util_framebuffer_get_num_samples() is valid' Upon context creation, internal driver structures are malloc()'ed and memset() to zero them. This results in a invalid number of samples 'by default'. Handle this in the simplest way to avoid elaborate and probably equally sub-optimial solutions. Signed-off-by: Edward O'Callaghan <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium/util: fix up inaccurate behavior of util_framebuffer_state_equal (v2)Marek Olšák2016-03-281-5/+5
| | | | | | v2: move the nr_cbufs check above the loop Reviewed-by: Ilia Mirkin <[email protected]> (v1)
* gallium/util: easy fixes for NULL colorbuffersMarek Olšák2014-01-131-0/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: bind NULL colorbuffers as specified by glDrawBuffersMarek Olšák2014-01-131-0/+21
| | | | | | | | | | | | | | | | | | | | 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]>
* gallium/util: implement layered framebuffer clear in u_blitterMarek Olšák2013-12-031-0/+24
| | | | | | | | | | | | | All bound layers (from first_layer to last_layer) should be cleared. This uses a vertex shader which outputs gl_Layer = gl_InstanceID, so each instance goes to a different layer. By rendering a quad and setting the instance count to the number of layers, it will trivially clear all layers. This requires AMD_vertex_shader_layer (or PIPE_CAP_TGSI_VS_LAYER), which only radeonsi supports at the moment. r600 could do this too. Standard DX11 hardware will have to use a geometry shader though, which has higher overhead.
* util: set all unused cbufs to NULL in util_copy_framebuffer_state()Brian Paul2013-11-111-1/+2
| | | | | | This helps fix an issue in the svga driver, and is just safer all-around. Reviewed-by: José Fonseca <[email protected]>
* auxiliary: fix util_framebuffer_copyLuca Barbieri2010-08-111-2/+4
| | | | | | | | | util_framebuffer_copy was attempting to copy all elements of the source framebuffer state. However, this breaks if the user does not zero initialize the structure. Instead, only copy the elements up to nr_cbufs, and clear elements up to dst->nr_cbufs, if the destination was larger than the source.
* util: add util_framebuffer_min_sizeKeith Whitwell2010-06-071-0/+35
|
* gallium: move framebuffer utility functions into a new fileBrian Paul2010-05-031-0/+111