summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_state.c
AgeCommit message (Collapse)Author
2010-08-30r600g: precompute some of the hw stateJerome Glisse
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 Airlie
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 Airlie
passes glsl1-discard tests
2010-08-27Revert "r600g: simplify states"Dave Airlie
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 Glisse
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 Verbeet
2010-08-23r600g: export one component per pixel + r7xx uncompression shaderJerome Glisse
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 Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-22r600g: depth buffer likely needs decompression when used as textureJerome Glisse
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 Glisse
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 Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20r600g: add occlusion query supportDave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-20gallium: make all checks for PIPE_TEXTURE_2D check for PIPE_TEXTURE_RECT tooLuca Barbieri
Searched for them with: git grep -E '[!=]=.*PIPE_TEXTURE_2D|PIPE_TEXTURE_2D.*[!=]=|case.*PIPE_TEXTURE_2D' Behavior hasn't been changed.
2010-08-18r600g: fix point sizeDave Airlie
fixes piglit pointAtten and point-sprite tests
2010-08-18r600g: fixup pitch alignment like r600c.Dave Airlie
This still needs work, passes tex3d, fbo-scissor-bitmap, scissor-bitmap
2010-08-18r600g: emit texture level offset in CB/DB setup.Dave Airlie
8 more piglit tests pass, fbo-clearmipmap, fbo-copyteximage, fbo-generatemipmap, fbo-generatemipmap-nonsquare, fbo-generatemipmap-scissor, fbo-generatemipmap-viewport, gen-teximage, gen-texsubimage
2010-08-17r600g: add user clip plane support.Dave Airlie
Apart from the fact that the radeon.h/r600_states.h editing is a nightmare, this wasn't so bad. passes piglit user-clip test now also trivial tests. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-13r600g: fix memory leaks running gears.Dave Airlie
I noticed gears memory usage was heading skywards, some r600 "states" aren't properly refcounted, and the ctx->state is never freed.
2010-08-12r600g: fix provoking-vertex piglit test.Dave Airlie
2010-08-12r600g: improve texture format checker.Dave Airlie
This takes the r300g texture format checker and fixes it up for r600g, it passes glean texSwizzle, pixelformats, and texture_srgb tests, however I think it L8S8_SRGB is broken as is L8_SRGB, need to investigate. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-11r600g: accept empty frag prog shaderJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-11r600g: add point/sprite rendering supportJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-09r600g: fix r600 context structure, avoid segfault when no scissorJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06r600g: fix rendering, only enable target we write tooJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06r600g: really fix multi target supportJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06r600g: finish multi target rendering supportJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06r600g: fix color format, indentation, definesJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06Revert "r600g: don't use dynamic state allocation for states"Jerome Glisse
This reverts commit 9c949d4a4dd43b7889e13bdf683bcf211f049ced. Conflicts: src/gallium/drivers/r600/r600_context.h src/gallium/drivers/r600/r600_draw.c src/gallium/drivers/r600/r600_shader.c src/gallium/drivers/r600/r600_state.c
2010-08-06r600g: start to fix up multiple targets.Dave Airlie
fixup exports from pixel shader for multi-cbs + depth buffer writing. Still crashes GPU running any of the multi-buffer or depth writing
2010-08-06r600g: add SRGB support.Dave Airlie
This enables GL2.1 and passes glean's texture_srgb test.
2010-08-06r600g: fixup z format translations.Dave Airlie
this enables GL_EXT_packed_depth_stencil. fbo-d24s8 passes
2010-08-06r600g: fix targetmask to work correctly.Dave Airlie
At least this seems to fix the glean maskedClear test.
2010-08-06r600g: improve supported format selection.Dave Airlie
This fixes fbo-readpixels piglit test, and adds support for swapping the formats. Not all formats are correct yet I don't think. Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-08-05r600g: don't use dynamic state allocation for statesJerome Glisse
Simplify state handly by avoiding state allocation. Next step is to allocate once for all context packet buffer and then avoid rebuilding pm4 packet each time (through use of combined crc) this would also avoid number of memcpy. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04r600g: always perform texture perspective divide + fix blendingJerome Glisse
quake3 engine seems to run fine at this point (ioquake) Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03r600g: add polygon offset supportJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03r600g: fix color target maskJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03r600g: fix stencilJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02r600g: add autogenerated reg definition + debug print cleanupJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02r600g: add stencil op/func translationDave Airlie
2010-08-02r600g: initial alpha test stateDave Airlie
2010-08-02r600g: add initial blend state.Dave Airlie
migrates cb_cntl to be regenerated
2010-08-02r600g: make r600_db_format static.Dave Airlie
this isn't used anywhere else yet.
2010-07-29r600g: mipmap early support + EX2/ABS instruction + cullingJerome Glisse
Add mipmap support (demos/src/redbook/mipmap is working) Add EX2/ABS shader instruction support. Add face culling support. Misc fixes. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-29gallium: Implement draw_vbo and set_index_buffer for all drivers.Chia-I Wu
Some drivers define a generic function that is called by all drawing functions. To implement draw_vbo for such drivers, either draw_vbo calls the generic function or the prototype of the generic function is changed to match draw_vbo. Other drivers have no such generic function. draw_vbo is implemented by calling either draw_arrays and draw_elements. For most drivers, set_index_buffer does not mark the state dirty for tracking. Instead, the index buffer state is emitted whenever draw_vbo is called, just like the case with draw_elements. It surely can be improved.
2010-07-28r600g: state context ptr in sampler_view & add I8/L8 buffer formatJerome Glisse
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28r600g: switch btw flat/linear interpolationJerome Glisse
I am not sure how to properly handle flat shading regarding non color parameter to fragment shader. It seems we should still interpolate non color using linear interpolation and flat shade only apply to color. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28r600g: split pipe state creating/binding from hw state creationJerome Glisse
Split hw vs pipe states creation handling as hw states group doesn't match pipe state group exactly. Right now be dumb about that and rebuild all hw states on each draw call. More optimization on that side coming. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28r600g: cleanup resource buffer/texture messJerome Glisse
Use a common function, fix the mess it was before. Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28r600g: fix up segfault with variation between views and count.Dave Airlie
For some reason gallium hands us something with lots of empty views, and we are expected to deal with it, just do what r300g does for this bit.