Commit Graph

86 Commits

Author SHA1 Message Date
Marek Olšák 8f75a6f1af gallium/u_blitter: remove get_next_surface_layer callback
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Brian Paul <brianp@vmware.com>
2017-08-22 15:16:44 +02:00
Marek Olšák a893c91697 gallium/u_blitter: use 2D_ARRAY for cubemap blits if possible
so that we can use TXF.

The cubemap blit pixel shader code size: 148 -> 92 bytes

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-06-07 18:10:50 +02:00
Marek Olšák c24c3b94ed gallium: decrease the size of pipe_vertex_buffer - 24 -> 16 bytes 2017-05-10 19:00:16 +02:00
Brian Paul b0d3938430 gallium: s/uint/enum pipe_render_cond_flag/ for set_render_condition()
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2017-03-08 08:50:20 -07:00
Rob Clark 142dd7b9c0 gallium/u_blitter: split out a helper for common clear state
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 09:21:13 -04:00
Rob Clark 2b2f436c69 gallium/u_blitter: add helper to save FS const buffer state
Not (currently) state that is overwridden by u_blitter itself, but
drivers with custom blit/clear which are reusing part of the u_blitter
infrastructure will use it.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 09:21:13 -04:00
Rob Clark 433e12fea8 gallium/u_blitter: export some functions
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 09:21:13 -04:00
Marek Olšák 5fed1122e8 gallium/u_blitter: implement mipmap generation
for pipe_context::generate_mipmap

first move some of the blit code from util_blitter_blit_generic
to a separate function, then use it from util_blitter_generate_mipmap

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-06-21 13:52:05 +02:00
Brian Paul 63df017fda util/blitter: use ARRAY_SIZE macro
And remove local definition of Elements() macro.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-04-25 12:59:29 -06:00
Brian Paul c877f1aeef util/blitter: minor formatting fixes 2015-12-11 16:53:20 -07:00
Brian Paul 3c256f572b gallium/util: fix code formatting in u_blitter.h
Trivial.
2015-08-27 13:11:26 -06:00
Marek Olšák ab0643225e util/u_blitter: implement alpha blending for pipe->blit 2015-08-21 22:21:45 +02:00
Ilia Mirkin a2a1a5805f gallium: replace INLINE with inline
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 <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2015-07-21 17:52:16 -04:00
Marek Olšák 267ad27ab6 gallium/u_blitter: disable tessellation for all operations
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2015-05-16 14:51:22 +02:00
José Fonseca 8771285054 s/Tungsten Graphics/VMware/
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>
2014-01-17 20:00:32 +00:00
Marek Olšák f0ed082bab gallium/u_blitter: remove useless parameters from some functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-14 17:42:08 +01:00
Marek Olšák 6b919b1b2d gallium/util: implement layered framebuffer clear in u_blitter
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.
2013-12-03 19:39:13 +01:00
Roland Scheidegger 793e8e3d7e gallium: add condition parameter to render_condition
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 <jfonseca@vmware.com>
2013-06-18 18:01:24 +02:00
Marek Olšák d6d4a9a2e8 gallium/u_blitter: make clearing independent of the colorbuffer format
There isn't any difference between 32_FLOAT and 32_*INT in vertex fetching.
Both of them don't do any format conversion.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-13 03:54:13 +02:00
Marek Olšák 17350ea979 gallium/u_blitter: make clearing independent of the number of bound colorbuffers
We can use the fragment shader TGSI property WRITES_ALL_CBUFS.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-06-13 03:54:13 +02:00
Marek Olšák 1ba46bbb4c gallium/u_blitter: implement buffer clearing
Although this might be useful for ARB_clear_buffer_object,
I need it for initializating resources in r600g.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: comment cleanups

NOTE: This is a candidate for the 9.1 branch.
2013-04-23 20:26:20 +02:00
Marek Olšák afec42a648 gallium/u_blitter: implement 3D blitting
Scaling and flipping in the Z direction isn't allowed yet.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:49 +01:00
Marek Olšák ccfcf32873 gallium/u_blitter: unify some parameters into a dstbox parameter in blit_generic
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:43 +01:00
Marek Olšák 23f76f558e gallium/u_blitter: remove useless parameter from blitter_default_dst_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:40 +01:00
Marek Olšák 21b1ec69fc gallium/util: move util_try_blit_via_copy_region to u_surface.c
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák 9f06966a7b gallium/u_blitter: fix conflict with u_memory.h
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák e73bf3b805 gallium: add start_slot parameter to set_vertex_buffers
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>
2012-10-31 00:55:13 +01:00
Marek Olšák 96ed6c90ef r600g: implement texturing with 8x MSAA compressed surfaces for Evergreen
The 2x and 4x MSAA cases are completely broken. The lfdptr instruction returns
garbage there.

The 8x MSAA case is broken on Cayman, though at least the result looks somewhat
correct.

Only the 8x MSAA case works on Evergreen and is enabled.
2012-10-29 12:51:41 +01:00
Brian Paul a115a29153 util/blitter: silence assorted MSVC warnings
Fix signed/unsigned comparison warnings and float/int assignment warnings.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Marek Olšák 7997b3c97c r600g: implement MSAA resolving for 8-bit and 16-bit integer formats
by changing the format to NORM.
2012-10-12 15:23:27 +02:00
Marek Olšák cecfb452ab gallium/u_blitter: add helper for blitting via resource_copy_region
v2: fix off-by-one error in is_box_inside_resource, add comments

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák 0b0697e80d gallium/u_blitter: add gallium blit implementation
The original blit function is extended and the otAher functions reuse it.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák 84d2f2295e gallium/u_blitter: add ability to disable and restore the render condition
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák 59dfe0af60 gallium/u_blitter: facilitate co-existence with the Draw module
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák 64db3cc6ad r600g: implement MSAA for Cayman
Everything works except for blitting MSAA colorbuffers, which isn't
so trivial on Cayman. It's a rarely-used feature anyway.
2012-08-31 01:19:03 +02:00
Marek Olšák 187d7fb2fe r600g: implement draw_rectangle callback
The color resolve on r6xx needs PT_RECTLIST. Using conventional primitive
types (triangles and quads) produces an ugly line between two diagonally
opposite corners. I guess a rectangular point sprite would work too.
2012-08-30 19:43:55 +02:00
Marek Olšák a3d9d7ec79 r600g: implement compression for MSAA colorbuffers for evergreen
This adds the FMASK and CMASK buffers. They share the same resource
with color data.

COMPRESSION and FAST_CLEAR are always enabled if both FMASK and CMASK are
allocated. We initialize the CMASK to a "compressed" state (not "fast cleared"),
so that we can keep FAST_CLEAR enabled all the time.

Both FMASK and CMASK must be present at the moment. If either one is missing,
the other one is not used.

v2: add cayman regs in the list

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák e0cc61bd91 gallium/u_blitter: document custom meta helpers 2012-08-15 19:20:58 +02:00
Marek Olšák 0f86915c53 r600g: implement MSAA color resolve 2012-08-15 19:20:58 +02:00
Marek Olšák 94b634eca0 r600g: implement MSAA depth-stencil decompression and resolve
and integer textures, which are resolved the same as depth, I think.
2012-08-15 19:20:58 +02:00
Marek Olšák 825b45366d gallium/u_blitter: implement blitting multisample resources
It can blit only one sample at a time (it should be called in a loop).
2012-08-15 19:20:57 +02:00
Marek Olšák 84645fa613 gallium/u_blitter: add a query for checking whether copying is supported
v2: add comments
2012-08-04 14:05:37 +02:00
Marek Olšák c8ff737a18 gallium/u_blitter: remove fallback for stencil copy that all drivers skipped
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák ef1bf6d69e gallium/u_blitter: add ability to blit only depth or only stencil
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák 8aaf6972d1 gallium/u_blitter: minor cleanup
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák 6c420b1668 gallium/u_blitter: set sample mask to ~0
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák 12fd81f9e7 gallium/u_blitter: accelerate depth-stencil copying using shader stencil export
This fixes stencil buffer write transfers on r600g.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák dc4c821f08 Squash-merge branch 'gallium-clip-state'
Conflicts:
	src/gallium/auxiliary/tgsi/tgsi_strings.c
	src/mesa/state_tracker/st_atom_clip.c

commit d919791f2742e913173d6b335128e7d4c63c0840
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 17:59:22 2012 +0100

    d3d1x: adapt to new clip state

commit cfec82bca3fefcdefafca3f4555285ec1d1ae421
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 14:16:51 2012 +0100

    gallium/docs: update for clip state changes

commit c02bfeb81ad9f62041a2285ea6373bbbd602912a
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 14:21:43 2012 +0100

    tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS

commit d4e0a785a6a23ad2f6819fd72e236acb9750028d
Author: Brian Paul <brianp@vmware.com>
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 <airlied@redhat.com>

commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
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 <maraeo@gmail.com>
Date:   Fri Jan 6 02:39:09 2012 +0100

    nvfx: adapt to new clip state

commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Jan 6 01:41:39 2012 +0100

    st/mesa: fix DrawPixels with GL_DEPTH_CLAMP

commit c86ad730aa1c017788ae88a55f54071bf222be12
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Tue Jan 3 23:51:30 2012 +0100

    nv50: adapt to new clip state

commit 3a8ae6ac243bae5970729dc4057fe02d992543dc
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Tue Jan 3 23:32:36 2012 +0100

    nvc0: adapt to new clip state

commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11
Author: Marek Olšák <maraeo@gmail.com>
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 <maraeo@gmail.com>
Date:   Mon Dec 26 06:26:55 2011 +0100

    svga: adapt to new clip state

commit c5bfa8b37d6d489271df457229081d6bbb51b4b7
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 14:11:51 2011 +0100

    r600g: adapt to new clip state

commit f11890905362f62627c4a28a8255b76eb7de7df2
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 14:10:26 2011 +0100

    r300g: adapt to new clip state

commit e37465327c79a01112f15f6278d9accc5bf3103f
Author: Marek Olšák <maraeo@gmail.com>
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 <maraeo@gmail.com>
Date:   Sun Dec 25 13:14:59 2011 +0100

    u_blitter: don't save/set/restore clip state

commit 9dd240ea91f523a677af45e8d0adb9e661e28602
Author: Marek Olšák <maraeo@gmail.com>
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 <maraeo@gmail.com>
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 <maraeo@gmail.com>
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 <maraeo@gmail.com>
Date:   Sun Dec 25 10:43:43 2011 +0100

    st/mesa: adapt to new clip state

commit b7b656a42fca19d7c85267f42649a206a85a2c72
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Dec 17 15:45:19 2011 +0100

    gallium: move state enable bits from clip_state to rasterizer_state
2012-01-10 00:25:05 +01:00
Marek Olšák ce31970af1 u_blitter: expose functions for setting default views and surfaces for copying
And more importantly, don't call u_sampler_view_default_template etc.
it was a source of bugs.
2012-01-01 11:47:05 +01:00
Marek Olšák 36d66f8d4a u_blitter: implement copy_buffer using stream output 2011-12-15 18:51:48 +01:00