Commit graph

40817 commits

Author SHA1 Message Date
Paul Berry
39fc725b0c i965: SF: Move the computation of urb_entry_read_offset.
This patch moves the computation of the SF URB entry read offset from
upload_sf_unit() to its own function, so that it can be re-used when
creating the gen4-5 SF program.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:29 -07:00
Paul Berry
f3ecc90730 i965: new VS: Compute urb entry size based on the VUE map.
Previously, the new VS backend computed the size of the URB entry by
counting the number of MRFs used in emitting the URB entry.  Now it
just gets it straight from the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:26 -07:00
Paul Berry
ee3195a5ff i965: new VS: Clarify comments about max_usable_mrf and add an assertion.
max_usable_mrf has been carefully set such that (max_usable_mrf -
base_mrf) is a multiple of 2, so that an even number of VUE slots are
emitted with each URB write (which Gen6 requires).  This patch adds an
assertion to confirm that this is the case, and moves the comment to
this effect to be near the assertion.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:22 -07:00
Paul Berry
e604f98f58 i965: new VS: use the VUE map to write out vertex attributes.
Previously, the new VS backend used two functions,
emit_vue_header_gen6() and emit_vue_header_gen4() to emit the fixed
parts of the VUE, and then a pair of carefully-constructed loops to
emit the rest of the VUE, leaving out the parts that were already
emitted as part of the header.

This patch changes the new VS backend to use the VUE map to emit the
entire VUE.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:18 -07:00
Paul Berry
d1435a49e9 i965: new VS: move clip distance computation (GEN5+) to a separate function.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:15 -07:00
Paul Berry
d9eca0b279 i965: new VS: Move PSIZ/flags computation to a separate function.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:13 -07:00
Paul Berry
f86d1976f8 i965: new VS: move NDC computation (GEN4-5) to a separate function.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:09 -07:00
Paul Berry
34fbab2125 i965: new VS: Use output_reg[] to find NDC and HPOS registers.
Previously, emit_vue_header_gen4() used local variables to keep track
of which registers were storing the NDC and HPOS.  This patch uses the
output_reg[] array instead, so that the code that manipulates NDC and
HPOS can be more easily refactored.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:05 -07:00
Paul Berry
85e57eb9ca i965: old VS: use the VUE map to compute the URB entry size.
Previously, the old VS backend computed the URB entry size by adding
the number of vertex shader outputs to the size of the URB header.
This often produced a larger result than necessary, because some
vertex shader outputs are stored in the header, so they were being
double counted.  This patch changes the old VS backend to compute the
URB entry size directly from the number of slots in the VUE map.

Note: there's a subtle change in that we no longer count header
registers towards the size of the VF input.  I believe this is
correct, because the header is only emitted in the output of the VS
stage--it is not present in the input.  (As evidence for this, note
that brw_vs_state.c sets urb_entry_read_offset to 0--it does not
include space for the header as part of the VS input).

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:01 -07:00
Paul Berry
3c17efd148 i965: old VS: Use brw_vue_map instead of implicit assumptions about VUE structure.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:03:57 -07:00
Paul Berry
7bb2dbfc97 i965: Add functions to compute offsets within the VUE map.
Some parts of the i965 driver keep track of locations within the VUE
(vertex URB entry) using byte offsets.  This patch adds inline
functions to compute these byte offsets using the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:03:53 -07:00
Paul Berry
45f1d7a666 i965: Write code to compute a VUE map.
Several places in the i965 code make implicit assumptions about the
structure of data in the VUE (vertex URB entry).  This patch adds a
function, brw_compute_vue_map(), which computes the structure of the
VUE explicitly.  Future patches will modify the rest of the driver to
use the explicitly computed map rather than rely on implicit
assumptions about it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:03:49 -07:00
Paul Berry
6489a1d5ba Refactor code that converts between gl_vert_result and gl_frag_attrib.
Previously, this conversion was duplicated in several places in the
i965 driver.  This patch moves it to a common location in mtypes.h,
near the declaration of gl_vert_result and gl_frag_attrib.

I've also added comments to remind us that we may need to revisit the
conversion code when adding elements to gl_vert_result and
gl_frag_attrib.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:02:32 -07:00
Dave Airlie
1d52ddc3bb r600g: add TXQ and TXF support
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:23:08 +01:00
Dave Airlie
cdeffbfddc r600g: add initial evergreen integer opcode support
This just adds the opcodes for evergreen, need to work on r600 and cayman
implementations.

don't advertise nativeintegers yet until we work out all the regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:22:24 +01:00
Dave Airlie
f154ac9cc2 mesa/st: add support for 2101010 vertex format conversion.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:18:18 +01:00
Dave Airlie
6cd2d55a7b mesa/varray: add interface support for ARB_vertex_type_2_10_10_10_rev (v2)
This just adds all the API check for vertex arrays using 2101010 types.

2101010 is also useable with GL_BGRA.

v2: fix whitespace.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 10:18:18 +01:00
Dave Airlie
51fcf080a3 mesa/vbo: add ARB_vertex_type_2_10_10_10_rev APIs.
This adds the vertex processing paths for the 2101010 types. It converts
the attributes to floats for all the immediate entry points, some entrypoints
are normalised and the attrib APIs take a normalized parameter.

There are four main paths,
ui10 -> float unnormalized
i10 -> float unnormalized
ui10 -> float normalized
i10 -> float normalized
along with the ui2/i2 equivs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:18:17 +01:00
Dave Airlie
667351bc5f mesa: add initial API changes for ARB_vertex_type_2_10_10_10_rev.
add new APIs to the internal mesa driver interface + set funcs in vtxfmt.c

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 10:16:32 +01:00
Dave Airlie
2b3da6b01e glapi: regen API files for new extension
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-06 10:16:16 +01:00
Dave Airlie
3543160f56 glapi: add ARB_vertex_type_2_10_10_10_rev entrypoints. (v2)
These are the new API entrypoints for ARB_vertex_type_2_10_10_10_rev
extension, along with the new INT_2_10_10_10_REV enum.

v2: fixup crazy whitespace cut-n-paste mess

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 10:15:59 +01:00
Bryan Cain
4e64cfbb4e mesa: add a UniformBooleanTrue option
Drivers supporting native integers set UniformBooleanTrue to the integer value
that should be used for true when uploading uniform booleans.  This is ~0 for
Gallium and 1 for i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-05 19:51:29 -05:00
Dave Airlie
f9b7d3bd4a r600g: add 10/10/10/2 vertex format conversion. 2011-09-05 19:08:18 +01:00
Dave Airlie
797bb0eb47 gallium: add missing formats for ARB_vertex_type_2_10_10_10_rev
This just reorgs one define in csv file, and adds all the new formats
that are needed for this extension.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-05 19:08:17 +01:00
Tobias Droste
4a468de2d7 gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn moved TargetRegistry.h and TargetSelect.h.
See revision 138450 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-09-05 18:49:11 +01:00
Bryan Cain
0dc575c6f6 glsl_to_tgsi: fixes for native integers and integer booleans
This fixes all but one of the piglit regressions from enabling native integers
in softpipe.  The change to fix the last regression is still being discussed.
2011-09-04 14:31:16 -05:00
Maarten Lankhorst
a09754c15f xvmc: Replace frame_started by picture_structure
The preferred solution to keeping track of the picture structure
has been putting it in the state tracker, so use picture_structure
instead of frame_started to check if a frame needs to begin.

If picture_structure has been changed, end the frame and start again.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-04 13:51:50 +02:00
Yuanhan Liu
0a00a9a05b intel: fix build error
Fix a build error introduced by commit 6862b54f:
i965_dri.so.tmp: undefined reference to `strerr'

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-09-03 07:26:52 -07:00
Marek Olšák
5572de8e7e mesa: handle zero-size buffers in MapBuffer and ranges in MapBufferRange (v3)
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-02 22:39:56 +02:00
Marek Olšák
0a33ac5413 glsl_to_tgsi: fix more potential shader reference leaks
The last one has been pointed out by Ian.
2011-09-02 22:39:56 +02:00
Eugeni Dodonov
6862b54f4d intel: Give an explanation why we are exiting for debugging.
This could happen in 3 different cases, and ERRNO can explain what
happened. First case would be EIO (gpu hang), second EINVAL (something is
wrong inside the batch), and we also discovered that sometimes it happens
with ENOSPACE. All of those cases are different it it could be worth to at
least know what happened.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-09-02 16:23:32 -03:00
Kenneth Graunke
ee41383ab3 i965/vs: Fix NULL pointer dereference in pre-Gen6 push constant loading.
According to the comment, we need to load /some/ push constants on
pre-Gen6 hardware or the GPU will hang.  The existing code set these
bogus parameters to NULL pointers; unfortunately, the code in
brw_curbe.c that loads them dereferences those pointers.  So, change
them to be pointers to an actual floating point value of 0.0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-02 12:17:06 -07:00
Eric Anholt
7fdbedac14 intel: Upload batchbuffer contents even if INTEL_NO_HW is set.
It is useful for debugging to dump batchbuffers while not actually
executing them.
2011-09-02 12:17:05 -07:00
Dave Airlie
0b666106c5 gallium: add caps for MIN/MAX texel offsets.
As per Brian's suggestion, add caps for drivers that support texture
offsets to advertise a min/max via TGSI, also use it in the state tracker.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-02 10:48:09 +01:00
Dave Airlie
2083a276eb tgsi: add support for texture offsets to the TGSI IR. (v2)
This adds tokens for texture offsets, to store 4 * swizzled vec 3
for use in TXF and other opcodes.

It also contains TGSI exec changes for softpipe to use this code,
along with GLSL->TGSI support for TXF.

v2: add some more comments, add back padding I removed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-02 10:47:45 +01:00
Christian König
49e24d3b8c st/vdpau: Implement VdpOutputSurfacePutBitsIndexed and VdpOutputSurfaceRenderOutputSurface
This gets mplayers menu overlay working.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:47 +02:00
Christian König
41fa51a49a st/xvmc: the alpha component of palette entries isn't used 2011-09-01 19:20:47 +02:00
Christian König
4f37636afb g3dvl: extend the functionality of the compositor
Prepares for vdpau menu overlay.
2011-09-01 19:20:46 +02:00
Christian König
23f01fd31c gallium: add R8A8 and A8R8 UNORM formats
They are mostly used for menu overlay in video decoding.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Christian König
8612235bbf st/xvmc: remove L4A4_UNORM workaround
This is no longer needed, since we now have native support for IA44 and AI44.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Christian König
0d0285ba91 r600g: add support for R4A4 and A4R4 textures.
Sampling worked out of the box, but this make them work as surface as well.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Christian König
cf49c49d0e gallium: try to cleanup a bit of the format mess created with pipe-video merge
Start with correctly defining IA44 and AI44 formats.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-01 19:20:46 +02:00
Kristian Høgsberg
64332917c9 wayland: Use wl_resource_* error functions 2011-09-01 09:54:10 -04:00
Benjamin Franzke
11f64668a9 egl_dri2: Destroy callback in release_pending_buffer 2011-09-01 11:44:43 +02:00
Benjamin Franzke
59884b9b59 wayland-drm: Fix compilation with wayland master
c661ecce introduced some not-yet-upstream stuff.
2011-09-01 11:44:25 +02:00
Brian Paul
db3a7c366b swrast: get rid of needless do/while 2011-08-31 21:30:02 -06:00
Brian Paul
025cf209bc mesa: fix broken store_texel() functions
This fixes the swrast failures for piglit's fbo-generatemipmap-formats
test (for uncompressed formats).  At some point down the road this code
will go away so I haven't checked all the other store_texel() functions.
2011-08-31 21:23:33 -06:00
Chia-I Wu
6b9e4b6ca7 intel: fix GLESv1 support
Add intelInitExtensionsES1 to enable required and optional GLESv1
extensions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-01 10:53:31 +08:00
Chia-I Wu
820789ac69 intel: rename intel_extensions_es2.c to intel_extensions_es.c
We'd like to add intelInitExtensionsES1 to it later.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-01 10:53:31 +08:00
Chia-I Wu
644929849c i915: build i915_dri.so for Android
Simple demos such as test-opengl-gl_basic work.  SurfaceFlinger does not
work yet due to missing GL_OES_draw_texture support (and maybe more).

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00