Commit Graph

831 Commits

Author SHA1 Message Date
Jerome Glisse d9f72b9f90 r600g: add PA_CL_CLIP_CNTL definition
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:27:36 -04:00
Jerome Glisse 32251c34f0 r600g: fix rendering, only enable target we write too
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:23:43 -04:00
Jerome Glisse b474478f20 r600g: really fix multi target support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 17:13:28 -04:00
Jerome Glisse c3ad060488 r600g: finish multi target rendering support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 16:12:22 -04:00
Jerome Glisse 27041d7cb3 r600g: fix color format, indentation, defines
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-06 11:28:33 -04:00
Jerome Glisse 6e6103004c Revert "r600g: don't use dynamic state allocation for states"
This reverts commit 9c949d4a4d.

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-06 10:59:27 -04:00
Dave Airlie 5f6ab5e259 r600g: start to fix up multiple targets.
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-06 16:05:24 +10:00
Dave Airlie 0a2a6c75bf r600g: add SRGB support.
This enables GL2.1 and passes glean's texture_srgb test.
2010-08-06 15:21:44 +10:00
Dave Airlie fc47cb9d71 r600g: fixup z format translations.
this enables GL_EXT_packed_depth_stencil. fbo-d24s8 passes
2010-08-06 15:06:25 +10:00
Dave Airlie b8de7788a4 r600g: fix targetmask to work correctly.
At least this seems to fix the glean maskedClear test.
2010-08-06 14:54:24 +10:00
Dave Airlie 2b90364765 r600g: improve supported format selection.
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-06 14:53:38 +10:00
Dave Airlie 121a625c16 r600g: add bo wait after map. 2010-08-06 11:46:52 +10:00
Jerome Glisse 9c949d4a4d r600g: don't use dynamic state allocation for states
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-05 15:41:35 -04:00
Jerome Glisse 12dac449fb r600g: force flush on map as temporary fix to readpixel
Should allow more piglit test to pass. Need to plugin
proper flushing.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04 16:29:56 -04:00
Jerome Glisse 9a78e790dc r600g: always perform texture perspective divide + fix blending
quake3 engine seems to run fine at this point (ioquake)

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-04 16:11:39 -04:00
Jerome Glisse dd863bf5e7 r600g: add polygon offset support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 17:45:51 -04:00
Jerome Glisse a0b3944c30 r600g: flush and resubmit if we reach limit
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 17:02:48 -04:00
Jerome Glisse 3a8d4a8979 r600g: fix color target mask
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 16:16:01 -04:00
Jerome Glisse 8f6341d421 r600g: fix stencil
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 15:49:21 -04:00
Jerome Glisse 7e42b7e5d2 r600g: fix LIT + fix multiple constant one ALU + fix ALU block splitting
Make sure LIT fills all slot for instruction (can't do W instruction
without having the Z slot filled with at least a NOP).

ALU instruction can't access more than 4 constant, move constant to
temporary reg if we reach the limit.

Fix ALU block splitting, only split ALU after ALU with last instruction
bit sets.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-03 14:31:49 -04:00
Jerome Glisse f031817450 r600g: split alu block to conform to limit + RCP opcode
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02 17:41:52 -04:00
Jerome Glisse 313df41562 r600g: add autogenerated reg definition + debug print cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-08-02 14:22:58 -04:00
Dave Airlie 4af5f11c32 r600g: add stencil op/func translation 2010-08-02 16:27:15 +10:00
Dave Airlie 3f4ec394b0 r600g: initial alpha test state 2010-08-02 16:27:15 +10:00
Dave Airlie 7bcd39ce50 r600g: add initial blend state.
migrates cb_cntl to be regenerated
2010-08-02 16:27:01 +10:00
Dave Airlie 01984cf34f r600g: set correct tex coord type for rect textures. 2010-08-02 14:56:20 +10:00
Dave Airlie 919750a557 r600g: make r600_db_format static.
this isn't used anywhere else yet.
2010-08-02 14:31:49 +10:00
Vinson Lee 1d74a1674c r600g: Remove unnecessary header. 2010-07-31 19:23:14 -07:00
Vinson Lee 5fa1af0905 r600g: Remove unnecessary header. 2010-07-31 14:56:53 -07:00
Jerome Glisse 094d66f459 r600g: add KIL opcode support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-30 18:05:07 -04:00
Jerome Glisse 6c288d06ac r600g: fix typo in tex instruction + shader semantic id fix
It seems we never get semantic id from TGSI so fallback
to use output number as id.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-30 11:12:10 -04:00
Jerome Glisse 7a73390f91 r600g: mipmap early support + EX2/ABS instruction + culling
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-29 19:05:57 -04:00
Chia-I Wu a57f842519 gallium: Keep only pipe_context::draw_vbo.
That is, remove pipe_context::draw_arrays, pipe_context::draw_elements,
pipe_context::draw_arrays_instanced,
pipe_context::draw_elements_instanced,
pipe_context::draw_range_elements.
2010-07-29 13:45:31 +08:00
Chia-I Wu 6d28bf917f gallium: Implement draw_vbo and set_index_buffer for all drivers.
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-29 13:45:30 +08:00
Jerome Glisse 42c1f27149 r600g: state context ptr in sampler_view & add I8/L8 buffer format
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 20:09:15 -04:00
Jerome Glisse 35e044ab56 r600g: switch btw flat/linear interpolation
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-28 19:59:38 -04:00
Jerome Glisse 6f0f6c6459 r600g: split pipe state creating/binding from hw state creation
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-28 19:36:16 -04:00
Jerome Glisse 742ee7935d r600g: cleanup resource buffer/texture mess
Use a common function, fix the mess it was before.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 12:18:19 -04:00
Jerome Glisse b346c4205d r600g: add lrp instruction support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 10:35:32 -04:00
Jerome Glisse 9961a0b92d r600g: actualy fix the literal emission
Previous patch added literal emission to wrong place, we
want to emit literal before emitting a new alu group.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-28 09:11:14 -04:00
Dave Airlie 2ab24a6fae r600g: fix up segfault with variation between views and count.
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.
2010-07-28 15:28:18 +10:00
Dave Airlie f514ad0a9b r600g: use gallium util for float->ui conversion 2010-07-28 11:55:09 +10:00
Jerome Glisse 641c9adb09 r600g: texture support
Add texture mapping support, redbook/texbind works if
you comment out glClear and second checkboard. Need to
fix :
 - texture overwritting
 - lod & mip/map handling
 - unormalized coordinate handling
 - texture view with first leve > 0
 - and many other things

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 20:18:32 -04:00
Vinson Lee 6a20539580 r600g: Move declaration before code.
Fixes SCons build.
2010-07-27 15:33:45 -07:00
Jerome Glisse 2b3b76a4a0 r600g: always emit literal after emiting an alu instruction
Make sure we always fill in the literal after alu instruction.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-27 13:50:11 -04:00
Stephan Schmid 0bebdc230f r600g: implememt the LIT instruction 2010-07-26 10:34:05 -04:00
Jerome Glisse 33241134e6 r600g: first pass at texture support
This add texture support to the assembler, generated code is
wrong (tested against working dump).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 20:57:21 -04:00
Vinson Lee bd27db400a r600g: Fix SCons build. 2010-07-23 17:50:35 -07:00
Jerome Glisse cf864fd58b r600g: fix dp2, dp3, dp4 tokens
We need to make sure dp are all mirror accross the alu unit.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 18:19:13 -04:00
Jerome Glisse 5cc2974dff r600g: add RSQ token support
Could serve as an example on how to add more token
support.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 17:49:26 -04:00
Jerome Glisse de553d906b r600g: drop compiler stuff and switch over dumb tgsi assembler
Writing a compiler is time consuming and error prone in
order to allow r600g to further progress in the meantime
i wrote a simple tgsi assembler, it does stupid thing but
i would rather keep the code simple than having people
trying to optimize code it does.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-23 17:35:36 -04:00
Jerome Glisse 0bca8fbfda r600g: add support for all R6XX/R7XX asic
This configure some of the value properly based on
asic so others asic than RV710 works too.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-21 17:05:37 -04:00
Dave Airlie 4b2820534e r600g: add r600 compile mode to compiler.
some of the ALU instructions are different on r6xx vs r7xx,
separate the alu translation to separate files, and use family
to pick which compile stage to use.
2010-07-21 17:05:37 -04:00
Dave Airlie 9433d0e801 r600g: add family retrival
allow pipe driver to get the family of the gpu.
2010-07-21 17:05:36 -04:00
Jerome Glisse 62f8b56dc6 r600g: split trans unit computation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-07-20 15:07:32 -04:00
Dave Airlie 8556b77c56 r600: use gallium list macros instead of making our own.
before this change, r600 glxinfo segfaulted in the list code, and I wasn't
debugging another linked list implementation, its 2010 after all.

So add the two missing list macros to the gallium header from X.org list header file (after fixing them), then port all r600 lists to the new header.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-02 15:27:17 +10:00
Jakob Bornecrantz a01e0afd9f Merge branch 'gallium-drm-driver-drescriptor'
Conflicts:
	src/gallium/state_trackers/egl/x11/native_dri2.c
	src/gallium/state_trackers/egl/x11/native_x11.c
	src/gallium/state_trackers/egl/x11/native_x11.h
	src/gallium/state_trackers/xorg/xorg_driver.c
	src/gallium/winsys/radeon/drm/radeon_drm.c
2010-06-28 21:14:45 +02:00
Jakob Bornecrantz 92fde20de3 r600g: Move bootstrap code to target 2010-06-24 02:15:50 +02:00
Marek Olšák eee570a0fe r600g: save vertex buffers in blitter 2010-06-09 02:26:44 +02:00
Zack Rusin 34f7681669 gallium: adjust the query interface to support custom types
we need to change it to support composite types
2010-06-08 06:28:11 -04:00
Vinson Lee 1574fb7846 r600g: Remove unnecessary header. 2010-06-07 16:54:18 -07:00
Jerome Glisse c6131879eb r600g: add shader literal constant support
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-06-06 22:16:47 +02:00
Jerome Glisse 0db388eedd r600g: split instruction into scalar
Split instruction into scalar in core compiler this simplify
the way we translate the instruction in latter stage.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-06-05 17:13:25 +02:00
Marek Olšák 8819421a3b r600g: implement clear_{render_target, depth_stencil}, resource_copy_region
resource_copy_region uses a software fallback because it relies on texture
samplers which haven't been implemented yet.
2010-06-04 03:04:16 +02:00
Marek Olšák 7d0418d3dc r600g: make blit functions static (private) 2010-06-04 03:04:16 +02:00
Marek Olšák ffd0a2e215 r600g: use cast wrappers 2010-06-04 03:04:16 +02:00
Vinson Lee 42aad574f2 r600g: Move declaration before code.
Fixes SCons build.
2010-06-03 17:41:57 -07:00
Bas Nieuwenhuizen d6ba70c658 r600g: added code for depthtesting
- added code to configure the depth buffer and to set up depth testing.
2010-06-03 21:38:53 +02:00
Roland Scheidegger c674ce5e3a r600g: adapt to interface changes
r600g should be able to handle separate depth stencil clears as well.
Also adapt surface_fill/copy stubs to new interface (not that it matters).
2010-06-03 17:46:47 +02:00
Vinson Lee d062d21416 scons: Handle Python OSError exception when missing libdrm_radeon.
Instead of crashing when libdrm_radeon is unavailable, the SCons build
just does not build r600g.
2010-06-03 00:08:22 -07:00
Marek Olšák 4182d3ea00 r600g: remove unused struct r600_state
What was the purpose of it?
2010-05-31 04:16:24 +02:00
Vinson Lee 1202f17063 r600g: Remove unnecessary headers. 2010-05-30 15:30:05 -07:00
Marek Olšák 7d9396d7cf r600g: fix gallium function parameters 2010-05-29 15:41:22 +02:00
Marek Olšák 1d57b6ebd1 r600g: make a local copy of viewport state 2010-05-29 15:41:22 +02:00
Jerome Glisse 6a143b8424 r600g: disable rendering
Disable rendering to avoid GPU lockup.
Use radeondb to debug shader compiler :
radeondb -c gallium.bof
radeondb -s gallium.json
Will print shader generated, best is to use fp demos to test
the compiler.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-05-27 23:24:26 +02:00
Bas Nieuwenhuizen 9e8a6f801d r600g: various fixes
- enabled flushing a buffer more than once
- enabled the blitter for r600_clear
- added some more colors to r600_is_format_supported (copied from r600_conv_pipe_format)
- r600_set_framebuffer_state now sets rctx->fb_state
- more states are saved before a blit (had to add some accounting for the viewport and the vertex elements state)
- fixed a few errors with reference counting
2010-05-27 23:24:22 +02:00
Jerome Glisse e68b4e5053 r600g: fix driver + shader compiler backend change
Change the way we translate from c_compiler to the
asic specific representation. Should make things
simpler.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-05-27 23:24:17 +02:00
Jakob Bornecrantz aeee52691c r600g: Integrate into build
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-05-27 23:24:12 +02:00
Jakob Bornecrantz 9abfc5ef60 r600g: Fix buffer offsets
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2010-05-27 23:24:07 +02:00
Marek Olšák b8fb1d75ce r600g: adapt to latest interfaces changes
- Wrapped the buffer and texture create/destroy/transfer/... functions
  using u_resource, which is then used to implement the resource functions.
- Implemented texture transfers.
  I left the buffer and texture transfers separate because one day we'll
  need a special codepath for textures.
- Added index_bias to the draw_*elements functions.
- Removed nonexistent *REP and *FOR instructions.
- Some pipe formats have changed channel ordering, so I've removed/fixed
  nonexistent ones.
- Added stubs for create/set/destroy sampler views.
- Added a naive implementation of vertex elements state (new CSO).
- Reworked {texture,buffer}_{from,to}_handle.
- Reorganized winsys files, removed dri,egl,python directories.
- Added a new build target dri-r600.
2010-05-27 23:24:02 +02:00
Jerome Glisse 72128962d6 r600g: Initial import 2010-05-27 23:23:56 +02:00