Commit Graph

49949 Commits

Author SHA1 Message Date
Kenneth Graunke 622eed0750 glsl: Split out ir_reader's ability to read ir_dereference_variables.
Most of the time, we just want to read an ir_dereference, so there's no
need to have these in separate functions.  However, the next patch will
want to read an ir_dereference_variable directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:38 -07:00
Kenneth Graunke d0fa0cb52c glsl: Move constant expression handling from calls to signatures.
When translating a call from AST to HIR, we need to decide whether it
can be evaluated to a constant before emitting any code (namely, the
temporary declaration, assignment, and call.)

Soon, ir_call will become a statement taking a dereference of where to
store the return value, rather than an rvalue to be used on the RHS of
an assignment.  It will be more convenient to try evaluation before
creating a call.  ir_function_signature seems like a reasonable place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:36 -07:00
Kenneth Graunke 807e967c61 glsl: Use ir_rvalue to represent generic error_type values.
Currently, ir_call can be used as either a statement (for void
functions) or a value (for non-void functions).  This is rather awkward,
as it's the only class that can be used in both forms.

A number of places use ir_call::get_error_instruction() to construct a
generic value of error_type.  If ir_call is to become a statement, it
can no longer serve this purpose.

Unfortunately, none of our classes are particularly well suited for
this, and creating a new one would be rather aggrandizing.  So, this
patch introduces ir_rvalue::error_value(), a static method that creates
an instance of the base class, ir_rvalue.  This has the nice property
that you can't accidentally try and access uninitialized fields (as it
doesn't have any).  The downside is that the base class is no longer
abstract.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:34 -07:00
Kenneth Graunke ac0f8bae8d glsl: Combine AST-level and IR-level parameter mode checking loops.
generate_call() and ast_function_expression::hir() both tried to verify
that 'out' and 'inout' parameters used l-values.  Irritatingly, it
turned out that this was not redundant; both checks caught -some- cases.

This patch combines the two into a single "complete" function that does
all the parameter mode checking.  It also adds a comment clarifying why
AST-level checking is necessary in the first place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:32 -07:00
Kenneth Graunke 909e889967 glsl: Split up function matching and call generation a bit more.
We used to have one big function, match_signature_by_name, which found
a matching signature, performed out-parameter conversions, and generated
the ir_call.  As the code for matching against built-in functions became
more complicated, I split it internally, creating generate_call().

However, I left the same awkward interface.  This patch splits it into
three functions:
1. match_signature_by_name()

   This now takes a name, a list of parameters, the symbol table, and
   returns an ir_function_signature.  Simple and one purpose: matching.

2. no_matching_function_error()

   Generate the "no matching function" error and list of prototypes.
   This was complex enough that I felt it deserved its own function.

3. generate_call()

   Do the out-parameter conversion and generate the ir_call.  This
   could probably use more splitting.

The caller now has a more natural workflow: find a matching signature,
then either generate an error or a call.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:29 -07:00
Kenneth Graunke 0405bd08ca glsl: Don't trust loop analysis in the presence of function calls.
Function calls may have side effects that alter variables used inside
the loop.  In the fragment shader, they may even terminate the shader.
This means our analysis about loop-constant or induction variables may
be completely wrong.

In general it's impossible to determine whether they actually do or not
(due to the halting problem), so we'd need to perform conservative
static analysis.  For now, it's not worth the complexity: most functions
will be inlined, at which point we can unroll them successfully.

Fixes Piglit tests:
- shaders/glsl-fs-unroll-out-param
- shaders/glsl-fs-unroll-side-effect

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-02 14:15:19 -07:00
Kenneth Graunke 252d3118dd i965/aub: Dump a final bitmap from DestroyContext.
Certain applications don't call SwapBuffers before exiting.  Yet, we'd
really like to see a bitmap containing the final rendered image even if
they choose never to present it.

In particular, Piglit tests (at least with -auto -fbo) fall into this
category.  Many of them failed to dump any images at all.

Dumping one final image at context destruction time seems to work.
We may wish to pursue a more elegant solution later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-02 13:47:53 -07:00
Marek Olšák 42bc0b9b9d r600g: unduplicate code for PS partial flush 2012-04-01 23:57:50 +02:00
Marek Olšák bc95152f1d r600g: determine in advance if hw has vertex cache 2012-04-01 23:57:50 +02:00
Marek Olšák 669d8766ff r600g: optimize r600_resource_va
Avoid calling get_radeon_bo and inline it.
2012-04-01 23:57:50 +02:00
Marcin Slusarz 68e4c83ffa targets/{xvmc,vdpau,va}: remove all objects on make clean 2012-04-01 17:42:48 +02:00
Eugeni Dodonov a45247fb1b intel: add PCI IDs for Ivy Bridge GT2 server variant
Those IDs are used by Bromolow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-04-01 10:50:55 -03:00
Vinson Lee 4123d0b321 linker: Fix memory leak in count_uniform_size::visit_field.
Fixes a Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-31 11:15:41 -07:00
Kenneth Graunke bd2410b48d intel: Add some PCI IDs for Haswell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:31 -07:00
Kenneth Graunke 4848122a96 i965: Set "Shader Channel Select" fields in Haswell's SURFACE_STATE.
These can be used to implement EXT_texture_swizzle without baking
state-dependent swizzle instructions into the shader and forcing
recompiles.

For now, just set them to pass-through mode, so everything continues to
work as it did on Ivybridge.  We can optimize this later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:31 -07:00
Kenneth Graunke a23dcc18e7 i965: Fill in Sample Mask in Haswell's 3DSTATE_PS.
We only need one sample, since we don't support multisampling yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:23 -07:00
Kenneth Graunke fc8edbe016 i965: Set "Stencil Buffer Enable" bit on Haswell.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:21 -07:00
Kenneth Graunke b4410ac394 i965: Set Line Stipple enable bit in 3DSTATE_SF for Haswell.
Apparently this needs to be the same as in 3DSTATE_WM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:03 -07:00
Kenneth Graunke 1b3a199097 i965: Update max VS/PS threads shift offsets for Haswell.
These now start at bit 23 instead of bit 24/25.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:39:02 -07:00
Kenneth Graunke 1ba8c6ad03 i965: Disable HiZ on Haswell for now.
Getting HiZ working means updating all the state packets for resolves
and clears.  It's not worth doing until we get the basics working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:38:59 -07:00
Kenneth Graunke 180aecb6dc i965: Add initial IS_HASWELL() macros.
For now, these all return 0, as I don't yet want to enable Haswell
support.  Eventually they will be filled in with proper PCI IDs.

Also add an is_haswell field similar to is_g4x to make it easy to
distinguish Gen7 and Gen7.5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-30 14:38:48 -07:00
Kenneth Graunke 01044fce6b i965: Avoid explicit accumulator operands in SIMD16 mode on Gen7.
According to the BSpec ISA volume's "Accumulator Register" section:

"[DevIVB] SIMD16 execution on dwords is not allowed when accumulator is
 explicit source or destination operand."

Fixes piglit tests:
- fs-multiply-const-ivec4
- fs-multiply-const-uvec4
- fs-multiply-ivec4-const
- fs-multiply-uvec4-const

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-30 14:27:54 -07:00
Marek Olšák 99a192ce7d gallium/postprocess: document serious issue causing undefined behavior 2012-03-30 18:14:06 +02:00
Marek Olšák ead0a89c96 r600g: cleanup after get_query_result change
Finally, union r600_query_result can be removed.
2012-03-30 17:12:52 +02:00
Marek Olšák 6d73382afc r300g: cleanup after get_query_result change 2012-03-30 17:12:51 +02:00
Marek Olšák 452d07759d gallium/util: add helper function util_query_clear_result 2012-03-30 17:12:51 +02:00
Marek Olšák 4445e170be gallium: adapt to get_query_result interface change
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-30 17:12:51 +02:00
Marek Olšák 102ed41ae6 gallium: make get_query_result return union* and not void*
This replaces the cryptic void* parameter with a union.
(based on union r600_query_result)

Users of this can still pass uint64* in it, but that cannot work for every
query type, obviously. Most importantly, the code now documents what should
be expected from get_query_result.

This also adds pipe_query_data_pipeline_statistics as per the D3D11 docs.

v2: fix indentation, add comments and use the doxygen style

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-30 17:12:51 +02:00
Tom Stellard 7d87c71a70 configure: Add --with-llvm-shared-libs
This option allows targets to link against the LLVM shared library
instead of the static libs.  With LLVM 2.9, his saves ~11 MB for each of
the r300 target libraries.
2012-03-30 09:13:04 -04:00
Kristian Høgsberg 2402ce04ae shared-glapi: Include from builddir
Fixes out-of-tree builds.

https://bugs.freedesktop.org/show_bug.cgi?id=47649
2012-03-29 09:25:15 -04:00
Vinson Lee a7b8e16dc6 gallivm: Fix method overriding in raw_debug_ostream.
Use matching type qualifers to avoid method hiding.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-28 22:46:17 -07:00
Ander Conselvan de Oliveira 4a976b60b1 egl_dri2: use gbm_surface as the native window type in drm platform 2012-03-28 22:14:34 -04:00
Ander Conselvan de Oliveira fd6acb97fb gbm: Create hooks for dri2_loader_extension in dri backend
Pass a dri2_loader extension to the dri driver when gbm creates the dri
screen.  The implementation jumps through pointers in the gbm device
so that an EGL on GBM implementation can provide the real implementations.
2012-03-28 22:14:34 -04:00
Ander Conselvan de Oliveira 0d1ef1f57f gbm: Add gbm_surface interface
The idea here is to be able to create an egl window surface from a
gbm_surface.  This avoids the need for the surfaceless extension and
lets the EGL platform handle buffer allocation, while keeping the user
in charge of somehow presenting the buffers (using kms page flipping,
for example).

gbm_surface_lock_front_buffer() locks a surface's front buffer and
returns a gbm bo representing it.  This bo should later be returned
to the gbm surface using gbm_surface_release_buffer().
2012-03-28 22:14:34 -04:00
Brian Paul 7f16246ace draw: fix missing immediates bug in polygon stipple code
The function that counts the number of TGSI immediates also needs to
emit the immediates.  This fixes assorted failures when using polygon
stipple with fragment shaders that have their own immediates.

NOTE: This is a candidate for the 8.0 branch.
2012-03-28 11:43:18 -06:00
Christian König fc0a5e21d7 vl: move winsys helper out of winsys directory
They aren't winsys of their own,
just help dealing with them.

v2: add some more comments in vl_winsys.h

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-28 15:47:41 +02:00
Jon TURNEY ba83b8b4ae Use -no-undefined libtool flag in src/glx/Makefile.am
"Use -no-undefined to assure libtool that the library has no unresolved
symbols at link time, so that libtool will build a shared library on
platforms that require that all symbols are resolved when the library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-28 13:03:52 +01:00
Yuanhan Liu 9cb777eb71 intel: fix un-blanced map_refcount issue
This is a regression introduced by commit cdcfd5, which forget to
increase the map_refcount for successfully-mapped region. Thus caused a
wrong non-blanced map_refcount.

This would fix the regression found in the two following webglc testcase
on Pineview platform:
   texture-npot.html
   gl-max-texture-dimensions.html

Cc: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-28 09:51:38 +08:00
Wang YanQing 7a6324dbfe glx:dri_common.c: check psc->driScreen->createDrawable return value
createDrawable may return NULL value, we should check it, or it will
make a segment failed.

[minor-indent-issue-fixed-by: Yuanhan Liu]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-28 09:51:16 +08:00
Marek Olšák 9773369ab4 r600g: also disable transform feedback on cayman
It's said to cause troubles there.
The env var is R600_STREAMOUT again.
2012-03-28 02:21:03 +02:00
Marek Olšák 393d741788 r600g: enable transform feedback on everything that isn't r700
Use R700_STREAMOUT=1 if you wanna hack transform feedback on r700.
2012-03-27 21:06:59 +02:00
Benjamin Franzke ad22e647e0 st/egl: Also remove wl_buffer_damage in wayland backend
As commit 03eca9d92d does for egl_dri2.
2012-03-27 18:51:53 +02:00
ojab 60b58822f0 gallivm: Use InitializeNativeTargetDisassembler().
To initialize only native LLVM Disassembler on LLVM >= 3.1.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-03-27 16:28:30 +01:00
Ander Conselvan de Oliveira 410aa3eb45 egl_dri2: make flush extension useable by drm platform 2012-03-27 08:28:07 -04:00
Kristian Høgsberg 03eca9d92d wayland: Stop using wl_buffer.damage 2012-03-27 08:28:07 -04:00
Neil Roberts 03f617f413 Add support for GL_EXT_unpack_subimage on GLES2
This extension just permits GL_UNPACK_ROW_LENGTH, GL_UNPACK_SKIP_ROWS
and GL_UNPACK_SKIP_PIXELS to be passed to glPixelStore on GLES2 so it
is trivial to implement.
2012-03-27 08:28:06 -04:00
Benjamin Franzke 860f4846c7 gles: Enable the GL_EXT_read_format_bgra extension
Also fixes the usage of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,
which may be set to a BGRA format e.g. for a MESA_FORMAT_ARGB8888 fb.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-27 09:03:19 +02:00
Benjamin Franzke e9a5457d73 gles1: Enable GL_EXT_texture_format_BGRA8888 in APIspec
The extension is already exposed for GLES1, but the APIspec
doesnt allow the usage of GL_BGRA_EXT in glTex(Sub)Image2D.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-27 09:03:19 +02:00
Dylan Noblesmith aebd549243 glapi: regenerate enums.c
For previous four commits:

    glapi: add GL_ARB_texture_float
    glapi: add GL_ARB_depth_buffer_float
    glapi: add GL_ARB_texture_compression_rgtc
    glapi: add ARB_texture_rg
2012-03-26 21:35:24 +00:00
Dylan Noblesmith 91c8bedb8a glapi: add GL_ARB_texture_float
And add some missing core GL 3.0 enums that came from this
extension, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 21:35:17 +00:00