summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_state.c
AgeCommit message (Collapse)AuthorFilesLines
2010-09-30r600g: clean up some code from move to new paths.Dave Airlie1-6/+6
mainly remove 2 suffix from function names
2010-09-29r600g: more cleanupJerome Glisse1-144/+2
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29r600g: cleanupJerome Glisse1-0/+1673
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29r600g: delete old pathJerome Glisse1-721/+0
Lot of clean can now happen. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-29Revert "r600g: add initial vertex translate support."Dave Airlie1-40/+1
This reverts commit 914b669b082258fc05d0fec047b69949d88585c4. I didn't mean to commit this yet, will redo in new state system once we clean it up.
2010-09-29r600g: add initial vertex translate support.Dave Airlie1-1/+40
2010-09-28r600g: fix db flush breaking config stateDave Airlie1-9/+9
2010-09-26r600g: move around variables to share depth uncompression codeJerome Glisse1-1/+2
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20r600g: move chip class to radeon common structureJerome Glisse1-1/+1
So texture code can be shared btw new state design & old one. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-20r600g: clean up valgrind issues on maxtargets test.Dave Airlie1-1/+7
2010-09-20r600g: fix fbo-drawbuffers-maxtargetsDave Airlie1-7/+22
we were leaking buffers since the flush code was added, it wasn't dropping references. move setting up flush to the set_framebuffer_state. clean up the flush state object. make more space in the BOs array for flushing.
2010-09-17r600g: add upload manager support.Dave Airlie1-0/+4
this add support for the upload manager for uploading user vbo/index buffers. this provides a considerable speedup in q3 type games.
2010-09-17r600g: attempt to abstract kernel bos from pipe driver.Dave Airlie1-2/+2
introduce an abstraction layer between kernel bos and the winsys BOs. this is to allow plugging in pb manager with minimal disruption to pipe driver.
2010-09-14r600g: Remove unnecessary headers.Vinson Lee1-2/+0
2010-09-10r600g: fix warning in r600 pipe driverDave Airlie1-1/+0
2010-09-10r600g: add initial evergreen supportDave Airlie1-4/+10
adds shader opcodes + assembler support (except ARL) uses constant buffers add interp instructions in fragment shader adds all evergreen hw states adds evergreen pm4 support. this runs gears for me on my evergreen
2010-09-10r600g: align flushing of cb/db with DDX/r600c.Dave Airlie1-0/+55
the DDX and r600c both flush cb/db after the draw is emitted, as long as they do that, r600g can't be different, as it races. We end up with r600g flush, set CB, DDX set CB, flush. This was causing misrendering on my evergreen, where sometimes the drawing would go to an old CB.
2010-09-08r600g: add support for constants in memory buffers.Dave Airlie1-47/+4
DX9 constants were in the constant file, and evergreen no longer support cfile. r600/700 can also use constants in memory buffers, so add the code (disabled for now) to enable that as precursor for evergreen.
2010-09-08r600g: abstract the hw states out behind a vtbl.Dave Airlie1-623/+13
this is step one towards evergreen support, it lets us plug in whole new hw level states.
2010-09-06r600g: fix up surface referencesDave Airlie1-4/+2
We end up referencing the new surf and derefing the old surface which is a copy of the pointer to the new surf. So just bump the ref count directly.
2010-09-06r600g: search for sampler views in context on removal.Dave Airlie1-0/+17
Need to remove from context as well.
2010-09-03r600g: fix segfault in state after reworkDave Airlie1-2/+2
probably can improve this a bit.
2010-09-03r600g: refactor sample states into a reusable struct.Dave Airlie1-87/+65
I will not cut-n-paste. I will not cut-n-paste. I will not cut-n-paste.
2010-09-03r600g: add texture border state.Dave Airlie1-2/+40
Okay I finally wrapped my head around what r600_context_state is meant to be, maybe I should just rename all the structs so that have distinct names. I've no idea however why 16 is a good magic number for R600_MAX_RSTATE.
2010-09-03r600g: deref old driver states for set entry points.Dave Airlie1-0/+10
2010-09-03r600g: drop r600_bind_state.Dave Airlie1-75/+34
This was another ugly function that really wasn't needed. The 3 calls to it from the gallium api were shorter than it, and all the calls from the set_ functions were pointless.
2010-09-03r600g: kill r600_context_state functionDave Airlie1-95/+63
having some sort of locality of code really matters, just create and setup state at time. Not sure if this is just further polishing of a bad thing, but at least it makes it more readable.
2010-09-03r600g: move lots of state inline helpers to separate header.Dave Airlie1-115/+0
this gets them out of sight of the main codeflow.
2010-09-03r600g: drop magic numbers in depth state.Dave Airlie1-3/+26
this also fixes occulsion queries.
2010-09-02r600g: force unbind of previously bind sampler/sampler_viewJerome Glisse1-83/+95
Previously bind sampler/sampler_view can be converted and endup overwritting the current state we want to schedule. Example : bind texA texB to sampler_view[0] & sampler_view[1], render, bind texB to sampler_view[0] render. Now state associated to texB are set to configure sampler_view slot 0, but as we don't unbind sampler_view[1] still point to texB state so we end up with sampler_view[1] overwritting sampler_view[0], which gives wrong rendering if next rendering bind texA to sampler_view[0], it will endup as texB is bound to sampler_view[0]. If you are not confuse at that point give me a call i will be buying you beer. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02r600g: fix logicop, the 3d ROP is the 2D rop shifted twice.Dave Airlie1-1/+1
2010-09-01r600g: fix binding of same texture to several target slotJerome Glisse1-18/+54
One can bind same texture or sampler to different slot, each slot needs it own state. The solution implemented here is not exactly beautifull or optimal need to think to somethings better. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-02r600g: fix incorrect state naming in pipe_sampler vs pipe_sampler_viewDave Airlie1-1/+1
fixes problems in valgrind with uninitialised values.
2010-09-01r600g: silence compiler warningJerome Glisse1-1/+1
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01r600g: refix db/cb stateJerome Glisse1-25/+110
Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01r600g: avoid dynamic allocation of statesJerome Glisse1-306/+80
Make state statically allocated, this kills a bunch of code and avoid intensive use of malloc/free. There is still a lot of useless duplicate function wrapping that can be kill. This doesn't improve yet performance, needs to avoid memcpy states in radeon_ctx_set_draw and to avoid rebuilding vs_resources, dsa, scissor, cb_cntl, ... states at each draw command. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-09-01Revert "Revert "r600g: precompute some of the hw state""Jerome Glisse1-55/+75
This reverts commit 1fa7245c348cb7aced81f1672140f64cb6450e2f. Conflicts: src/gallium/drivers/r600/r600_state.c
2010-09-01r600g: correct cb/zb offset emits.Dave Airlie1-2/+2
This fixes fbo-3d and fbo-cubemap
2010-09-01Revert "r600g: precompute some of the hw state"Dave Airlie1-75/+151
This reverts commit de0b76cab22caa9fc7260f80acb8f151ccced6c5, its pre-computes the texture state wrong, you can't just use an array of levels, since you can have FBOs to depth texture slices inside a level as well it would get really messy quickly. Probably need to split commits like this up into pieces for each piece of state, so we can revert bits easier in case of regressions. This also break 5 piglit tests, and valgrind starts to warn about invalid read/writes after this.
2010-08-30r600g: precompute some of the hw stateJerome Glisse1-151/+75
Idea is to build hw state at pipe state creation and reuse them while keeping a non PM4 packet interface btw winsys & pipe driver. This commit also force rebuild of pm4 packet on each call to radeon_state_pm4 which in turn slow down everythings, this will be addressed. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-30r600g: fixup states generation in winsys.Dave Airlie1-19/+19
The current states code had an unhealthy relationship between that had to somehow magically align themselves, editing either place meant renumbering all states after the one you were on, and it was pretty unapproachable code. This replaces the huge types structures with a simple type + sub type struct, which is keyed on an stype enum in radeon.h. Each stype can have a per-shader type subclassing (4 types supported, PS/VS/GS/FS), and also has a number of states per-subtype. So you have 256 constants per 4 shaders per one CONSTANT stype. The interface from the driver is changed to pass in the tuple, (stype, id, shader_type), and we look for this. If radeon_state_shader ever shows up on profile, it could use a hashtable based on stype/shader_type to speed things up. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-30r600g: add KILP supportDave Airlie1-0/+2
passes glsl1-discard tests
2010-08-27Revert "r600g: simplify states"Dave Airlie1-41/+37
This reverts commit bd25e23bf3740f59ce8859848c715daeb9e9821f. Apart from introducing a lot of hex magic numbers and being highly impenetable code, it causes lots of lockups on an average piglit run that always runs without lockups. Always run piglit before/after doing big things like this.
2010-08-25r600g: simplify statesJerome Glisse1-37/+41
Directly build PM4 packet, avoid using malloc (no states are bigger than 128 dwords), remove unecessary informations, remove pm4 building in favor of prebuild pm4 packet. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-23r600g: Add support for PIPE_CAP_DEPTH_CLAMP.Henri Verbeet1-2/+3
2010-08-23r600g: export one component per pixel + r7xx uncompression shaderJerome Glisse1-1/+1
We need to always at least export one component (wether it's depth or color. Add valid r7xx shader program for depth decompression. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22r600g: fix DB decompressionJerome Glisse1-8/+2
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22r600g: depth buffer likely needs decompression when used as textureJerome Glisse1-9/+29
Before using depth buffer as texture, it needs to be decompressed (tile pattern of db are different from one used for colorbuffer like texture) Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-21r600g: partialy fix texturing from depth buffer + initial support for untilingJerome Glisse1-1/+6
Partialy fix texturing from depth buffer, depth buffer is tiled following different tile organisation that color buffer. This properly set the tile type & array mode field of texture sampler when sampling from db resource. Add initial support to untiling buffer when transfering them, it's kind of broken by corruption the vertex buffer of previous draw. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20r600g: cleanup definition, fix segfault when no valid pixel shaderJerome Glisse1-1/+5
Signed-off-by: Jerome Glisse <jglisse@redhat.com>