Compare commits

...

10414 Commits

Author SHA1 Message Date
Jerome Glisse
72916698b0 r600g: fix segfault with old kernel
Old kernel do not have dma support, patch pushed were missing some
of the check needed to not use dma.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 14:51:40 -05:00
Zack Rusin
dbb2d192de glx: only advertise GLX_INTEL_swap_event if it's supported
Only drivers supporting DRI2 version >=4 support GLX_INTEL_swap_event.
So lets mark it as such otherwise applications which use this extension
(i.e. everything based on Clutter, e.g. gnome-shell) break horribly on
drivers supporting DRI2 versions only up to 3.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-24 19:13:05 -08:00
Vadim Girlin
c9343047cf r600g: improve inputs/interpolation handling with llvm backend
Get rid of special handling for reserved regs.
Use one intrinsic for all kinds of interpolation.

v2[Vincent Lejeune]: Rebased against current master

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2013-01-28 18:30:38 +00:00
Tom Stellard
33dc412b89 r600g: Add ar_chan member to struct r600_bytecode
r600_bytecode::ar_chan stores the register channel for the value that
will be loaded into the AR register.

At the moment, this field is only used by the LLVM backend.  The default
backend always sets ar_chan = 0.
2013-01-28 18:30:38 +00:00
Tom Stellard
0ba0926861 r600g: More robust checks for MOVA_INT instructions 2013-01-28 18:30:37 +00:00
Vincent Lejeune
a871e01174 r600g/llvm: Add dummy export for vs output
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59588

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-28 18:30:37 +00:00
Tom Stellard
91a160b19f r600g: Fix building with --enable-r600-llvm-compiler
https://bugs.freedesktop.org/show_bug.cgi?id=59877
2013-01-28 18:30:37 +00:00
Alex Deucher
e110c98cae r600g: don't emit WAIT_UNTIL on cayman/TN (v2)
It shouldn't be needed and older kernels don't support
it.

v2: Replace with PS partial flush as before.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=59945

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-28 12:11:27 -05:00
Jerome Glisse
325422c494 r600g: add async for staging buffer upload v2
v2: Add virtual address to dma src/dst offset for cayman

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 11:30:35 -05:00
Jerome Glisse
bff07638a8 r600g: add multi ring support with dma as first second ring v4
We keep track of ring emission order in a stack, whenever we need to
flush we empty the stack in a fifo order. There is few helpers function
for bo mapping and other ring activities that will make sure that
the ring stack is properly flush and submitted.

v2: fix st flush path, and other flush path to properly flush all
    rings if necessary
v3: - improve name of ring helpers
    - make sure that each time a cs is gona be written it endup at
      top of the stack to avoid any issue such as :
      STACK[0] = dma (withbo A,B)
      STACK[1] = gfx (withbo C,D)
      Now if code try to emit a dma command relative to bo C or D
      it will start writting cmd stream into the cs and once it
      reach the point where it adds relocation it will flush.
      At that point the cs will have cmd that don't have proper
      relocation into the relocation buffer and kernel will just
      refuse to run.
v4: - Drop the stack idea as it turn out there is no way to use it
      or benefit from it. Any time the driver start command on other
      ring, it always need to flush the previous ring. So make code
      simpler by not using a stack.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 11:30:35 -05:00
Jerome Glisse
6c064fd749 radeon/winsys: add dma ring support to winsys v3
Add ring support, you can create a cs for each ring. DMA ring is
bit special regarding relocation as you must emit as much relocation
as there is use of the buffer.

v2: - Improved comment on relocation changes
    - Use a single thread to queue cs submittion this simplify driver
      code while not impacting performances. Rational for this is that
      you have to wait for all previous submission to have completed
      so there was never a case while we could have 2 different thread
      submitting a command stream at the same time. This code just
      consolidate submission into one single thread per winsys.
v3: - Do not use semaphore for empty queue signaling, instead use
      cond var. This is because it's tricky to maintain an even number
      of call to semaphore wait and semaphore signal (the number of
      cs in the stack would for instance make that number vary).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-28 11:30:35 -05:00
Roland Scheidegger
cbf0f66631 gallivm,draw,llvmpipe: mass rename of unit->texture_unit/sampler_unit
Make it obvious what "unit" this is (no change in functionality).
draw still uses "unit" in places where it changes the shader by adding
texture sampling itself - it seems like this can't work with shaders
using dx10-style sample opcodes (can't mix gl-style and dx10-style
sample instructions in a shader).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-28 06:58:06 -08:00
Roland Scheidegger
c789b981b2 gallivm: split sampler and texture state
Split the sampler interface to use separate sampler and texture (sampler_view)
state. This is needed to support dx10-style sampling instructions.
This is not quite complete since both draw/llvmpipe don't really track
textures/samplers independently yet, as well as the gallivm code not quite
using the right sampler or texture index respectively (but it should work
for the sampling codes used by opengl).
We are however losing some optimizations in the process, apply_max_lod will
no longer work, and we potentially could end up with more (unnecessary)
recompiles (if switching textures with/without mipmaps only so it shouldn't
be too bad).

v2: don't use different callback structs for sampler/sampler view functions
(which just complicates things), fix up sampling code to actually use the
right texture or sampler index, and similar for llvmpipe/draw actually
distinguish between samplers and sampler views.

v3: fix more of PIPE_MAX_SAMPLER / PIPE_MAX_SHADER_SAMPLER_VIEWS mismatches
(both in draw and llvmpipe), based on feedback from José get rid of unneeded
static sampler derived state.(which also fixes the only 2 piglit regressions
due to a forgotten assignment), fix comments based on Brian's feedback.

v4: remove some accidental unrelated whitespace changes

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-28 06:50:36 -08:00
Marek Olšák
87592cff57 gallium/u_upload_mgr: fix a serious memory leak
It can eat all memory and crash in a matter of minutes with r600g.
2013-01-28 02:51:52 +01:00
Christoph Bumiller
e058f2ac97 nouveau: don't try to use push_data if it's not implemented 2013-01-27 13:45:06 +01:00
Matt Turner
51b64ce47b gles3: Update gl3.h
Contains a fix for Khronos bug 9557.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-26 20:42:19 -08:00
Marek Olšák
8891b2f9c9 r600g: add more cases for copying unsupported formats to resource_copy_region
just in case a new format is added to gallium
2013-01-26 14:59:04 +01:00
Marek Olšák
26c872c2a2 r600g: don't use radeon_surface_level::npix_x/y/z
npix_x/y/z is wrong with NPOT textures, since it's always aligned to POT
if the level is non-zero, so we can't use that.

This fixes piglit/spec/EXT_texture_shared_exponent/fbo-generatemipmap-formats.
2013-01-26 14:58:52 +01:00
Marek Olšák
edc38330da r600g: fix compile warnings in r600_cp_dma_copy_buffer on 32-bit gcc 2013-01-26 14:50:36 +01:00
Alex Deucher
f951f2f52c r600g: fix up CP DMA for VM on cayman and TN
Need to add the virtual address.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-25 21:57:42 -05:00
Brian Paul
c1d35aece0 svga: use pipe_sampler_view_release() in svga_cleanup_tss_binding()
Fixes a crash when the Redway3D Turbine demo exits.  We've made this
change in other places in the past.  The root issue is texture objects
are being shared by multiple contexts and sampler views get shared too.
Sampler views have a context pointer and if that context gets deleted
we may try to reference that context when finally deleting the sampler
view.

pipe_sampler_view_release() avoids this problem because it takes
an explicit context.

Reviewed-by: Zack Rusin <zackr@vmware.com>
2013-01-25 15:57:35 -07:00
Brian Paul
50c4c818aa st/mesa: handle new GLSL IR enumerants in switch statements
To silence warnings about unhandled cases.
2013-01-25 15:46:14 -07:00
Brian Paul
9227c53741 svga: add NULL pointer check in svga_create_sampler_state()
Note: This is a candidate for the 9.0 branch.
2013-01-25 15:41:41 -07:00
Brian Paul
7a89f08a22 vbo: add a null pointer check to handle OOM instead of crashing
Note: This is a candidate for the 9.0 branch.
2013-01-25 15:41:41 -07:00
Brian Paul
b13c534f14 util: add new error checking code in vbuf helper
Check the return value of calls to u_upload_alloc() and
u_upload_data() and return early if needed.

Since we don't have a way to propagate errors all the way up to
Mesa through pipe_context::draw_vbo(), call debug_warn_once() so
the user might have some clue about OOM errors.

Note: This is a candidate for the 9.0 branch.
2013-01-25 15:41:40 -07:00
Brian Paul
8c3f9ea073 st/mesa: do proper error checking for u_upload_alloc() calls
We weren't properly checking the return value of these calls (and
calls to u_upload_data()) to detect OOM errors.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:40 -07:00
Brian Paul
68a097596e util: add some defensive coding in u_upload_alloc()
Some callers of this function were checking the 'ptr' result to see if
the function failed.  But the correct way is to check the regular
return value for PIPE_ERROR_x.  Now we initialize all the returned
values at the top of the function in case we do hit an error (like OOM).

Callers are more likely to detect OOM conditions now.  But there
are some callers which don't do any error checking...

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:40 -07:00
Brian Paul
d6f8b7ef38 glsl: use glsl_strtof() instead of glsl_strtod()
Since the result of those calls is always assigned to a float.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 15:41:40 -07:00
Brian Paul
811b5b4b39 glsl: add new glsl_strtof() function
Note, we could alternately implement this in terms of glsl_strtod()
with a (float) cast.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 15:41:39 -07:00
Brian Paul
6102b9d441 softpipe: add casts to silence MSVC warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
257783b939 util: silence MSVC signed/unsigned comparison warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
539541f2e2 util: silence MSVC double->float conversion warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
869071dfb7 util: silence MSVC signed/unsigned warnings in debug_get_flags_option()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:39 -07:00
Brian Paul
1a15772b7c st/mesa: silence assorted MSVC warnings in DrawPixels code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
eee762258e swrast: silence a bunch of MSVC warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
ccbb479f40 mesa: use GLbitfield64 when copying program inputs
Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
701a0f6a76 mesa: add some casts to silence MSVC warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Brian Paul
ddb774ddf1 mesa: add casts in _mesa_GetTexParameterfv() to silence warnings
There are other similar int->float casts elsewhere in the function.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-25 15:41:38 -07:00
Matt Turner
9aadc3a6cc i965: Enable ARB_shading_language_packing
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:24 -08:00
Matt Turner
64dbc51b49 i965: Assert that the 4x8 pack/unpack operations have been lowered
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
96220111dd i965: Lower the 4x8 pack/unpack operations
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
321555fb41 glsl: Add support for lowering 4x8 pack/unpack operations
Lower them to arithmetic and bit manipulation expressions.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
1ef674f215 glsl: Evaluate constant pack/unpack 4x8 expressions
That is, evaluate constant expressions for the following functions:
  packSnorm4x8, unpackSnorm4x8
  packUnorm4x8, unpackUnorm4x8

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
b64b174b0a glsl: Extend ir_expression_operation for ARB_shading_language_packing
For each function {pack,unpack}{Snorm,Unorm}4x8, add a corresponding
opcode to enum ir_expression_operation. Validate the new opcodes in
ir_validate.cpp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
b0239ce960 glsl: Add IR lisp for ARB_shading_language_packing
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Matt Turner
12aa2fec5b glsl: Add infrastructure for ARB_shading_language_packing
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 14:10:23 -08:00
Tom Stellard
7a850c5851 configure.ac: Don't set LLVM_LIBS when llvm is disabled 2013-01-25 22:05:00 +00:00
Tom Stellard
264e6dad28 r600g: Don't build llvm_wrapper.cpp when we aren't using LLVM
We were using the NEED_RADEON_GALLIUM conditional to decide whether or not
to build llvm_wrapper.cpp, which is required for using the LLVM backend.
llvm_wrapper.cpp needs to be linked against the LLVM IPO libary
and this library is only added to LLVM_LIBS if either opencl or the
r600-llvm-compiler is enabled.

The NEED_RADEON_GALLIUM conditional is set to true when enabling the
radeonsi driver, so if the radeonsi and r600 drivers are enabled without
also enabling opencl or r600-llvm-compiler, llvm_wrapper.cpp will be
built, but the IPO library won't be added to LLVM_LIBS.  This was
causing unresolved symbol errors when buiding with this configuration.

https://bugs.freedesktop.org/show_bug.cgi?id=59831

Tested-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-25 22:05:00 +00:00
Eric Anholt
1a316af034 i965: Pass in the glarray to get_surface_type.
Dereffing all the values in the two callers was just pointless, and
the function isn't inlined so there was actual code impact.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:41:04 -08:00
Eric Anholt
80aeda2784 i965: Remove nonsense comment.
vb.inputs_read has never been a thing, even in the initial import.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:59 -08:00
Eric Anholt
23e5503348 i965: Remove NDEBUG undef that was snuck in.
If you want debug, set --enable-debug in your config flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:54 -08:00
Eric Anholt
8fe43b6dc9 i965: reuse _mesa_sizeof_type for index buffer types.
The core Mesa code has just one more case than this (GL_BITMAP), so I
don't see any cause to special-case it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:49 -08:00
Eric Anholt
b859a12f21 i965: Reuse precalculated ib_type_size value.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:44 -08:00
Eric Anholt
9aa02a205d i965: Drop debug check for knowing the size of a type.
This was added in b93684f5f3, but there's
no need for it -- get_size has to succeed, and it has an assert for us
in debug builds.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:39 -08:00
Eric Anholt
5ae3c20791 i965: Stop worrying about alignment of vertex data.
For our current types, the required alignment is actually just 1 byte.
When we get doubles, we have to worry (those have to be aligned to the
natural size), but we don't have doubles yet and they'll just be a
special case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:33 -08:00
Eric Anholt
2a7a5062c9 i965: Use the glarray _ElementSize that Mesa tracks for us.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:40:22 -08:00
Eric Anholt
f6191e09aa mesa: Print more informative debug for _mesa_do_init_remap_table().
This is the same logic from _mesa_map_function_array().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:36:43 -08:00
Ian Romanick
22233da1ee glsl: Remove ir_variable::uniform_block
v2: A previous patch contained a spurious hunk that removed an
assignment to ir_variable::uniform_block.  That hunk was moved to this
patch.  Suggested by Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:36 -05:00
Ian Romanick
f09d77b2af glsl: Allow dereferencing fields of an interface instance
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:36 -05:00
Ian Romanick
32f3229255 glsl: Allow elimination of uniform block members
glGetActiveUniform is not supposed to report block members that are not
active even if they are included in the layout of the block.  The block
layout is determined from the GLSL_TYPE_INTERFACE that defines the
block, so eliminating the ir_variables that correspond to the individual
fields is safe.

Fixes gles3conform test
uniform_buffer_object_getuniformindices_for_for_nonexistent_or_not_active_uniform_names.

This also fixes the assertion failures (added in the previous commit) in
gles3conform uniform_buffer_object_index_of_not_active_block,
uniform_buffer_object_inherit_and_override_layouts, and
uniform_buffer_object_repeat_global_scope_layouts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:36 -05:00
Ian Romanick
514f8c7ec7 glsl: Calculate UBO data at link-time
Use the function added in the previous commit.

This temporarily causes gles3conform
uniform_buffer_object_index_of_not_active_block,
uniform_buffer_object_inherit_and_override_layouts, and
uniform_buffer_object_repeat_global_scope_layouts to assertion fail.
This is fixed in the next commit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:36 -05:00
Ian Romanick
0ab7399822 glsl: Add link_uniform_blocks to calculate all UBO data at link-time
Calculate all of the block member offsets, the IndexNames, and
everything else to do with every UBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
681df909e3 glsl: Add a visitor to determine whether a uniform block is ever used
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
d1b4960f9b glsl: Lower UBO references using link-time data instead of compile-time data
Pretty much all of the compile-time, per-compilation unit block data is
about to get the axe.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
90b1dd03e5 glsl: Add gl_uniform_buffer_variable::IndexName field
glGetUniformIndices requires that the block instance index not be
present in the name of queried uniforms.  However,
gl_uniform_buffer_variable::Name will include the instance index.  The
IndexName field is added to handle this difference.

Note that currently IndexName will always point to the same string as
Name.  This will change soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
11d42de681 glsl: Make the align function available elsewhere in the linker
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
e2c95cd674 glsl: Calculate link-time uniform block data without using compile-time block data
Pretty much all of the compile-time, per-compilation unit block data is
about to get the axe.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25 09:07:35 -05:00
Ian Romanick
bd963e12ef glsl: Assert that interfaces, like structures, are not seen as leaf types
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
99b8935ce2 glsl: Add new uniform_field_visitor::process variant
This flavor takes a type and a base name.  It will be used to handle
cases where the block name (instead of the instance name) is used for an
interface block.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
007de494d2 glsl: Recurse into uniform blocks just like uniform structures
v2: Inspite of the spell checker, spell recurse correctly.  Suggested by
Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:35 -05:00
Ian Romanick
25e75b0a13 glsl: Handle instance array declarations
v2: Add a comment and an assertion about the array size in the
non-instance name case.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
5383661092 glsl: Track blocks in the symbol table using the glsl_type instead of the gl_uniform_block
Eventually the gl_uniform_block information won't be calculated until
linking.  Block names need to be checked for name clashes during
compiling, so we have to track it differently.

v2: Update the commit message.  Suggested by Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
9a204bb9f6 glsl: Add new uniform_field_visitor::visit_field variant
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
141e9d42f5 glsl: Modify uniform_field_visitor::visit_field to take a row_major parameter
Not used yet, but the UBO layout visitor will use this.

v2: Remove a spruious hunk.  This is moved to the patch "glsl: Remove
ir_variable::uniform_block".  Suggested by Carl Worth.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
6a0c1bc163 glsl: Modify uniform_field_visitor::recursion to take a row_major parameter
Not used yet, but the UBO layout visitor will use this.

v2: Add some commentary as to why row_major is always set to false in
process.  Suggesed by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
23b7ce3a82 glsl: Add a predicate to determine whether a variable is an interface block
For the first declaration below, there will be an ir_variable named
"instance" whose type and whose instance_type will be the same
glsl_type.  For the second declaration, there will be an ir_variable
named "f" whose type is float and whose instance_type is B2.

"instance" is an interface instance variable, but "f" is not.

uniform B1 {
    float f;
} instance;

uniform B2 {
    float f;
};

v2: Copy the comment message documentation into the code.  Suggested by
Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
3b09603dda glsl: Require that indices into uniform block arrays be constants
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
7a7b44b329 glsl: Add ir_variable::interface_type field
For variables that are in an interface block or are an instance of an
interface block, this is the GLSL_TYPE_INTERFACE type for that block.

Convert the ir_variable::is_in_uniform_block method added in the
previous commit to use this field instead of ir_variable::uniform_block.

v2: Fix the place-holder comment on ir_variable::interface_type.
Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
13be1f4a10 glsl: Add ir_variable::is_in_uniform_block predicate
The way a variable is tested for this property is about to change, and
this makes the code easier to modify.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:34 -05:00
Ian Romanick
17e6f19044 glsl: Generate an interface type for uniform blocks
If the block has an instance name, add the instance name to the symbol
table instead of the individual fields.

Fixes the piglit test interface-name-access-without-interface-name.vert
for real.

v2: Update the comment before the assertion that interface block
definitions won't generate instructions.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-01-25 09:07:33 -05:00
Ian Romanick
491364e1f3 glsl: Add GLSL_TYPE_INTERFACE
Interfaces are structurally identical to structures from the compiler's
point of view.  They have some additional restrictions, and generally
GPUs use different instructions to access them.  Using a different base
type should make this a bit easier.

This commit also adds the glsl_type::interface_packing fields.  For
GLSL_TYPE_INTERFACE types, this will track the specified packing mode.
It is analogous to gl_uniform_buffer::_Packing.

v2: Add serveral missing GLSL_TYPE_INTERFACE cases in switch-statements.

v3: Add information about glsl_type::interface_packing.  Move row_major
checking in glsl_type::record_key_compare from this patch to the
previous patch.  Both suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
7f96a8471e glsl: Add row_major field to glsl_struct_field
For now, this will always be false.  In the near future, an "interface"
type will be added that shares a lot of infrastructure with structures.

v2: Move row_major checking in glsl_type::record_key_compare from the
next patch to this patch.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
51f740cd5a glsl: Refactor out processing of structure fields
This will soon also be used for processing interface block fields.

v2: Add a comment explaining the interface of
ast_process_structure_or_interface_block.  Suggested by Paul Berry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
a39a70c8d4 glsl: Parse interface array size
The size is parsed and stored in the AST, but it is not used yet.
Processing of the array size is added in the patch "glsl: Handle
instance array declarations"

v2: Update the commit message (suggested by Carl Worth).  Add a comment
to ast_uniform_block::array_size (suggested by Paul Berry).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Kenneth Graunke
34f966bdcb glsl: Parse non-array uniform block instance names in GLSL ES 3.00.
In GLSL ES 3.00 (and GLSL 1.50), uniform blocks can have an associated
"instance name", which essentially namespaces the variables inside.

This patch adds basic parsing for this new feature, but doesn't yet hook
it up to actually do anything yet.

It does not support for arrays of interface blocks; a later commit will
take care of that.

This change temporarily regresses the piglit test
interface-name-access-without-interface-name.vert.  This shader failed
to compile before (the expected result), but it failed to compile for
the wrong reason.  This is not a real regression.

v2: Add some comments to ast_uniform_block::instance_name.  Suggested by
Paul Berry.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Kenneth Graunke
0d2e6336a2 glsl: Refactor uniform block parser rules.
The existing code has a lot of duplication; the only difference between
the two cases is whether we merge in an additional layout qualifier.

Apparently creating a layout_qualifieropt rule that can be empty causes
a lot of conflicts and confusion.  However, refactoring out the guts of
the ast_uniform_block creation works fine.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
b226a058db linker: Refactor intra-stage block compatabililty testing
Also slightly change the compatibility test.  Instead of comparing the
offsets of the block variables, compare the packing mode of the blocks.
Ideally we don't want to assign the offsets until a later stage of
linking.

This is put in a new file called link_uniform_blocks.cpp.  Some new
functions related to uniform blocks are going to live in that file as
well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
9a971ab695 mesa: Track the packing mode of a UBO in gl_uniform_buffer
This allows the next patch to verify that two uniform blocks match
without first calculating the locations of the fields.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:33 -05:00
Ian Romanick
ecfb404e8d glsl: Replace most default cases in switches on GLSL type
This makes it easier to find switch-statements that need to be updated
after a new GLSL_TYPE_* is added because the compiler will generate a
warning.

Switch-statements that only had a small number of cases (e.g.,
everything in ir_constant_expression.cpp) were not modified.  I may
regret that decision when we eventually add support for doubles.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-25 09:07:32 -05:00
Eric Anholt
416326e337 i965: Correct gen6+ guardband calculation.
Too much attention was paid to the first paragraphs, and not enough to
the last little note that "oh, by the way, the rendered things
themselves still have to be clipped to just 8192 wide/high".

Fixes GTF's clip.c test with 4096 or higher width on ivb, where one of
the triangles got the upper half of its pixels dropped.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 09:04:52 -05:00
Kenneth Graunke
9db2098d18 i965: Use GL_RED for DEPTH_TEXTURE_MODE in ES 3.0 for unsized formats.
Khronos has apparently decided that depth textures with sized formats
(allowed with ARB_internalformat_query or ES 3.0) should be treated as
GL_RED, while unsized formats (an existing feature) should be treated
as GL_INTENSITY for compatibility with ES 2.0.

Ian is proposing changes to ARB_internalformat_query which will make
this actually legal and consistent.

A similar problem exists with GL 4.2, but we're going to ignore that
for the time being.

Tested on Ivybridge: no Piglit regressions; fixes 4 es3conform tests:
- depth_texture_fbo
- depth_texture_fbo_clear
- depth_texture_teximage
- depth_texture_texsubimage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 09:04:25 -05:00
Chad Versace
7638ede4ce i965: Bump maximum supported ES2 context version to 3.0
Since patch "i965: Validate requested GLES context version in
brwCreateContext", we have been able to create ES 3.0 contexts due to the
max version check.  So...bump the max version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-25 08:30:40 -05:00
Paul Berry
e4f661afc8 i965/Gen6+: Enable ARB_ES3_compatibility extension
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 08:30:40 -05:00
Ian Romanick
1d0e8c109c mesa/es3: Enable ES 3.0 API and shading language version
v2: Add ARB_internalformat_query to the list of required extensions.

v3: Add OES_depth_texture_cube_map to the list of required extensions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-25 08:30:40 -05:00
Vinson Lee
07e215f4ec scons: Add imports.c to builtin_compiler build.
Fixes build regression introduced by commit
eac030e38e.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59835
2013-01-24 22:36:27 -08:00
Chad Versace
0974031f88 i965/fs/gen7: Fix fatal typo in unpackHalf2x16
s/src/src_w/

That little typo, which sneaked into v4 of the previous patch, generates
incorrect fs code.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:51:06 -08:00
Chad Versace
20dfa501b3 i965/fs/gen7: Emit code for GLSL 3.00 pack/unpack operations (v4)
v2: Remove lewd comment. [for idr]
v3: - Optimize away tmp register for packHalf2x16. [for anholt, paul]
    - Improve comments. [for anholt, paul]
    - Reduce near-duplicate code by removing vec4_visitor emit_pack/unpack
      methods. [for chadv]
v4: Factor our UD/W register conversion into helper function. [for anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:31:06 -08:00
Chad Versace
203c12b18f i965/vs/gen7: Emit code for GLSL ES 3.00 pack/unpack operations (v3)
FIXME: This patch emits VS code that violates documented hardware
restrictions and then relies on undocumented behavior that results from
that violation.  This patch passes all tests, but should be fixed ASAP to
conform to the hardware documentation.

v2: Explain undocumented hardware behavior. Improve comments.
v3: Use ALU1 helper methods F32TO16() and F16TO32(). [for anholt]

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:11 -08:00
Chad Versace
7093558b31 i965: Quote the PRM on a HorzStride subtlety
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:11 -08:00
Chad Versace
7e21910f23 i965: Add opcodes for F32TO16 and F16TO32
The GLSL ES 3.00 operations packHalf2x16 and unpackHalf2x16 will emit
these opcodes.

- Define the opcodes BRW_OPCODE_{F32TO16,F16TO32}.
- Add the opcodes to the brw_disasm table.
- Define convenience functions brw_{F32TO16,F16TO32}.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
ee0ed52d69 i965: Lower the GLSL ES 3.00 pack/unpack operations (v2)
On gen < 7, we fully lower all operations to arithmetic and bitwise
operations.

On gen >= 7, we fully lower the Snorm2x16 and Unorm2x16 operations, and
partially lower the Half2x16 operations.

v2:
  - Comment that scalarization is needed only for SOA code [for idr].
  - Replace switch-statement with if-statement [for idr].
  - Remove misplaced hunk from previous patch [found by idr].

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
b9f56ea923 glsl: Add lowering pass for GLSL ES 3.00 pack/unpack operations (v4)
Lower them to arithmetic and bit manipulation expressions.

v2: Rewrite using ir_builder [for idr].
v3: Comment typos. [for mattst88]
v4: Fix arithmetic error in comments.
    Factor out a shift instruction.
    Don't heap allocate factory.instructions.
    [for paul]

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Matt Tuner <mattst88@gmail.com> (v3)
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v4)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
9d7931ddf0 glsl: Fix type-deduction for and/or/xor expressions
In ir_expression's constructor, the cases for {bit,logic}_{and,or,xor}
failed to handle the case when both operands were vectors.

Note: This is a candidate for the stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
ccf87f2199 glsl: Reformat and/or/xor cases in ir_expression ctor
Replace tabs with spaces. According to docs/devinfo.html, Mesa's
indetation style is:
  indent -br -i3 -npcs --no-tabs infile.c -o outfile.c

This patch prevents whitespace weirdness in the next patch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
f859e4fbd1 glsl/ir_builder: Add helpers for making if-statements
Add two overloaded variants of
    ir_if *if_tree()

The new functions allow one to chain together if-trees within a single C++
expression that resembles a real if-statement.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
a32bc53029 glsl/ir_builder: Add enum writemask
Using this enum improves the readibility of calls to assign(), whose third
argument is a writemask.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
a6479ef968 glsl/ir_factory: Add helper method for making an ir_constant
Add method ir_factory::constant.  This little method constructs an
ir_constant using the factory's mem_ctx.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
5790174e37 glsl/ir_builder: Add more helpers for constructing expressions
Add the following functions, each of which construct the similarly named
ir expression:
    div, round_even, clamp

    equal, less, greater, lequal, gequal

    logic_not, logic_and, logic_or

    bit_not, bit_or, bit_and, lshift, rshift

    f2i, i2f, f2u, u2f, i2u, u2i

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
fafcbf52b7 glsl/ir_factory: Initialize members to NULL in constructor
This eliminates unexpected behavior due to unitialized values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
542c7a3022 glsl: Evaluate constant GLSL ES 3.00 pack/unpack expressions (v3)
That is, evaluate constant expressions of the following functions:
  packSnorm2x16  unpackSnorm2x16
  packUnorm2x16  unpackUnorm2x16
  packHalf2x16   unpackHalf2x16

v2: Reuse _mesa_pack_float_to_half and its inverse to evaluate
    pack/unpackHalf2x16. [for idr]
v3: Whitespace fixes. [for mattst88]
    Don't cast neg floats directly to uint16; use an intermediate cast to
    int16. [for paul]

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
529b6d1f3d mesa: Remove rounding bias in _mesa_float_to_half()
Not all float32 values can be exactly represented as a float16.
_mesa_float_to_half() rounded such intermediate float32 values to zero by
truncating unrepresentable bits in the mantissa.

This patch improves _mesa_float_to_half() by rounding intermediate float32
values to the nearest float16; when the float32 is exactly between two
float16 values we round to the one with an even mantissa. This behavior is
preferred over the old behavior because:
  - It has reduced bias relative to the old behavior.

  - It reproduces the behavior of real hardware: opcode F32TO16 in
    Intel's GPU ISA.

  - By reproducing the behavior of the GPU (at least on Intel hardware),
    compile-time evaluation of constant packHalf2x16 GLSL expressions will
    result in the same value as if the expression were executed on the GPU.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:10 -08:00
Chad Versace
eac030e38e mesa,glsl: Move round_to_even() from glsl to mesa/main (v2)
Move round_to_even's definition to mesa/main so that _mesa_float_to_half()
can use it in order to eliminate rounding bias.

In additon to moving the fuction definition, prefix its name with "_mesa",
just as all other functions in mesa/main are prefixed.

v2: Fix Android build.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:24:07 -08:00
Chad Versace
1fafd00839 glsl/standalone_scaffolding: Add stub for _mesa_warning()
A subsequent patch will add mesa/main/imports.c as a dependency to the
compiler, which in turn requires that _mesa_warning() be defined.

The real definition of _mesa_warning() is in mesa/main/errors.c, but to
pull that file into the standalone scaffolding would require transitively
pulling in the dispatch tables.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
ee5921ad0d glsl: Extend ir_expression_operation for GLSL 3.00 pack/unpack functions (v2)
For each function {pack,unpack}{Snorm,Unorm,Half}2x16, add a corresponding
opcode to enum ir_expression_operation.  Validate the new opcodes in
ir_validate.cpp.

Also, add opcodes for scalarized variants of the Half2x16 functions.  (The
code generator for the i965 fragment shader requires that all vector
operations be scalarized.  A lowering pass, to be added later, will
scalarize the Half2x16 functions).

v2: Fix assertion message in ir_to_mesa [for idr].

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
3a88d71d35 glsl: Add IR lisp for GLSL ES 3.00 pack/unpack functions
For each of the following functions, add a declaration to
builtins/profiles/300es.glsl and create new file
builtins/ir/${funcname}.ir:

  packSnorm2x16  unpackSnorm2x16
  packUnorm2x16  unpackUnorm2x16
  packHalf2x16   unpackHalf2x16

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Tuner <mattst88@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
6f8f919a53 glsl: Fix typo in comment
s/num_operands()/get_num_operands()/

Discovered because Eclipse failed to resolve the false reference.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:11:41 -08:00
Chad Versace
ca7d332253 i965/disasm: Fix horizontal stride of dest registers
The bug: The printed horizontal stride was the numerical value of the
  BRW_HORIZONTAL_$N enum.
The fix: Translate the enum before printing.

Note: This is a candidate for the stable releases.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-24 21:10:46 -08:00
Paul Berry
d1f2e9699f intel: Fix glCopyTexSubImage on buffers whose width >= 32kbytes
When possible, glCopyTexSubImage calls are performed using the
hardware blitter.  However, according to the Ivy Bridge PRM, Vol1
Part4, section 1.2.1.2 (Graphics Data Size Limitations):

    The BLT engine is capable of transferring very large quantities of
    graphics data. Any graphics data read from and written to the
    destination is permitted to represent a number of pixels that
    occupies up to 65,536 scan lines and up to 32,768 bytes per scan
    line at the destination. The maximum number of pixels that may be
    represented per scan line’s worth of graphics data depends on the
    color depth.

With an RGBA32F color buffer (which has 16 bytes per pixel) this
imposes a maximum width of 2048 pixels.  Other pixel formats have
accordingly larger limits.

To make matters worse, if the pitch of the buffer is 32k or greater,
intel_copy_texsubimage's call to intelEmitCopyBlit will overflow
intelEmitCopyBlit's src_pitch and dst_pitch parameters (which are
16-bit signed integers).

We can conveniently avoid both problems by avoiding use of the blitter
when the miptree's pitch is >= 32k.

Fixes gles3conform "framebuffer_blit_functionality_magnifying_blit"
tests when the buffer width is equal to 8192.

Note: this is very similar to the recent patch "intel: Fix ReadPixels
on buffers whose width >= 32kbytes" except that it applies to
glCopyTexSubImage instead of glReadPixels.  In a future patch it would
be nice to refactor the code so that (a) overflow is avoided, and (b)
intelEmitCopyBlit is responsible for checking whether the blitter can
handle the width, so that all callers of intelEmitCopyBlit work
properly, rather than just these two.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-24 18:35:08 -08:00
Paul Berry
c6a50ddfcb glsl: Allow varying structs in GLSL ES 3.00 and GLSL 1.50.
Previously I thought that varying structs had been added to GLSL ES
3.00 by mistake, because chapter 11 of the GLSL ES 3.00 spec
("Counting of Inputs and Outputs") failed to mention how structs
should be handled.  Khronos has clarified
(https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9828) that varying
structs are indeed required, and that chapter 11 will be modified to
indicate that the minimal reference packing algorithm flattens varying
structs to their individual components.

Mesa doesn't flatten varying structs to their individual components,
but this is ok, since it packs varyings of all kinds with no wasted
space at all (except where this is impossible due to differing
interpolation modes), so it will outperform the minimal reference
packing algorithm in all but the most pathological cases.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:49 -08:00
Paul Berry
cd53457ffa glsl: Disable transform feedback of varying structs.
It is not clear from the GLSL ES 3.00 spec how transform feedback is
supposed to apply to varying structs:

- There is no specification for how the structure is to be packed when
  it is recorded into the transform feedback buffer.

- There is no reasonable value for GetTransformFeedbackVarying to
  return as the "type" of the variable.

We currently have a Khronos bug requesting clarification on how this
feature is supposed to work
(https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9856).

This patch just disables transform feedback of varying structs for
now; we can implement the proper behaviour once we find out from
Khronos what it is.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:46 -08:00
Paul Berry
1ecd23dea9 glsl: Update lower_packed_varyings to handle varying structs.
This patch adds code to lower_packed_varyings to handle varyings of
type struct.  Varying structs are currently packed in the most naive
possible way (in declaration order, with no gaps), so there is a
potential loss of runtime efficiency.  In a later patch it would be
nice to replace this with a "flattening" approach (wherein a varying
struct is flattened to individual varyings corresponding to each of
its structure elements), so that the linker can align each structure
element independently.  However, that would require a significantly
more complex implementation.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:43 -08:00
Paul Berry
88e4bfde26 glsl: Generalize compute_packing_order for varying structs.
This patch paves the way for allowing varying structs by generalizing
varying_matches::compute_packing_order to handle any type of varying.
Previously, we packed in the order (vec4, vec2, float, vec3), with
matrices being packed according to the size of their columns.  Now, we
pack everything according to its number of components mod 4, in the
order (0, 2, 1, 3).

There is no behavioural change for vectors.  Matrices are now packed
slightly differently:

- mat2x2 gets assigned PACKING_ORDER_VEC4 instead of
  PACKING_ORDER_VEC2.  This is slightly better, because it guarantees
  that the matrix occupies a single varying slot.

- mat2x3 gets assigned PACKING_ORDER_VEC2 instead of
  PACKING_ORDER_VEC3.  This is kind of a wash.  Previously, mat2x3 had
  a 25% chance of having neither of its columns double parked, a 50%
  chance of having exactly one of its columns double parked, and a 25%
  chance of having both of its columns double parked.  Now it always
  has exactly one of its columns double parked.

- mat3x3 gets assigned PACKING_ORDER_SCALAR instead of
  PACKING_ORDER_VEC3.  This doesn't affect much, since in both cases
  there is no guarantee of how the matrix will be aligned.

- mat4x2 gets assigned PACKING_ORDER_VEC4 instead of
  PACKING_ORDER_VEC2.  This is slightly better for the same reason as
  in mat2x2.

- mat4x3 gets assigned PACKING_ORDER_VEC4 instead of
  PACKING_ORDER_VEC3.  This is slightly better for the same reason as
  in mat2x2.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:40 -08:00
Paul Berry
3680864c0b glsl: Disable structure splitting for shader ins/outs.
Previously, it didn't matter whether structure splitting tried to
split shader ins/outs, because structs were prohibited from being used
for shader ins/outs.  However, GLSL 3.00 ES supports varying structs.
In order for varying structs to work, we need to make sure that
structure splitting doesn't get applied to them, because if it does,
then the linker won't be able to match up varyings properly.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:37 -08:00
Paul Berry
42a29d89fd glsl: Eliminate ambiguity between function ins/outs and shader ins/outs
This patch replaces the three ir_variable_mode enums:

- ir_var_in
- ir_var_out
- ir_var_inout

with the following five:

- ir_var_shader_in
- ir_var_shader_out
- ir_var_function_in
- ir_var_function_out
- ir_var_function_inout

This eliminates a frustrating ambiguity: it used to be impossible to
tell whether an ir_var_{in,out} variable was a shader in/out or a
function in/out without seeing where the variable was declared in the
IR.  This complicated some optimization and lowering passes, and would
have become a problem for implementing varying structs.

In the lisp-style serialization of GLSL IR to strings performed by
ir_print_visitor.cpp and ir_reader.cpp, I've retained the names "in",
"out", and "inout" for function parameters, to avoid introducing code
churn to the src/glsl/builtins/ir/ directory.

Note: a couple of comments in the code seemed to indicate that we were
planning for a possible future in which geometry shaders could have
shader-scope inout variables.  Our GLSL grammar rejects shader-scope
inout variables, and I've been unable to find any evidence in the GLSL
standards documents (or extensions) that this will ever be allowed, so
I've eliminated these comments.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:30 -08:00
Paul Berry
7d51ead56e glsl: Clean up case statement in builtin_variables.cpp's add_variable.
The case statement purported to handle the addition of ir_var_const_in
and ir_var_inout builtin variables.  But no such variables exist.
This patch removes the unnecessary cases, and adds a comment
explaining why they're not needed.

Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 16:30:27 -08:00
Kenneth Graunke
fce9e5d41b i965/vs: Do headerless texturing for texelFetchOffset().
For texelFetchOffset(), we just add the texel offsets to the coordinate
rather than using the message header's offset fields.  So we don't
actually need a header on Gen5+.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-24 15:19:08 -08:00
Matt Turner
0412864ae8 libgl-xlib/build: Link with C++ when LLVM is used
Also link-in libX11 and libXext.

Tested-by: Brian Paul <brianp@vmware.com>
2013-01-24 14:00:27 -08:00
Paul Berry
b50c0feb2c intel: Fix ReadPixels on buffers whose width >= 32kbytes
When possible, glReadPixels calls are performed using the hardware
blitter.  However, according to the Ivy Bridge PRM, Vol1 Part4,
section 1.2.1.2 (Graphics Data Size Limitations):

    The BLT engine is capable of transferring very large quantities of
    graphics data. Any graphics data read from and written to the
    destination is permitted to represent a number of pixels that
    occupies up to 65,536 scan lines and up to 32,768 bytes per scan
    line at the destination. The maximum number of pixels that may be
    represented per scan line’s worth of graphics data depends on the
    color depth.

With an RGBA32F color buffer (which has 16 bytes per pixel) this
imposes a maximum width of 2048 pixels.

To make matters worse, if the pitch of the buffer is 32k or greater,
intel_miptree_map_blit's call to intelEmitCopyBlit will overflow
intelEmitCopyBlit's src_pitch and dst_pitch parameters (which are
16-bit signed integers).

We can conveniently avoid both problems by avoiding the readpixels
blit path when the miptree's pitch is >= 32k.

Fixes gles3conform "half_float" tests when the buffer width is greater
than 2048.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-24 13:17:07 -08:00
Ian Romanick
ac158f8ee7 intel: callocing a 32 byte temp is silly, so don't
I believe that the size used to vary, so the dynamic allocation is
necessary.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-24 13:57:46 -05:00
Marek Olšák
7a23029b2f st/mesa: implement ARB_internalformat_query v2
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-24 18:39:28 +01:00
Marek Olšák
041234ee1e st/mesa: advertise OES_depth_texture_cube_map if GLSL 1.30 is supported
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-24 18:38:49 +01:00
Marek Olšák
4f0563a658 st/dri: disallow recursion in dri_flush
ST_FLUSH_FRONT may call driThrottle, which is implemented with dri_flush.
This prevents double flush as well as fence leaks caused by a recursion
in the middle of throttling.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58839

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 18:22:14 +01:00
Marek Olšák
fffe3e0908 st/dri: add null-pointer check, remove duplicated local variable
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 18:22:14 +01:00
Tom Stellard
0261b4ecdb Revert "Revert "targets/opencl: Link against libgallium.la instead of libgallium.a""
This reverts commit 7824ab8070.

Now that we force linking with LLVM shared libs when building clover,
we can link against libgallium.la with no problems.
2013-01-24 15:45:32 +00:00
Tom Stellard
cf69a591e1 configure.ac: Force use of LLVM shared libs with --enable-opencl v2
If we build clover with LLVM static libraries, then clover and also each
pipe_*.so driver that is built will contain their own static copy of
LLVM.  The recent automake changes have uncovered a problem where
the pipe_*.so drivers try to use clover's LLVM symbols.  This causes
LLVM's static registry objects to be initialized each time
a pipe_*.so driver is loaded by clover.  Initializing these objects
multiple times is not allowed and leads to assertion failures in the
LLVM code.

We can avoid all these problems by having clover and all the pipe_*.so
drivers link against the same LLVM shared library.

https://bugs.freedesktop.org/show_bug.cgi?id=59334
https://bugs.freedesktop.org/show_bug.cgi?id=59534

v2:
  - Fix shared library detection when LLVM is built with CMake
2013-01-24 15:45:18 +00:00
Tom Stellard
69d639ba8b configure.ac: Compute the required llvm static libraries only once
In order to determine which static LLVM libraries are needed we pass
a list of components to llvm-config and it generates the list of
library dependencies for us.  The advantage of only calling llvm-config
one time is that it can determine if two components depend on the same
library and then add it to the output list only once.  The old practice
of having each driver call llvm-config to add its own dependencies to
$(LLVM_LIBS) caused many libraries to be added to this variable multiple
times.
2013-01-24 15:44:53 +00:00
Michel Dänzer
35f0dc2cc7 radeonsi: Fall back to dummy pixel shader instead of trying indirect addressing.
Indirect addressing isn't fully handled yet.

Fixes crashes with piglit tests using indirect addressing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:48 +01:00
Marek Olšák
68cebb9a8f radeonsi: make sure copying of all texture formats is accelerated
[ Cherry-picked from r600g commit 7c371f4695 ]

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:31 +01:00
Michel Dänzer
de4e448095 radeonsi: Handle PIPE_FORMAT_L32A32_S/UINT for rendering.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:31 +01:00
Michel Dänzer
d0096dfa85 radeonsi: Make sure to use float number format for packed float colour formats.
These aren't covered by UTIL_FORMAT_TYPE_FLOAT.

Fixes 15 piglit (sub)tests.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-24 08:46:31 +01:00
Ian Romanick
5bd86b26df intel: Enable S3TC extensions always
Always enable the use of pre-compressed texture data.  The ability to
perform on-line compression still requires the presence of libtxc_dxtn
or an explicit driconf over-ride.  Applications that just want to submit
precompessed data when an on-line compressor is not available can look
for the GL_EXT_texture_compression_dxt1 and
GL_ANGLE_texture_compression_dxt[35] extensions.

v2: Only enable the extensions that do not require on-line compression
by default.  The previous statement "This should not impact many (if
any) real applications." proved to be false for at least Sauerbraten.
This application mostly submits pre-compressed data, but it also can
submit uncompressed data that it asks the driver to compress.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Acked-by: Eric Anholt <eric@anholt.net> [v1]
Acked-by: Lee Salzman <lsalzman@gmail.com>
2013-01-23 23:38:04 -05:00
Ian Romanick
53f8251107 mesa: Like EXT_texture_compression_dxt1, advertise ANGLE_texture_compression_dxt in all APIs
This is technically outside the ANGLE spec, but it seems unlikely to
cause any harm.

v2: Simplify the extension checks by assuming the ANGLE extension will
always be enabled by any driver that enables the EXT.  Suggested by
Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Lee Salzman <lsalzman@gmail.com>
2013-01-23 23:38:04 -05:00
Ian Romanick
d45c6c817d mesa: Simplify _mesa_choose_tex_format handling of compressed formats
For non-generic compressed format we assert two things:

1. The format has already been validated against the set of available
   extensions.

2. The driver only enables the extension if it supports all of the
   formats that are part of that extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 23:38:04 -05:00
Ian Romanick
a021881ccd mesa: Use a single flag for the S3TC extensions that don't require on-line compression
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Lee Salzman <lsalzman@gmail.com>
2013-01-23 23:38:04 -05:00
Carl Worth
8059c2ea90 i965: Use swizzles to force R, G, and B to 0.0 for ALPHA textures.
Similar to the previous commit, we may be using a texture with actual RGBA
storage for the GL_ALPHA format, so force the color values to 0.0.

This commit fixes the following piglit (sub) tests:

	EXT_texture_snorm/fbo-blending-formats
		GL_ALPHA16_SNORM
	        GL_ALPHA8_SNORM
		GL_ALPHA_SNORM

Note: Haswell bypasses this swizzle code, so may require an independent fix
for this bug.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 17:41:09 -08:00
Carl Worth
33599433c7 i965: Use swizzles to force alpha to 1.0 for RED, RG, or RGB textures.
We may be using a texture with actual RGBA storage for these formats, so force
the alpha value read to 1.0.

This commit fixes the following piglit (sub) tests:

	ARB_texture_float/fb-blending-formats
		GL_RGB16F_ARB
	EXT_framebuffer_object/fbo-blending-formats
                GL_RGB10
		GL_RGB12
	        GL_RGB16
	EXT_texture_snorm/fbo-blending-formats
		GL_RGB16_SNORM
		GL_RGB8_SNORM
		GL_RGB_SNORM

These test improvements depend on the previous commit as well. That commit
smashes alpha to 1.0 for the case of ReadPixels (so fixes "FBO testing" as
reported by this test), while this commit smashes alpha to 1.0 for the case of
texturing (fixed the "window testing" as reported by this test).

Note: Haswell bypasses this swizzle code, so may require an independent fix
for this bug.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 17:40:52 -08:00
Carl Worth
570ed2be7d ReadPixels: Force ALPHA to 1 while rebasing RGBA values for GL_RGB format
When performing a ReadPixels operation, we may be reading from a buffer that
stores alpha values, but that is actually representing a buffer with no alpha
channel. In this case, while rebasing the values, touch up all alpha values
read to 1.0.

This commit fixes the following piglit (sub) tests:

	ARB_texture_float/fbo-colormask-formats
		GL_RBG16F_ARB
	EXT_texture_snorm/fbo-colormask-formats
		GL_RGB16_SNORM
		GL_RGB8_SNORM
		GL_RGB_SNORM

It likely improves the results of other tests as well, but a PASS remains
elusive due to additional bugs.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-01-23 17:40:52 -08:00
Carl Worth
b961ba44ed i965: Examine _BaseFormat when deciding to perform xRGB_alpha fixups
The renderbuffer's Format field may have an alpha channel even when the
underlying _BaseFormat does not. This can happen when mesa chooses to use
RGBA16 for an RGB16 format, for example.

So look at _BaseFormat when deciding whether to fixup the blend factors.

This test improves the results of at least the following piglit tests:

	EXT_frambebuffer_object/fbo-blending-formats
        	{GL_RGB10, GL_RGB12, GL_RGB16}
	EXT_texture_snorm/fbo-blending-formats
		{GL_RGB16_SNORM, GLRGB8_SNORM, GL_RGB_SNORM}

But none of these actually change from FAIL to PASS yet. The R, G, and B probe
values are fixed with this commit, but the tests still fail because the alpha
values are still wrong.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-23 17:40:24 -08:00
José Fonseca
0642437606 scons: Fix source lists parsing on Windows.
/ vs \ mismatch was causing .objs to be put in the source tree, causing
breakeage when doing different build types in the same tree (eg., debug
vs release).

Fix this by normalizing everything to / slashes.

It's probably a good idea to purge all .objs from source tree to prevent
issues completely.
2013-01-23 12:11:53 +00:00
Matt Turner
60315e3eaf GL3.txt: i965 supports ARB_base_instance
Added in commit cdd3f549.
2013-01-22 21:34:25 -08:00
Brian Paul
bd8045d4c5 wmesa: include api_exec.h to fix compilation 2013-01-22 16:44:11 -07:00
Brian Paul
26a05b5005 draw: fix MSVC divide-by-zero compilation error
Kind of lame, but it works.
2013-01-22 16:44:11 -07:00
Kenneth Graunke
cdd3f5496a i965: Implement the GL_ARB_base_instance extension.
Thanks to Fredrik Höglund, all the hard work was already done.

Tested using a modified oglconform (that actually runs these tests on
our driver); it looks like there may be some bugs when using client
arrays.  All applicable non-compatibility tests passed.

For now, only enable it in core profiles.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ian Romanick <idr@freedesktop.org>
2013-01-22 15:41:30 -08:00
Matt Turner
0d108116bd glsl/build: Build libglcpp and libglslcore in builtin_compiler
And reuse them if not cross compiling.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:45 -08:00
Matt Turner
952e6e9f3b glsl/Makefile.sources: Correct BUILTIN_COMPILER_CXX_FILES
Squashed with two reverts:

Revert "android: Update for builtin_stubs.cpp move"

This reverts commit c0def90ede.

Revert "scons: Update for builtin_stubs.cpp"

This reverts commit 8ac4b82699.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Tested-on-Android-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-22 14:33:41 -08:00
Matt Turner
2a71054396 build: Use AX_PROG_FLEX
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47248
2013-01-22 14:33:38 -08:00
Matt Turner
b68b85224d build: Use AX_PROG_BISON
No one tests yacc/byacc. Let's just request bison specifically.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46815
2013-01-22 14:33:31 -08:00
Matt Turner
3791ce05eb builtin_compiler/build: Use generated parser files
... instead of generating them again.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:28 -08:00
Matt Turner
efd201caa5 glsl/build: Build tests via the glsl Makefile
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:24 -08:00
Matt Turner
86d30dea3c glsl/build: Build glcpp via the glsl Makefile
Removing the subdirectory recursion provides a small speed up.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:20 -08:00
Matt Turner
cc9f609cb9 glsl/build: Don't build builtin_compiler separately if not cross compiling
Reduces the number of times that src/glsl/ is compiled when not cross
compiling.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:16 -08:00
Matt Turner
569f0e400a glsl/build: Don't build glsl_compiler
Use glslparsertest from piglit instead.

Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 14:33:07 -08:00
Brian Paul
ab74fee5e1 draw: fix problem in screen-space interpolation clip code
I don't see how this could have ever worked right.

The screen-space interpolation code uses the vertex->data[pos_attr]
position which contain window coords.  But window coords are only
computed for the unclipped vertices; the clipped vertices have
undefined window coords (see draw_cliptest_tmp.h).

Use the vertex clip coords instead which are always defined.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=55476
(piglit fbo-blit-stretch failure on softpipe)

Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
ed643d6b2f draw: improve the clipper debug/printf code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
4a938ef713 draw: add new debug code and comments in clip code template
In debug builds, set clipped vertex window coordinates to NaN values
to help debugging.  Otherwise, we're just leaving the coordinate in clip
space and it's invalid to use it later expecting it to be a window coord.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
547a418888 swrast: fix blit code's nearest/linear coordinate arithmetic
Fixes piglit's fbo-blit-stretch test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
b70b486249 swrast: fix incorrect width for direct/nearest blit
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Brian Paul
728bf86a23 swrast: move resampleRow setup code in blit_nearest()
The resampleRow setup depends on pixelSize.  For color buffers,
we don't know the pixelSize until we're in the buffer loop.  Move
that code inside the loop.

Fixes: http://bugs.freedesktop.org/show_bug.cgi?id=59541

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-22 14:53:58 -07:00
Andreas Boll
0a60ea4ddc docs: import release notes for 9.0.2, add news item 2013-01-22 21:28:51 +01:00
José Fonseca
9a0973044e scons: Disable frame pointer omission for all build types except release.
In particular for checked builds, where debug_backtrace_capture relies
on it.
2013-01-22 20:19:28 +00:00
José Fonseca
de0057caa6 nouveau/build: Fix build failures when drm is not in /usr/include.
Fixes failures to include libdrm/nouveau.h when drm is not installed in
/usr/include.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-22 19:10:47 +00:00
Michel Dänzer
a56dfd99e2 radeon/llvm: Handle LP_CHAN_ALL in emit_fetch_immediate().
Fixes piglit spec/ARB_sampler_objects/sampler-incomplete and
spec/EXT_texture_swizzle/depth_texture_mode_and_swizzle.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-22 18:50:02 +01:00
Kenneth Graunke
121d19de92 build: Fix build on systems where /usr/bin/python isn't python 2.
configure.ac sets up a PYTHON2 variable, which is what we want
AX_PYTHON_MODULE to use (since we only use Python 2 for now).

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31598
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-22 09:05:32 -08:00
Ian Romanick
148fc6d537 mesa/es3: Apply stricter multisample blit rules for ES3.
Fixes gles3conform
framebuffer_blit_error_blitframebuffer_multisampled_read_buffer_different_origins.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-22 03:26:24 -05:00
Ian Romanick
d7475c7966 mesa/es3: Disallow FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE query of DEPTH_STENCIL_ATTACHMENT
This error was added in the 3.0.1 update to the OpenGL ES 3.0 spec.
Fixes the updated gles3conform packed_depth_stencil_parameters test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-22 03:26:24 -05:00
Ian Romanick
9cb64a4cb6 mesa: Don't allow blits to / from the same buffer in OpenGL ES 3.0
Fixes gles3conform test CoverageES30.  It temporarily regresses some
framebuffer_blit tests, but the failing subcases have been determined to
be invalid for OpenGL ES 3.0.

v2: Fix typo in depth (and stencil) RB checking.  Noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-22 03:26:24 -05:00
Eric Anholt
85c2e99039 mesa: Remove exec thunks from the dlist.c module.
These were introduced in 2000 during a rework of the TNL module (commit
cab974cf6c), though I'm having a hard time
finding an instance there of one of these Exec functions being changed
at runtime.

Regardless, as far as I can tell now, these functions don't get changed,
by grepping for calls to SET_* to change the dispatch table (we do change
functions in GLvertexformat at runtime, but those don't overlap with
this set of functions).  Remove them and just let them be initialized to
the same functions as are in the Exec table.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
ab4c549378 mesa: Initially populate the display list with the exec list.
This cuts out a ton of code to make functions not set to a save_ variant
match.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
7820e2dd8d mesa: Delay display list save dispatch setup until Exec is set up.
This will let us copy from the Exec dispatch to deal with our commands that
don't get compiled into display lists.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
be4b1664fb mesa: Make the drivers call a non-code-generated dispatch table setup.
I want to drive the Save dispatch table setup from this same function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:48 -08:00
Eric Anholt
ced98f17ef mesa: Remove the size argument from _mesa_alloc_dispatch_table().
All callers are in Mesa core and all use _gloffset_COUNT, so just rely on
the already baked-in use of _gloffset_COUNT in the function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
cb49016622 mesa: Remove two of the now unused ASSERT_OUTSIDE_BEGIN_END macros.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
a9754793da mesa: Drop manual checks for outside begin/end.
We now have a separate dispatch table for begin/end that prevent these
functions from being entered during that time.  The
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to
change any return values or introduce new error-only stubs at this
point.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
c572251417 mesa: Install a minimal dispatch table during glBegin()/glEnd().
This is a step toward getting rid of ASSERT_OUTSIDE_BEGIN_END() in Mesa.

v2: Finish create_beginend_table() comment, move loopback API init into it,
    and add a const flag. (suggestions by Brian)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
2013-01-21 21:26:47 -08:00
Eric Anholt
0aaf0445ba mesa: Remove the dead PrepareExecBegin() driver hook.
This was used in i965 for a while, but no more.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:47 -08:00
Eric Anholt
23916cae8e mesa: Use an early return to unindent most of vbo_exec_Begin/End().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:46 -08:00
Eric Anholt
7b3c8b3747 mesa: Improve a glTexEnv error message by looking up the enum.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:46 -08:00
Eric Anholt
4d8f72f2bc mesa: Fix regression in dlist save primitive tracking.
My change 7ca4f07b5b caused errors to not
be thrown when they should, because the new if statement for ExecuteFlag
made the CurrentSavePrimitive not get set.  And on further review, we
shouldn't be validating our primitive in GL_COMPILE mode, since the
command shouldn't be executed yet.

Partially fixes piglit gl-1.0-beginend-coverage.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-21 21:26:46 -08:00
Maarten Lankhorst
3a91e7955a vl: round next_msc to integer frame, and kill skew_msc
This reduces jitter slightly in a cleaner way, without desynchronizing mplayer2 as badly
when falling behind.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-01-21 23:49:56 +01:00
José Fonseca
71c87e42e1 scons: Fix dependencies of generated headers.
It appears that scons implicit dependency scanners fail to chain
dependencies of generated headers when these are outside the build tree.

This patch ensures generated source files are _always_ put in the build
tree. I'm not 100% this will fix all depency issues, but from my
experiments it does seem to fix this.

NOTE: For this to be effective it is necessary to clean the source tree
from generated header/source files.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-21 19:10:54 +00:00
Ian Romanick
75b7e1df13 intel: Don't expose XRGB8888 visuals any more
There really isn't any point.  There is no resource savings, and we have
to do gymnastics in the driver to make it work.

There are also bad interactions with multisampling and OpenGL ES 3.0.
In ES3, a multisample-to-singlesample blit must have identical source
and destination format.  This means a multisample RGBA8 to singlesample
RGB8 (window) blit will generate an error.  Also in ES3, RGB8 is not a
renderable format.  This means that the application CANNOT make an RGB8
multisample renderbuffer.

As a result, if an application gets an RGB8 window and wants to do
multisample FBO rendering, it will probably break.

"Fixes" gles3conform
framebuffer_blit_functionality_multisampled_to_singlesampled_blit test
on RGB8 visuals.

v2: Fix 'formats' array size.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2013-01-21 13:34:34 -05:00
Ian Romanick
9bdf5bef76 i965: Enable floating-point textures always
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2013-01-21 11:46:21 -05:00
Marek Olšák
4a1af434e6 r300g: add a workaround for the AA colorbuffer addressing bug on R500 2013-01-21 17:00:51 +01:00
Marek Olšák
7bfbf5b287 r300g: allow resolutions up to 1280x1024 with AA optimizations on 1-pipe cards
because single-pipe cards have bigger CMASK RAM
2013-01-21 17:00:51 +01:00
Marek Olšák
b7cb655298 r300g: enable AA optimizations for the RGBA16F format 2013-01-21 17:00:51 +01:00
Marek Olšák
6f6112a2b9 radeonsi: More assorted depth/stencil changes ported from r600g.
[ Squashed port of the following r600g commits: - Michel Dänzer ]

commit 428e37c2da
Author: Marek Olšák <maraeo@gmail.com>
Date:   Tue Oct 2 22:02:54 2012 +0200

    r600g: add in-place DB decompression and texturing with DB tiling

    The decompression is done in-place and only the compressed tiles are
    decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F.

    The texture unit is programmed to use non-displayable tiling and depth
    ordering of samples, so that it can fetch the texture in the native DB format.

    The latest version of the libdrm surface allocator is required for stencil
    texturing to work. The old one didn't create the mipmap tree correctly.
    We need a separate mipmap tree for stencil, because the stencil mipmap
    offsets are not really depth offsets/4.

    There are still some known bugs, but this should save some memory and it also
    improves performance a little bit in Lightsmark (especially with low
    resolutions; tested with Radeon HD 5000).

    The DB->CB copy is still used for transfers.

commit e2f623f1d6
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Jul 28 13:55:59 2012 +0200

    r600g: don't decompress depth or stencil if there isn't any

commit 43e226b6ef
Author: Marek Olšák <maraeo@gmail.com>
Date:   Wed Jul 18 00:32:50 2012 +0200

    r600g: optimize uploading depth textures

    Make it only copy the portion of a depth texture being uploaded and
    not the whole 2D layer.

    There is also a little code cleanup.

commit b242adbe5c
Author: Marek Olšák <maraeo@gmail.com>
Date:   Wed Jul 18 00:17:46 2012 +0200

    r600g: remove needless wrapper r600_texture_depth_flush

commit 611dd52942
Author: Marek Olšák <maraeo@gmail.com>
Date:   Wed Jul 18 00:05:14 2012 +0200

    r600g: init_flushed_depth_texture should be able to report errors

commit 80755ff563
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Jul 14 17:06:27 2012 +0200

    r600g: properly track which textures are depth

    This fixes the issue with have_depth_texture never being set to false.

commit fe1fd67556
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 03:10:37 2012 +0200

    r600g: don't flush depth textures set as colorbuffers

    The only case a depth buffer can be set as a color buffer is when flushing.

    That wasn't always the case, but now this code isn't required anymore.

commit 5a17d8318e
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 02:14:18 2012 +0200

    r600g: flush depth textures bound to vertex shaders

    This was missing/broken. There are also minor code cleanups.

commit dee58f94af
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 01:54:24 2012 +0200

    r600g: do fine-grained depth texture flushing

    - maintain a mask of which mipmap levels are dirty (instead of one big flag)
    - only flush what was requested at a given point and not the whole resource
      (most often only one level and one layer has to be flushed)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 15:42:28 +01:00
Vadim Girlin
bc398f908f radeonsi: improve flushed depth texture handling
Use r600_resource_texture::flished_depth_texture for GPU access, and
allocate it in the VRAM. For transfers we'll allocate texture in the GTT
and store it in the r600_transfer::staging.

Improves performance when flushed depth texture is frequently used by the
GPU, e.g. in Lightsmark

[ Ported from r600g commit 3770847960 ]

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 15:42:28 +01:00
Marek Olšák
bfb405ceee radeonsi: Assorted depth/stencil changes ported from r600g.
[ Squashed port of the following r600g commits: - Michel Dänzer ]

commit c1e8c845ea
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Jul 7 19:10:00 2012 +0200

    r600g: inline r600_hw_copy_region

commit 4891c5dc64
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Jun 25 22:53:21 2012 +0200

    r600g: inline r600_blit_push_depth and use resource_copy_region

    We are going to have a separate resource for depth texturing and transfers
    and this is just a transfer thing.

commit da98bb6fc1
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Jun 25 12:45:32 2012 +0200

    r600g: split flushed depth texture creation and flushing

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 15:42:28 +01:00
Michel Dänzer
f0ffbbc9ff radeonsi: Enable 1D tiling for non-depth resources as well.
No piglit regressions anymore thanks to fixes in libdrm_radeon and here.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 14:10:52 +01:00
Michel Dänzer
90d919fcd0 radeonsi: Fix 1D tiling mode index for non-scanout resources.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-21 14:10:52 +01:00
Matt Turner
a076c272e2 build: Remove dead SHARED_GLAPI variable
The static Makefiles used it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:46 -08:00
Matt Turner
3f276b37b1 glsl/build: Build glsl_test only on make check
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:44 -08:00
Matt Turner
ecbe3118c2 glsl/build: Remove dead LIBRARY_* variables
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:41 -08:00
Matt Turner
37f34e53e0 xmlpool/build: generate options.h via BUILT_SOURCES
Fixes missing options.h when doing 'make check' in dri/common before
'make' has been run.

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-20 20:06:20 -08:00
Jordan Justen
6c7fa72229 fbobject: add additional fbo completeness checks for GLES
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
f8e7aa2827 framebuffer: update allowed implementation format/type
Allow additional format/type combinations based on the
color render buffer to fix failures with gles3-gtf.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
ffdffd834a readpix: allow implementation format/type
For GLES2/3 allow reading of pixels with format/type based on:
 * GL_IMPLEMENTATION_COLOR_READ_FORMAT
 * GL_IMPLEMENTATION_COLOR_READ_TYPE

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
119002a648 extensions: enable EXT_color_buffer_float for ES3
[mattst88] v2: Enable only for ES3 per spec.
[mattst88] v3: Use _mesa_is_gles3 since EXT_color_buffer_float is
	       ES3-only.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Matt Turner
227f58695e extensions: Add ES3-only extension support
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
ce9118c7f0 readpix: check FBO completeness before trying to access the read-buffer
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
8b0bc9de36 readpix: add error checking for GLES3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
a793ffa0b8 copyteximage: update error checking for GLES3
Changes based on GTF/gles3 conformance test suite.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Jordan Justen
3b51d71c85 copyteximage: check that sRGB usage is valid for GLES3 / GL
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-20 19:54:38 -08:00
Ian Romanick
285fe32bd9 intel: Enable GL_OES_depth_texture_cube_map
For now I'm just enabling this on the same subset of hardware that has
OpenGL 3.0 enabled.  This same functionality is part of OpenGL 3.0, and
there is no matching desktop extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:23 -05:00
Ian Romanick
1c29d8f4ff mesa/es3: Allow unsized depth and depth-stencil formats in ES3
They're part of GL_OES_depth_texture_cube_map, and we'll always enable
that extension in ES3 contexts.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:20 -05:00
Ian Romanick
b3eed73c3b mesa/es2: Allow depth component cube maps in ES2 if the extension is enabled
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:18 -05:00
Ian Romanick
0f899c2da8 mesa: Add extension bit tracking for GL_OES_depth_texture_cube_map
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-20 20:56:01 -05:00
Adam Jackson
30530ee9ac gallium: Remove ppc asm backend
The vs part hasn't been wired up since tgsi_sse2 was disabled in:

    commit 4eb3225b38
    Author: José Fonseca <jose.r.fonseca@gmail.com>
    Date:   Tue Nov 8 00:10:47 2011 +0000

	Remove tgsi_sse2.

And it would certainly not work correctly in its current state:

draw/draw_vs_ppc.c: In function ‘draw_create_vs_ppc’:
draw/draw_vs_ppc.c:190:24: warning: assignment from incompatible pointer
type [enabled by default]

As with the sse2 backend, this should be done in llvm anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-20 17:12:47 -05:00
Andreas Boll
410b58c7bf build: require python module libxml2
configure should warn if libxml2 is not found.
libxml2 is needed by glapi/gen.

Fixes error during build in src/mapi/glapi/gen:
ImportError: No module named libxml2

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31598
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-19 23:50:39 +01:00
Vincent Lejeune
f9f5c92f73 r600g/llvm: Fixes addressspace of basevectors for clipvertex 2013-01-19 22:28:13 +01:00
Christoph Bumiller
e264b8ef41 nv50/ir: add definitions of Target and CodeEmitter dtors
I really did build test, my compiler just doesn't seem to care.
2013-01-19 22:13:45 +01:00
Christoph Bumiller
7d2d450ea6 nouveau: fix undefined behaviour when testing sample_count
NOTE: This is a candidate for the 9.0 branch.
2013-01-19 20:54:39 +01:00
Christoph Bumiller
b0863c26d4 nv50/ir: fix a couple of warnings 2013-01-19 20:54:39 +01:00
Ian Romanick
f59a3a0fe2 mesa: Array uniform name length includes length of [0]
This is required by OpenGL ES 3.0 and desktop OpenGL 4.2.  Previous
version were ambiguous.  This also matches the behavior of NVIDIA's
closed-source driver (version 304.64).

Fixed gles3conformance test uniform_buffer_object_getactiveuniformsiv
and uniform_buffer_object_structure_and_array_element_names (on my
in-progress branch that fixes a bunch of other stuff...YMMV).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
8ef3c83ffe mesa: Array uniform names are supposed to have [0] appended
This is required by OpenGL ES 3.0 and desktop OpenGL 4.2.  Previous
version were ambiguous.  This also matches the behavior of NVIDIA's
closed-source driver (version 304.64).

Fixed gles3conformance test uniform_buffer_object_getactiveuniform.

Several piglit tests expect glGetActiveUniform to *not* include the [0]
on the end.  These tests were already failing on NVIDIA, and this change
regresses them on Mesa.  Patches have been sent to the piglit mailing
list to fix the tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
5938c7774f mesa: Refactor getting a uniform's name to a helper function
We currently have a bug in this code, and I don't want to fix it in two
places.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
f26520146b glsl: Eliminate link_update_uniform_buffer_variables return value
It always returns true, so there's no point in having a return value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
bd85c75922 glsl: Remove unused loc parameter from generate_call
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
56053b0a2d mesa: Remove unused field gl_uniform_buffer_variable::Buffer
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:33 -08:00
Ian Romanick
feea85da06 linker: Use helper variable sh
This looks like a copy-and-paste left over.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:32 -08:00
Ian Romanick
db718e2472 glsl: Remove stale comment
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:32 -08:00
Kenneth Graunke
4f29169913 glsl: Track UBO block names in the symbol table.
The GLSL 1.40 spec says:

    "Uniform block names and variable names declared within uniform
    blocks are scoped at the program level."

Track the block name in the symbol table and emit errors when conflicts
exist.

Fixes es3conform's uniform_buffer_object_block_name_conflict test, and
fixes the piglit block-name-clashes-with-{variable,function,struct}.vert
tests.

NOTE: This is a candidate for the 9.0 branch.

v2: Fix bad constructor initialization.  Noticed by Topi Pohjolainen.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 17:35:32 -08:00
Ian Romanick
bb47a4d081 glsl: Reject row_major and column_major on non-matrix types
About both row_major and column_major layout qualifiers, the GLSL spec
says:

    "It only affects the layout of matrices."

However, the OpenGL ES 3.0 conformance tests have taken this to mean it
is an error use it elsewhere.  This seems logical given that
'layout(row_major) vec4 foo' is probably not what the programmer meant.

The only catch is dealing with structures that contain matrices.  Layout
qualifiers cannot be applied directly to fields of structures, so the
only way to affect the layout of the fields is to apply a qualifier to
the structure declaration itself.  There is ongoing debate about this
within Khronos, and it seems to be settling in favor of allowing the
qualifiers on structures.  I light of this, I have chosen to allow the
qualifiers on structures but emit a warning since the usage may not be
portable.

Fixes gles3conform test
uniform_buffer_object_layouts_not_for_matrix_type and causes no
regressions.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 17:35:32 -08:00
Eric Anholt
1ec1b577f7 mesa: Skip updating texgen when not doing fixed function.
Between the previous commit and this one, improves GLBenchmark 2.1
offscreen performance by 0.48% +/- 0.24% (n=22, throttling outliers
removed).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 13:03:46 -08:00
Eric Anholt
078727d41c mesa: Don't bother updating ff texture state if we have a fragment shader.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 13:03:41 -08:00
Eric Anholt
b5788146ba mesa: Drop a comment about ff vertex shading and texturing.
It's never going to have texture fetches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-18 13:03:27 -08:00
Eric Anholt
4533a38fa8 mesa: Fix out of bounds writes when uncompressing non-block-aligned ETC1.
Fixes a crash in GLB2.1 offscreen on the glthread branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:27 -08:00
Eric Anholt
5e529d708a i965: Add support for GL_ARB_texture_buffer_object_rgb32.
Tested with piglit ARB_texture_buffer_object/formats.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:22 -08:00
Eric Anholt
582b06c2c6 i965: Add support for MESA_FORMAT_RGB_FLOAT32 surfaces.
This is for GL_ARB_texture_buffer_object_rgb32 support, but it also
causes the format to get used for float32 rgb textures as well on
Ironlake and later.  Since that came with some surprises, separate
the change from the enable commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:18 -08:00
Eric Anholt
60894edeef intel: Make intel_region's pitch be bytes instead of pixels.
We almost never want a stride in pixels -- if you're doing anything with
a stride, you're specifying an offset or incrementing a pointer, and in
both cases you had to multiply by cpp to get the bytes value you wanted.
But worse, on the way to creating a region from a new tiled BO, we
divided by cpp to get pitch in pixels, and for an RGB32 buffer (an
upcoming change) the pitch wouldn't divide exactly, and we'd end up with
a wrong stride in our region.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:13 -08:00
Eric Anholt
8fd62e80ae intel: Make intel_blit.c take pitches in bytes.
As we gain support for NPOT cpp, a pitch may not divide by cpp cleanly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-18 12:48:07 -08:00
Vincent Lejeune
3b14ce2caf r600g/llvm: tgsi to llvm emits store.swizzle intrinsic for vs/fs output
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:34:26 +00:00
Vincent Lejeune
7b20526466 r600g/llvm: tgsi to llvm emits stream output intrinsics.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:34:21 +00:00
Vincent Lejeune
ce34ff1ad7 r600g/llvm:translate ARL opcode to a simple cast
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:08:10 +00:00
Vadim Girlin
7d532800d8 r600g/llvm: rework handling of the constants
Vincent Lejeune:
  - tgsi to llvm now emits pointers for constants

Tom Stellard:
  - Only use texture cache for vtx fetch with compute shaders
  - Change address space used for constant loads to match LLVM
    backend.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-18 20:08:10 +00:00
Kenneth Graunke
1ee2880e86 mesa: Only mark textures as mipmap incomplete on MAX_LEVEL issues.
According to the OpenGL 3.2 Core Profile specification, section 3.8.12:

"For one-, two-, and three-dimensional and one-and two-dimensional array
 textures, a texture is mipmap complete if all of the following
 conditions hold true:
 - [...]
 - levelbase <= levelmax [...]

 Using the preceding definitions, a texture is complete unless any of
 the following conditions hold true:
 - [...]
 - The minification filter requires a mipmap (is neither NEAREST nor
   LINEAR), and the texture is not mipmap complete."

(This text also appears in all GL >= 3.2 specs and the ES 3.0 spec.)

From this, we see that levelbase <= levelmax should only affect mipmap
completeness, not base-level completeness.

Prior versions of GL did not have the notion of mipmap completeness,
simply calling the texture incomplete in this case.  But I don't think
we really care.

Fixes es3conform's sgis_texture_lod_basic_completeness test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:27 -08:00
Kenneth Graunke
f0dbd9255b i965/vs: Store texturing results into a vec4 temporary.
The sampler appears to ignore writemasks (even when correcting the
WRITEMASK_XYZW in brw_vec4_emit.cpp to the proper writemask) and just
always writes all four values.

To cope with this, just texture into a temporary, then MOV out into a
register that has the proper number of components.

NOTE: This is a candidate for stable branches.

Fixes es3conform's shadow_execution_vert.test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:27 -08:00
Kenneth Graunke
aeff9a0d98 i965/vs: Set LOD to 0 for ordinary texture() calls.
Previously it was left undefined, causing us to select a random LOD.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:26 -08:00
Kenneth Graunke
56ce55d198 i965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.
This is purely a refactor.  However, in a moment, we'll want to set
lod_type to float for ir_tex, where ir->lod_info.lod is NULL.

NOTE: This is a candidate for stable branches (for the next patch).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 11:31:26 -08:00
Kenneth Graunke
613e64060c i965: Lower textureGrad() with samplerCubeShadow on pre-Haswell.
Fixes regressions since commit 899017fc54
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Fri Jan 4 07:53:09 2013 -0800

    i965: Use Haswell's sample_d_c for textureGrad with shadow samplers.

That patch assumed that all instances were lowered.  However, we weren't
lowering textureGrad() with samplerCubeShadow because I couldn't figure
out the LOD calculations.  It turns out they're easy: you just have to
use 1 for the depth.  This causes it to pass oglconform's four tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Ian Romanick <idr@freedesktop.org>
2013-01-18 10:30:54 -08:00
Roland Scheidegger
d03d9b657e llvmpipe: turn on integer texture support
Now that things mostly seem to work enable those formats.
Some formats cause crashes (notably RGB8 variants) so switch these off
(these crashes are not specific to INT/UINT variants but the state tracker
doesn't use them for UNORM etc. formats so it went unnoticed so far).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Roland Scheidegger
f2a87a1f5b llvmpipe: more fixes for integer color buffers
Cast back the fake floats to ints, and make sure we don't try to do scaling
in format conversion (which only makes sense with normalized values).
Also need to disable blending and alpha test (as per spec) for such buffers.
This makes fbo-blending from the piglit ext_texture_integer tests work for most
formats (some crash, and the luminance and intensity variants have the GB or
GBA channels respectively wrong).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Roland Scheidegger
dc6bc3b642 llvmpipe: trivial code and comment cleanup.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Roland Scheidegger
8c84a82383 llvmpipe: fix using wrong format with MRT in blend code
We were passing in the rt index however this was always 0 for non-independent
blend case. (The format was only actually used to decide if the color mask
covered all channels so this went unnoticed and was discovered by accident.)
Additionally, there was a second problem because we do fixups in the key based
on color buffer format we cannot use non-independent blend anyway as the fixed
up values would never get used.
So always turn non-independent blending into independent.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-18 09:14:52 -08:00
Ian Romanick
ca39c0f94a mesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_type
Filtering of DEPTH_COMPONENT and DEPTH_STENCIL for TEXTURE_3D is already
done in texture_error_check because these combinations aren't allowed on
desktop GL either.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-01-17 10:47:46 -08:00
Ian Romanick
311cc5d973 mesa: Don't allow DEPTH_STENCIL for 3D textures
Just like DEPTH_COMPONENT.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-01-17 10:47:42 -08:00
Brian Paul
57ddf1227f swrast: fix assorted bugs in software blit code
1. The loop over dest buffers in blit_linear() needed a null pointer
check.  Fixes https://bugs.freedesktop.org/show_bug.cgi?id=59499

2. The code to grab the drawRb's format needs to be inside the drawing loop.

3. An equality test was using = instead of == thus messing up a
renderbuffer attachment texture pointer.  This lead to memory
corruption and a crash at exit.

Finally, fix a capitalization error NumDrawBuffers -> numDrawBuffers
and change type to unsigned to fix signed/unsigned comparison warnings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-01-17 09:38:54 -07:00
Michel Dänzer
51efb081f7 radeonsi: Actually keep track if we are using depth textures for samplers.
20-odd more piglits.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:21 +01:00
Michel Dänzer
3c92bfe2d2 radeonsi: Fix Z24 texture formats.
About half a dozen more piglits.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:21 +01:00
Michel Dänzer
1ace200b2b radeonsi: Set SPI_SHADER_COL_FORMAT to what the pixel shader actually exports.
Instead of deriving it from the colour buffer formats only.

Fixes a number of piglit tests which export depth from the pixel shader.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:21 +01:00
Michel Dänzer
bc5e65096d radeonsi: Use proper hardware format for stencil texturing.
Fixes piglit 'spec/ARB_depth_buffer_float/fbo-clear-formats stencil' crash.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:20 +01:00
Michel Dänzer
c486e3ef34 radeonsi: Enable tiling for depth/stencil resources.
Enabling it for all resources still seems to cause problems, but depth/stencil
buffers are always accessed with tiling by the DB block.

Also, stick to 1D tiling for now. Getting 2D tiling to work properly will
require substantial changes in libdrm_radeon and possibly the kernel as well.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:20 +01:00
Michel Dänzer
c408f0c5c4 radeonsi: Consolidate calculation of tile mode index.
Apart from the obvious cleanup, this makes sure all blocks use the same tiling
mode for accessing the resource.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 16:57:20 +01:00
Maarten Lankhorst
9ba7eac535 nvc0: add support for accelerated video decoding through the dedicated engines
Currently the use of external firmware is required, with kernel and
userspace firmware needed for all Fermi cards except nvd9. Kepler and nvd9
should only require kernel firmware.
2013-01-17 16:28:57 +01:00
Michel Dänzer
6eb0d3d863 radeonsi: Pass texture type to sampling intrinsics.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2013-01-17 15:47:38 +01:00
Maarten Lankhorst
edc8e8cbef nvc0: add space checks to clear functions
Thanks to calim for helping me find and fix the issue.
2013-01-17 12:37:25 +01:00
Maarten Lankhorst
5dc76c7670 nv50: add space checks to clear functions, and respect depth
Thanks to calim for helping me find and fix the issue.
2013-01-17 12:37:15 +01:00
Brian Paul
56c01d8109 st/mesa: a couple fixes for st_BlitFramebuffer()
1. Loop over multiple destination color buffers.  If we set
glDrawBuffers(GL_FRONT_AND_BACK) we need to loop over multiple color
buffers, blitting to each.

2. Add checks for null src/dst surface pointers.  This fixes a crash
in the piglit fbo-missing-attachment-blit test.
See bug http://bugs.freedesktop.org/show_bug.cgi?id=59450

Reviewed-by: Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-16 17:06:17 -07:00
Brian Paul
af7b4b01f1 st/mesa: simplify some src/dst surface setup in BlitFramebuffer
Use the renderbuffer attachment pointers that we grabbed earlier.

Reviewed-by: Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-16 17:06:17 -07:00
Brian Paul
09154c274c meta: add 'f' suffix to floats to silence some MSVC warnings 2013-01-16 17:06:17 -07:00
Brian Paul
6064810e53 mesa: add missing ASSERT_OUTSIDE_BEGIN_END() in _mesa_GetInternalformativ()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-16 17:06:17 -07:00
Matt Turner
99629735e7 build: Make src/gtest before src/mesa
Fixes a make check problem where libgtest.la wasn't build before tests
that want to link with it.
2013-01-16 13:31:36 -08:00
Jon TURNEY
e6e73089e5 Fix mapi code generator for out-of-tree build
Use os.path.join() rather than hand-rolling it, so path is correct if
sys.argv[0] returns an absolute path.

(According to the python documentation, it's platform dependent whether
sys.argv[0] is a full pathname or not.  It probably also depends on how
the process was started...)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-16 19:53:01 +00:00
Maarten Lankhorst
4fad211502 nvc0: Add support for video buffer 2013-01-16 17:44:09 +01:00
Maarten Lankhorst
4b8af72f96 vl/video_buffer: fix up surface ordering for the interlaced case
It seems the other code expects surface[0..1] to be the luma field in interlaced case.

See for example vdpau/surface.c vlVdpVideoSurfaceClear and vlVdpVideoSurfacePutBitsYCbCr.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-01-16 17:22:55 +01:00
Maarten Lankhorst
892c1fa8d8 vl/compositor: fix weave shader bugs
Writemask was XY instead of YZ (thanks to calim for spotting it).

The pixel calculation resulted in the pixel always being off by one.
If y was .5:

y' = round(y) + 0.5 = 1.5

Fixing this also means the LRP function has to swap the pixels it, since
it's now the other way around for top/bottom.

WIth these fixes only chroma for top and bottom pixel rows are wrongly interpolated
in my test program:

--- nvidia
+++ nouveau
@@ -1,4 +1,4 @@
-YCbCr[0] = 00c080
+YCbCr[0] = 00b070
 YCbCr[1] = 00b070
 YCbCr[2] = 029050
 YCbCr[3] = 207050
@@ -61,4 +61,4 @@
 YCbCr[60] = 0c5070
 YCbCr[61] = c05090
 YCbCr[62] = 0e70b0
-YCbCr[63] = e080c0
+YCbCr[63] = e070b0

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2013-01-16 17:22:45 +01:00
Brian Paul
dfcd7658c5 mesa: add new formatquery.c file to SConscript file to fix build 2013-01-16 08:18:33 -07:00
Christian König
f449948812 radeonsi/vdpau: remove nonsense state tracker dep
Added with automake conversion, but makes no sense at all.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-16 15:28:43 +01:00
Ian Romanick
1cedf7819b glapi: Remove duplicate ARB_base_instance from gl_API.xml
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 23:20:18 -08:00
Ian Romanick
3c00a52f7e intel: Enable GL_ARB_internalformat_query
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
f5e7f12e4a mesa: Add driver method to determine the possible sample counts
Use this method in _mesa_GetInternalformativ for both GL_SAMPLES and
GL_NUM_SAMPLE_COUNTS.

v2: internalFormat may not be color renderable by the driver, so zero
can be returned as a sample count.  Require that drivers supporting the
extension provide a QuerySamplesForFormat function.  The later was
suggested by Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
bda540d235 mesa: Add dispatch and extension XML for GL_ARB_internalformat_query
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
5e4bb063f0 mesa: Add extension tracking bit for GL_ARB_internalformat_query
Though, I'm tempted to always expose this extension when
GL_ARB_framebuffer_object is exposed.  In that case, it would share the same
enable bit.

v2: Correctly sort extension names.  Suggested by Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Ian Romanick
1b468d043e mesa: Add skeleton implementation of glGetInternalformativ
This is for the GL_ARB_internalformat_query extension and GLES 3.0.

v2: Generate GL_INVALID_OPERATION if the extension is not supported.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-15 21:34:45 -08:00
Vinson Lee
780c2cb42b meta: Move loop variable declaration outside for loop.
Fixes build with MSVC.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-01-15 18:03:25 -08:00
Brian Paul
7ecbbc3386 mesa: move declarations before code to fix MSVC build 2013-01-15 17:02:30 -07:00
Anuj Phogat
d0ce8d6ceb mesa: Round float param in glTexparameterf() to nearest integer
OpenGL 4.2 specification suggests rounding the float data to nearest
integer when the type of internal state is integer. Out of range floats
should be clamped to {INT_MIN, INT_MAX}. This is not specified anywhere
in gl/gles spec but below test expects this behavior.  This patch makes
gles3 conformance sgis_texture_lod_basic_getter.test pass.

A GL spec bug will be raised to include clamping of out of range floats.

V2: Round float to nearest integer for all cases where
_mesa_Texparameterf() converts float param to int. Use the same block of
float to int conversion code for GL_TEXTURE_SWIZZLE_{R,G,B,A}_EXT cases
as well.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:37 -08:00
Anuj Phogat
bed997daba mesa: Add support to allow blitting to multiple color draw buffers
This patch fixes a blitting case when drawAttachment->Texture ==
readAttachment->Texture. It was causing an assertion failure in
intel_miptree_attach_map() with gles3 conformance test case:
framebuffer_blit_functionality_minifying_blit

Number of changes in this file look scary. But most of them are caused
by introducing a big for loop to support rendering to multiple color
draw buffers.

V2: Fixed a case when number of draw buffer attachments are zero.
V3: Put a for loop in blit_nearest() and blit_linear() functions in to
    support blitting to multiple color draw buffers.
V4: Remove variable declaration in for loop to avoid MSVC compilation
    issues.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:23 -08:00
Anuj Phogat
ab36ca0614 mesa: Add error checking in _mesa_BlitFramebuffer() for MRTs
This patch adds required error checking in _mesa_BlitFramebuffer() when
blitting to multiple color render targets. It also fixes a case when
blitting to a framebuffer with renderbuffer/texture attached to
GL_COLOR_ATTACHMENT{i} (where i!=0). Earlier it skips color blitting if
nothing is found attached to GL_COLOR_ATTACHMENT0.

V2: Fixed a case when number of draw buffer attachments are zero.
V3: Do compatible_color_datatypes() and compatible_resolve_formats()
    check for all the draw renderbuffers in fbobject.c. Fix debug code
    at bottom of _mesa_BlitFramebuffer() to handle MRTs. Combine error
    checking code for linear blits with other color blit error checking.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:12 -08:00
Anuj Phogat
2f2801f876 mesa: Fix GL error generation in _mesa_GetFramebufferAttachmentParameteriv()
This allows query on default framebuffer in
glGetFramebufferAttachmentParameteriv() for gles3. Fixes unexpected GL
errors in gles3 conformance test case:
framebuffer_blit_functionality_multisampled_to_singlesampled_blit

V2: Use _mesa_is_gles3() check to restrict allowed attachment types to
specific APIs.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:09:03 -08:00
Anuj Phogat
b77243b9c2 intel: Support blitting to multiple color draw buffers
This patch enables blitting to multiple color attachments of a
framebuffer.  It also fixes a case when blitting to a framebuffer with
renderbuffer/texture attached to non-zero attachment point
i.e. GL_COLOR_ATTACHMENT{1, 2, ...}.  Earlier we were incorrectly
blitting to GL_COLOR_ATTACHMENT0 by default.

V2: Use intel_copy_texsubimage() for blitting only if all the color
attachments can blit using it.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:08:55 -08:00
Anuj Phogat
0c535ae7fc meta: Add functionality to do _mesa_meta_BlitFrameBuffer() using glsl
This patch rewrites _mesa_meta_BlitFrameBuffer() function to add support
for blitting with GLSL/GLSL ES shaders. These changes were required to
support glBlitFrameBuffer() in gles3. This patch, along with other
patches in this series, make 16 failing framebuffer_blit test cases in
gles3 conformance pass.

V2: Properly handle flipped blits for source and destination
    renderbuffer / textures. Add support for GL_TEXTURE_RECTANGLE in
    _mesa_meta_BlitFrameBuffer. Create a temp depth texture to support
    depth buffer blitting.
V3: Remove unsupported / redundant shader code. Add an assertion to make
    sure that we don't use rectangle texture in ES. Put API guard on
    glTexEnvi().
V4: For gles3: Don't use ReadPixels or CopyTexImage2D to blit depth
    buffer.  gles3 spec says for CopyTexImage2D that "color buffer
    components can be dropped during the conversion to internalformat,
    but new components cannot be added." So, use the internal format of
    read renderbuffer to create texture for color buffer blitting.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2013-01-15 15:08:38 -08:00
Anuj Phogat
252573ae0f mesa: Fix GL error generation in glBlitFramebuffer()
V2:
If mask has GL_STENCIL_BUFFER_BIT set, the depth formats for
readRenderBuffer and drawRenderBuffer must match unless one of the two
buffers doesn't have depth, in which case it's not blitted, so the
format check should be ignored.  Same comment goes for stencil formats
in depth renderbuffers if mask has GL_DEPTH_BUFFER_BIT set.

v3 (Kayden): Refactor code to be a bit more readable.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 15:08:12 -08:00
Kenneth Graunke
f727fc6304 mesa: Make ES3 glDrawBuffers() only accept BACK/NONE for the winsys fbo.
Nothing was explicitly checking this.

v2: Update GL3 spec reference.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> [v2]
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
2013-01-15 15:04:50 -08:00
Kenneth Graunke
fd3891cbbe mesa: Handle GL_BACK correctly for ES 3.0 in glDrawBuffers().
In ES 3.0, when calling glDrawBuffers() on the window system
framebuffer, the only valid targets are GL_NONE or GL_BACK.  Since there
is no stereo rendering in ES 3.0, this is a single buffer, unlike
desktop where it may be two (and thus isn't allowed).

For single-buffered configs, GL_BACK ironically means the front (and
only) buffer.  I'm not sure that it matters, however, as ES shouldn't
have front buffer rendering in the first place.

Fixes es3conform framebuffer_blit_coverage_default_draw_buffer_binding.

v2: Update GLES3 spec reference.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> [v2]
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
2013-01-15 14:59:40 -08:00
Ian Romanick
d786bf2c2a egl/dri2: Fix typo in the previous commit
I didn't notice this due to a noobed piglit run.  It wasn't previously
noticed because the patch was only run on a driver that supported GLES3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 14:19:04 -08:00
Rob Schneider
45575ff388 libgl-gdi: Avoid hangs on DLL_PROCESS_DETACH.
At process exit DLL_PROCESS_DETACH is signaled to DllMain(), where then
a final cleanup is triggered.  In stw_cleanup() code is triggered that
tries to communicate a shutdown to the spawned threads -- however at
that time those threads have already been terminated by the OS and so
the process hangs.

v2: skip stw_cleanup_thread() too

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2013-01-15 14:16:09 -08:00
Chad Versace
eb09940e55 egl/dri2: Add plumbing for EGL_OPENGL_ES3_BIT_KHR
Fixes error EGL_BAD_ATTRIBUTE in the tests below on Intel Sandybridge:
    * piglit egl-create-context-verify-gl-flavor, testcase OpenGL ES 3.0
    * gles3conform, revision 19700, when runnning GL3Tests with -fbo

This plumbing is added in order to comply with the EGL_KHR_create_context
spec. According to the EGL_KHR_create_context spec, it is illegal to call
eglCreateContext(EGL_CONTEXT_MAJOR_VERSION_KHR=3) with a config whose
EGL_RENDERABLE_TYPE does not contain the EGL_OPENGL_ES3_BIT_KHR. The
pertinent
portion of the spec is quoted below; the key word is "respectively".

  * If <config> is not a valid EGLConfig, or does not support the
    requested client API, then an EGL_BAD_CONFIG error is generated
    (this includes requesting creation of an OpenGL ES 1.x, 2.0, or
    3.0 context when the EGL_RENDERABLE_TYPE attribute of <config>
    does not contain EGL_OPENGL_ES_BIT, EGL_OPENGL_ES2_BIT, or
    EGL_OPENGL_ES3_BIT_KHR respectively).

To create this patch, I searched for all the ES2 bit plumbing by calling
`git grep "ES2_BIT\|DRI_API_GLES2" src/egl`, and then at each location
added a case for ES3.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:54 -08:00
Chad Versace
26f9faa04b intel: Expose support for DRI_API_GLES3
If the hardware/driver combo supports GLES3, then set the GLES3 bit in
intel_screen's bitmask of supported DRI API's.  Neither the EGL nor GLX
layer uses the bit yet.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:54 -08:00
Chad Versace
e90c08e667 dri: Define enum __DRI_API_GLES3
This enum corresponds to EGL_OPENGL_ES3_BIT_KHR.
Neither the GLX nor EGL layer use the enum yet.

I don't like the GLES bits. I'd prefer that all GLES APIs be exposed
through a single API bit, as is done in GLX_EXT_create_context_es_profile.
But, we need this GLES3 enum in order to do the plumbing necessary to
correctly support EGL_OPENGL_ES3_BIT_KHR as required by the
EGL_KHR_create_context spec.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:53 -08:00
Chad Versace
a11fe62058 intel: Move validation of context version into intelInitContext
Each driver (i830, i915, i965) used independent but similar code to
validate the requested context version. With the rececnt arrival of GLES3,
that logic has needed an update. Rather than apply identical updates to
each drivers validation code, let's just move the validation into the
shared routine intelInitContext.

This refactor required some incidental changes to functions
i830CreateContext and intelInitContext. For each function, this patch:
    - Adds context version parameters to the signature.
    - Adds a DRI_CTX_ERROR out param to the signature.
    - Sets the DRI_CTX_ERROR at each early return.

Tested against gen6 with piglit egl-create-context-verify-gl-flavor.
Verified that this patch does not change the set of exposed EGL context
flavors.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:45:51 -08:00
Chad Versace
4945086f36 intel: Set screen's api mask according to hw capabilities (v3)
Before this patch, intelInitScreen2 set DRIScreen::api_mask with the hacky
heuristic below:

    if (gen >= 3)
        api_mask = GL | GLES1 | GLES2;
    else
        api_mask = 0;

This hack was likely broken on gen2 (i830), but I don't care enough to
properly investigate. It appears that every EGLConfig on i830 has
EGL_RENDERABLE_TYPE=0, and thus eglCreateContext will never succeed.
Anyway, moving on to living drivers...

With the arrival of EGL_OPENGL_ES3_BIT_KHR, this heuristic is now
insufficient. We must enable the GLES3 bit if and only if the driver is
capable of creating a GLES3 context. This requires us to determine the
maximum supported context version supported by the hardware/driver for
each api *during initialization of intel_screen*.

Therefore, this patch adds four new fields to intel_screen which indicate
the maximum supported context version for each api:
  max_gl_core_version
  max_gl_compat_version
  max_gl_es1_version
  max_gl_es2_version

The api mask is now correctly set as:

    api_mask = GL;
    if (max_gl_es1_version > 0)
        api_mask |= GLES1;
    if (max_gl_es2_version > 0)
        api_mask |= GLES2;

Tested against gen6 with piglit egl-create-context-verify-gl-flavor.
Verified that this patch does not change the set of exposed EGL context
flavors.

v2:
  - Replace the if-tree on gen with a switch, for Ian.
  - Unconditionally enable the DRI_API_OPENGL bit, for Ian.

v3:
  - Drop max gl version to 1.4 on gen3 if !has_occlusion_query,
    because occlusion queries entered core in 1.5. For Ian.

v4:
  - Drop ES2 version back to 2.0 due to rebase (Ian).

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick.intel.com>
2013-01-15 13:44:29 -08:00
Matt Turner
112e302481 mesa: Return INVALID_ENUM for glReadPixels(..., GL_DEPTH_*, ...) on ES 3
I'm not sure if this is the correct fix. The
_mesa_es_error_check_format_and_type function (used above in the ES 1
and 2 cases) was originally added for glTexImage checking and allows
GL_DEPTH_STENCIL/GL_UNSIGNED_INT_24_8 combinations. Using it in ES 3
causes other tests to regress.

Fixes es3conform's packed_depth_stencil_error test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Matt Turner
2906e2034c mesa: Return INVALID_OPERATION when type is known but not allowed
INVALID_ENUM is for when the type is simply not known.

Fixes part of es3conform's packed_depth_stencil_error test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Matt Turner
c8901133a4 mesa: Allow HALF_FLOAT in glVertexAttribPointer for GLES3
Fixes es3conform's half_float_max_vertex_dimensions and
half_float_textures tests.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Matt Turner
cbef5371f6 mesa: Reject texture-only formats as renderbuffer formats in ES 3
ES 3 specifies some formats as texture-only (i.e., not available for
renderbuffers).

See the "Required Texture Formats" section (pg 126) of the ES 3 spec.

v2: Allow RED and RG float rendering in core profiles The check used to
be (version > 30) || (compat profile w/extensions).  Just deleting
<version > 30) broke 3.0+ core profiles.

Fixes es3conform's color_buffer_unsupported_format test.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Kenneth Graunke
8907b6a8e4 mesa: Fix default value of BUFFER_ACCESS_FLAGS.
According to both the GL 3.0 and ES 3.0 specifications (table 2.7 for GL
and table 2.8 for ES), the default value of BUFFER_ACCESS_FLAGS is
supposed to be zero.

Note that there are two related quantities: the obsolete BUFFER_ACCESS
enum and the new BUFFER_ACCESS_FLAGS bitfield.

BUFFER_ACCESS can only be GL_READ_ONLY, GL_WRITE_ONLY, or GL_READ_WRITE;
BUFFER_ACCESS_FLAGS can easily represent all three via GL_MAP_WRITE_BIT,
GL_MAP_READ_BIT, and their logical or.  It also supports more flags.

Thus, Mesa only stores the bitfield, and simply computes the old enum
when queried, via simplified_access_mode(bufObj->AccessFlags).

The tricky part is that, while BUFFER_ACCESS_FLAGS defaults to 0,
BUFFER_ACCESS defaults to GL_READ_WRITE for desktop [GL 3.0, table 2.8]
and GL_WRITE_ONLY_OES for ES [the GL_EXT_map_buffer_range extension].

Mesa tried to implement this by setting the default AccessFlags to
GL_MAP_READ_BIT | GL_MAP_WRITE_BIT on desktop, and GL_MAP_WRITE_BIT on
ES.  But in all specifications, it needs to be 0.

This patch moves that logic into simplified_access_mode(): when
AccessFlags == 0, it now returns GL_READ_WRITE for desktop and
GL_WRITE_ONLY for ES 1/2.  (BUFFER_ACCESS doesn't exist on ES 3.0,
so it's irrelevant there.)

With that in place, it changes the AccessFlags default to 0.

Fixes three es3conform tsets:
- copy_buffer_defaults
- map_buffer_range_modify_indices
- pixel_buffer_object_default_parameters

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Kenneth Graunke
f3db20da1a mesa: Rework crazy error code rules in glDrawBuffers().
Perhaps most importantly, this patch adds comments quoting the relevant
spec paragraphs above each error condition.

It also makes three changes:
- For FBOs, GL_COLOR_ATTACHMENTm where m >= MaxDrawBuffers is supposed
  to generate INVALID_OPERATION (not INVALID_ENUM).
- Constants that refer to multiple buffers (such as FRONT, BACK, LEFT,
  RIGHT, and FRONT_AND_BACK) are supposed to generate INVALID_OPERATION,
  not INVALID_ENUM.
- In ES 3.0, for FBOs, buffers[i] must be NONE or GL_COLOR_ATTACHMENTi
  or else INVALID_OPERATION occurs.  (This is a new restriction.)

Fixes es3conform's draw-buffers-api test.

v2: The error path was missing a "return" like all the other error
paths.  Also, we may as well call it glDrawBuffers in the error message
since the ARB suffix doesn't exist in ES 3.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:00 -08:00
Carl Worth
d9d857e24f i965: Force even an empty query to flush all previous queries.
The specification requires that query results are processed in order, (when
one query result is returned, all previous query of the same type must also be
available). The implementation was failing this requirement in the case of
BeginQuery and EndQuery with no intervening drawing, (the result would be made
available immediately without flushing previous queries).

This fixes the following es3conform test:

	occlusion_query_query_order

as well as the following piglit test:

	occlusion_query_order

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:18 -08:00
Carl Worth
c0b768ffee meta: Allow meta operations to pause/resume an active occlusion query
This allows for avoiding the occlusion query erroneously accumulating results
during the meta operation. This functionality is made conditional on a new
MESA_META_OCCLUSION_QUERY bit so that meta-operations which should generate
fragments can continue to get the current behavior.

The implementation of glClear is specifically augmented to request the flag
since glClear is specified to not generate fragments.

This fixes the following es3conform tests:

	occlusion_query_draw_occluded.test
 	occlusion_query_clear
	occlusion_query_custom_framebuffer
	occlusion_query_stencil_test
	occlusion_query_discarded_fragments

As well as the following piglit test:

	occlusion_query_meta_no_fragments

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:18 -08:00
Carl Worth
3dd76f7168 queryobj: Add EverBound flag, making ISQuery() return false before BeginQuery()
This flag allows for the specified behavior that GenQueries reserves a name,
but does not associate an object with it until BeginQuery. We allocate the
object immediately with the new EverBound flag set to false, and then set the
flag to true at the time of BeginQuery.

This allows us to implement a conformant IsQuery function by checking the
state of the new EverBound flag.

This fixes the following es3conform tests:

	occlusion_query_genqueries
	occlusion_query_is_query_nonzero

and the following piglit test:

	occlusion_query_lifetime

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:34:01 -08:00
Carl Worth
c7df9c0e12 Update comment to specify actual text being referenced from the specification.
The reference to "correct, see spec" was a bit too vague to be useful,
(particularly since the language being referenced here changes between OpenGL
3.1 and OpenGL 4.3).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-15 13:10:58 -08:00
Brian Paul
133383f77a docs: minor updates to VMware guest driver docs
The DRM's --enable-vmwgfx-experimental-api flag isn't needed anymore.
2013-01-15 13:55:24 -07:00
Marek Olšák
7660529c44 r300g: fix and cleanup flushing before clearing CMASK, ZMASK, and HIZ 2013-01-15 21:50:34 +01:00
Marek Olšák
ca2c28859e r300g: implement MSAA compression and fast MSAA color clear
These are optimizations which make MSAA a lot faster.

The MSAA work is complete with this commit.  (except for enablement of AA
optimizations for RGBA16F, for which a patch is ready and waiting until
the kernel CS checker fix lands)

MSAA can't be made any faster as far as hw programming is concerned.

The catch is only one process and one colorbuffer can use the optimizations
at a time.  There usually is only one MSAA colorbuffer, so it shouldn't be
an issue.

Also, there is a limit on the size of MSAA colorbuffer resolution in terms
of megapixels.  If the limit is surpassed, the AA optimizations are disabled.
The limit is:
- 1 Mpix on low-end and some mid-level chipsets (1024x768 and 1280x720)
- 2 Mpix on some mid-level chipsets (1600x1200 and 1920x1080)
- 3 or 4 Mpix on high-end chipsets (2048x1536 or 2560x1600, respectively)
It corresponds to the number of raster pipes (= GB pipes) available, each pipe
can hold 1 Mpix of AA compression data.

If it's enabled, the driver prints to stdout:
  radeon: Acquired access to AA optimizations.
2013-01-15 21:48:58 +01:00
Marek Olšák
1dfe8eead9 gallium/util: add a half float array to util_color
For convenient packing into half floats.
2013-01-15 21:48:49 +01:00
Tom Stellard
7824ab8070 Revert "targets/opencl: Link against libgallium.la instead of libgallium.a"
This reverts commit 4148a29ed8.

This is a work-around for bug:
https://bugs.freedesktop.org/show_bug.cgi?id=59334

We really should be linking against libgallium.la instead of
libgallium.a, but until we can figure why linking against libgallium.la
causes runtime failures in clover we will continue to link against
libgallium.a

Acked-by: Andreas Boll <andreas.boll.dev@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
2013-01-15 18:04:51 +00:00
Marek Olšák
f26eb36e8b st/mesa: use a generic varying to pass the clear color to the FS
The color varying may have reduced precision or be even clamped.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
355d463f73 gallium/util: fix glClear with MRT by making the FS write to all cbufs
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
2cd1407d2d st/mesa: fix InternalFormat for Z24X8 window-system buffers
This probably doesn't fix anything, but it's good to be consistent.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
d489c90a68 st/mesa: remove dead conditional in Clear
I think the conditional always evaluates to false.

If I understand the code in core Mesa correctly, depthBits or stencilBits
is 0 if the depth or stencil renderbuffer is NULL, respectively.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
f94ea25a4a st/mesa: simplify conditionals in Clear
just check depth and stencil separately, the outcome is the same

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
01b7124788 st/mesa: fix glClear with different colormask for each colorbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
f04dd3d003 gallium: remove PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
cabe4fbb85 st/mesa: always assume separate depth and stencil clear is supported
All drivers implement it now.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Marek Olšák
16a30e201e softpipe: implement separate depth-stencil clear
The CAP is going away.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 16:47:18 +01:00
Jon TURNEY
77dd50d020 libgl-xlib: softpipe and llvmpipe aren't mutually exclusive at link time
Since automake changes, softpipe and llvmpipe are mutually exclusive at link
time.  This doesn't make much sense to me as we can choose between them at
run-time using GALLIUM_DRIVER.

Creating library file: .libs/libGL.dll.a
.libs/xlib.o: In function `sw_screen_create_named':
/jhbuild/checkout/mesa/mesa/src/gallium/targets/libgl-xlib/../../../../src/gallium/auxiliary/target-helpers/inline_sw_helper.h:35:
undefined reference to `_softpipe_create_screen'

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-15 10:43:33 +00:00
Jordan Justen
8443b59a5b pack: handle GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV case
For floats, if GL_RGB is the source, then alpha should be set to
1.0F.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:52:19 -08:00
Jordan Justen
80784066cc glformats: allow GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV for GLES2/3
This format is allowed by the GL_EXT_texture_type_2_10_10_10_REV
extension.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:52:09 -08:00
Jordan Justen
ba34c1d570 copyteximage: Use Driver's AllocTextureImageBuffer instead of TexImage
Call Driver.AllocTextureImageBuffer rather than calling
Driver.TexImage with NULL data, format=GL_NONE and type=GL_NONE.

This avoids setting ctx->Unpack, which can lead to incorrectly
trying to upload data.

The GLES3 GTF program's packed_pixels_pbo test was triggering
an error for i965 with the previous code.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:50:31 -08:00
Jordan Justen
91ec623bd2 copyteximage: update signed vs. unsigned format matching
Fixes issues with gles3-gtf

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:48:14 -08:00
Jordan Justen
161a3cd9fc framebuffer: add _mesa_get_read_renderbuffer
This returns the current read renderbuffer for the specified
format type.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:48:14 -08:00
Matt Turner
f5a3d151b0 teximage: use _mesa_es3_error_check_format_and_type for GLES3
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:48:13 -08:00
Matt Turner
9cfcac4528 glformats: add _mesa_es3_error_check_format_and_type
This function checks for ES3 compatible
format/type/internalFormat/dimension combinations.

[jordan.l.justen@intel.com: additional tweaks for gles3-gtf]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:59 -08:00
Jordan Justen
cf300eaab6 fbobject: don't allow LUMINANCE/INTENSITY/ALPHA fbo on ES/Core
v2:
 * Only allow on GL Legacy contexts

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:02 -08:00
Jordan Justen
275620c4b2 fbobject: add VERBOSE=api message for renderbuffer storage
Add API debug trace message for:
 * glRenderbufferStorage
 * glRenderbufferStorageMultisample

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:02 -08:00
Jordan Justen
7f867851f5 fbobject: add VERBOSE=api message for check framebuffer status
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 20:47:02 -08:00
Brian Paul
1c9833ba70 util: add new primitive types to pipe_prim_names[] array
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-01-14 18:15:41 -07:00
Brian Paul
f5eb1b123f st/mesa: add some simple buffer/draw debug code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-14 18:15:41 -07:00
Brian Paul
cb6ef3d112 libgl-xlib: link with -lrt
Fixes a runtime error:

glxgears: symbol lookup error: /home/brian/mesa/lib/gallium/libGL.so.1: undefined symbol: clock_gettime

v2: use $(CLOCK_LIB) and $(PTHREAD_LIBS) per Andreas Boll.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-14 18:15:41 -07:00
Carl Worth
258453716f i965: Avoid blending with destination alpha when RB format has no alpha bits
The hardware does not support a render target without an alpha channel.
So when the user creates a render buffer with no alpha channel, there actually
is storage available for alpha internally. It requires special care to
avoid these unwanted alpha bits from causing any problems.

Specifically, when blending, and when the blend factors would read the
destination alpha values, this commit coerces the blend factors to instead be
either 0 or 1 as appropriate.

A similar fix was made for pre-gen6 hardware in commit eadd9b8e and this
commit shares the fixup function written by Ian then.

This commit the following es3conform test:

	rgb8_rgba8_rgb

As well as the following piglit (sub) tests:

	EXT_framebuffer_object/fbo-blending-formats/3
	EXT_framebuffer_object/fbo-blending-formats/GL_RGB
	EXT_framebuffer_object/fbo-blending-formats/GL_RGB8

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-14 15:35:37 -08:00
Kristian Høgsberg
6d4d4b00dd egl/wayland: Implement EGL_EXT_buffer_age
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2013-01-14 16:39:15 -05:00
Kristian Høgsberg
90804e886d egl/wayland: Pull color buffers from dri2_surf->color_buffers pool
We used to keep the color buffers in the dri_buffers array and
swap __DRI_BUFFER_BACK_LEFT and __DRI_BUFFER_FRONT_LEFT around there
and swap third_buffer in in case we needed to triple buffer.  That
gets a little fidgety with all the swaps, so lets use the
color_buffers pool like the gbm platform does.  We track the color buffers,
their corresponding wl_buffer and locked status here and just plug
a free one into dri2_surf->buffers when we need to.

This is a nice clean-up in itself, but it also sets us up to track
buffer age in the color_buffers structs.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2013-01-14 16:39:15 -05:00
Johannes Obermayr
dc473c5f0a gallium/svga: Make sure -std=gnu99 is set.
This is a work-around until configure.ac stops touching CFLAGS.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-14 13:32:13 -08:00
Damien Lespiau
164a04ed1b build: Fix the documented default value of --with-gallium-drivers
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-14 09:11:44 -08:00
Marek Olšák
e3e1ffb252 r300g: set a dummy vertex buffer in context_create
so that the driver doesn't crash if an app doesn't set any vertex buffers.
2013-01-14 05:58:06 +01:00
Marek Olšák
5330c5a248 r300g: fix MSAA resolve to an untiled texture
RB3D_DEBUG_CTL doesn't help, so I resolve to a tiled temporary texture and
then blitting it to the destination one, which we also do in other situations.
2013-01-14 03:12:01 +01:00
Marek Olšák
e102b665e6 r300g: advertise MSAA support for the RGB10_A2 format on r500
It seems to be working just fine.
2013-01-14 03:12:01 +01:00
Marek Olšák
5fc83101fb r300g: allow separate depth and stencil clear
The handling of the CAP is broken in st/mesa anyway. Let's just kill it.

This commit pretty much enables fast Z clear for FBOs with Z24S8.
The driver falls back to clearing with a quad if the fast clear cannot be
used. It can still do fast color clear, for example.
2013-01-14 03:11:43 +01:00
Marek Olšák
e93a5c2b86 r300g: if both Z and stencil are present, they must be fast-cleared together 2013-01-14 03:11:42 +01:00
Marek Olšák
631c631cbf r300g: allow HiZ with a 16-bit zbuffer 2013-01-14 03:11:42 +01:00
Marek Olšák
3f584c211a r300g: random hyperz cleanups 2013-01-14 03:11:42 +01:00
Marek Olšák
4d6faf5175 r300g: kill the X.Org state tracker target
This won't ever be made default and we don't need it anyway.

We should also consider doing this for other drivers.
2013-01-14 03:11:41 +01:00
Johannes Obermayr
6acef6c5f7 xmlpool: Fix out-of-tree builds.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-13 12:38:50 +01:00
Johannes Obermayr
40a9b0f5d2 gtest: Build it only for 'make check'.
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-13 12:38:44 +01:00
Johannes Obermayr
ebcabb88cf tests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 12:38:38 +01:00
Adam Jackson
06f3a1f792 r200: Fix probable thinko in r200EmitArrays
Effectively this path would always assert.  Move the break statement to
the (probable) intended place.

Note: This is a candidate for the stable branches.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2013-01-13 12:38:31 +01:00
Nathan Schulte
1b8adabe2e target/dri-swrast: fix for nonstandard LLVM prefix
Include LLVM_LDFLAGS when building with LLVM.  Fixes the following build
errors:
  CXXLD  swrast_dri.la
  /usr/bin/ld: cannot find -lLLVMR600CodeGen
  /usr/bin/ld: cannot find -lLLVMR600Desc
  /usr/bin/ld: cannot find -lLLVMR600Info
  /usr/bin/ld: cannot find -lLLVMR600AsmPrinter

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 12:22:15 +01:00
Andreas Boll
9da454f295 targets/dri-r600: Force c++ linker in all cases
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59282
2013-01-13 12:19:29 +01:00
Andreas Boll
e09a5846cd glapi/gen: remove an obsolete comment from Makefile.am
Glapi gets generated at build time.

See commit:
0ce0f7c0c8
mesa: Remove the generated glapi from source control, and just build it.
2013-01-13 00:55:37 +01:00
Matt Turner
92ce9c38fd Remove hacks for static Makefiles
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - don't remove compatibility with scripts for the old build system

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - remove more obsolete hacks

v4: Andreas Boll <andreas.boll.dev@gmail.com>
    - add a previously removed TOP variable to fix vgapi build
2013-01-13 00:55:37 +01:00
Kenneth Graunke
8c80bdc4a8 i965: Move program_id to intel_screen instead of brw_context.
According to bug #54524, I regressed oglconform's multicontext test
when I reenabled the fragment shader precompile.

However, these test cases only passed by miraculous coincedence.  We
assign each fragment program a unique ID (brw_fragment_program::id which
becomes brw_wm_prog_key::program_string_id) which we obtain by storing a
per-context counter.

The test case uses GLX context sharing to access the same fragment
program from two different contexts.  This means that we share a program
cache.  Before the precompile, if both contexts happened to use the same
shaders in the same order, we'd obtain the same program_string_ids (by
virtue of doing the same computation twice).  However, the more likely
scenario is that they completely disagree on program_string_id.

This meant that we'd have two completely different fragment shaders in
the cache with the same ID, tricking us to think they were the same
(aside from NOS), so we'd render using the wrong program.

This patch implements a simple fix suggested by Eric: it moves the
global counter out of brw_context and into intel_screen, which is shared
across all contexts.  A mutex protects it from concurrent access.

This is also the first direct usage of pthreads in the i965 driver.

Fixes 10 subcases of oglconform's multicontext test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54524
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:36:21 -08:00
Kenneth Graunke
2c4ad502ce i965: Fix build error with clang.
Technically, variable sized arrays are a required feature of C99,
redacted to be optional in C11, and not actually part of C++ whatsoever.

Gcc allows using them in C++ unless you specify -pedantic, and Clang
appears to allow them for simple/POD types.

exec_list is arguably POD, since it doesn't have virtual methods, but I
can see why Clang would be like "meh, it's a C++ struct, say no", seeing as
it's meant to support C99.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58970
Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-01-12 15:35:40 -08:00
Kenneth Graunke
fea648db08 i965/fs: Don't mix integer/float immediates in i2b handling.
The simulator gets very angry about our i2b code:

cmp.ne(16)      g3<1>D          g2<0,1,0>D      0F

We can't mix integer DWord and float types.  The only reason to use 0F
here was to share code with f2b.  Split it and use 0D instead.

While we don't believe anything bad will actually happen because of
this, it's nice to fix the warnings and easy enough to do.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:35:38 -08:00
Kenneth Graunke
4a6753926f i965: Add an INTEL_DEBUG=no16 option.
Often when debugging, I don't want to see SIMD16 shaders.  It makes
INTEL_DEBUG=vs/fs output much easier to read, especially when a program
dumps many shaders.  Plus, I also want to verify that SIMD8 works before
even considering SIMD16.

v2: Fix the likeliness check (caught by Chris and Eric).

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-12 15:35:38 -08:00
Alexandre Demers
67ef755908 configure.ac: Fixing common dri dependency when using dri state tracker
Fixes a regression caused by b587a7595e

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59261
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-13 00:13:16 +01:00
Fredrik Höglund
ac1c2b8238 st/mesa: set ctx->Const.UniformBufferOffsetAlignment
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-12 22:08:09 +01:00
José Fonseca
a3dd1ff45f scons: Update for xmlpool/options.h generation. 2013-01-12 19:00:04 +00:00
Johannes Obermayr
6bca283ad5 nv50/nvc0: Build codegen in nv50.
This is required to make libnv50 independent of libnvc0.
2013-01-12 17:14:04 +01:00
Pekka Vuorela
09a00a141f winsys/sw/wayland: Fix build to properly use wayland cflags
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59281
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-12 16:02:30 +01:00
Jordan Justen
3c3a2b51b8 texformat: use MESA_FORMAT_ARGB2101010 with GL_UNSIGNED_INT_2_10_10_10_REV
Choose MESA_FORMAT_ARGB2101010 when storing
GL_RGBA + GL_UNSIGNED_INT_2_10_10_10_REV or
GL_RGB + GL_UNSIGNED_INT_2_10_10_10_REV.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:46:12 -08:00
Jordan Justen
53e0f32efe texstore argb2101010: merge GL_RGBA and GL_RGB cases
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:46:02 -08:00
Jordan Justen
f1c5b5d15e glformats: support _mesa_bytes_per_pixel for 2101010+GL_RGB
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:45:01 -08:00
Jordan Justen
89e07ccf61 glformats: add _mesa_base_format_component_count
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:44:25 -08:00
Jordan Justen
6d63b6e503 glformats: add functions to detect signed/unsigned integer types
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:40:47 -08:00
Jordan Justen
2ace406b1f unpack: support unpacking MESA_FORMAT_ARGB2101010
Note: This is a candidate for the stable branches.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-12 01:40:01 -08:00
Ian Romanick
8af7d3ce9f mesa: Add extension tracking for {ARB,OES}_get_program_binary
The ARB_get_program_binary spec says "OpenGL 3.0 is required."  The
nearly identical OES_get_program_binary extension is available for
OpenGL ES 2.0, so I don't see how / why OpenGL 3.0 is a requirement for
the ARB version.  Let's just enable whenever GL_ARB_shader_objects is
available.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
31ca0c8be3 mesa: Add GetProgramiv support for GL_PROGRAM_BINARY_LENGTH
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
50c5fac4e2 mesa: Add Get support for PROGRAM_BINARY_FORMATS and NUM_PROGRAM_BINARY_FORMATS
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
fefd03e16c mesa: Add tracking for GL_PROGRAM_BINARY_RETRIEVABLE_HINT state
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
8e2e670007 mesa: Emit errors for geometry shader enums when ARB_gs4 is not supported
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
e3f273e2f4 glapi: Emit dispatch for {ARB,OES}_get_program_binary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:53 -08:00
Ian Romanick
11b49dbd05 glapi: Remove spurious space from end of extension name
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
3fe747a0fe mesa: Add stub implementations of glGetProgramBinary and glProgramBinary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
ec41349a78 mesa: Fix the naming of _mesa_ProgramParameteriARB
After recent changes in the XML, the dispatch generators will expect
this function to be named _mesa_ProgramParameteri.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
bb7f1a9ae8 glapi: Reorder and clean up some of the includes and comments
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Ian Romanick
a002902168 mesa: Fix GL_SHADER_BINARY_FORMATS query
There were two bugs here.  First, this and several other queries were
not available in a desktop GL context with GL_ARB_ES2_compatibility.
Second, GL_NUM_SHADER_BINARY_FORMATS returns zero, but
GL_SHADER_BINARY_FORMATS writes one element of data to the buffer.  If
NUM is zero, no data should be written.

Fixes piglit test 'arb_get_program_binary-overrun shader'.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 18:13:52 -08:00
Dave Airlie
4f1e037acf docs/GL3.txt: update GL3 status for r600g.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-12 00:19:18 +00:00
Dave Airlie
5039ad6bc5 r600g: fix warnings for htile va
This fixes a warning about mismatched types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 23:19:11 +00:00
Dave Airlie
d23aa65001 r600g: texture buffer object + glsl 1.40 enable support (v2)
This adds TBO support to r600g, and with GLSL 1.40 enabled,
we now get 3.1 core profiles advertised for r600g.

The r600/700 implementation is a bit different from the evergreen one,
as r6/7 hw lacks vertex fetch swizzles. So we implement it by passing 5
constants per sampler to the shader, the shader uses the first 4 as masks
for each component and the 5th as the alpha value to OR in.

Now TXQ is also broken so we have to pass a constant for the buffer size,
on evergreen we just pass this, on r6/7 we pass it as the 6th element
in the const info buffer.

v1.1: drop return as DDX doesn't use a texture type
v2: add r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Dave Airlie
77c10225ee r600g: uniform buffer object support
This adds 12 more constant buffers for use as UBOs,
along with adding relative constant fetching for 2D indices.

This with GLSL 1.40 enabled passes all the same tests as softpipe
on my evergreen system.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Dave Airlie
199eea4a4b r600: always export a position from vertex shader
This fixes piglit glsl-1.40-tf-no-position from gpu hanging on my rv635
at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-01-11 22:31:54 +00:00
Carl Worth
cc5fc8bf2f glcpp: Add tests for line continuation
First we test that line continuations are honored within a comment, (as
recently changed in glcpp), then we test that line continuations can be
disabled via an option within the context. This is tested via the new support
for a test-specific command-line option passed to glcpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
2483039aca glcpp: Rewrite line-continuation support to act globally.
Previously, we were only supporting line-continuation backslash characters
within lines of pre-processor directives, (as per the specification). With
OpenGL 4.2 and GLES3, line continuations are now supported anywhere within a
shader.

While changing this, also fix a bug where the preprocessor was ignoring
line continuation characters when a line ended in multiple backslash
characters.

The new code is also more efficient than the old. Previously, we would
perform a ralloc copy at each newline. We now perform copies only at each
occurrence of a line-continuation.

This commit fixes the line-continuation.vert test in piglit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
63d156900f glcpp: Add --disable-line-continuations argument to standalone glcpp
This will allow testing of disabled line-continuation on a case-by-case basis,
(with the option communicated to the preprocessor via the GL context).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
409dee5eac glcpp: Allow test-specific arguments for standalone glcpp tests
This will allow the test exercising disabled line continuations to arrange
for the --disable-line-continuations argument to be passed to the standalone
glcpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
0206ea3751 glcpp: Honor the GL context's DisableGLSLLineContinuations option
And simply don't call into the function that removes line continuations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
f8987f9972 glcpp: Accept pointer to GL context rather than just the API version
As the preprocessor becomes more sophisticated and gains more optional
behavior, it's easiest to just pass the GL context pointer to it so that
it can examine any fields there that it needs to (such as API version,
or the state of any driconf options, etc.).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
4b00ecebd0 drirc: Add quirk to disable GLSL line continuations for Savage2
This application is known to contain shaders that:

1. Have a stray backslash as the last line of comment lines
2. Have a declaration immediately following that line

Hence, interpreting that backslash as a line continuation causes the
declaration to be hidden and the shader fails to compile.  Fortunately, the
shaders also:

3. Do not have any other intentional line-continuation characters

So disabling line continuations entirely for the application fixes this
problem without causing any other breakage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
c0c9c9966f driconf: Add a new option: disable_glsl_line_continuations
This is to enable a quirk for Savage2 which includes a shader with a stray '\'
at the end of a comment line. Interpreting that backslash as a line
continuation will break the compilation of the shader, so we need a way to
disable this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:55:41 -08:00
Carl Worth
c6c575c69a driconf: Add proper dependency for compiling .mo files from .po files.
Previously this was happening unconditionally, leading to some excessive
rebuilding/relinking during builds.

Note that the .po files are not automatically updated due to changes to the
t_options.h file. Instead, translators should continue to use "make po"
manually. This is because after new strings are merged into the existing .po
file, manual work is still required by translators to ensure that the
translations are correct.
2013-01-11 13:54:54 -08:00
Carl Worth
b587a7595e driconf: Add translation-generation to build system, don't track generated files
Previously, the xmlpool directory had a lone Makefile to assist poeple in
manually invoking a deep make in order to update the translations in
options.h. We can observe that this wasn't happening in fact, (new
translations had been added to de.po without being generated into options.h,
and new options had been manually added directly to options.h rather than to
t_options.h).

Prevent both of these problems from occurring in the future by automatically
generating options.h as part of the standard build of mesa.

For this, the generated options.h is now removed from version control, (along
with Makefile in favor of Makefile.am).

[chadv: Port the Autotools changes to Android.]
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Carl Worth
8888c6f8e5 driconf: Fix German translations by removing a couple of bogus backslashes
As can be seen, many other translation strings already include a single
apostrophe just fine without any escaping. This strangely-escaped apostrophe
was causing a build failure ("invalid escape sequence") resulting in no "de"
translations in the final options.h file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Chad Versace
ec04617fb3 driconf: Fix gen_xmlpool.py script to allow running from any directory
The gen_xmlpool.py script would work correctly only when executed from the
directory that contained the script. This shortcoming was due to some
hard-coded paths in the script.

In order to easily invoke the script from the Android build system, we
must be able to execute the script from an arbitrary directory. To enable
that, this patch replaces the two hard-coded paths with new command line
arguments.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-11 13:54:54 -08:00
Carl Worth
11c3013610 driconf: Add some translations which have been available, but were not compiled
These translations have existed in the de.po file, but were not in the
generated options.h file. This was fixed by simply running "make options.h".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Carl Worth
bc50f02bc7 driconf: Add option definitions to source file, not generated target
For the last two most-recently-added driconf options, their definition was
manually added to options.h, a file which is intended to be automatically
generated, (as part of support for translated driconf option
descriptions). This means that these options would be eliminated if the
generation step were performed again.

Fix this by correctly adding the definitions of these options to t_options.h,
(the file used as input to the generator), and not the options.h file, which
is generated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 13:54:54 -08:00
Tom Stellard
4148a29ed8 targets/opencl: Link against libgallium.la instead of libgallium.a 2013-01-11 21:40:42 +00:00
Tom Stellard
4fc11fa3c8 drivers/radeon: Don't link against libgallium.la
This fixes several duplicate symbol errors.

libllvmradeon is a simple helper library.  If it requires symbols in
other libraries, this should be taken care of by the gallium target that
uses it (e.g. libr600.la)
2013-01-11 21:40:42 +00:00
Matt Turner
93d5fe1478 mesa: Use _mesa_lookup_enum_by_nr in tex*_error_check
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 11:45:10 -08:00
Ian Romanick
42ed81a7c3 mesa/es3: Add support for GL_PRIMITIVE_RESTART_FIXED_INDEX
This requires some derived state.  The cut vertex used is either the
value specified by glPrimitiveRestartIndex or it's hard-coded to ~0.
The derived state gl_array_attrib::_RestartIndex captures this value.
In addition, the derived state gl_array_attrib::_PrimitiveRestart is set
whenever either gl_array_attrib::PrimitiveRestart or
gl_array_attrib::PrimitiveRestartFixedIndex is set.

v2: Use _mesa_is_gles3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Ian Romanick
00d8ad81ff i965: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVE
We just treat this as an alias for GL_ANY_SAMPLES_PASSED.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-11 10:57:25 -08:00
Ian Romanick
886979a097 mesa/es3: Add support for GL_ANY_SAMPLES_PASSED_CONSERVATIVE query target
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Ian Romanick
8d47fe2960 mesa/es3: Allow transpose matrix uniforms in GLES3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Matt Turner
5e918a3825 glcpp: Reject token pasting operator in GLES
The GLSL ES 3.0 spec (Section 12.17) says:
"GLSL ES 1.00 removed token pasting and other functionality."

NOTE: This is a candidate for the stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-11 10:57:25 -08:00
Carl Worth
93e719ba4d glcpp: Make undefined macros illegal in #if and #elif for GLES3
Simply emitting a nicely-formatted error message if any undefined macro is
encountered in a parser context expecting an expression.

With this commit, the following piglit test now passes:

	spec/glsl-es-3.00/compiler/undefined-macro.vert

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Carl Worth
77e1bc9f1d glcpp: Add a flag to the parser state to indicate GLES.
This can be triggered either by creation of a GLES context (with
api == API_OPENGLES2) or else by a #version directive with version
value 100 or with a string of "es" following the version value.

There's no behavioral change with this commit—just preparation for ES-specific
behavior in the preprocessor in the future.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-11 10:57:25 -08:00
Andreas Boll
100440d1b1 glcpp: Add back tests/*.out to .gitignore
Accidentally removed in ac2793cf3e
2013-01-11 11:49:33 +01:00
Knut Andre Tidemann
8da2dab31d targets/egl-static: fix link failure to libwayland-drm
Fixes the following build error:
  CXXLD    egl_gallium.la
g++: error: ../../../../src/egl/wayland/wayland-drm/.libs/.libs/libwayland-drm.a: No
such file or directory

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-01-11 10:56:36 +01:00
Johannes Obermayr
d98716233e targets/dri-swrast: Force c++ linker in all cases.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59226

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2013-01-11 10:20:42 +01:00
Roland Scheidegger
babab28760 llvmpipe: fix clearing integer color buffers
We get int/uint clear color value in this case, and util_pack_color can't
handle these formats at all (even if it could, float input color isn't what
we want).
Pass through the color union appropriately and handle the packing ourselves
(as I couldn't think of a good generic util solution).
This gets piglit fbo_integer_precision_clear and
fbo_integer_readpixels_sint_uint from the ext_texture_integer test group from
segfault to pass (which only leaves fbo-blending from that group not working).

v2: fix up comments
2013-01-10 18:10:20 -08:00
Roland Scheidegger
5785f22d23 gallivm: fix border color for integer textures
Need to bitcast the float border color (luckily we already get
the color as int just disguised as float).
Fixes piglit texwrap GL_EXT_texture_integer bordercolor.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-10 18:02:01 -08:00
Roland Scheidegger
31884946b5 gallivm: more integer texture format fetch fixes
Change the texel type to int/uint instead of float throughout the sampling
code which makes it easier to catch errors (as llvm will complain about wrong
types if we mistakenly treat these values as real floats somewhere).
This should also get things like e.g. sampler swizzles (for unused channels)
right.
This fixes piglit texture_integer_glsl130 test.
Border color not working (crashing) yet.
(These formats are not exposed yet in llvmpipe.)

v2: couple cleanups according to José's comments

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-01-10 18:02:01 -08:00
Matt Turner
5eeedb852b build: mapi/glapi/gen: Use BUILT_SOURCES 2013-01-10 22:01:31 +01:00
Matt Turner
ac2793cf3e Clean up .gitignore files 2013-01-10 22:01:31 +01:00
Matt Turner
3ed95dc073 Remove MESA_PIC_FLAGS macro 2013-01-10 22:01:31 +01:00
Matt Turner
f1d229ee94 Remove installmesa 2013-01-10 22:01:31 +01:00
Matt Turner
b585c0059c Remove minstall 2013-01-10 22:01:31 +01:00
Matt Turner
424f200881 Remove checking for makedepend 2013-01-10 22:01:31 +01:00
Matt Turner
c977e61fe2 Remove gallium's unused Makefile.template 2013-01-10 22:01:31 +01:00
Matt Turner
74d105174b Remove gbm's unused Makefile.template 2013-01-10 22:01:31 +01:00
Matt Turner
ae352ccb90 Remove gallium targets' Makefile.{dri,vdpau,xorg,xvmc} 2013-01-10 22:01:31 +01:00
Matt Turner
8f8e85e703 Remove mklib 2013-01-10 22:01:31 +01:00
Matt Turner
41349a4253 Remove unused glsl Makefile.template 2013-01-10 22:01:31 +01:00
Matt Turner
c87474089d Remove configs/{current,default} 2013-01-10 22:01:30 +01:00
Andreas Boll
cb4d5021c6 gallium/tests/unit: Convert to automake 2013-01-10 22:01:30 +01:00
Andreas Boll
59088a2c2c gallium/tests/trivial: Convert to automake 2013-01-10 22:01:30 +01:00
Matt Turner
45270fb0fd targets/pipe-loader: Convert to automake
C++ linking (controlled by the nodist_EXTRA idiom) is needed

unconditionally for:
	nouveau (uses C++ in the driver)
	r300 (since LLVM is always required)
	radeonsi (since LLVM is always required)
	swrast (if builting LLVM pipe)

and conditionally (depends whether LLVM is enabled) for
	i915
	r600
	vmwgfx

and never needed for swrast (softpipe).

Unfortunately, automake seems to *always* link with C++ if nodist_EXTRA
is specified, even inside a false conditional. Not sure if this is a
bug, but it does seem to be weird behavior.

v2: Johannes Obermayr <johannesobermayr@gmx.de>
    - Fix some undefined symbols.

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    - Install pipe_* to $(libdir)/gallium-pipe.

v4: Johannes Obermayr <johannesobermayr@gmx.de>
    - Build it only once on --enable-gallium-gbm / --enable-opencl.
2013-01-10 22:01:30 +01:00
Matt Turner
53c62d3fb0 targets/gbm: Convert to automake 2013-01-10 22:01:30 +01:00
Matt Turner
cdee0e8084 targets/egl-static: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
    - Add missing Automake.inc

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    - Fix linking.

v4: Andreas Boll <andreas.boll.dev@gmail.com>
    - Port changes from ff574d653b
	  gallium/egl-static: Fix unresolved symbol 'clock_gettime'
2013-01-10 22:01:28 +01:00
Matt Turner
d53901c67c targets/xa-vmwgfx: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
af6a2e4f82 targets/xvmc-softpipe: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
45bf6aa617 targets/xvmc-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
c2371ccdac targets/xvmc-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
b173b16cba targets/xvmc-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing xvmc state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
0b132df3ad build: AC_SUBST XVMC_MAJOR/MINOR 2013-01-10 22:01:11 +01:00
Matt Turner
f2bf0cdf72 targets/xorg-radeonsi: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:11 +01:00
Matt Turner
ff5ab73d53 targets/xorg-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
7d451ba83a targets/xorg-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
f984d128c5 targets/xorg-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
1a4349125b targets/xorg-i915: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
7f24483e3d targets/vdpau-softpipe: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
e3b2160a1f targets/vdpau-radeonsi: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
98c051355f targets/vdpau-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
7e0d6ff6d7 targets/vdpau-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
d0df9e82c7 targets/vdpau-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Add missing vdpau state tracker to _LIBADD variable

v3: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
184b2f0f68 build: AC_SUBST VDPAU_MAJOR/MINOR 2013-01-10 22:01:10 +01:00
Matt Turner
0470fb4efe targets/libgl-xlib: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
c14c801a03 targets/dri-vmwgfx: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
b3068d87cb targets/dri-swrast: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
dd65729057 targets/dri-radeonsi: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
ab07ae05a3 targets/dri-r600: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:10 +01:00
Matt Turner
b570f1fc31 targets/dri-r300: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:09 +01:00
Matt Turner
6ed9f9f232 targets/dri-nouveau: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:09 +01:00
Matt Turner
2cd5bf7536 targets/dri-i915: Convert to automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Provide compatibility with scripts for the old Mesa build system
2013-01-10 22:01:09 +01:00
Matt Turner
880063f5bc build: Update drivers/Makefile.am to use LTLIBRARIES 2013-01-10 22:01:09 +01:00
Matt Turner
c236fa82c2 state_trackers/xvmc/test: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
984562d630 state_trackers/xvmc: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
69089ef5b0 Remove xvmc hack 2013-01-10 22:01:09 +01:00
Matt Turner
405a9dabe2 state_trackers/xorg: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
2ad2603467 state_trackers/xa: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
68c0311996 state_trackers/vega: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
d2ca32e332 state_trackers/vdpau: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
1ba5d8ac40 Remove vdpau hack 2013-01-10 22:01:09 +01:00
Matt Turner
083dcdf809 state_trackers/glx: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
c0b9081dc5 state_trackers/gbm: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
8443efdf2c state_trackers/egl: Convert to automake 2013-01-10 22:01:09 +01:00
Matt Turner
9b35758926 state_trackers: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
5089072419 Remove state_tracker/Makefile
Unneeded and unnecessary.
2013-01-10 22:01:08 +01:00
Matt Turner
9f38a1c871 build: Don't build pipebuffer
It's already built by src/gallium/auxiliary.
2013-01-10 22:01:08 +01:00
Tom Stellard
0dcb9ae0d9 radeon/llvm: Convert to Automake
v2: Johannes Obermayr <johannesobermayr@gmx.de>
    Fix some undefined symbols.

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    Build it -shared to fix egl_gallium.so on r600/radeonsi builds.
2013-01-10 22:01:08 +01:00
Matt Turner
2cbb94b3ce build: Add automake conditionals for gallium drivers 2013-01-10 22:01:08 +01:00
Matt Turner
f4b1f2807f state_trackers/dri/sw: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
d988481d58 state_trackers/dri/drm: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
2ff51cd639 state_trackers/dri: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
44653c0a0e winsys/sw/xlib: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
24c2fe94a2 winsys/sw/wrapper: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
1d0ef53e7b winsys/sw/wayland: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
1c9fb3c5b5 winsys/sw/null: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
5c4ade53a4 winsys/sw/fbdev: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
a6b3cd1349 winsys/sw/dri: Convert to automake 2013-01-10 22:01:08 +01:00
Matt Turner
b4beea6418 winsys/sw: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
2b5a1c0299 svga/winsys/drm: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
77fc30b57d nouveau/winsys/drm: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
da2d98fac7 radeonsi: Convert to automake
Can't use LTLIBRARIES here yet, since libradeon isn't converted.
2013-01-10 22:01:07 +01:00
Matt Turner
c35cddd134 nvc0: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
2a28353ca0 nv50: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
36066770bf nv30: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
1cf66321f9 nouveau: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
0a42131f3b svga: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
f781d4c60d softpipe: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
960cbd8b78 llvmpipe: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
b51cdfa64b rbug: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
3bfe7c2111 i915/winsys/sw: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
266d639b91 i915/winsys/drm: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
7d5496ab3b i915g: Convert to automake 2013-01-10 22:01:07 +01:00
Matt Turner
533130a5bb r600g: Use gallium automake include file 2013-01-10 22:01:06 +01:00
Tom Stellard
80d290d47a libgallium: Convert to automake 2013-01-10 22:01:06 +01:00
Tom Stellard
047fe04750 trace: Convert to automake 2013-01-10 22:01:06 +01:00
Tom Stellard
34a6150188 radeon/winsys: Convert to automake 2013-01-10 22:01:06 +01:00
Matt Turner
8dc4048b3b r300g: Link ralloc.c and register_allocate.c into separate library 2013-01-10 22:01:06 +01:00
Tom Stellard
e04413cbb0 r300g: Build a libtool archive 2013-01-10 22:01:06 +01:00
Tom Stellard
c07c2696c7 r300g: Use gallium automake include file
[mattst88] v2: Remove ARCH_FLAGS/OPT_FLAGS
2013-01-10 22:01:06 +01:00
Tom Stellard
c040fe102c gallium: Add common automake include file
v2: Matt Turner <mattst88@gmail.com>
    Remove ARCH_FLAGS/OPT_FLAGS

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    Add -I$(top_srcdir)/include to GALLIUM_CFLAGS
2013-01-10 22:01:06 +01:00
Matt Turner
9bf0d49abe automake: Convert Gallium target and winsys 2013-01-10 22:01:06 +01:00
Kristian Høgsberg
4e42e569dd egl/gbm: Implement EGL_EXT_buffer_age
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-10 15:58:05 -05:00
Matt Turner
0ae81b8422 mesa: Rename and wire-up GetInteger64i_v
The function was named badly and wasn't in the dispatch table,
making it hard to find.

Fixes transform_feedback2_states and gets a few other transform
feedback tests closer to working in es3conform.

Reviewed-by Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
1a3ffbf378 mesa: Correct glGet{Boolean,Integer}i_v names
Reviewed-by Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
ec8ee91923 mesa: Allow GL_DEPTH_STENCIL_ATTACHMENT in ES 3
Fixes framebuffer_srgb_default_encoding_fbo and 5 packed_depth_stencil
tests from es3conform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-10 10:57:51 -08:00
Chad Versace
75b963c095 mesa: Support more glGet enums for ES3
For glGetIntegerv, add support for the following in an OpenGL ES 3.0
context:
    GL_MAJOR_VERSION
    GL_MINOR_VERSION
    GL_NUM_EXTENSIONS

See Table 6.29 of the OpenGL ES 3.0 spec.

Fixes error GL_INVALID_ENUM in piglit egl-create-context-verify-gl-flavor,
testcase for OpenGL ES 3.0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
532e05a9d0 mesa: Support querying GL_MAX_ELEMENT_INDEX in ES 3
The ES 3 spec says that the minumum allowable value is 2^24-1, but the
GL 4.3 and ARB_ES3_compatibility specs require 2^32-1, so return 2^32-1.

Fixes es3conform's element_index_uint_constants test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
92855727f1 mesa: De-duplicate ES2 queries
From GL/GLES/GL_CORE and GLES2 -> GL/GL_CORE/GLES2.

Yes, we really were exposing ES2_compatibility queries on ES 1.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
5bb1827d95 mesa: Allow glGet* queries on EXT_texture_lod_bias data in ES 3
Fixes the remaining 4 texture_lod_bias failures in es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
e895d368e1 mesa: Allow glGet* queries on EXT_framebuffer_blit data in ES 3
Fixes 2 framebuffer_blit es3conform tests.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
d9948e49d3 mesa: Allow glGet* queries on ARB_fragment/vertex_shader data in ES 3
Fixes uniform_buffer_object_implementation_dependent_limits in
es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
d93c1b62f8 mesa: Allow glGet* queries on ARB_framebuffer_object data in ES 3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
914415a63f mesa: Allow glGet* queries on ARB_transform_feedback2 data in ES 3
Fixes the transform_feedback2_init_defaults test from es3conform.

The ES 3 spec lists these as TRANSFORM_FEEDBACK_PAUSED and
TRANSFORM_FEEDBACK_ACTIVE.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
3d0e4eb134 mesa: Allow glGet* queries on EXT_transform_feedback data in ES 3
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
3f1217607a mesa: Allow glGet* queries on ARB_sync data in ES 3
Fixes the sync_coverage_max_server_wait_timeout test in es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
0a8866e751 mesa: Allow glGet* queries of EXT_pbo data in ES 3
Fixes pixel_buffer_object_default_binding and gets other tests in
es3conform closer to passing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
be68dae374 mesa: Allow glGet* queries of select ARB_ubo data in ES 3
Fixes 5 uniform_buffer_object tests in es3conform.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:51 -08:00
Matt Turner
0cc018526f Add ES 3 handling to get.c and get_hash_generator.py
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Matt Turner
57616159aa glapi: Move ARB_base_instance to the correct location
It's #107, it shouldn't be added after the #116 comment.

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Matt Turner
a5ed966069 mesa/tests: Add ARB_ES3_compatibility enums
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Matt Turner
910a0bfe5b glapi: Add enums for ARB_ES3_compatibility
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-10 10:57:50 -08:00
Quentin Glidic
c5e9396424 mesa/program: Fix both Classic and Gallium build
Follow-up for 9078441072 and
3a5ad21cd3

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57044
Tested-by: Fabio Pedretti <fabio.ped@libero.it>
Tested-by: Brad King <brad.king@kitware.com>
2013-01-10 10:34:56 -08:00
Andreas Boll
f416b382d6 configure.ac: fix typo in error message 2013-01-10 18:41:53 +01:00
Marek Olšák
2f89949b66 r300g: don't set sample positions to the pixel center if MSAA is disabled
but an MSAA resource is bound. This effectively makes the MSAA disable switch
not affect rasterization, but it still affects the alpha-to-one and
alpha-to-coverage states. This hardware just lacks a proper MSAA disable
switch.

This fixes graphics corruption in sauerbraten.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59194
2013-01-10 15:37:10 +01:00
Paul Berry
9a07b6bd74 intel: Clean up confusion between logical and physical surface dimensions.
In most cases, the width, height, and depth of the physical surface
used by the driver to implement a texture or renderbuffer is equal to
the logical width, height, and depth exposed to the client through
functions such as glTexImage3D().  However, there are two exceptions:
cube maps (which have a physical depth of 6 but a logical depth of 1)
and multisampled renderbuffers (which have larger physical dimensions
than logical dimensions to allow multiple samples per pixel).

Previous to this patch, we accounted for the difference between
physical and logical surface dimensions at inconsistent places in the
call graph (multisampling was accounted for in
intel_miptree_create_for_renderbuffer(), and cubemaps were accounted
for in intel_miptree_create_internal()).  As a result, it wasn't
always clear, when calling a miptree creation function, whether
physical or logical dimensions were needed.  Also, we weren't
consistent about storing logical dimensions in the intel_mipmap_tree
structure (we only did so in the
intel_miptree_create_for_renderbuffer() code path, and we did not
store depth).

This patch refactors things so that intel_miptree_create_internal() is
responsible for converting logical to physical dimensions and for
storing both the physical and logical dimensions in the
intel_mipmap_tree structure.  As a result, all miptree creation
functions interpret their arguments as logical dimensions, and both
physical and logical dimensions are always available to functions that
work with intel_mipmap_trees.

In addition, it renames the fields in intel_mipmap_tree used to store
the dimensions, so that it is clear from the name whether physical or
logical dimensions are being referred to.

This should fix the following bugs:

- When creating a separate stencil surface for a depthstencil cubemap,
  we would erroneously try to convert the depth from 1 to 6 twice,
  resulting in an assertion failure.

- When creating an MCS buffer for compressed multisampling, we used
  physical dimensions instead of logical dimensions, resulting in
  wasted memory.

In addition, this should considerably simplify the implementation of
ARB_texture_multisample, because it moves the code to compute the
physical size of multisampled surfaces out of renderbuffer-only code.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-09 13:10:47 -08:00
Paul Berry
a5f87e8843 intel: Add a force_y_tiling parameter to intel_miptree_create().
This allows intel_miptree_alloc_mcs() to force Y tiling for the MCS
buffer.  Previously we accomplished this by the hack of passing
INTEL_MSAA_LAYOUT_CMS as the msaa_layout parameter, but that parameter
is going to be going away soon.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-09 13:10:30 -08:00
Paul Berry
8f15f19696 intel: Move compute_msaa_layout earlier in file.
No functional change.  This patch moves the compute_msaa_layout()
function earlier in intel_mipmap_tree.c so that it can be used by
other functions in that file.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-09 13:10:14 -08:00
Vinson Lee
b37930f309 r600g: Fix memory leak in r600_bytecode_add_vtx.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-01-09 11:11:46 -05:00
Marek Olšák
f8651dea4e r300g: optionally log MSAA resources to stderr
Set: RADEON_DEBUG=msaa
2013-01-09 16:47:10 +01:00
Marek Olšák
1385c353cf r300g: fix the GPU name in the renderer string
Broken by ca474f98f2.
2013-01-09 16:40:37 +01:00
Marek Olšák
4f2d9a8f52 r300g: fix CS checker errors caused by emit_dsa_state
size is 10 on r500 and 8 on r300
2013-01-09 16:40:37 +01:00
Johannes Obermayr
959e83d650 clover: Adapt libclc's INCLUDEDIR and LIBEXECDIR to make use of the new introduced libclc.pc.
Tom Stellard:
  -Keep --with-libclc-path and mark it deprecated.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2013-01-08 20:32:47 -05:00
Ian Romanick
ed3f237e09 glsl: Don't add structure fields to the symbol table
I erroneously added this back in January 2011 in commit 88421589.
Looking at the commit message, I have no idea why I added it.  It only
added non-array structure fields to the symbol table, so array structure
fields are treated correctly.

Fixes piglit tests structure-and-field-have-same-name.vert and
structure-and-field-have-same-name-nested.vert.  It should also fix
WebGL conformance tests shader-with-non-reserved-words.

NOTE: This is a candidate for the stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57622
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 13:09:31 -08:00
Kenneth Graunke
a5265f7536 i965/fs: Fix struct vs. class in acp_entry definitions. 2013-01-08 13:09:31 -08:00
Marek Olšák
a70e5e2b94 r600g: implement buffer copying using CP DMA for R7xx, Evergreen, Cayman
R6xx doesn't work - the issue seems to be with flushing (sometimes
the destination buffer contains garbage). There are no hangs, so we're good.

R7xx doesn't seem to have any alignment restriction despite our initial
thinking. Everything just works.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-08 21:58:28 +01:00
Marek Olšák
2d3d0d3a5a st/mesa: fix possible MSVC build error v2
https://bugs.freedesktop.org/show_bug.cgi?id=59143

Using GLubyte as per Brian's suggestion.
2013-01-08 21:53:13 +01:00
Paul Berry
c35abcd1b0 glsl: Pack flat "varyings" of mixed types together.
This patch enhances the varying packing code so that flat varyings of
uint, int, and float types can be packed together.

We accomplish this in lower_packed_varyings.cpp by making the type of
all flat varyings ivec4, and then using information-preserving type
conversions (e.g. ir_unop_bitcast_f2i) to convert all other types to
ints.

The varying_matches::compute_packing_class() function is updated to
reflect the fact that varying packing no longer needs to segregate
varyings of different base types.

Fixes piglit test varying-packing-mixed-types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Split lower_packed_varyings_visitor::bitwise_assign into
pack/unpack variants.
2013-01-08 09:18:14 -08:00
Paul Berry
18720555dd glsl: Prohibit structs and bools from being used as "varyings".
The GLSL 1.30 spec only allows vertex shader outputs and fragment
shader inputs ("varyings" in pre-GLSL-1.30 parlance) to be of type
int, uint, float, or vectors, matrices, or arrays thereof.  Bools,
bvec's, and structs are prohibited.  (Integral varyings were
prohibited prior to GLSL 1.30).

Previously, Mesa only performed this check on variables declared with
the "varying" keyword, and it always performed the check according to
the pre-GLSL-1.30 rules.  As a result, bools and structs were allowed
to slip through, provided they were declared using the new in/out
syntax.

This patch modifies the error check so that it occurs after "varying"
is converted to "in/out", and corrects it to properly account for GLSL
version.

Fixes piglit tests:
  in-bool-prohibited.frag
  in-bvec2-prohibited.frag
  in-bvec3-prohibited.frag
  in-bvec4-prohibited.frag
  in-struct-prohibited.frag
  out-bool-prohibited.vert
  out-bvec2-prohibited.vert
  out-bvec3-prohibited.vert
  out-bvec4-prohibited.vert
  out-struct-prohibited.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:09:21 -08:00
Paul Berry
c33be485c5 glsl: Plumb through is_parameter to apply_type_qualifier_to_variable()
This patch adds logic to allow the ast_to_hir function
apply_type_qualifier_to_variable() to tell whether it is acting on a
variable declaration or a function parameter.  This will allow it to
correctly interpret the meaning of "out" and "in" keywords (which have
different meanings in those two contexts).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:09:18 -08:00
Paul Berry
4b11b57ab4 glsl: Separate varying linking code to its own file.
linker.cpp is getting pretty big, and we're about to add even more
varying packing code, so split out the linker code that concerns
varyings to its own file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:09:09 -08:00
Paul Berry
8706395f25 mesa: Add ALIGN() macro to main/macros.h.
Previously this macro existed in 3 separate places, some inside the
intel driver and some outside of it.  It makes more sense to have it
in main/macros.h

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-08 09:08:57 -08:00
Paul Berry
09df6bb96d glsl: Fix loop bounds detection.
When analyzing a loop where the loop condition is expressed in the
non-standard order (e.g. "4 > i" instead of "i < 4"), we were
reversing the condition incorrectly, leading to a loop bound that was
off by 1.

Fixes piglit tests {vs,fs}-loop-bounds-unrolled.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-08 09:08:53 -08:00
Marek Olšák
844d14ebee winsys/radeon: bump the size of relocation hashlist
This should reduce the number of hash collisions in ETQW.
2013-01-08 16:41:57 +01:00
Christoph Bumiller
18f3f7b958 nvc0: catch too high GENERIC indices to prevent GRAPH traps 2013-01-08 16:13:52 +01:00
Christoph Bumiller
b9c8a98e21 nvc0: use correct resource target to select blit shader 2013-01-08 16:13:52 +01:00
Christoph Bumiller
41e105d5be nvc0: add missing call to map edge flag in push_vbo
Note: this is a candidate for the 9.0 stable branch.
2013-01-08 16:13:52 +01:00
Christoph Bumiller
be75a9373a nv50/ir: wrap assertion using typeid in #ifndef NDEBUG
Note: this is a candidate for the 9.0 stable branch.
2013-01-08 16:13:52 +01:00
Christoph Bumiller
076f4ced8b nvc0: fix out of bounds writes for unaligned sizes in push_data 2013-01-08 16:13:51 +01:00
Christoph Bumiller
39fe03e2de nouveau: increase max order of suballocated buffers by 1
This is really a hack to make TF2 (considerably, up to 20 -> 70 fps
at low res) faster.
2013-01-08 16:13:51 +01:00
Christoph Bumiller
48a45ec24a nouveau: improve buffer transfers
Save double memcpy on uploads to VRAM in most cases.
Properly handle FLUSH_EXPLICIT.
Reallocate on DISCARD_WHOLE_RESOURCE to avoid sync.
2013-01-08 16:13:51 +01:00
Marek Olšák
a75ddfd55d r300g: fix assertion failure in emit_dsa_state
Broken by 8ed6b1400b.
2013-01-08 14:33:18 +01:00
Kenneth Graunke
a60c567fcf i965: Support GL_FIXED and packed vertex formats natively on Haswell+.
Haswell and later support the GL_FIXED and 2_10_10_10_rev vertex formats
natively, and don't need shader workarounds.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
e219764fde i965: Add #defines for GL_FIXED vertex formats.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
f3840b1632 i965: Add remaining #defines for packed vertex formats.
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
899017fc54 i965: Use Haswell's sample_d_c for textureGrad with shadow samplers.
The new hardware actually just supports this now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Kenneth Graunke
30f8f58c20 i965/fs: Remove dead code from generate_uniform_pull_constant_load_gen7.
generate_uniform_pull_constant_load_gen7() is only called on Gen7+, so
the gen < 6 code is dead.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-07 16:48:02 -08:00
Alexander von Gluck IV
23595aa427 mesa: Drop mmx optimizations on Haiku
* Prevents compatibility problems. As Haiku
  doesn't use rtasm anymore, it's kind of
  pointless.
2013-01-07 17:39:49 -06:00
Alexander von Gluck IV
b9227b3e15 mesa: Don't use rtasm for Haiku swrast
* We have a symbol conflict as rtasm in
  Mesa collides with rtasm in gallium.
* As us linking gallium and mesa together
  is an edge case, lets just omit the rtasm
  code from Mesa as we should be going
  llvmpipe soon :)
2013-01-07 17:39:49 -06:00
Alex Deucher
4332f6fc18 r600g: set the virtual address for the htile buffer
Fixes cayman and TN with htile enabled.  Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=59089
https://bugs.freedesktop.org/show_bug.cgi?id=58667
Possibly others.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-01-07 15:21:46 -05:00
Jerome Glisse
ca474f98f2 radeon/winsys: move radeon family/class identification to winsys
Upcoming async dma support rely on winsys knowing about GPU families.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-07 11:06:07 -05:00
Jerome Glisse
d499ff98cd r600g/radeon/winsys: indentation cleanup
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-01-07 11:06:02 -05:00
Marek Olšák
afec10df37 r600g: flush FMASK and CMASK at the end of CS 2013-01-06 22:06:34 +01:00
Marek Olšák
8ed6b1400b r300g: implement MSAA
This is not as optimized as r600g - the MSAA compression is missing,
so r300g needs a lot of bandwidth (more than r600g to do the same thing).
However, if the bandwidth is not an issue for you, you can enjoy this
unoptimized MSAA support.
The only other missing optimization for MSAA is the fast color clear.

MSAA is enabled on r500 only, because that's the only GPU family I tested.
That said, MSAA should work on r300 and r400 as well (but you must set
RADEON_MSAA=1 to allow it, then turn MSAA on in your app or set GALLIUM_MSAA=n,
n >= 2, n <= 6)
I will enable the support by default on r300-r400 once someone (other than me)
tests those chipsets with piglit.

The supported modes are 2x, 4x, 6x.

The supported MSAA formats are RGBA8, BGRA8, and RGBA16F (r500 only).
Those 3 formats are used for all GL internal formats.

Tested with piglit. (I have ported all MSAA tests to GL2.1)
2013-01-06 14:44:12 +01:00
Marek Olšák
cc030da428 r300g: simplify DSA state, add ability to patch FG_ALPHA_FUNC while emitting
Preparation for MSAA and alpha-to-coverage.
2013-01-06 14:44:12 +01:00
Marek Olšák
25b3c0a52c r300g/compiler: add shader emulation for the alpha_to_one state 2013-01-06 14:44:12 +01:00
Vinson Lee
2f358feda3 configure.ac: Remove space after indent -T flag.
Fixes this build error on platforms not using GNU indent.

indent: Command line: ``-T'' requires a parameter

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2013-01-04 19:10:48 -08:00
Ian Romanick
d299ef3ad0 intel: Fix copy-and-paste bug setting gl_constants::MaxSamples
gl_constants::MaxSamples is an integer, so setting it to 1.0 is just
silly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Ian Romanick
a86d629799 mesa: Disallow R, RG, or RGB integer and unsigned formats in OpenGL ES 3.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Ian Romanick
2aae3abd77 mesa: Disallow SNORM formats for renderbuffers in OpenGL ES
v2: Move {RED,RG,RGB,RGBA}_SNORM changes from the previous commit to
this commit.  Based on suggestions from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Ian Romanick
4b92379da2 mesa: Disallow deprecated SNORM formats for renderbuffers
The OpenGL 3.2 core profile spec says:

    "The following base internal formats from table 3.11 are
    color-renderable: RED, RG, RGB, and RGBA. The sized internal formats
    from table 3.12 that have a color-renderable base internal format
    are also color-renderable. No other formats, including compressed
    internal formats, are color-renderable."

The OpenGL 3.2 compatibility profile spec says (only ALPHA is added):

    "The following base internal formats from table 3.16 are
    color-renderable: ALPHA, RED, RG, RGB, and RGBA. The sized internal formats
    from table 3.17 that have a color-renderable base internal format
    are also color-renderable. No other formats, including compressed
    internal formats, are color-renderable."

Table 3.12 in the core profile spec and table 3.17 in the compatibility
profile spec list SNORM formats as having a base internal format of RED,
RG, RGB, or RGBA.  From this we infer that they should also be color
renderable.

The OpenGL ES 3.0 spec says:

    "An internal format is color-renderable if it is one of the formats
    from table 3.12 noted as color-renderable or if it is unsized format
    RGBA or RGB. No other formats, including compressed internal
    formats, are color-renderable."

In the OpenGL ES 3.0 spec, none of the SNORM formats have "color-
renderable" marked in table 3.12.  The RGB I and UI formats also are not
color-renderable in ES3, but we'll save that change for another patch.

Both NVIDIA's closed-source driver (version 304.64) and AMD's
closed-source driver (Catalyst 12.6 on HD 3650) reject *all* SNORM
formats for renderbuffers in OpenGL 3.3 compatibility profiles.

v2: Move {RED,RG,RGB,RGBA}_SNORM changes from the this commit to the
next commit.  Based on suggestions from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-04 17:39:05 -08:00
Brian Paul
69c2528b83 util: fix addressing bug in pipe_put_tile_z() for PIPE_FORMAT_Z32_FLOAT
The Z32 pixel is 4 bytes so multiply x by 4, not 2.

Note: This is a candidate for the stable branches.
2013-01-04 15:30:46 -07:00
Brian Paul
073a53fe2f util: add get/put_tile_z() support for PIPE_FORMAT_Z32_FLOAT_S8X24_UINT
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58972

Note: This is a candidate for the stable branches.
2013-01-04 15:30:46 -07:00
Brian Paul
1b6ba9c4c8 gallivm: support more immediates in lp_build_tgsi_info()
Bump limit from 32 to 128.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58545
2013-01-04 15:30:45 -07:00
Brian Paul
46bad058eb xlib: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values
Fixes piglit glx-dont-care-mask test.

Note: This is a candidate for the stable branches.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-04 15:18:53 -07:00
Brian Paul
fe90762414 st/glx: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values
Fixes piglit glx-dont-care-mask test.

Note: This is a candidate for the stable branches.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-04 15:18:53 -07:00
Tom Stellard
aed37cbee8 radeon/llvm: Remove backend code from Mesa
This code now lives in an external tree.

For the next Mesa release fetch the code from the master branch
of this LLVM repo:
http://cgit.freedesktop.org/~tstellar/llvm/

For all subsequent Mesa releases, fetch the code from the official LLVM
project:
www.llvm.org
2013-01-04 21:05:09 +00:00
Johannes Obermayr
05c143cc04 Support LLVM >= 3.2 on radeonsi and opencl.
Tom Stellard:
 - Backend now has same name for all LLVM versions
 - Add missing LLVM_VERSION_INT definition
2013-01-04 21:05:09 +00:00
Tom Stellard
54f3a3e88d clover: Fix build after the addition of enum pipe_flush_flags
Broken since commit 598cc1f74d
2013-01-04 21:05:09 +00:00
Marek Olšák
bce36d1556 r300g: don't check for vertex and index buffer bind flags 2013-01-04 21:08:28 +01:00
Marek Olšák
beb358809e r300g/swtcl: use memcpy to emit indices 2013-01-04 21:08:28 +01:00
Marek Olšák
ad1d1a4d9e r300g/swtcl: simplify vertex uploading
- skip the vertex buffer reallocation in flush and just use
  the unsynchronized flag to get new memory.
- remove the cruft needed to get around the issues with the vertex buffer
  reallocation in flush
- use pb_buffer instead of pipe_resource
2013-01-04 21:08:28 +01:00
Marek Olšák
37fd455b21 r300g/swtcl: fix crash when setting vertex buffers
Broken by e73bf3b805.
2013-01-04 21:08:28 +01:00
Marek Olšák
d4ff72b944 r300g: don't set PIPE_BIND flags for internal textures 2013-01-04 21:08:28 +01:00
Paul Berry
06f67e75ee i965: Fix glCompressedTexSubImage2D offsets for ETC textures.
This patch fixes intel_miptree_unmap_etc() (which decompresses ETC
textures to linear) to pay attention to map->x and map->y when writing
to the destination image.  Previously these values were ignored,
causing the xoffset and yoffset parameters passed to
glCompressedTexSubImage2D() to be ignored.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-01-04 11:16:43 -08:00
Kristian Høgsberg
48ac6d7e97 egl/wayland: Remove kooky flush code
We used to have to jump through hoops to call glFlush at swap buffer time,
but the flush extension made that unnecessary a long time ago.
2013-01-04 11:20:12 -05:00
Kristian Høgsberg
b433e319b3 egl/wayland: Remove confusing comment about front buffer rendering 2013-01-04 11:20:12 -05:00
Kristian Høgsberg
b5160a10c0 egl_dri2: Remove unused struct dri2_egl_buffer from header file 2013-01-04 11:20:12 -05:00
Kristian Høgsberg
0725f2d654 egl: Add extension infrastructure for EGL_EXT_buffer_age 2013-01-04 11:20:12 -05:00
Kristian Høgsberg
f79739ebdd egl: Update to revision 19987 of eglext.h
This pulls in EGL_EXT_buffer_age.
2013-01-04 11:20:12 -05:00
Brian Paul
35fe71d97e util: move var declaration before loop to fix MSVC error 2013-01-04 08:22:02 -07:00
Marek Olšák
1aebb6911e r600g: implement 3D transfers
That means we can map and read multiple slices with one transfer_map call.
2013-01-04 14:06:54 +01:00
Marek Olšák
ee351ea178 st/mesa: fix assertion failures with 2101010 vertex formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:39 +01:00
Marek Olšák
d1818d6f68 st/mesa: accelerate CopyTexSubImage for 1D array textures
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:36 +01:00
Marek Olšák
ed86809ac9 st/mesa: fix CopyTexSubImage fallback for 1D array textures
- We should use a 3D transfer of size Width x 1 x NumLayers.
- We should use layer_stride instead of stride.
  (even though they are likely to be equal with 1D array textures)

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:28 +01:00
Marek Olšák
85cb4f299d st/mesa: fix GetTexImage for compressed 2D array textures
This uses a 3D blit to decompress the texture and then a 3D transfer
to read it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:17 +01:00
Marek Olšák
538d3a2d46 gallium/util: remove unused helper util_create_rgba_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:14 +01:00
Marek Olšák
5daba187c9 st/mesa: try to find the format matching format+type in decompressed_with_blit
There was the fast path based on _mesa_format_matches_format_and_type
for GetTexImage, but it never worked, because the Mesa format we were testing
there was always compressed. Further testing showed that the fast path
had been completely broken.

In this commit, the somewhat limited helper util_create_rgba_texture is
no longer used and instead, custom code for the texture creation is added,
which tries to find the best matching RGBA8 format, so that we can hit
the fast path *always* if the read format is a variant of RGBA8 and supported
by the driver.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:06:09 +01:00
Marek Olšák
0aecb174ce st/mesa: fix GetTexImage for compressed cubemaps
I'll deal with 2D arrays later.

NOTE: This is a candidate for the stable branches.
2013-01-04 14:05:52 +01:00
Marek Olšák
afec42a648 gallium/u_blitter: implement 3D blitting
Scaling and flipping in the Z direction isn't allowed yet.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:49 +01:00
Marek Olšák
5665deeaea gallium/u_blitter: fix blitting TEXTURE_CUBE_ARRAY with a non-zero cube index
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:47 +01:00
Marek Olšák
53d232d223 gallium/u_blitter: minor simplification
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:45 +01:00
Marek Olšák
ccfcf32873 gallium/u_blitter: unify some parameters into a dstbox parameter in blit_generic
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:43 +01:00
Marek Olšák
23f76f558e gallium/u_blitter: remove useless parameter from blitter_default_dst_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:40 +01:00
Marek Olšák
8fdece2896 gallium/util: complete implementation of util_dump_transfer
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:32 +01:00
Marek Olšák
8bd134f31b mesa: allow TEXTURE_CUBE_MAP_ARRAY in GetTexImage
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-01-04 14:05:21 +01:00
Marek Olšák
12aeb47b6a gallium/radeon: send the END_OF_FRAME flag to the DRM 2013-01-04 13:18:50 +01:00
Marek Olšák
598cc1f74d gallium: extend pipe_context::flush for it to accept an END_OF_FRAME flag
Usage with pipe_context:
  pipe->flush(pipe, NULL, PIPE_FLUSH_END_OF_FRAME);

Usage with st_context_iface:
  st->flush(st, ST_FLUSH_END_OF_FRAME, NULL);

The flag is only a hint for drivers. Radeon will use it for buffer eviction
heuristics in the kernel (e.g. for queries like how many frames have passed
since a buffer was used).

The flag is currently only generated by st/dri on SwapBuffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2013-01-04 13:18:33 +01:00
Marek Olšák
4ad5ebaefa radeonsi: fix int->bool conversion in fence_signalled 2013-01-04 12:42:03 +01:00
Marek Olšák
9f0ddbc9e4 r600g: fix int->bool conversion in fence_signalled
NOTE: This is a candidate for the stable branches.
2013-01-04 12:42:03 +01:00
Paul Berry
b8b1d61e76 Add new .gitignore entries for Automake 1.13 tests
Automake 1.13 creates a bunch of new build artefacts:
- bin/test-driver, a script for running tests.
- *.trs files for every "make check" test result.
- *.log files containing the output of every test run by "make check".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-03 15:24:45 -08:00
Kenneth Graunke
82f8e8ebd5 i965: Replace structs with bit-shifting for Gen7 SURFACE_STATE entries.
Every generation except Gen7 creates SURFACE_STATE entries via a
uint32_t array.  Only Gen7 uses the older bitfield structure, which we
moved away from because it was less efficient.  Convert it for
consistency.

This reduces the compiled size of gen7_wm_surface_state.o by 2.86% in a
release build.

v2: Fix accidental use of BRW_SURFACE_WIDTH/HEIGHT in brw_state_dump.c;
    switch back to gen7_set_surface_mcs_info setting surf[6] directly
    (both per Eric's review comments).

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-01-03 13:36:04 -08:00
smoki
5bf357db89 radeon/r200: Fix tcl culling
Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=57842
2013-01-03 13:22:22 -05:00
Jonas Ådahl
800ed958c3 wayland: Don't cancel a roundtrip when any event is received
Since wl_display_dispatch_queue() returns the number of processed events
or -1 on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when the
roundtrip does an early return and the callback later writes to the then
out of scope stack allocated `done' parameter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2013-01-03 11:44:55 -05:00
Vinson Lee
622d96aae4 i965: Add break statement at end of BRW_OPCODE_CONTINUE case.
Fixes missing break in switch defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 22:30:13 -08:00
Chad Versace
bfe28b8d93 egl/android: Fix build for Jelly Bean (v2)
In Jelly Bean, the interface to ANativeWindow changed. The change included
adding a new parameter the queueBuffer and dequeueBuffer methods,
removing the lockBuffer method, and requiring libsync.

v2:
  - s/fence_fd == -1/fence_fd != -1/
  - Fix leak. Close the fence_fd.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-02 14:55:36 -08:00
Chad Versace
56c6cdc9e7 android: Define Make variables for Android version
Define the following Make variables:
    MESA_ANDROID_MAJOR_VERSION
    MESA_ANDROID_MINOR_VERSION
    MESA_ANDROID_VERSION

These variable will allow us to make version-dependent decisions on
library dependencies. In particular, building Mesa against JellyBean will
require libsync.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2013-01-02 14:51:18 -08:00
Matt Turner
7f962c5ef3 mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to GetSamplerParameter*
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 12:33:49 -08:00
Matt Turner
f10b54fd79 mesa: Add missing ASSERT_OUTSIDE_BEGIN_END to SamplerParameter*
Commit f22d49de added the SamplerParamter* functions but only used
ASSERT_OUTSIDE_BEGIN_END inside the -f and -fv versions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 12:33:44 -08:00
Matt Turner
1b06a0478f mesa: Mark _mesa_{init,delete}_sampler_object as static
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-01-02 12:33:35 -08:00
Adam Jackson
86b6964ef9 glcpp: Typo fix.
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:09:22 -05:00
Adam Jackson
c8d3fd4a12 r300g: Fix visibility CFLAGS in automake
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:08:21 -05:00
Adam Jackson
443954d161 galahad, noop: Fix visibility CFLAGS in automake
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:08:15 -05:00
Adam Jackson
0daabd5239 glcpp: Fix visibility CFLAGS in automake
Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-01-02 14:07:58 -05:00
Paul Berry
7c0323296e mesa: Implement compressed 2D array textures.
This patch adds functionality to Mesa to upload compressed
2-dimensional array textures, using the glCompressedTexImage3D and
glCompressedTexSubImage3D calls.

Fixes piglit tests "EXT_texture_array/compressed *" and "!OpenGL ES
3.0/ext_texture_array-compressed_gles3 *".  Also partially fixes GLES3
conformance test "CoverageES30.test".

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-02 10:28:39 -08:00
Paul Berry
261ee4d907 mesa: Fix error reporting in _mesa_invalidate_pbo_{compressed_,}teximage.
The old error reporting was completely bogus, passing _mesa_error() a
format string that didn't even match the remaining arguments.  Also,
in many cases the number of dimensions in the TexImage call was not
preserved in the error message (e.g. an error in glTexImage2D was
reported simply as an error in glTexImage).

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-02 10:28:23 -08:00
Brian Paul
c7d3254b8e mesa: fix signed/unsignd mix-up in fetch_signed_l_latc1()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58844
2013-01-02 09:02:04 -07:00
Brian Paul
955babf2d9 glsl: add cast to silence signed/unsigned comparision warning 2013-01-01 08:47:04 -07:00
Brian Paul
05cd6cfd5f xlib: handle _mesa_initialize_visual()'s return value
If the call fails, we should return NULL from XMesaCreateVisual().
This was found when Waffle tried to create a visual with depth/stencil
bits = -1.  That's an illegal value for glXChooseFBConfig() and we should
return NULL in that situation.

Note: This is a candidate for the stable branches.
2012-12-31 18:17:58 -07:00
Kenneth Graunke
66ea6e8ec3 i965: Fail to blit rather than assert on invalid pitch requirements.
Dungeon Defenders hits TexImage()'s try_pbo_upload() path where
image->Width == 2, which doesn't meet intelEmitCopyBlit's requirement
that the pitch needs to be a multiple of 4.

Since intelEmitCopyBlit can already fail for a myriad of other reasons,
and it's not clear that other callers are immune to this failure mode,
simply make it return false rather than assert.

Fixes Dungeon Defenders on i965/Ivybridge.  Now playable (aside from
having to work around the EXT_bindable_uniform issue).

NOTE: This is probably a candidate for the 9.0 branch.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-12-29 01:04:30 -08:00
Eric Anholt
2f225f6145 intel: Skip texture validation logic when nothing has changed.
Improves GLBenchmark 2.1 offscreen performance by 3.2% +/- 1.5% (n=52).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 11:05:23 -08:00
Eric Anholt
73c376bbde intel: Turn a test in miptree_match_image into an assert.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 11:05:20 -08:00
Eric Anholt
12751ef2a7 i965: Stop making a copy of non-builtin uniforms in ParameterValues[].
We don't need them now that our set of parameter pointers points at the
GL core storage for them.  This should save memory/bandwidth/overhead in
uniform updates.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:54 -08:00
Eric Anholt
7e28d6c1ab i965: Consistently use nr_pull_params instead of NumParameters.
NumParameters used to be an upper bound on the number of vec4s to be
uploaded, which was basically safe (unless your buffer was bound near
the top of address space *and* you array indexed outside the buffer, in
which case I think you might GPU hang).  As I migrate the driver away
from ParameterValues[], this is no longer true.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:50 -08:00
Eric Anholt
aa6e35e80d i965/vs: Reference the core GL uniform storage for non-builtin uniforms.
Like in the FS, there's no reason to use an external copy if the
ParameterValues[] relayout of it isn't the layout we need.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:48 -08:00
Eric Anholt
c0d1f508d6 i965/fs: Reference the core GL uniform storage for non-builtin uniforms.
There's no reason to use an external copy if the relayout in the
external copy isn't serving us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:45 -08:00
Eric Anholt
bd326623ef glsl: Add a note about a surprising feature of gl_uniform_storage->type.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:42 -08:00
Eric Anholt
f189570ccf i965/fs: Remove the param_index/param_offset indirection.
Now that ParameterValues doesn't change across the visitor, we don't
need to go through this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:39 -08:00
Eric Anholt
d5efc14635 i965: Add asserts to check that we don't realloc ParameterValues.
Things are even more restrictive than they used to be, so I've made
mistakes in this area.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:36 -08:00
Eric Anholt
ffdfafb06c i965: Add texrect scale parameters before pointers to ParameterValues.
If adding scale parameters during program compile caused a realloc of
ParameterValues, then the driver uniform storage set up by
_mesa_associate_uniform_storage() would point to potentially freed
memory.

Note that this uses TexturesUsed, which may change at runtime for GLSL
when sampler uniforms change.  This is a flaw in our handling of texrect
in general, and not one I'm fixing currently.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:33 -08:00
Eric Anholt
6ccc505fc0 i965: Fix a typo in a comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:30 -08:00
Eric Anholt
50a88e2f44 i965: Add a note about a bug from the no-recompile-on-sampler-updates change.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-28 10:53:25 -08:00
Brian Paul
7c35521295 mesa: add missing texel fetch code for sRGB DXT formats
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58548
2012-12-26 15:23:05 -07:00
Eric Anholt
5791c56811 i965: Fix border color handling for deprecated SNORM formats.
We don't have native hardware support for these, so they get promoted to
RGBA, in which case we don't have hardware dealing with the channel
swizzling for us.

Fixes piglit EXT_texture_snorm/texwrap formats bordercolor (-swizzled).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-26 12:08:33 -08:00
Eric Anholt
5628501e7b i965: Start using HIZ for Z16 textures.
I had left this out for a long time because it regressed some
depthstencil-render-miplevels cases when it was enabled.  Now that the
bugs causing those are fixed, there's nothing stopping us.

Improves glbenchmark 2.1 offscreen performance by 7.3% +/- 2.8% (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-26 12:03:04 -08:00
Eric Anholt
3e1d8e62e7 intel: Use the parent miptree's format for setting up HiZ miptrees.
This worked out before because the parent was always 4 bytes so it
didn't affect the layout, but now we want to support Z16 too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-26 12:02:47 -08:00
Eric Anholt
cb3b172d19 intel: Remove a couple of dead function prototypes.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:12 -08:00
Eric Anholt
0d6a722ec4 i965: Add perf debug for depth/stencil alignment workaround.
Fixing these rendering bugs has been implicated in performance
regressions (which may be unfixable), but at least knowing that it's
happening should help diagnose those regressions.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
e454b2d480 i965: Assert that relayout laid out something that won't need it again.
The ETC1 changes failed at this, so let's make sure it will be caught in
testing next time.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
3b458416e3 i965: Also fix validation of Z32F_S8 textures.
This was caught by the assertion in the next commit.  It fixes the
remaining piglit depthstencil-render-miplevels cases, probably by
avoiding broken stencil copies in the validation path.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
46386816a7 i965: Fix validation of ETC miptrees.
When comparing to the teximage's format, we have to look at the
format-the-mt-was-created-for not the format-actually-stored-in-the-mt.

Improves glbenchmark 2.1 offscreen test performance 159% +/- 17% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54582
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:46:04 -08:00
Eric Anholt
3b99d094c9 qi965: Add perf debug for texture relayout.
Relayout is expensive, so it's something developers (both us and others)
should know about when it happens.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-22 13:45:56 -08:00
Eric Anholt
c417d261dd i965: Fix hiz resolves getting stomped by depth offset validation.
Fixes all the remaining non-Z32F_S8 depthstencil-render-miplevels tests
in piglit.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-22 13:41:22 -08:00
Marek Olšák
a58bf9d8f9 r600g: rename GPU_FLUSH -> INVAL_READ_CACHES
because that's what it does.
2012-12-22 19:39:29 +01:00
Marek Olšák
9ef26fc667 r600g: remove redundant parameter alloc_bo from r600_texture_create_object
alloc_bo == !buf
2012-12-22 19:39:29 +01:00
Matt Turner
a585b8f3a6 Make IsVertexArray() return false before BindVertexArray()
Rename existing _Used flag to EverBound.

The GL 4.3 and ES 3.0 specs say

   These names are marked as used, for the purposes of GenVertexArrays
   only, but they do not acquire array state until they are first bound.

This also affects Apple VAOs, which is fine since the
APPLE_vertex_array_object spec says

   A vertex array object is created by binding an unused name. This
   binding is accomplished by calling BindVertexArrayAPPLE with id set
   to the name of the new vertex array object.

Fixes arb_vertex_array_object_isvertexarray.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-21 20:03:30 -08:00
Matt Turner
fd93d55141 Make IsTransformFeedback() return false before BindTransformFeedback()
The GL 4.3 an ES 3.0 specs say

   A transform feedback object is created by binding a name returned by
   GenTransformFeedbacks with the command
      void BindTransformFeedback( enum target, uint id );

Fixes arb_transform_feedback2-istransformfeedback and part of
es3conform's CoverageES30.test.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-21 20:03:07 -08:00
Dave Airlie
54203ef5ac nouveau: deal with tbo cap for now.
This fixes the printk running apps against master.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-22 13:12:30 +10:00
Marek Olšák
9c6410e5c3 r600g: always use a tiled resource as the destination of MSAA resolve
i.e. we have to allocate a temporary tiled resource if dst isn't tiled.

This fixes hardlocks on r6xx-r7xx, though using a linear resource is forbidden
on later asics as well.

NOTE: This is a candidate for the stable branches.
2012-12-21 23:43:34 +01:00
Marek Olšák
9b0b4cf058 winsys/radeon: the env var RADEON_NOOP can be used to skip CS ioctls 2012-12-21 23:42:23 +01:00
Marek Olšák
eccc74f5d3 r600g: remove a false comment 2012-12-21 23:42:09 +01:00
Marek Olšák
fb45a816eb r600g: don't suspend TIME_ELAPSED queries during flushing
According to the GL spec, the result should be equivalent to comparing
two timestamps.
2012-12-21 23:42:04 +01:00
Marek Olšák
6d49ffde11 gallium/tests: fix build breakage after pipe_surface::usage removal 2012-12-21 23:41:41 +01:00
Frank Henigman
46e3aeb077 mesa: add bounds checking for uniform array access
No piglit regressions and now passes glsl-uniform-out-of-bounds-2.

validate_uniform_parameters now checks that the array index is
valid.  This means if an index is out of bounds, glGetUniform* now
fails with GL_INVALID_OPERATION, as it should.
_mesa_uniform and _mesa_uniform_matrix also call
validate_uniform_parameters so the bounds checks there became
redundant and were removed.

The test in glGetUniformLocation is modified to check array bounds
so it now returns GL_INVALID_INDEX (-1) if you ask for the location
of a non-existent array element, as it should.

Signed-off-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2012-12-21 11:23:48 -08:00
José Fonseca
74f0731953 util/u_format: Round when converting depth values from float to z16_unorm.
This makes the z16_unorm -> float -> z16_unorm conversion lossless.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-12-21 10:04:51 +00:00
Jerome Glisse
e8ca1a53a6 r600g: add cs tracing infrastructure for lockup pin pointing
It's a build time option you need to set R600_TRACE_CS to 1 and it
will print to stderr all cs along as cs trace point value which
gave last offset into a cs process by the GPU.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-12-20 18:23:54 -05:00
Jerome Glisse
6532eb17ba r600g: add htile support v16
htile is used for HiZ and HiS support and fast Z/S clears.
This commit just adds the htile setup and Fast Z clear.
We don't take full advantage of HiS with that patch.

v2 really use fast clear, still random issue with some tiles
   need to try more flush combination, fix depth/stencil
   texture decompression
v3 fix random issue on r6xx/r7xx
v4 rebase on top of lastest mesa, disable CB export when clearing
   htile surface to avoid wasting bandwidth
v5 resummarize htile surface when uploading z value. Fix z/stencil
   decompression, the custom blitter with custom dsa is no longer
   needed.
v6 Reorganize render control/override update mecanism, fixing more
   issues in the process.
v7 Add nop after depth surface base update to work around some htile
   flushing issue. For htile to 8x8 on r6xx/r7xx as other combination
   have issue. Do not enable hyperz when flushing/uncompressing
   depth buffer.
v8 Fix htile surface, preload and prefetch setup. Only set preload
   and prefetch on htile surface clear like fglrx. Record depth
   clear value per level. Support several level for the htile
   surface. First depth clear can't be a fast clear.
v9 Fix comments, properly account new register in emit function,
   disable fast zclear if clearing different layer of texture
   array to different value
v10 Disable hyperz for texture array making test simpler. Force
    db_misc_state update when no depth buffer is bound. Remove
    unused variable, rename depth_clearstencil to depth_clear.
    Don't allocate htile surface for flushed depth. Something
    broken the cliprect change, this need to be investigated.
v11 Rebase on top of newer mesa
v12 Rebase on top of newer mesa
v13 Rebase on top of newer mesa, htile surface need to be initialized
    to zero, somehow special casing first clear to not use fast clear
    and thus initialize the htile surface with proper value does not
    work in all case.
v14 Use resource not texture for htile buffer make the htile buffer
    size computation easier and simpler. Disable preload on evergreen
    as its still troublesome in some case
v15 Cleanup some comment and remove some left over
v16 Define name for bit 20 of CP_COHER_CNTL

Signed-off-by: Pierre-Eric Pelloux-Prayer <pelloux@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-12-20 18:23:51 -05:00
Jerome Glisse
24b1206ab2 r600g: rework flusing and synchronization pattern v7
This bring r600g allmost inline with closed source driver when
it comes to flushing and synchronization pattern.

v2-v4: history lost somewhere in outer space
v5: Fix compute size of flushing, use define for flags, update
    worst case cs size requirement for flush, treat rs780 and
    newer as r7xx when it comes to streamout.
v6: Fix num dw computation for framebuffer state, remove dead
    code, use define instead of hardcoded value.
v7: Remove dead code

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-12-20 18:23:31 -05:00
Paul Berry
cf5632094b mesa: Allow glReadBuffer(GL_NONE) for winsys framebuffers.
Previously, Mesa code assumed that glReadBuffer(GL_NONE) was only
valid for user-created framebuffer objects.  However, the spec is
quite clear that is should also be valid for the default framebuffer.
From section 18.2.1 ("Obtaining Pixels from the Framebuffer") of the
GL 4.3 spec:

    "When READ_FRAMEBUFFER_BINDING is zero, i.e. the default
    framebuffer, src must be one of the values listed in table 17.4,
    including NONE."

Similar language exists in the GLES 3.0 spec, and in desktop GL all
the way back to ARB_framebuffer_object.

Partially fixes GLES3 conformance test "CoverageES30.test".

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-20 10:03:30 -08:00
José Fonseca
ab2f573634 llvmpipe: Drop PIPE_QUERY_TIME_ELAPSED support.
It was slightly wrong: we were computing the longest duration of
the query among all the rasterizer tasks.

Regardless, for tile-based implementations such as llvmpipe, time differences
will never be very useful, because rendering before/during/after the query
is all interleaved.  And this is expected, see ARB_timer_query spec, issue 10.

In particular, piglit ext_timer_query-time-elapsed still fails, because
it makes assumptions that don't hold true in in tiled architectures. Not
sure how to fix that though.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-20 16:33:49 +00:00
José Fonseca
3160b0b9fc mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.
ARB/EXT_timer_query's definition of GL_TIME_ELAPSED match precisely the
subtraction of two GL_TIMESTAMP queries.

And for a lot of drivers, that's precisely how they have to implement
internally -- by emitting two hardware timestamp queries.

So, to simplify driver implementation, simply allow doing so in the state
tracker.

Eventually if no driver implements PIPE_QUERY_TIME_ELAPSED then we could
retire it.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-20 16:33:49 +00:00
José Fonseca
9976216bf6 gallium: s/PIPE_CAP_TIMER_QUERY/PIPE_CAP_QUERY_TIME_ELAPSED/
To better reflect what it is being advertised.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-20 16:33:49 +00:00
Marek Olšák
ef11ed61a0 r600g: add assertions to prevent creation of invalid surfaces 2012-12-20 17:13:18 +01:00
Marek Olšák
fefa2112bf r600g: refactor and make streamout dumping more informative
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:15 +01:00
Marek Olšák
6a2ec765bd r600g: try to fix streamout for the cases where BURST_COUNT > 0
The burst was incorrectly used, because ELEM_SIZE was always 0.
I don't know if the burst works, because I don't know of any test
which uses it.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:12 +01:00
Marek Olšák
72362ebefb r600g: lower stream outputs with dst_offset < start_component
This fixes streamout breakage caused by the varying packing.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:09 +01:00
Marek Olšák
d0e40bd3ed r600g: use r600_get_temp to get temporaries for CLIPDIST shader outputs
I need this to be able to use r600_get_temp in the function later.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-20 17:13:06 +01:00
Brian Paul
fddcc67f5c softpipe: fix up FS variant unbinding / deletion
The old call to tgsi_exec_machine_bind_shader() in
softpipe_delete_fs_state() was never called since the shader's original
tokens are never passed to the tgsi interpreter (only shader _variant_
tokens are).  Now, unbind the variant's tokens from the tgsi interpreter
when we free the variant.

This doesn't fix any known bugs but it's the right thing to do.

Note: This is a candidate for the stable branches.
2012-12-19 09:02:08 -07:00
Brian Paul
18ef8f83b2 softpipe: fix unreliable FS variant binding bug
In exec_prepare() we were comparing pointers to see if the fragment
shader variant had changed before calling tgsi_exec_machine_bind_shader().
This didn't work reliably when there was a lot of shader token malloc/
freeing going on because the memory might get reused.
Instead, bind the shader variant during regular state validation.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=40404
(fixes a couple of piglit's glsl-max-varyings test)

Note: This is a candidate for the stable branches.
2012-12-19 09:02:08 -07:00
Jerome Glisse
50880314e3 Revert "r600g: work around ddx over alignment"
This reverts commit d8287bac1f.

Cause more issue than it fix. Need to think of a proper solution.
2012-12-19 09:56:17 -05:00
Jerome Glisse
d8287bac1f r600g: work around ddx over alignment
This force surface allocated from ddx to be consider as height
aligned on 8 and fix 1D->2D tiling transition that result from
this.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-18 16:10:54 -05:00
Paul Berry
1b37fc40fc i965: Fix gl_VertexID when there are no other vertex inputs.
brw_emit_vertices contains special case logic to handle the case where
a vertex shader doesn't read any inputs.  This special case logic was
incorrectly activating in the case were the only vertex input is
gl_VertexID.  As a result, if a shader used gl_VertexID but used no
other inputs, then all vertices got a gl_VertexID of zero.

Fixes oglconform test "ubo-usage advanced.transform_feedback".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-18 09:02:53 -08:00
Paul Berry
5b7099c74d mesa: Make a function is_transform_feedback_active_and_unpaused.
The rather unweildy logic for determining this condition was repeated
in a large number of places.  This patch consolidates it to a single
inline function.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-18 09:02:53 -08:00
Paul Berry
1ad516207d mesa: Fix corner cases of BindBufferBase with transform feedback.
This patch implements the following behaviours, which are mandated by
the GL 4.3 and GLES3 specs.

1. Regarding the GL_TRANSFORM_FEEDBACK_BUFFER_SIZE query: "If the
   ... size was not specified when the buffer object was bound
   (e.g. if it was bound with BindBufferBase), ... zero is returned."
   (GL 4.3 section 6.7.1 "Indexed Buffer Object Limits and Binding
   Queries").

2. "BindBufferBase binds the entire buffer, even when the size of the
   buffer is changed after the binding is established. It is
   equivalent to calling BindBufferRange with offset zero, while size
   is determined by the size of the bound buffer at the time the
   binding is used."  (GL 4.3 section 6.1.1 "Binding Buffer Objects to
   Indexed Targets").  I interpret "at the time the binding is used"
   to mean "at the time of the call to glBeginTransformFeedback".

3. "Regardless of the size specified with BindBufferRange, or
   indirectly with BindBufferBase, the GL will never read or write
   beyond the end of a bound buffer. In some cases this constraint may
   result in visibly different behavior when a buffer overflow would
   otherwise result, such as described for transform feedback
   operations in section 13.2.2."  (GL 4.3 section 6.1.1 "Binding
   Buffer Objects to Indexed Targets").

Item 1 has been part of the spec all the way back to the inception of
the EXT_transform_feedback extension.  Items 2 and 3 were added in GL
4.2 and GLES 3.

Prior to GL 4.2, in place of items 2 and 3, the spec simply said
"BindBufferBase is equivalent to calling BindBufferRange with offset
zero and size equal to the size of buffer."  For transform feedback,
Mesa behaved as though this meant "...equal to the size of buffer at
the time of the call to BindBufferBase".  However, this was
problematic because it left it ambiguous what to do if the buffer is
shrunk between the call to BindBuffer{Base,Range} and the call to
BeginTransformFeedback.  Prior to this patch, Mesa's behaviour was to
try to write beyond the end of the buffer, likely resulting in memory
corruption.  In light of this, I'm interpreting the spec change as a
clarification, not an intended behavioural change, so I'm making the
change apply regardless of API version.

Fixes GLES3 conformance test transform_feedback2_pause_resume.test.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-18 09:02:49 -08:00
Paul Berry
b87e65c3b6 mesa/gles3: Generate error on draw call if transform feedback would overflow.
In desktop GL, if a draw call would cause transform feedback buffers
to overflow, the draw call should succeed, and the extra primitives
should simply not be recorded in the transform feedback buffers.

In GLES3, however, if a draw call would cause transform feedback
buffers to overflow, the draw call is supposed to produce an
INVALID_OPERATION error and no drawing should occur.

This patch implements the GLES3-required behaviour.

Fixes GLES3 conformance test "transform_feedback_overflow.test".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-18 08:31:38 -08:00
Paul Berry
febc237141 mesa/gles3: Generate error on DrawElements* calls if transform feedback active.
In GLES3, only glDrawArrays() and glDrawArraysInstanced() calls are
allowed when transform feedback is active.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-12-18 08:31:34 -08:00
Paul Berry
3870f2903f mesa: refactor _mesa_compute_max_transform_feedback_vertices from i965.
Previously, the i965 driver contained code to compute the maximum
number of vertices that could be written without overflowing any
transform feedback buffers.  This code wasn't driver-specific, and for
GLES3 support we're going to need to use it in core mesa.  So this
patch moves the code into a core mesa function,
_mesa_compute_max_transform_feedback_vertices().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v2: Eliminate C++-style variable declarations, since these won't work
with MSVC.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-18 08:31:26 -08:00
Paul Berry
61c1b065fb mesa: Change args to vbo_count_tessellated_primitives.
No functional change--this simply paves the way to allow futures
patches to call vbo_count_tessellated_primitives() during error
checking, before the _mesa_prim struct has been constructed.

This will be needed for GLES3, which requires draw calls to fail if
there is not enough space available in transform feedback buffers to
accommodate the primitives to be drawn.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-18 08:31:03 -08:00
Vadim Girlin
8cf552b182 radeon/llvm: improve cube map handling
Add support for TEX2, TXB2, TXL2, fix SHADOWCUBE

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-18 17:40:57 +04:00
Vadim Girlin
3b89fcbe54 radeon/llvm: fix TXQ_LZ handling for cube maps
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-12-18 17:40:57 +04:00
Vadim Girlin
63cabf0abb r600g: initialize inst_mod in r600_tex_from_byte_stream
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-12-18 17:40:57 +04:00
Roland Scheidegger
dc613f11dd gallivm: fix conversion for pure integer formats
Since the idea is to just expand or shrink the bit width but not otherwise do
conversion we also need to adjust the sign bit according to src, otherwise
the conversion code will incorrectly clamp the values. (Since this only works
for casting to ordinary floats the norm and fixed bits should always be fine.)

This fixes the remaining piglit attribs GL3 failures.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-18 01:57:35 +01:00
Kenneth Graunke
12f3b3d437 glsl: Fix gl_context vs. ralloc context in check_version again, again.
Dave found some, but there were more.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58039
2012-12-17 11:20:53 -08:00
Andreas Pokorny
fd65fb5aa8 vega: fix for object handle leak
frees the object handle when a OpenVG
is destroyed.

Signed-off-by: Andreas Pokorny <andreas.pokorny@elektrobit.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-17 10:22:26 -07:00
Brian Paul
9b13e731fa wmesa: include version.h to silence warning 2012-12-17 10:22:22 -07:00
Brian Paul
a9048aa6e6 xlib: include headers to fix errors/warnings 2012-12-17 10:22:10 -07:00
Jordan Justen
6cf3034ba7 mesa osmesa/x11: fix build error introduced in 4bea4cb9
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=58380

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-17 08:55:41 -08:00
Roland Scheidegger
3d14b25030 gallivm: fix texel fetch for array textures (2)
a460aea3f1 wasn't entirely correct,
since all coords are already ints hence need to skip the iround.
Passes piglit texelFetch with sampler1DArray/sampler2DArray.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-17 11:50:27 +01:00
Jordan Justen
1358f3a905 mesa: assert if driver did not compute the version
Make sure drivers initialize the version before:
 * _mesa_initialize_exec_table is called
 * _mesa_initialize_exec_table_vbo is called
 * A context is made current

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:28 -08:00
Jordan Justen
075f8722ab mesa: don't initialize VBO vtxfmt in _vbo_CreateContext
The driver should call _mesa_initialize_vbo_vtxfmt after
computing the context version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:28 -08:00
Jordan Justen
53ee3959f2 mesa: don't initialize exec dispatch tables in _mesa_initialize_context
Drivers must compute the context version, and then call
_mesa_initialize_exec_table themselves.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
d5d1f10955 mesa dispatch_sanity: call new functions to initialize exec table
In a future patch the exec functions will no longer set up
by _mesa_initialize_context and _vbo_CreateContext.

Therefore we must call _mesa_initialize_exec_table and
_mesa_initialize_exec_table_vbo.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
4bea4cb9fd drivers: compute version and then initialize exec table
This change forces the context version to be computed before
initilizing the exec dispatch tables.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
0924f4e90c vbo: add _mesa_initialize_vbo_vtxfmt
This function initializes the exec/save dispatch tables
for VBO vtxfmt.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Jordan Justen
d440149538 mesa: separate exec allocation from initialization
In glapi/gl_genexec.py:
* Remove _mesa_alloc_dispatch_table call

In glapi/gl_genexec.py and api_exec.h:
* Rename _mesa_create_exec_table to _mesa_initialize_exec_table

In context.c:
* Call _mesa_alloc_dispatch_table instead of _mesa_create_exec_table
* Call _mesa_initialize_exec_table (this is temporary)

Once all drivers have been modified to call
_mesa_initialize_exec_table, then the call to
_mesa_initialize_context can be removed from context.c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-16 15:30:27 -08:00
Dave Airlie
fa5078c255 r600g: fixup offset types for printing
This allows the debug code to at least show the sign properly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 10:36:42 +00:00
Henri Verbeet
cf358a2b42 gallium/u_blitter: Remove the overlapped blit assert from util_blitter_blit_generic().
This is used by st_BlitFramebuffer() / r600_blit(), and ARB_fbo allows
overlapped blits, even though the result is undefined. No piglit regressions
on r600g / CYPRESS.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-16 11:13:20 +01:00
Dave Airlie
a9abaaafd8 glsl_parser_extras.cpp: fixup gl vs mem contexts again.
This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=58039

Tested-by: Darxus on bug 58039
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 17:30:08 +10:00
Kenneth Graunke
4f91f8dd60 i965: Move BRW_MAX_GRF and similar defines to brw_reg.h.
These don't really belong in brw_structs.h.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-15 13:40:16 -08:00
Kenneth Graunke
1db1283563 i965: Split struct brw_reg out from brw_eu.h into its own header.
struct brw_instruction and the related instruction emitting code won't
be useful on Gen8+, as the instruction encoding changed.  However, the
struct brw_reg code is still extremely valuable.

While we're at it, fix up some style points:
- s/GLuint/unsigned/g
- s/GLint/int/g
- s/GLshort/int16_t/g
- s/GLushort/uint16_t/g
- s/INLINE/inline/g
- Replace tabs with spaces
- Put return types on a separate line from the function name/parameters
- Remove trailing whitespace
- Remove extraneous whitespace around function parameters

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-15 13:40:09 -08:00
Dave Airlie
e1ca88f098 docs: add ARB_texture_buffer_object_rgb32
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 07:07:43 +10:00
Dave Airlie
39fa4c0a58 st/mesa: add texture buffer object rgb32 support.
This checks if the pipe driver can support RGB32 formats.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 06:55:39 +10:00
Dave Airlie
1b62c326ea mesa: add support for ARB_texture_buffer_object_rgb32
This adds the extensions + the tex buffer support for checking
the formats.

There is a piglit test enhancement sent to that list.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-16 06:55:33 +10:00
Dave Airlie
7d7a549fa0 glsl: avoid using gl context as a memory context
Not sure what was going on here, but running piglit with debug builds
might be a good plan :-)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-15 15:29:49 +10:00
Ian Romanick
b23e92dbe7 i965: Add missing autoconf bits so test_vec4_register_coalesce will build
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Eric Anholt <eric@anholt.net>
2012-12-14 18:44:18 -08:00
Eric Anholt
c9e48e5b08 i965: Generalize VS compute-to-MRF for compute-to-another-GRF, too.
No statistically significant performance difference on glbenchmark 2.7
(n=60).  It reduces cycles spent in the vertex shader by 3.3% +/- 0.8%
(n=5), but that's only about .3% of all cycles spent according to the
fixed shader_time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:06:35 -08:00
Eric Anholt
471af25fc5 i965/vs: Extend opt_compute_to_mrf to handle limited "reswizzling"
The way our visitor works, scalar expression/swizzle results that get
stored in channels other than .x will have an intermediate MOV from
their result in the .x channel to the real .y (or whatever) channel, and
similarly for vec2/vec3 results.

By knowing how to adjust DP4-type instructions for optimizing out a
swizzled MOV, we can reduce instructions in common matrix multiplication
cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:06:30 -08:00
Eric Anholt
a76a03f437 i965/vs: Add a unit test for opt_compute_to_mrf().
The compute-to-mrf code is really twitchy, and it's hard to construct
GLSL testcases for it.  This unit test is also really hard to work with
(for example, if your instruction is removed by dead code elimination,
you end up inspecting something irrelevant), but I did use it for
debugging some of the commits to follow.

I called it test_vec4_register_coalesce because the compute-to-mrf code
is about to morph into that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:06:01 -08:00
Eric Anholt
7171c45d3a i965/fs: Drop an unnecessary _safe on a list walk.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:05:57 -08:00
Eric Anholt
78ce522932 i965/fs: Add a note explaining a detail of register_coalesce_2().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 16:05:48 -08:00
Eric Anholt
7baf9198b2 i965: Also consider HALTs a potential block end.
The final halt of the fragment shader turns off the remaining channels,
then jumps such that everything is turned back on.  So, we can have our
last ENDIF of the shader point at that directly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:45:26 -08:00
Kenneth Graunke
2702202290 i965: Jump to the end of the next outer conditional block on ENDIFs.
From the Ivybridge PRM, Volume 4, Part 3, section 6.24 (page 172):

"The endif instruction is also used to hop out of nested conditionals by
 jumping to the end of the next outer conditional block when all
 channels are disabled."

Also:
"Pseudocode:
 Evaluate(WrEn);
 if ( WrEn == 0 ) {  // all channels false
   Jump(IP + JIP);
 }"

First, ENDIF re-enables any channels that were disabled because they
didn't match the conditional.  If any channels are active, it proceeds
to the next instruction (IP + 16).  However, if they're all disabled,
there's no point in walking through all of the instructions that have no
effect---it can jump to the next instruction that might re-enable some
channels (an ELSE, ENDIF, or WHILE).

Previously, we always set JIP on ENDIF instructions to 2 (which is
measured in 8-byte units).  This made it do Jump(IP + 16), which just
meant it would go to the next instruction even if all channels were off.

It turns out that walking over instructions while all the channels are
disabled like this is worse than just instruction dispatch overhead: if
there are texturing messages, it still costs a couple hundred cycles to
not-actually-read from the texture results.

This patch finds the next instruction that could re-enable channels and
sets JIP accordingly.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 15:42:34 -08:00
Chris Forbes
2f7f095a80 i965: expose ARB_texture_cube_map_array
V3: Put enable in an existing block rather than making a new
one for no good reason.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:51 -08:00
Eric Anholt
380fc562b3 i965/fs: Fix setup for textureGrad(samplerCubeArray, coord, dPdx, dPdy)
Caught by tex_grad-01.frag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:48 -08:00
Eric Anholt
3c56063354 i965/fs: Move the failure for gen7 16-wide intdiv to emit_math().
The cube map array code adds another caller of emit_math(), which
needs this check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:43 -08:00
Chris Forbes
d2dbba8755 i965: fs: Add fixup for textureSize on Gen6/7
V2: Moved up into emit(ir_texture *) to avoid duplication and fix
ordering for Gen7; Gen6 math quirks moved into previous patches.

Tested on Gen6 only; passes all the cube_map_array piglits.

V3: Fixed weird whitespace
V4: Use sampler->type; otherwise broken on arrays of samplers.
v5: Minor style fixes (by anholt)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:39 -08:00
Chris Forbes
6e34723ac9 i965: fs: fix gen6+ math operands in one place
V4: Fix various style nits as pointed out by Eric, and expand IMM
    operands on both Gen6 and Gen7.
v5: minor style nits (by anholt)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:35 -08:00
Chris Forbes
f6a3fda25d i965: vs: Add fixup for textureSize with cube array samplers
V3: Fixed weird whitespace
V4: Use sampler's type rather than variable's type; otherwise broken
    with arrays of samplers. (Thanks Eric)
v5: Fix a couple more style nits (by anholt)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:31 -08:00
Chris Forbes
1cb57ea493 i965/vs: Fix gen6+ math operand quirks in one place
This causes immediate values to get moved to a temp on gen7, which is needed
for an upcoming change but hadn't happened in the visitor until then.

v2: Drop gen > 7 checks (doesn't exist), and style-fix comments (changes by
    anholt).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:28 -08:00
Chris Forbes
0cda3382a6 i965: Add various plumbing for cubemap arrays
V4: Fixed style nits

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:26:12 -08:00
Eric Anholt
2cae9f2d4a i965/fs: Add empirically-determined instruction latencies for gen7.
v2: Actually switch on the other math instructions mentioned in the
    comment.
v3: Add timing data for textureSize(), and clean up some long comment
    lines.

Testing shader_time of fs16 shaders on a few frames of various apps:
nexuiz improved by 2.9% +/- 1.5% (n=10)
no difference on GLB2.5 (n=36, outliers removed)
no difference on GLB2.7 (n=25)
etqw improved by 2.6% +/- 2.2% (n=25)
no difference on lightsmark (n=25)

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:22 -08:00
Eric Anholt
4df1e18864 i965/fs: Fix the clock increment in scheduling.
I've tested this to be true with various ALU ops on gen7 (with the
exception of MADs, which go at either 3 or 4 cycles per dispatch).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:14 -08:00
Eric Anholt
6255fc7426 i965/fs: Move the old gen4 bspec-based scheduling info to a helper func.
For gen7 everything changes, and we have actual information on latency.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:10 -08:00
Eric Anholt
461a29783a i965/fs: Set up gen7 UBO loads as sends from GRFs.
This gives the instruction scheduler a chance to schedule between the
loads, whereas before it was restricted due to the dependencies between
the MRFs for setting them up.

For one shader in gles3conform, it goes from getting stuck in register
allocation for as long as anybody's bothered to leave it running down
to 23 seconds, thanks to the LIFO scheduling.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:18:05 -08:00
Eric Anholt
456dbcc337 i965/fs: Before reg alloc, schedule instructions to reduce live ranges.
This came from an idea by Ben Segovia.  16-wide pixel shaders are very
important for latency hiding on i965, so we want to try really hard to
get them.  If scheduling an instruction makes some set of instructions
available, those are probably the ones that make the instruction's
result dead.  By choosing those first, we'll have a tendency to reduce
the amount of live data as opposed to creating more.

Previously, we were sometimes getting this behavior out of the
scheduler, which was what produced the scheduler's original performance
wins on lightsmark.  Unfortunately, that was mostly an accident of the
lame instruction latency information that I had, which made it
impossible to fix the actual scheduling for performance.  Now that we've
fixed the scheduling for setup for register allocation, we can safely
update the latency parameters for the final schedule.

In shader-db, we lose 37 16-wide shaders, but gain 90 new ones.  4
shaders that were spilling change how many registers spill, for a
reduction of 70/3899 instructions.

v2: Simplify the new loop.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:17:59 -08:00
Eric Anholt
ba864bfcfa i965/fs: Add some optional debug printfs to scheduling.
Seeing when instructions become available to schedule is really useful.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:17:55 -08:00
Eric Anholt
7a9f940cab i965/fs: Schedule instructions both before and after register allocation.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-14 15:17:41 -08:00
Eric Anholt
1315f3b4b3 i965: Make sure that the shader_time report at context destroy happens.
Otherwise, you end up with some report from within a second of context
destroy, which is now what you really want for testing the impact of
changes
2012-12-14 15:05:10 -08:00
Eric Anholt
81c247404a i965: Print a total time for the different shader stages.
Sometimes I've got a patch for a performance optimization that's not
showing a statistically significant performance difference on reported
FPS, but still seems like a good idea because it ought to reduce time
spent in the shader.  If I can see the total number of cycles spent in
the shader stage being optimized, it may show that the patch is still
worthwhile (or point out that it's actually broken in some way).
2012-12-14 15:05:10 -08:00
Eric Anholt
f74560f3fb i965: Scale shader_time to compensate for resets.
Some shaders experience resets more than others, which skews the numbers
reported.  Attempt to correct for this by linearly scaling according to
the number of resets that happen.

Note that will not be accurate if invocations of shaders have varying
times and longer invocations are more likely to reset.  However, this
should at least be better than the previous situation.
2012-12-14 15:05:10 -08:00
Eric Anholt
338b5f887d i965: Adjust the split between shader_time_end() and shader_time_write().
I'm about to emit other kinds of writes besides time deltas, and it
turns out with the frequency of resets, we couldn't really use the old
time delta write() function more than once in a shader.
2012-12-14 15:05:10 -08:00
Paul Berry
ca7e891e8a glsl/linker: Pack between varyings.
This patch implements varying packing between varyings.

Previously, each varying occupied components 0 through N-1 of its
assigned varying slot, so there was no way to pack two varyings into
the same slot.  For example, if the varyings were a float, a vec2, a
vec3, and another vec2, they would be stored as follows:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 flt  x   x   x  <vec2->  x   x  <--vec3--->  x  <vec2->  x   x   varyings

(Each * represents a varying component, and the "x"s represent wasted
space).

This change packs the varyings together to eliminate wasted space
between varyings, like so:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 <vec2-> <vec2-> flt <--vec3--->  x   x   x   x   x   x   x   x   varyings

Note that we take advantage of the sort order introduced in previous
patches (vec4's first, then vec2's, then scalars, then vec3's) to
minimize how often a varying is "double parked" (split across varying
slots).

Reviewed-by: Eric Anholt <eric@anholt.net>

v2: Skip varying packing if ctx->Const.DisableVaryingPacking is true.
2012-12-14 10:51:21 -08:00
Paul Berry
df87722bec glsl/linker: Pack within compound varyings.
This patch implements varying packing within varyings that are
composed of multiple vectors of size less than 4 (e.g. arrays of
vec2's, or matrices with height less than 4).

Previously, such varyings used up a full 4-wide varying slot for each
constituent vector, meaning that some of the components of each
varying slot went unused.  For example, a mat4x3 would be stored as
follows:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 <-column1->  x  <-column2->  x  <-column3->  x  <-column4->  x   matrix

(Each * represents a varying component, and the "x"s represent wasted
space).  In addition to wasting precious varying components, this
layout complicated transform feedback, since the constituents of the
varying are expected to be output to the transform feedback buffer
contiguously (e.g. without gaps between the columns, in the case of a
matrix).

This change packs the constituents of each varying together so that
all wasted space is at the end.  For the mat4x3 example, this looks
like so:

 <----slot1----> <----slot2----> <----slot3----> <----slot4---->  slots
  *   *   *   *   *   *   *   *   *   *   *   *   *   *   *   *
 <-column1-> <-column2-> <-column3-> <-column4->  x   x   x   x   matrix

Note that matrix columns 2 and 3 now cross a boundary between varying
slots (a characteristic I call "double parking" of a varying).

We don't bother trying to eliminate the wasted space at the end of the
varying, since the patch that follows will take care of that.

Since compiler back-ends don't (yet) support this packed layout, the
lower_packed_varyings function is used to rewrite the shader into a
form where each varying occupies a full varying slot.  Later, if we
add native back-end support for varying packing, we can make this
lowering pass optional.

Reviewed-by: Eric Anholt <eric@anholt.net>

v2: Skip varying packing if ctx->Const.DisableVaryingPacking is true.
2012-12-14 10:51:18 -08:00
Paul Berry
4bb8661b1b gallium: Disable varying packing on hardware with <=8 texture indirections.
In practice this will disable varying packing on R300, R400, i915g,
and nv30.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-14 10:51:10 -08:00
Paul Berry
6ee500cfd2 mesa: Add an option so driver can opt out of varying packing.
On hardware that supports a limited number of texture indirections,
varying packing will comsume an extra texture indirection, since ALU
operations are needed in the fragment shader to unpack the varyings
before any texturing can be done.

This patch introduces a new driver option,
ctx->Const.DisableVaryingPacking, which can be used by a driver to opt
out of varying packing if the extra texture indirection is costly
enough to outweigh the advantages of packing varyings.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-14 10:49:32 -08:00
Paul Berry
1745a4d751 glsl: Add a lowering pass for packing varyings.
This lowering pass generates GLSL code that manually packs varyings
into vec4 slots, for the benefit of back-ends that don't support
packed varyings natively.

No functional change--the lowering pass is not yet used.

Reviewed-by: Eric Anholt <eric@anholt.net>

v2: Don't use ir_hierarchical_visitor--just loop over instructions
directly.  Also, make the names of the packed varyings include the
names of the original varyings that were packed into them.
2012-12-14 10:49:21 -08:00
Paul Berry
f3993107f0 glsl/linker: Sort varyings by packing class, then vector size.
This patch paves the way for varying packing by adding a sorting step
before varying assignment, which sorts the varyings into an order that
increases the likelihood of being able to find an efficient packing.

First, varyings are sorted into "packing classes" by considering
attributes that can't be mixed during varying packing--at the moment
this includes base type (float/int/uint/bool) and interpolation mode
(smooth/noperspective/flat/centroid), though later we will hopefully
be able to relax some of these restrictions.  The number of packing
classes places an upper limit on the amount of space that must be
wasted by varying packing, since in theory a shader might nave 4n+1
components worth of varyings in each of m packing classes, resulting
in 3m components worth of wasted space.

Then, within each packing class, varyings are sorted by vector size,
with vec4's coming first, then vec2's, then scalars, and then finally
vec3's.  The motivation for this order is that it ensures that the
only vectors that might be "double parked" (with part of the vector in
one varying slot and the remainder in another) are vec3's.

Note that the varyings aren't actually packed yet, merely placed in an
order that will facilitate packing.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 10:49:12 -08:00
Paul Berry
eb989e37cb glsl/linker: Subdivide the first phase of varying assignment.
This patch further subdivides the loop that assigns varying locations
into two phases: one phase to match up the varyings between shader
stages, and one phase to assign them varying locations.

In between the two phases the matched varyings are stored in a new
data structure called varying_matches.  This will free us to be able
to assign varying locations in any order, which will pave the way for
packing varyings.

Note that the new varying_matches::assign_locations() function returns
the number of varying slots that were used; this return value will be
used in a future patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 10:49:08 -08:00
Paul Berry
25ed3bef9b glsl/linker: Defer recording transform feedback locations.
This patch subdivides the loop that assigns varying locations into two
phases: one phase to match up varyings between shader stages (and
assign them varying locations), and a second phase to record the
varying assignments for use by transform feedback.

This paves the way for varying packing, which will require us to
further subdivide the first phase.

In addition, it lets us avoid a clumsy O(n^2) algorithm, since we can
now record the locations of all transform feedback varyings in a
single pass through the tfeedback_decls array, rather than have to
iterate through the array after assigning each varying.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-14 10:49:05 -08:00
Paul Berry
3e81c666db glsl: Create a field to store fractional varying locations.
Currently, the location of each varying is recorded in ir_variable as
a multiple of the size of a vec4.  In order to pack varyings, we need
to be able to record, e.g. that a vec2 is stored in the second half of
a varying slot rather than the first half.

This patch introduces a field ir_variable::location_frac, which
represents the offset within a vec4 where a varying's value is stored.
Varyings that are not subject to packing will always have a
location_frac value of zero.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:52 -08:00
Paul Berry
3c9c17db4a glsl/linker: Make separate ir_variable field to mean "unmatched".
Previously, the linker used a value of -1 in ir_variable::location to
denote a generic input or output of the shader that had not yet been
matched up to a variable in another pipeline stage.

This patch introduces a new ir_variable field,
is_unmatched_generic_inout, for that purpose.

In future patches, this will allow us to separate the process of
matching varyings between shader stages from the processes of
assigning locations to those varying.  That will in turn pave the way
for packing varyings.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:38 -08:00
Paul Berry
50895d443a glsl/linker: Always invalidate shader ins/outs, even in corner cases.
Previously, link_invalidate_variable_locations() was only called
during assign_attribute_or_color_locations() and
assign_varying_locations().  This meant that in the corner case when
there was only a vertex shader, and varyings were being captured by
transform feedback, link_invalidate_variable_locations() wasn't being
called for the varyings.

This patch migrates the calls to link_invalidate_variable_locations()
to link_shaders(), so that they will be called in all circumstances.
In addition, it modifies the call semantics so that
link_invalidate_variable_locations() need only be called once per
shader stage (rather than once for inputs and once for outputs).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:35 -08:00
Paul Berry
18392443d4 glsl/lower_clip_distance: Update symbol table.
This patch modifies the clip distance lowering pass so that the new
symbol it generates (glClipDistanceMESA) is added to the shader's
symbol table.

This will allow a later patch to modify the linker so that it finds
transform feedback varyings using the symbol table rather than having
to iterate through all the declarations in the shader.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-14 10:48:28 -08:00
Tapani Pälli
d249159fe6 android: build fix for libmesa_glsl_utils
hash_table.c compilation requires ralloc.h include path

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-14 10:01:45 -08:00
Brian Paul
a12a8c910f mesa: minor indentation fixes in texcompress_etc.c 2012-12-14 06:33:08 -07:00
Brian Paul
b29f2d5ff5 mesa: remove old swrast-based compressed texel fetch code 2012-12-14 06:33:08 -07:00
Brian Paul
7dc36a50de swrast: use new core Mesa compressed texel fetch functions 2012-12-14 06:33:08 -07:00
Brian Paul
faa95fd7fa mesa: reimplement _mesa_decompress_image() using new tex fetch code 2012-12-14 06:33:08 -07:00
Brian Paul
ccbe7db1e6 mesa: added _mesa_get_compressed_fetch_func() 2012-12-14 06:33:08 -07:00
Brian Paul
ad3e39bb6d mesa: add new texel fetch code for etc formats 2012-12-14 06:33:07 -07:00
Brian Paul
cd7baf5bf4 mesa: add new texel fetch code for rgtc formats 2012-12-14 06:33:07 -07:00
Brian Paul
141d299965 mesa: add new texel fetch code for fxt formats 2012-12-14 06:33:07 -07:00
Brian Paul
a774eaa57e mesa: add new texel fetch code for dxt formats 2012-12-14 06:33:07 -07:00
Brian Paul
2037a06da9 mesa: add compressed_fetch_func typedef
This is a first step in removing the swrast-related code in core
Mesa's texture compression files.
2012-12-14 06:33:07 -07:00
Brian Paul
90b7797a1d swrast: merge get_texel_fetch_func() and set_fetch_functions()
No real need for separate functions anymore.
2012-12-14 06:33:07 -07:00
Brian Paul
f4896cea04 swrast: make _mesa_get_texel_fetch_func() static
Not called from any other file.
2012-12-14 06:33:07 -07:00
Dave Airlie
9e41b0badb draw/llvmpipe: fix transform feedback position + enable other extensions
This builds on the previous draw/softpipe patch.

So llvmpipe does streamout calls after clip/viewport stages,
but we have the pre-clip position stored for later use, so
when we are doing transform feedback, and its the position vertex
grab the vertex from the stored pre clip position.

The perfect fix is too probably add a codegen transform feedback
stage in between shader and clip stages, but this is good enough
for now.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-14 11:34:40 +10:00
Dave Airlie
55d37eb40e draw: add support for later transform feedback extensions
This adds support to draw for the new features of transform feedback.

a) fix count_from_stream_output, using max_index+1 for now but it looks
like it should be valid as its derived from the vertex elements/vbo.

b) fix striding and dst offsets in output buffers - was just wrong before.

c) fix crash if tfb is suspended (so.num_targets == 0)

This also enables the new features on softpipe. It should be possible
to enable them on llvmpipe as well after this commit, but would need
to schedule piglit runs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-14 11:34:15 +10:00
Tom Stellard
4330cfec8b clover: Fix build since removal of pipe_surface::usage
by commit 25409c6da8
2012-12-13 20:04:34 +00:00
Maxence Le Dore
6d7d821e3d r600g/radeonsi: Silence warnings
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-12-13 19:40:28 +00:00
Tom Stellard
c68babfc3c clover: Add support for compiler flags
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-12-13 19:22:44 +00:00
Tom Stellard
7f71efcf7a clover: Don't erase build info of devices not being built
Every call to _cl_program::build() was erasing the binaries and logs for
every device associated with the program.  This is incorrect because
it is possible to build a program for only a subset of devices and so
any device not being build should not have this information erased.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-12-13 19:22:35 +00:00
Vincent Lejeune
c7f9fb37ea r600g: use load_ar checks with llvm output.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-12-13 19:22:10 +00:00
Thierry Reding
60e05d7388 build: Fix AX_PROG_{CC,CXX}_FOR_BUILD macros
Override the cross_compiling and ac_tool_prefix variables by reassigning
to them instead of redefining the macros. Redefining them will actually
cause the variable names to be replaced instead of their content.

Furthermore push the definition of CPPFLAGS before running the checks
for the build tools to avoid the host CPPFLAGS from leaking into the
build CPPFLAGS.

While at it drop the redefinition of AC_TRY_COMPILER which hasn't been
used since autoconf 2.50 and make sure that all definitions are properly
popped when done (LDFLAGS, ac_cv_prog_CPP, ac_cv_prog_CXXCPP).

Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
2012-12-13 10:58:11 -08:00
Roland Scheidegger
a460aea3f1 gallivm: fix texel fetch for array textures
Since we don't call lp_build_sample_common() in the texel fetch path we missed
the layer fixup code. If someone would have tried to do texelFetch with array
textures it would have crashed for sure.
Not really tested (can't run the piglit test being able to use texelFetch with
array samplers for now with llvmpipe).

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-13 19:17:09 +01:00
Paul Berry
6267853055 mesa: Fix computation of default vertex attrib stride for 2_10_10_10 formats.
Previously, if the client program didn't specify a stride when setting
up a vertex attribute, we used _mesa_sizeof_type() to compute the size
of the type, and multiplied it by the number of components.

This didn't work for the 2_10_10_10 formats, since _mesa_sizeof_type()
returns -1 for those types, resulting in all kinds of havoc, since it
was causing the hardware to be programmed with a negative stride
value.

This patch adds a new function _mesa_bytes_per_vertex_attrib(), which
is similar to the existing function _mesa_bytes_per_pixel(), but which
computes the size of a vertex attribute based on the type and the
number of formats.  For packed formats (currently only the 2_10_10_10
formats), it verifies that the number of components is correct and
returns the size of the packed format.  For unpacked formats, it
returns the size of the type times the number of components.

In addition, this patch adds an assertion so that if we ever forget to
update _mesa_bytes_per_vertex_attrib() when adding a new vertex
format, we'll see the problem quickly rather than having to debug a
subtle conformance test failure.

Fixes GLES3 conformance tests
vertex_type_2_10_10_10_rev_{conversion,divisor,stride_pointer}.test.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-13 10:09:03 -08:00
Matt Turner
11cea47246 mesa/uniform_query: Don't write to *params if there is an error
The GL 3.1 and ES 3.0 specs say of glGetActiveUniformsiv:
   "If an error occurs, nothing will be written to params."

So, make a pass through the indices and check that they're valid before
the pass that actually writes to params. Checking pname happens on the
first iteration of the second loop.

Fixes es3conform's getactiveuniformsiv_for_nonexistent_uniform_indices
test.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-13 09:53:28 -08:00
Matt Turner
6acabe33a3 mesa: print unsigned values with %u
Otherwise messages say silly things like
   glGetActiveUniformBlockiv(block index -1 >= 0)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-13 09:53:11 -08:00
Kenneth Graunke
200bb36778 i965: Fix disassembly of jump targets on Gen7.
Gen7 stores the JIP/UIP bits in different places.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-12 22:19:08 -08:00
Kenneth Graunke
c2eb9d3a0a i965: Make try_rewrite_rhs_to_dst compare VGRF size to regs written.
try_rewrite_rhs_to_dst is a quick optimization to avoid generating new
temporaries (and MOVs from those temporaries to the dest) for every
expression tree we visit.  By generating better code in simple cases, we
reduce the burden on later optimization passes like register coalescing.

Previously, we compared inst->regs_written() to lhs->vector_elements
to make sure the instruction generating our value wrote the same number
of components as our destination register.

However, this fails in some cases.  One example is texturing (which
produces a vec4) into gl_FragData[i].  Technically, gl_FragData[i] is
also a vec4.  However, the destination VGRF actually has size 4n (where
n is the size of the array).

split_virtual_grfs() can't split VGRFs that are used by SEND messages
which require contiguous destination registers (like texturing), and
register allocation needs all VGRFs to have sizes between 1 and 4.

Amnesia: The Dark Descent hits this case: a texturing instruction
(4 components) gets rewritten to the gl_FragData output register
(which was 4*3 = 12 components), causing the register allocator to
hit the "we rely on split_virtual_grfs" assertion.

This makes it possible to play Amnesia.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-12 14:44:37 -08:00
Emil Velikov
1223458764 configure.ac: Disable compiler optimizations when --enable-debug is set
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-12 14:48:06 -06:00
Brian Paul
e721a76e68 softpipe: remove unused corner0 variable 2012-12-12 08:51:19 -07:00
Brian Paul
8ef27e8fa9 llvmpipe: remove unneeded draw_flush() call
This is redundant since we're calling draw_bind_fragment_shader()
which already does a flush.

v2: the redundant flush in llvmpipe_set_constant_buffer() has
already been removed by commit 3427466e6d

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-12 08:45:45 -07:00
Marek Olšák
d225d076a9 r600g: suballocate memory for fetch shaders from a large buffer
Fetch shaders are usually destroyed at the context destruction by the state
tracker, so we can put them all in a large buffer without wasting memory.

This reduces the number of relocations sent to the kernel a little bit.

Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:12:31 +01:00
Marek Olšák
8df3855eed r600g: suballocate memory for the STRMOUT_BUFFER_FILLED_SIZE register
Instead of having a 4-byte buffer for each streamout target, we suballocate
each dword from a 4K buffer.

This further reduces the overall number of relocations.

Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:12:28 +01:00
Marek Olšák
cc2d908572 gallium/util: add a simple allocator for suballocating from a large buffer
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:12:24 +01:00
Marek Olšák
2478fcd87c r600g: use u_upload_mgr for allocating staging transfer buffers
u_upload_mgr suballocates memory from a large buffer and maps the allocated
range (unsychronized), which is perfect for short-lived staging buffers.

This reduces the number of relocations sent to the kernel.

Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12 13:11:52 +01:00
Marek Olšák
448cd5ea60 winsys/radeon: don't use BIND flags, add a flag for the cache bufmgr instead 2012-12-12 13:09:54 +01:00
Marek Olšák
1d0bf69f83 st/dri: add a way to force MSAA on with an environment variable
There are 2 ways. I prefer the former:
  GALLIUM_MSAA=n
  __GL_FSAA_MODE=n

Tested with ETQW, which doesn't support MSAA on Linux. This is
the only way to get MSAA there.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
afa902a705 mesa: don't advertise ARB_texture_buffer_object in legacy contexts
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
0ac83a2001 mesa: disallow creation of GL 3.1 compatibility contexts
Death to driver-specific hacks!

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
25409c6da8 gallium: remove pipe_surface::usage
Not really used by anybody now.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:54 +01:00
Marek Olšák
c1f704073b svga: stop using pipe_surface::usage
There are only 2 possible usages: render target and depth stencil.
Both can be derived from the surface format, so the flag is redundant.

And it's going away...

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
21b1ec69fc gallium/util: move util_try_blit_via_copy_region to u_surface.c
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
3a555637b2 gallium/cso: don't use the pipe_error return type where it's not needed
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
eae9674f18 gallium: manage render condition in cso_context and fix postprocessing w/ it
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Marek Olšák
9ec6ffd85d st/mesa: remove a weird msaa hack
It doesn't work and it's not clear how it's supposed to work.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-12 13:09:53 +01:00
Dave Airlie
621259b3de softpipe: implement seamless cubemap support. (v1.1)
This adds seamless sampling for cubemap boundaries if requested.

The corner case averaging is messy but seems like it should be spec
compliant.

The face direction stuff is also a bit messy, I've no idea if that could
or should be simpler, or even if all my directions are fully correct!

v1.1: update comments, drop unneeded seamless calls for nearest, fix
if statement layout.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 10:35:05 +10:00
Dave Airlie
3392f2fbcf gallium: fix cap warnings for tbo cap.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 07:16:02 +10:00
Dave Airlie
5cdcd7251a glsl_to_tgsi: emit multi-level structs and arrays properly.
This follow the code from the i965 driver, and emits the structs
and arrays recursively.

This fixes an assert in the two UBO tests
fs-struct-copy-complicated and
vs-struct-copy-complicated

These tests now pass on softpipe, with no regressions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-12 06:57:38 +10:00
Brian Paul
2ee0b44252 llvmpipe: don't use user constant buffers
This fixes some use-after-free issues.  I haven't measured any real
performance difference with a handful of Mesa demos.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-11 12:48:07 -07:00
Brian Paul
3427466e6d llvmpipe: support pipe_resource-based constant buffers
Before this we only supported user-based constant buffers.

First, we basically plumb pipe_constant_buffer objects through llvmpipe
rather than pipe_resource objects.

Second, update llvmpipe_set_constant_buffer() and try_update_scene_state()
so they understand both resource- and user-based constant buffers.

The problem with user constant buffers is the potential for use-after-free,
as seen in some WebGL tests.  The next patch will flip the switch for
resource-based const buffers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-11 12:48:06 -07:00
Brian Paul
4c6053dc51 util: add util_copy_constant_buffer() helper function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-11 12:48:06 -07:00
Eric Anholt
beafced21c i965/fs: Improve performance of shaders that start out with a discard.
I had tried this in the past, but ran into trouble with applications
that sample from undiscarded pixels in the same subspan.  To fix that
issue, only jump to the end for an entire subspan at a time.

Improves GLbenchmark 2.7 (1024x768) performance by 7.9 +/- 1.5% (n=8).

v2: Drop the br variable in the jump instruction -- if I ever do jumps
    pre-gen6, it'll be a different code block anyway since we don't have
    HALT until gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:13:15 -08:00
Eric Anholt
d5016495cc i965/fs: Rewrite discards to use a flag subreg to track discarded pixels.
This makes much more sense on gen6+, and will also prove useful for
early exit of shaders on discard.

v2: fix up a stale comment from before converting gen4-5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:13:08 -08:00
Eric Anholt
b278f65e1c i965/fs: Add an instruction flag for choosing the flag subregister.
We're going to redo discard handling to track discards in the other flag
subregister, saving instructions in the discard and allowing predicated
jumps out to the end of the shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:58 -08:00
Eric Anholt
2c69a9fb60 i965: Let brw_flag_reg() choose the flag reg and subreg.
We're about to start using the f0.1 subregister.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:54 -08:00
Eric Anholt
6a1490bc8f i965: Print the flag reg updated by conditional modifiers.
This makes our output more consistent with other disasm tools, and
will be necessary when we start using f0.1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:49 -08:00
Eric Anholt
b7fd4b3f94 i965: Add the new flag_reg_nr instruction field from IVB.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:47 -08:00
Eric Anholt
f606a42a3c i965: Correct the name and usage of the flag subregister number field.
We've been calling it a register number, it's actually the subregister,
and things will get confusing once we start using it if it isn't fixed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:12:41 -08:00
Eric Anholt
7d404a4bd8 i965: Remove bogus flag_reg_nr field from bits3.
There's a flag subreg nr field in bits2 next to src0.vertstride, but
there shouldn't be anything in bits3 next to src1.vertstride.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-11 10:11:44 -08:00
Tobias Droste
cb8300f5a9 st/egl/drm: only unref the udev device if needed
Fixes compiler warning:

drm/native_drm.c: In function ‘native_create_display’:
drm/native_drm.c:180:21: warning: ‘device’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drm/native_drm.c:157:24: note: ‘device’ was declared here

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-11 12:53:58 -05:00
José Fonseca
bc4bf3c840 softpipe: Use os_time_get_nano() everywhere. 2012-12-11 16:45:01 +00:00
Johannes Obermayr
b361bb3de4 clover: Install CL headers.
Note: This is a candidate for the stable branches.
2012-12-10 19:22:37 -05:00
Tom Stellard
ffe1794e0c gallivm: Lower TGSI_OPCODE_MUL to fmul by default
This fixes a number of crashes on r600g due to the fact that
lp_build_mul assumes vector types when optimizing mul to bit shifts.

This bug was uncovered by 0ad1fefd69
2012-12-10 19:22:37 -05:00
Dave Airlie
8000e7b4b6 llvmpipe: fix txq for 1d/2d arrays. (v3)
Noticed would fail, we were doing two things wrong

a) 1d arrays require the layers in height
b) minifying the layers field.

v2: don't change height code, fixup completely inside txq
as suggested by Roland.

v3: just add minify before texture array size

v1: Reviewed-by: Jose Fonseca <jfonseca@vmware.com>

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-11 09:38:01 +10:00
Dave Airlie
41f4f094c4 llvmpipe: increase texture target width to reflect increase
Now that we've gone over 7.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-11 09:37:55 +10:00
Jordan Justen
0151237457 mesa syncobj: don't store a pointer to the set_entry
The set_entry pointer can become invalid if the set table
is re-hashed.

This likely will fix
https://bugs.freedesktop.org/show_bug.cgi?id=58012
(Regression since 56e95d3c)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-10 10:58:45 -08:00
Fabio Pedretti
8b6e782eb9 vega: remove unused variables
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-10 09:43:20 -07:00
Fabio Pedretti
eefd373876 nvc0: comment unused nvc0_validate_zcull function
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-10 09:43:18 -07:00
Fabio Pedretti
9b4926b64b nv50: remove unused OpClassStr array
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-10 09:43:17 -07:00
smoki
320d531373 r200: fix broken tcl lighting
command mistakenly used vector instead of scalar emit (the more or less
identical code in radeon is already correct).
Seems like it would be broken ever since kms probably.
Should fix bugs 22576, 26809.
2012-12-10 17:30:26 +01:00
Dave Airlie
17f5dc5730 st_glsl_to_tgsi: fix ubo bools.
This should fix the ubo boolean tests, along with the previous
ubo loading fix.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-10 14:25:49 +10:00
Dave Airlie
7a66c8acd3 st_glsl_to_tgsi: call ubo load pass earlier
This calls it in around the same place as the 965 driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-10 14:22:34 +10:00
Dave Airlie
af2d9affb1 glsl_to_tgsi: fix texture offset translation
I noticed the texelFetch offset test failed on 2D rect samplers
with GLSL 1.40. This is because I wrote the immediate->offset
translation wrong.

Fixed the translation to actually use the ureg info to set the
offsets up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-10 12:23:47 +10:00
Dave Airlie
157f5d043a drisw: fix up context and apis for software context
This ports over from the dri2 code to the drisw bits. It means 3.1
core contexts now work for softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-09 20:28:56 +10:00
Kenneth Graunke
bd87441ac0 i965: Add missing _NEW_BUFFERS dirty bit in Gen7 SBE state.
This is needed to compute render_to_fbo.  It even has the comment.

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-08 18:12:21 -08:00
Christoph Bumiller
5e98cefb5a st/mesa: set PIPE_BIND_SAMPLER_VIEW for TBOs in st_bufferobj_data 2012-12-08 22:47:00 +01:00
Christoph Bumiller
1f079f9e58 nvc0/ir: allow neg,abs modifiers on OP_SET with integer result 2012-12-08 22:47:00 +01:00
Christoph Bumiller
7c6584b996 nvc0/ir/emit: fix check for flags register use in logic ops 2012-12-08 22:46:37 +01:00
Brian Paul
4b73cdb864 draw: fix/improve dirty state validation
This patch does two things:

1. Constant buffer state changes were broken (but happened to work by
   dumb luck).  The problem is we weren't calling draw_do_flush() in
   draw_set_mapped_constant_buffer() when we changed that state.  All the
   other draw_set_foo() functions were calling draw_do_flush() already.

2. Use a simpler state validation step when we're changing light-weight
   parameter state such as constant buffers, viewport dims or clip planes.
   There's no need to revalidate the whole pipeline when changing state
   like that.  The new validation method is called bind_parameters()
   and is called instead of the prepare() method.  A new
   DRAW_FLUSH_PARAMETER_CHANGE flag is used to signal these light-weight
   state changes.  This results in a modest but measurable increase in
   FPS for many Mesa demos.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
c5f544e690 draw: add reminder comments about similar code in different files
When one function is changed, also look at the other.
Presently, there are some differences with respect to geometry
shaders and instanced drawing...

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
a506ccd89f draw: rearrange code in llvm_middle_end_prepare()
To clean it up and make it look more like the non-LLVM
fetch_pipeline_prepare() function.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
3e0fa487fb draw: fix comment typo
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
9b11344b25 draw: add comment on draw->pt.opt field
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
Brian Paul
b46b44b0a9 draw: update a comment about index buffers
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-08 06:58:10 -07:00
José Fonseca
122dfc5ee2 gallium/os: Fix nano->micro second concersion.
copy'n'paste: best friend, worst enemy..

Trivial.
2012-12-08 11:15:46 +00:00
Dave Airlie
1f688327e6 llvmpipe: fix missing tbo cap warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 03:46:56 +00:00
Dave Airlie
73ae865af8 mesa/st: add ARB_uniform_buffer_object support (v2)
this adds UBO support to the state tracker, it works with softpipe
as-is.

It uses UARL + CONST[x][ADDR[0].x] type constructs.

v2: don't disable UBOs if geom shaders don't exist (me)
rename upload to bind (calim)
fix 12 -> 13 comparison as comment (calim + brianp)
fix signed->unsigned (Brian)
remove assert (Brian)

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:38 +10:00
Dave Airlie
535e248c5f softpipe: enable GLSL 1.40
This enables GLSL 1.40 advertising by softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:38 +10:00
Dave Airlie
a6256f1e67 softpipe: add texture buffer object support
This adds TBO support to softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:38 +10:00
Dave Airlie
22439f24a2 st/mesa: add option to enable GLSL 1.40
Allow GLSL 1.40 to be enabled if the driver advertises it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:34 +10:00
Dave Airlie
915efe7f07 st/mesa: add texture buffer object support to state tracker (v1.1)
This adds the necessary changes to the st to allow texture buffer object
support if the driver advertises it.

v1.1: remove extra blank line and whitespace

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:33 +10:00
Dave Airlie
a0281c4a8c gallium: add new texture buffer object capability
this just adds the define to the header.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-08 13:32:33 +10:00
José Fonseca
0c2492ea4a mesa/meta: Move declaration before statements. 2012-12-08 01:05:52 +00:00
José Fonseca
eeff87cee3 mesa: Move declaration before statement.
For MSVC's sake.
2012-12-08 01:02:30 +00:00
Anuj Phogat
4e9d19717c intel: Enable ETC2 support on intel hardware
This patch enables support for ETC2 compressed textures on
all intel hardware. At present, ETC2 texture decoding is not
available on intel hardware. So, compressed ETC2 texture data
is decoded in software and stored in a suitable uncompressed
MESA_FORMAT at the time of glCompressedTexImage2D. Currently,
ETC2 formats are only exposed in OpenGL ES 3.0.

V2: Use single etc_wraps variable for both etc1 and etc2.
V3: Remove redundant code and use just one intel_miptree_map_etc()
    and intel_miptree_unmap_etc() function.
    Choose MESA_FORMAT_SIGNED_{R16, GR1616} for ETC2 signed-{r11, rg11}
    formats

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-07 16:29:49 -08:00
Anuj Phogat
e06dcbfdc2 mesa: Add decoding functions for GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
Data in GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 format is decoded and stored
in MESA_FORMAT_SARGB.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:49 -08:00
Anuj Phogat
883efbf6da mesa: Add decoding functions for GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
Data in GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 format is decoded and stored
in MESA_FORMAT_RGBA8888_REV.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:49 -08:00
Anuj Phogat
75211f4367 mesa: Add decoding functions for GL_COMPRESSED_SIGNED_RG11_EAC
Data in GL_COMPRESSED_SIGNED_RG11_EAC format is decoded and stored in
MESA_FORMAT_SIGNED_GR1616.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
7697f25667 mesa: Add decoding functions for GL_COMPRESSED_SIGNED_R11_EAC
Data in GL_COMPRESSED_SIGNED_R11_EAC format is decoded and stored in
MESA_FORMAT_SIGNED_R16.

v2:
16 bit signed data is converted to 16 bit unsigned data by
adding 2 ^ 15 and stored in an unsigned texture format.

v3:
1. Handle a corner case when base code word value is -128. As per
OpenGL ES 3.0 specification -128 is not an allowed value and should
be truncated to -127.
2. Converting a decoded 16 bit signed data to 16 bit unsigned data by
adding 2 ^ 15 gives us an output which matches the decompressed image
(.ppm) generated by ericsson's etcpack tool. ericsson is also doing this
conversion in their tool because .ppm image files don't support signed
data. But gles 3.0 specification doesn't suggest this conversion. We
need to keep the decoded data in signed format. Both signed format
tests in gles3 conformance pass with these changes.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
aa217090f5 mesa: Add decoding functions for GL_COMPRESSED_RG11_EAC
Data in GL_COMPRESSED_RG11_EAC format is decoded and stored in
MESA_FORMAT_RG1616.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
dc86cb3705 mesa: Add decoding functions for GL_COMPRESSED_R11_EAC
Data in GL_COMPRESSED_R11_EAC format is decoded and stored in
MESA_FORMAT_R16.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
5ea8cd0084 mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
Data in GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC format is decoded and stored
in MESA_FORMAT_SARGB8.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
62fc4b4ae1 mesa: Add decoding functions for GL_COMPRESSED_RGBA8_ETC2_EAC
Data in GL_COMPRESSED_RGBA8_ETC2_EAC format is decoded and stored
in MESA_FORMAT_RGBA8888_REV.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
965a24995d mesa: Add decoding functions for GL_COMPRESSED_SRGB8_ETC2
Data in GL_COMPRESSED_SRGB8_ETC2 format is decoded and stored
in MESA_FORMAT_SARGB8.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
81911101ee mesa: Add decoding functions for GL_COMPRESSED_RGB8_ETC2
Data in GL_COMPRESSED_RGB8_ETC2 format is decoded and stored in
MESA_FORMAT_RGBX8888_REV.

v2: Use CLAMP macro and stdbool.h
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
38d523584c mesa: Make nonlinear_to_linear() function available outside file
This patch changes nonlinear_to_linear() function to non static inline
and makes it available outside format_unpack.c. Also, removes the
duplicate copies in other files.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 16:29:48 -08:00
Anuj Phogat
e519b8a9af mesa: Add new MESA_FORMATs for ETC2 compressed textures
It is required by OpenGL ES 3.0 to support ETC2 textures.
This patch adds new MESA_FORMATs for following etc2 texture
formats:
 GL_COMPRESSED_RGB8_ETC2
 GL_COMPRESSED_SRGB8_ETC2
 GL_COMPRESSED_RGBA8_ETC2_EAC
 GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
 GL_COMPRESSED_R11_EAC
 GL_COMPRESSED_RG11_EAC
 GL_COMPRESSED_SIGNED_R11_EAC
 GL_COMPRESSED_SIGNED_RG11_EAC
 MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1
 MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1

Above formats are currently available in only gles 3.0.

v2: Add entries in texfetch_funcs[] array.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

v3 (Paul Berry <stereotype441@gmail.com>): comment out symbols that
are not implemented yet, so that this commit compiles on its own;
future commits will uncomment the symbols as they become available.
2012-12-07 16:29:47 -08:00
Kenneth Graunke
23b7103cee meta: Use #version 300 es for _mesa_glsl_Clear's integer shaders on ES3.
Fixes es3conform's color_buffer_float_clamp_(fixed|on|off) tests.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 16:29:45 -08:00
Kenneth Graunke
50e4a1df94 meta: Use #version 300 es in GenerateMipmap shaders on ES3.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 16:29:31 -08:00
Paul Berry
6cffdb1ca0 Set es_version to false when using FF fragment shading in meta ops
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 16:28:40 -08:00
Eric Anholt
1ddc021b2a mesa: Use the new hash table for the variable refcount visitor.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: open_hash_table => hash_table]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-07 14:46:18 -08:00
Jordan Justen
59284bc44a program/hash_table.c: rename to program/prog_hash_table.c
Removes a collision of the object file name for main/hash_table
and program/hash_table.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-07 14:46:18 -08:00
Matt Turner
970ec8dbc3 mesa: Ignore size and offset parameters for BindBufferRange when buffer is 0
The ES 3 conformance suite unbinds buffers (by binding buffer 0) and
passes zero for the size and offset, which the spec explicitly
disallows. Otherwise, this seems like a reasonable thing to do.

Khronos will be changing the spec to allow this (bug 9765). Fixes
es3conform's transform_feedback_init_defaults test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-07 14:11:13 -08:00
Christoph Bumiller
cfa752cd33 nv50,nvc0: fix shader eviction 2012-12-07 22:48:54 +01:00
Christoph Bumiller
f7599b2c32 nv50,nvc0: add support for cube map arrays
NOTE: nv50 support not enabled, someone with nva3/8 please fix.
2012-12-07 22:48:54 +01:00
Stefan Dösinger
ff5a9868c8 r300: Don't disable destination read if the src blend factor needs it
The read can remain disabled if the src alpha factor needs it because
the result would still be zero.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57984

NOTE: This is a candidate for stable release branches.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-12-07 17:48:16 +01:00
Michel Dänzer
ff574d653b gallium/egl-static: Fix unresolved symbol 'clock_gettime'.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-07 16:10:02 +01:00
José Fonseca
e7bbd9c243 gallivm: Rudimentary native integer support.
Just enough for draw module to work ok.

This improves "piglit attribs GL3", though something fishy is still
happening with certain unsigned integer values.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
José Fonseca
6e27e2e90e draw: Dump LLVM shader key.
Just like we do in llvmpipe for the fragment shader compilation key.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
José Fonseca
3b7ce72625 gallivm: Allow indirection from TEMP registers too.
The ADDR file is cumbersome for native integer capable drivers.  We
should consider deprecating it eventually, but this just adds support
for indirection from TEMP registers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
José Fonseca
1d35f77228 gallivm,llvmpipe,draw: Support multiple constant buffers.
Support 16 (defined in LP_MAX_TGSI_CONST_BUFFERS) as opposed to 32 (as
defined by PIPE_MAX_CONSTANT_BUFFERS) because that would make the jit
context become unnecessarily large.

v2: Bump limit from 4 to 16 to cover ARB_uniform_buffer_object needs,
per Dave Airlie.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 15:03:07 +00:00
Marek Olšák
35840ab189 st/dri: implement MSAA for GLX/DRI2 framebuffers
All MSAA buffers are allocated privately and resolved into the DRI-provided
back and front buffers.

If an MSAA visual is chosen, the buffers st/mesa receives are all
multi-sample. st/mesa doesn't have access to the single-sample buffers
in that case.

This makes MSAA work in games like Nexuiz.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:29 +01:00
Marek Olšák
919f788b92 gallium: pass the current context to the flush_front state tracker function
I will later use the context to resolve an MSAA front buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:29 +01:00
Marek Olšák
888714feb6 st/dri: don't expose MSAA configs with accumulation buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
985649b596 st/dri: refactor dri_fill_in_modes
- We can use a single loop for adding new configs.
- The useless parameter depth_bits is removed.
- The maximum number of samples is bumped to 32.
- We can support Z16_UNORM and Z32_UNORM unconditionally since the zbuffers
  are private.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
39737e17e7 st/dri: always allocate private depth-stencil buffers
This disables DRI2 sharing of zbuffers. The window zbuffer is allocated just
like any other texture - through resource_create.

The idea of allocating a zbuffer through DRI2 isn't very useful with MSAA,
where a single-sample zbuffer is useless.

IIRC, the Intel driver does the same thing.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
976b832e9a st/mesa: implement CopyTexSubImage for MSAA framebuffers
Reviewed-by: Brian Paul <brianp@vmware.com>

Just use pipe->blit, which can do resolve, flipping, and format conversions.
The util_blit_pixels codepath is still there for the cases where we have to
force alpha to 1.

This also turns on acceleration for copying GL_DEPTH_STENCIL.
2012-12-07 14:19:28 +01:00
Marek Olšák
9f06966a7b gallium/u_blitter: fix conflict with u_memory.h
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
49f1104c44 r600g: transfers of MSAA color textures should do the resolve
so that ReadPixels and various fallbacks work.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
cbddb8f365 trace: dump pipe_resource::nr_samples
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Marek Olšák
5fb2b1f4d4 glx/dri2: set the __DRI2_FLUSH_DRAWABLE flag where it should be set
Sorry, I accidentally omitted this.

It only broke MLAA.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-07 14:19:28 +01:00
Andreas Boll
520892688a build: Fix GLES linkage without libglapi
fixes a regression introduced with
fc9ea7c74d

NOTE: This is a candidate for the 9.0 branch.

Reported-by: Brian Paul <brianp@vmware.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-12-07 09:21:44 +01:00
Dave Airlie
5b2a3443fa llvmpipe: fix regression in gears speed.
This fixes the gears regression since transform feedback.

Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-07 08:35:08 +10:00
Kenneth Graunke
76f13f80e6 glsl: Add missing semicolon in the grammar
This may not be strictly necessary, but every other rule in the grammar ends
with a semicolon.  It also appears that this was supposed to be commited with
the original patch that changed this rule, but the wrong version of the patch
was accidentally pushed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-06 12:13:22 -08:00
Ian Romanick
62c0938639 glsl: Allow layout qualifiers in GLSL 3.00 ES
Note that while 'packed' is a reserved word in GLSL ES, row_major is not.
This means that we have to use the string-based matching for that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
486f955654 glsl: Create builtin function profiles for GLSL 3.00 ES.
Nearly all of the builtin functions in GLSL 3.00 ES are already
implemented in Mesa; this patch enables them.

A few functions are not implemented yet; those have been commented
out, with a FIXME comment to act as a reminder of what still needs to
be implemented.  Here is the complete list: packSnorm2x16,
unpackSnorm2x16, packUnorm2x16, unpackUnorm2x16, packHalf2x16,
unpackHalf2x16.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
9a69f66353 glsl: add determinant() functions.
These functions are defined in GLSL 1.50 and GLES 3.00 ES.

The formulas have been extracted from the existing implementation of
inverse().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
4d6d22100a glsl: Make builtin function profiles for GLSL ES use "es" in the filename.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
8dec1bfedd glsl: Add builtin variables for GLSL 3.00 ES.
This patch also adds assertions so that when we add new GLSL versions,
we'll notice that we need to update the builtin variables.

[v2, idr]: s/Frab/Frag/  Noticed by Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
d7949eefcb glsl: Populate built-in types correctly for GLSL 3.00 ES.
This patch implements all of the built-in types for GLSL 3.00 ES.
This is almost exactly the same as the set of built-in types for GLSL
1.30, except ate 1D samplers are skipped, and samplerCubeShadow is
added.

This patch also addes an assertion so that when we add new GLSL
versions, we'll notice that we need to update the types.

In review, Eric noted:

    "This change looks correct.  The overall interaction of profiles is
    getting ugly, though.  I'm imagining a restructure of the symbol
    table population so that there's a big list of types, and each
    #version has a nice list of strings of type names copy and pasted
    out of its spec."

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
5e10a5c5e4 glsl: Make {Min,Max}ProgramTexelOffset available to compiler.
These constants need to be made available to shaders in GLSL 3.00 ES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
15ba2a5825 glsl: Fix linker checks for GLSL ES 3.00.
This patch updates the following linker checks to do the right thing
in GLSL 3.00 ES:

- Failing to write to gl_Position is allowed in GLSL 1.40+ as well as
  GLSL 3.00 ES.

- It is an error to write to both gl_ClipVertex and gl_ClipDistance in
  GLSL 1.30+.  This does not apply to GLSL 3.00 ES.

- GLSL 3.00 ES uses the same varying counting rules as GLSL 1.00 ES.

- In GLSL 1.30 and GLSL 3.00 ES, "discard" terminates the shader.

- In GLSL 1.00 ES and GLSL 3.00 ES, both a fragment and a vertex
  shader must be present.

[v2, idr]: Fix minro typo in a comment.  Noticed by Ken.

[v3, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
91c92bb6fb glsl: Record in gl_shader_program whether the program uses GLSL ES.
Previously we recorded just the GLSL version (or the max version, if
GLSL 1.10 and GLSL 1.20 programs were linked together).

[v2, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
a9f34dc304 glsl: Clean up shading language mixing check for GLSL 3.00 ES.
Previously, we prohibited mixing of shading language versions if
min_version == 100 or max_version >= 130.  This was technically
correct (since desktop GLSL 1.30 and beyond prohibit mixing of shading
language versions, as does GLSL 1.00 ES), but it was confusing.  Also,
we asserted that all shading language versions were between 1.00 and
1.40, which was unnecessary (since the parser already checks shading
language versions) and doesn't work for GLSL 3.00 ES.

This patch changes the code to explicitly check that (a) ES shaders
aren't mixed with desktop shaders, (b) shaders aren't mixed between ES
versions, and (c) shaders aren't mixed between desktop GLSL versions
when at least one shader is GLSL 1.30 or greater.  Also, it removes
the unnecessary assertion.

[v2, idr]: Slightly tweak the is_es_prog detection to occur outside the loop
instead of doing something special on the first loop iteration.  Suggested by
Ken.

[v3, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
c150e876b4 glsl: Record in gl_shader whether the shader uses GLSL ES.
Previously we recorded just the GLSL version, with the knowledge that
100 means GLSL 1.00 ES.  With the advent of GLSL 3.00 ES, this is
going to get more complex, and eventually will probably become
ambiguous (GLSL 4.00 already exists, and GLSL 4.00 ES is likely to be
created some day).

To reduce confusion, this patch simply records whether the shader is
GLSL ES as an explicit boolean.

[v2, idr]: s/IsEs(Shader|Prog)/IsES/  Suggested by Ken and Eric.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
2b4aeddfb3 glsl/parser: Handle "#version 300 es" directive.
Note that GLSL 1.00 is selected using "#version 100", so "#version 100
es" is prohibited.

v2: Check for GLES3 before allowing '#version 300 es'

v3: Make sure a correct language_version is set in
_mesa_glsl_parse_state::process_version_directive.

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:22 -08:00
Paul Berry
629b9edc99 glsl/parser: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.

No functional change.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
a03c2c7ab9 glsl/preprocessor: Handle "#version 300 es" directive.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
2152df51c0 glsl/preprocessor: Extract version directive processing into a function.
Version directive handling is going to have to be used within two
parser rules, one for desktop-style version directives (e.g. "#version
130") and one for the new ES-style version directive (e.g. "#version
300 es"), so this patch moves it to a function that can be called from
both rules.

No functional change.

[mattst88] v2: Use intmax_t instead of int for version argument. Would
otherwise write garbage after #version since PRIiMAX was reading 64-bits
instead of 32.

[idr] v3: A later commit fixes the caller of
_glcpp_parser_handle_version_declaration to pass the correct number of
parameters.  Fix it in the patch that changes the interface instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
d4a24745b8 glsl: Enable GLSL ES 3.00 features inherited from desktop GLSL.
This patch turns on the following features for GLSL ES 3.00:

- Array constructors, whole array assignment, and array comparisons.
- Second and third operands of ?: may be arrays.
- Use of "in" and "out" qualifiers on globals.
- Bitwise and modulus operators.
- Integral vertex shader inputs.
- Range-checking of literal integers.
- array.length method.
- Function calls may be constant expressions.
- Integral varyings must be qualified with "flat".
- Interpolation and centroid qualifiers may not be applied to vertex
  shader inputs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
534ec62152 glsl: parse GLSL ES 3.00 keywords correctly.
GLSL ES 3.00 adds the following keywords over GLSL 1.00: uint,
uvec[2-4], matNxM, centroid, flat, smooth, various samplers, layout,
switch, default, and case.

Additionally, it reserves a large number of keywords, some of which
were already reserved in versions of desktop GL that Mesa supports,
some of which are new to Mesa.

A few of the reserved keywords in GLSL ES 3.00 are keywords that are
supported in all other versions of GLSL: attribute, varying,
sampler1D, sampler1DShador, sampler2DRect, and sampler2DRectShadow.

This patch updates the lexer to handle all of the new keywords
correctly when the language being parsed is GLSL 3.00 ES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
948e5dda67 glsl: Rework lexer keyword handling in preparation for GLSL 3.00 ES.
This patch expands the lexer KEYWORD macro to take two additional
arguments: the GLSL ES versions in which the given keyword was first
reserved, and supported, respectively.  This will allow us to
trivially add support for GLSL 3.00 ES keywords, even though the set
of GLSL 3.00 ES keywords is neither a subset or a superset of the
keywords corresponding to any desktop GLSL version.

The new KEYWORD macro makes use of the
_mesa_glsl_parse_state::is_version() function, so it accepts 0 as
meaning "unsupported" (rather than 999, which we used previously).

Note that a few keywords ("packed" and "row_major") are supported
*either* when GLSL 1.40 is in use or when ARB_uniform_buffer_obj
support is enabled.  Previously, we handled these by cleverly taking
advantage of the fact that the KEYWORD macro didn't parenthesize its
arguments in the usual way.  Now they are handled more
straightforwardly, with a new macro, KEYWORD_WITH_ALT.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
0d9bba6e43 glsl: Make use of new _mesa_glsl_parse_state::check_version() function.
Previous to this patch, we were not very consistent about the errors
we generate when a shader tried to use a feature that is prohibited in
the current GLSL version.  Some error messages failed to mention the
GLSL version currently in use (or did so inaccurately), and some error
messages failed to mention the first GLSL version in which the given
feature is allowed.

This patch reworks all of the error checks to use the check_version()
function, which produces error messages in a standard form
(approximately "$FEATURE forbidden in $CURRENT_GLSL_VERSION
($REQUIRED_GLSL_VERSION required).").

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
e3ded7fe62 glsl: Make use of new _mesa_glsl_parse_state::is_version() function.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
5d0fd3270f glsl: Add GLSL version query functions.
With the advent of GLSL 3.00 ES, the version checks we perform in the
GLSL compiler (to determine which language features are present) will
become more complicated.  To reduce the complexity, this patch adds
functions check_version() and is_version() to _mesa_glsl_parse_state.
These functions take two version numbers: a desktop GLSL version and a
GLSL ES version, and return a boolean indicating whether the GLSL
version being compiled is at least the required version.  So, for
example, is_version(130, 300) returns true if the GLSL version being
compiled is at least desktop GLSL 1.30 or GLSL 3.00.

The check_version() function additionally produces an error message if
the version check fails, informing the user of which GLSL version(s)
support the given feature.

[v2, idr]: Add PRINTFLIKE annotation to the new method.  The numbering of th
parameters is correct because GCC is silly.

[v3, idr]: Fix copy-and-paste error in the comment before
_mesa_glsl_parse_state::is_version.  Noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
dc9f9d8e66 glsl: Compute version_string on the fly.
Fixes a bug where version_string would be left uninitialized if no
GLSL "#version" directive was used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
d9bfaa104e glsl: Make a function to express a GLSL version ir human-readable form.
This will be useful in generating more helpful error messages,
especially with the addition of GLSL 3.00 ES support.

[v2, idr]: Rename ctx parameter to mem_ctx

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
53e572f15c glsl: Simplify symbol table version checking.
Previously, we stored the GLSL language version in the
glsl_symbol_table struct.  But this was unnecessary--all
glsl_symbol_table needs to know is whether functions and variables
have separate namespaces (they do in GLSL 1.10 only).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Paul Berry
9a93ba3068 mesa: Add ARB_ES3_compatibility flag.
Adding this now makes it easier to develop and test GLES3 features, since we
can do initial development and testing using desktop GL.  Later GLSL compiler
patches check for either ctx->Extensions.ARB_ES3_compatibility or
_mesa_is_gles3 to allow certain features (i.e., "#version 300 es").

[v2, idr]: Just edits to the commit message.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Carl Worth <cworth@cworth.org>
2012-12-06 12:13:21 -08:00
Michel Dänzer
e0f2ffc3d9 radeonsi: Fix cube texture coordinates.
8 more piglits.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-06 20:35:18 +01:00
Michel Dänzer
aac2154729 radeon/llvm: Export prepare_cube_coords helper to driver.
To be used by radeonsi.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-12-06 20:18:40 +01:00
Brian Paul
7745596ceb mesa: use rand() instead of random()
As Vinson Lee did in commit bb284669f8
in hash_table.c

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-06 11:55:02 -07:00
Jordan Justen
56e95d3ca2 mesa: validate that sync objects were created by mesa
Previously, the user could send in a pointer that was not created
by mesa. When we dereferenced that pointer, there would be an
exception.

Now we keep a set of pointers and verify that the pointer
exists in that set before dereferencing it.

Note: This fixes several crashing gles3conform tests.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:43:07 -08:00
Jordan Justen
e12d9f0c6d main/syncobj: return GL_INVALID_VALUE for invalid sync objects
Note: The GL/GLES3 web man pages don't seem to properly
document glWaitSync's error when the sync object is invalid.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:43:07 -08:00
Eric Anholt
82c9d98ab9 mesa: add set support (stores a set of pointers)
From: git://people.freedesktop.org/~anholt/hash_table

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: minor rework for mesa]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:43:07 -08:00
José Fonseca
db9a1052d1 llvmpipe: Fix statement before declaration. 2012-12-06 17:23:11 +00:00
José Fonseca
b79194401a util: Add util_copy_box helper.
Must users of util_copy_rect() need or should deal with volumes.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
José Fonseca
4da4e8ee2a gallium/util: Move the util_copy/fill_rect into u_surface.
u_rect.h said these should move to a different file, and u_surface seems
a better home.

Leave #include "util/u_surface.h" to avoid having to touch thousand of
files.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
José Fonseca
d296326e06 gallium/os: Cleanup up os_time_get/os_time_get_nano.
- Re-implement os_time_get in terms of os_time_get_nano() for consistency
- Use CLOCK_MONOTONIC as recommended
- Only use clock_gettime on Linux for now.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
José Fonseca
7e14293556 gallium/os: Fix os_time_sleep() on Windows for small durations.
Prevents undetermined sleeps.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 17:12:31 +00:00
Stefan Dösinger
d8069b7603 meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER
Fixes clears in Wine on r200.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-06 11:37:24 -05:00
Stefan Dösinger
f6a4e1bc1e radeon: Initialize swrast before setting limits
NOTE: This is a candidate for stable release branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-06 11:37:24 -05:00
Stefan Dösinger
654a945f4d r200: Initialize swrast before setting limits
Otherwise the driver announces 4096 vertex shader constants and other
way too high limits.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-06 11:37:24 -05:00
Matthew Waters
ac24d17258 mesa: fix compiler warnings when including GL/gl.h with other gl headers
GL/gl.h provides some definitions (GL_FALSE, GL_ONE, etc) that have
the same value as other gl headers but are represented differently
(0 vs 0x0 and 1 vs 0x1).
This causes compiler warnings about redefining such definitions when
including GL/gl.h with other gl headers.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=57802

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-12-06 09:08:52 -07:00
José Fonseca
5e99cd9159 gallivm: Fix lerping of (un)signed normalized numbers.
Several issues actually:

- Fix a regression in unsigned normalized in the rescaling
  [0, 255] to [0, 256]

- Ensure we use signed shifts where appropriate (instead of
  unsigned shifts)

- Refactor the code slightly -- move all the logic inside
  lp_build_lerp_simple().

This change, plus an adjustment in the tolerance of signed normalized
results in piglit fbo-blending-formats fixes bug 57903

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 15:58:40 +00:00
José Fonseca
33ffca713a gallivm: Fix lp_build_print_value of smaller integer types.
They need to be converted to the native integer type to prevent garbage
in higher order bits from being printed.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-06 15:58:40 +00:00
Brian Paul
5396582f5e llvmpipe: remove unused variable 2012-12-06 08:34:08 -07:00
Brian Paul
52b02cc676 draw: remove some dead constant buffer code
Remove the draw_vs_set_constants() and draw_gs_set_constants()
functions and the draw->vs.aligned_constants,
draw->vs.aligned_constant_storage and draw->vs.const_storage_size
fields.  None of it was used.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-06 07:48:53 -07:00
Chad Versace
45a01cba90 android: Fix build of libmesa_program
Commit 4097308 fixed the build in a questionable way. It worked at the
time, but, as Ian pointed out, the fix would likely fail at a future
commit due to the indeterminism of parallel builds. And that's exactly
what happened; the fix no longer works. `mm -j4` on Fedora 17 fails for
me.

The problem is that there is no rule for program_parse.tab.h. To fix that,
this patch adds a rule that makes program_parse.tab.c depend on
program_parse.tab.h. Technically, the c file does not depend on the
h file. However, because the two files are generated together by a single
invocation of Bison, any rule that forces execution of Bison is
sufficient.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-05 23:06:16 -08:00
Dave Airlie
77b26564c3 llvmpipe: EXT_transform_feedback support (v1.1)
I'd written most of this ages ago, but never finished it off.

This passes 115/130 piglit tests so far. I'll look into the
others as time permits.

v1.1: fix calloc return check as suggested by Jose.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-06 14:48:10 +10:00
Eric Anholt
71f06344a0 i965: Add a debug flag for counting cycles spent in each compiled shader.
This can be used for two purposes: Using hand-coded shaders to determine
per-instruction timings, or figuring out which shader to optimize in a
whole application.

Note that this doesn't cover the instructions that set up the message to
the URB/FB write -- we'd need to convert the MRF usage in these
instructions to GRFs so that our offsets/times don't overwrite our
shader outputs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)

v2: Check the timestamp reset flag in the VS, which is apparently
    getting set fairly regularly in the range we watch, resulting in
    negative numbers getting added to our 32-bit counter, and thus large
    values added to our uint64_t.
v3: Rebase on reladdr changes, removing a new safety check that proved
    impossible to satisfy.  Add a comment to the AOP defs from Ken's
    review, and put them in a slightly more sensible spot.
v4: Check timestamp reset in the FS as well.
2012-12-05 14:29:44 -08:00
Eric Anholt
ef2fbf67d4 i965: Add a flag for instructions with normal writemasking disabled.
For getting values from the new timestamp register, the channels we
load have nothing to do with the pixels dispatched.
2012-12-05 14:29:44 -08:00
Vincent Lejeune
00d77e9fe4 r600g: use default action for min/max opcode in tgsi to llvm
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:31:55 +01:00
Vincent Lejeune
2d97f77b9f gallivm: Have a default emit function for min/max opcode
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:31:18 +01:00
Vincent Lejeune
2a03f28e54 r600g: use default action for fdiv/rcp opcode
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:31:02 +01:00
Vincent Lejeune
0a2f58f6ed gallivm: have a default emit function for fdiv/rcp
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:30:39 +01:00
Vincent Lejeune
0ad1fefd69 r600g: Use default mul/mad function for tgsi-to-llvm
Reveiwed-by: Tom Stellard <thomas.stellard at amd.com>
2012-12-05 18:30:16 +01:00
Vincent Lejeune
e9f090e8b2 glsl: add new variable declaration in function body in lower_output_read
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
2012-12-05 18:23:42 +01:00
Brian Paul
d2c7fe5389 draw: set precalc_flat flag for AA lines too
Fixes flat shading for AA lines.  demos/src/trivial/line-smooth is a
test case which hits this.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-12-05 08:05:00 -07:00
Chris Forbes
484a8dcfa8 mesa: expose ARB_texture_cube_map_array in core contexts as well
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2012-12-05 16:52:37 +10:00
Vinson Lee
129a580062 scons: Require drm to build gallium/state_trackers/egl/x11/x11_screen.c.
x11_screen.c includes xf86drm.h, which comes from libdrm-dev.

This patch fixes this build error.

  Compiling src/gallium/state_trackers/egl/x11/x11_screen.c ...
src/gallium/state_trackers/egl/x11/x11_screen.c:30:21: fatal error: xf86drm.h: No such file or directory

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-04 22:21:04 -08:00
Eric Anholt
a64c1eb9b1 i965/fs: Add support for uniform array access with a variable index.
Serious Sam 3 had a shader hitting this path, but it's used rarely so it
didn't show a significant performance difference (n=7).  It does reduce
compile time massively, though -- one shader goes from 14s compile time
and 11723 instructions generated to .44s and 499 instructions.

Note that some shaders lose 16-wide mode because we don't support
16-wide and pull constants at the moment (generally, things looping over
a few-element array where the loop isn't getting unrolled).  Given that
those shaders are being generated with 15-20% fewer instructions, it
probably outweighs the loss of 16-wide.
2012-12-04 17:11:11 -08:00
Eric Anholt
67d9e7b581 i965/fs: Conditionalize constant-index UBO load code and add comments.
I wanted to separate this step for easier reviewing when I add the
variable-index case next.
2012-12-04 16:59:59 -08:00
Eric Anholt
f22a909a08 i965/fs: Restrict optimization that would fail for gen7's SENDs from GRFs
v2: Fix SNB math bug in register_coalesce() where I was looking at the
    instruction to be removed, not the instruction to be copy propagated
    into.
2012-12-04 16:58:46 -08:00
Eric Anholt
9156d0cba1 i965/fs: Allow source mods on gen7+ math.
This gen6 restriction was removed in gen7 as the mathbox merge to act
more like a normal instruction was finished in the hardware.
2012-12-04 16:27:54 -08:00
Eric Anholt
d8214e4384 i965/fs: Add instruction emit for varying-index reads of uniforms.
The gen7 send-from-GRF path is sufficiently different from the perspective of
IR generation and optimization that I just made it a separate opcode.

v2: fix whitespace, rebase on Ken's recent refactor.
2012-12-04 16:27:53 -08:00
Eric Anholt
29340d02dc i965/fs: Rename the existing pull constant load opcode.
We're going to use another send message for handling loads with a varying
per-fragment array index.
2012-12-04 16:27:53 -08:00
Eric Anholt
78e9c57a3e i965: Add a header_present flag for setting up dp read messages.
As of gen7, we can skip the header on some messages, and this can make
optimization on those messages much nicer when you've got GRFs instead of MRFs
as the source.
2012-12-04 16:27:53 -08:00
Eric Anholt
8f05b2f2b0 i965/gen7: Add some safety checks for send messages from GRFs. 2012-12-04 16:27:53 -08:00
José Fonseca
fb6d901ad2 gallivm: Re-add the kludge for lp_build_lerp of fixed point types.
I removed it in commit 7d44d354bd but
texture sample code still relies on it.

Not sure how to this cleanly, so put it pack for now.
2012-12-04 21:18:18 +00:00
José Fonseca
ed4dfaa164 scons: Link against librt
Fixes missing clock_gettime symbol.
2012-12-04 19:37:21 +00:00
José Fonseca
de76101672 util/u_debug: Cleanup/fix debug_dump_image.
- Handle other formats.
- Prevent CRLF on Windows.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
a416a4a91d translate: Fix the fetch function assertions.
fetch_rgba_float is NULL for integer formats, and vice-versa.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
4da0cb83ab util/u_draw: Skip rendering instead of aborting when excessive number of instances is found.
This is a temporary hack. I believe the only way of properly fixing this
is to check buffer overflow just before fetching based on addresses,
instead of number of vertices/instances. This change simply allows tests
that stress buffer overflows to complete without asserting, and should
not affect valid rendering.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
7da3a947c7 draw: Properly limit vertex buffer fetches on draw arrays.
We need to clamp vertex buffer fetch based on its size, not based on the
user specified max index hint.

This matches draw_pt_fetch_run() above.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:19 +00:00
José Fonseca
d1864273f2 draw: Use symbolic primitive names in debug output.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
32e899ab8b draw: Consider the geometry shader when choosing the vertex size.
A single vertex size is chosen for the whole pipeline. So the number of
geometry shader outputs must also be taken in consideration.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
b636204ae8 tgsi: Allow TXF from buffers.
There is more work necessary to properly support buffers in shaders, but
this gets things a bit further along.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
c0e4ee9b27 util/surface: Always use the surface format when clearing.
Not the texture format, as they might differ.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
64f9916314 tgsi: Increase maximum number of temps to 4096.
To match Shader Model 4 limits, as specified in
http://msdn.microsoft.com/en-us/library/windows/desktop/ff471378.aspx

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-04 19:35:18 +00:00
José Fonseca
294d8a71ef llvmpipe: Fix alignment.
My understanding and actual implementation of how the pixels are being
fetch differed.

This fixes bug 57863.

Trivial.
2012-12-04 19:33:04 +00:00
José Fonseca
7d44d354bd gallivm: Generalize lp_build_mul and lp_build_lerp for signed normalized types.
This fixes fdo bug 57755 and most of the failures of piglit fbo-blending-formats
GL_EXT_texture_snorm.

GL_INTENSITY_SNORM is still failing, but problem is probably elsewhere,
as GL_R8_SNORM works fine.
2012-12-04 19:32:50 +00:00
Dave Airlie
ec83535c83 automake/gallium: attempt to fix -lrt
fix non-automake bits in pipe-load to.

Should fix:
http://bugs.freedesktop.org/57852

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-04 18:02:07 +10:00
Dave Airlie
a853301fb7 u_cache: fix dereference before NULL check 2012-12-04 17:55:52 +10:00
Ian Romanick
bdba4b30de intel: Always enable GL_ARB_framebuffer_object
Now that _mesa_BindFramebuffer does the right thing in ES contexts when the
gl_extensions::ARB_framebuffer_object bit is set, the Intel driver doesn't
need this hack.

No piglit or GLES2 conformance regressions observed on IVB, and this
patch (and the previous) fix es3conform's framebuffer_srgb_draw and
transform_feedback_misc tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 21:26:48 -08:00
Ian Romanick
a13f9dfbb8 mesa: Only require Gen'ed name for glBind{Framebuffer,Renderbuffer} on desktop
Desktop OpenGL implementations that support either
GL_ARB_framebuffer_object or OpenGL 3.0 must require names from
glGenFramebuffers for glBindFramebuffer.  We have enforced this rule for
quite some time.  However, OpenGL ES 1.0, 2.0, and 3.0 implementations
are required to allow user-defined names (e.g., not from
glGenFramebuffers{OES,}).

The Intel drivers have hacked around this by not enabling
GL_ARB_framebuffer_object in an ES context.  Instead, just pick the
correct behavior in _mesa_BindFramebuffer based on the context API.

Chad pointed out in a review e-mail:

    "I'd like to point out, though, that glBindFramebufferEXT and
    glBindRenderbufferEXT are still broken on desktop GL because they
    don't accept user-genned names. But that fix belongs to a different
    series."

Currently glBindFramebufferEXT is an alias for glBindFramebuffer.
Unalising two functions presents some difficulty, so we'll have to
revisit this eventually.

v2: Perform same check in _mesa_BindRenderbuffer too.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
2012-12-03 21:24:54 -08:00
Brian Paul
4d2f04cd6c mesa: fix uint64 printing in syncobj.c
To silence printf format warnings.

v2: insert "0x" prefix

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-03 20:55:17 -07:00
Kenneth Graunke
32c6db3978 mesa: Disable GL_NV_primitive_restart extension in core contexts.
The NV formulation of primitive restart is turned on/off with
glEnableClientState/glDisableClientState.  These two functions don't
exist in core contexts, which mean that GL_NV_primitive_restart is
essentially useless...even broken.

However, leaving it on causes oglconform's primitive-restart-nv tests to
run in OpenGL 3.1 contexts, which results in them all failing.  This
patch causes 29 subtests to go from "fail" to "not run".

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-03 17:59:28 -08:00
Kenneth Graunke
3ac97c6ccc i965: Allow INTEL_DEBUG=fs as a synonym for INTEL_DEBUG=wm.
I keep accidentally trying to use it.  "fs" is a sensible name for
fragment shader debugging, and "wm" is...not.  It's also more symmetric
with "vs".

Leave INTEL_DEBUG=wm because old habits die hard.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-12-03 17:57:43 -08:00
Johannes Obermayr
21694b8eac gallium/auxiliary: Add -fno-rtti to CXXFLAGS on LLVM >= 3.2.
Also remove the recently added and overloaded LLVM_CXXFLAGS from CXXFLAGS.

Note: This is a candidate for the stable branches.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-12-03 19:07:43 -05:00
Stefan Dösinger
e866bd1ade r300g: Give CLIP_DISABLE another try
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-12-04 00:07:13 +01:00
Eric Anholt
b126228f12 i965: Include codegen time in the INTEL_DEBUG=perf stall detection.
In the VS case, we were missing the entire compile time in the stall
detection!

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:50 -08:00
Eric Anholt
0f06864ba5 i965: Don't leak the IR annotation into later instructions.
After walking our IR instructions (Mesa or GLSL), we don't want to also
mark the start of the FB/URB writes or whatever as being that IR.  This
can end up being misleading when the end of the IR visit got copy
propagated out to a later instruction in the URB writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:46 -08:00
Eric Anholt
1db9a72351 i965/vp: Fix crashes with INTEL_DEBUG=vs.
The VP generation doesn't set up the output reg strings, so if you
didn't happen to get these values as 0 on the stack, you'd lose.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:43 -08:00
Eric Anholt
0e5f94a552 i965/vs: Fix uninitialized shader pointer used in debug output.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 13:19:34 -08:00
Adrian Marius Negreanu
409730843f android: fix bison warning of conflicting outputs to file
Bison -o parameter expects a .c file.
The corresponding .h filename is obtained
by removing the extension of the initial .c.

This was breaking compilation on Ubuntu 12.04

libmesa_dricore_intermediates/libmesa_dricore.a(program_parse.tab.o): In
function `_mesa_parse_arb_program':
external/mesa/src/mesa/program/program_parse.y:2682: multiple definition
of `_mesa_parse_arb_program'
libmesa_dricore_intermediates/libmesa_dricore.a(lex.yy.o):external/mesa/src/mesa/program/program_parse.y:2682:
first defined here

Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-and-tested-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-03 12:12:28 -08:00
Brian Paul
a4311054c7 st/mesa: add null pointer check in st_renderbuffer_delete()
In my testing I haven't found any cases where we get a null context
pointer, but it might still be possible.  Check for null just to be safe.

Note: This is a candidate for the stable branches.
2012-12-03 11:30:42 -07:00
Brian Paul
c6d74bfaf6 st/glx: accept GLX_SAMPLE_BUFFERS/SAMPLES_ARB == 0
Only fail if GLX_SAMPLE_BUFFERS_ARB or GLX_SAMPLES_ARB are non-zero.
We were already doing this in the older swrast/glx code.

This fixes a piglit/waffle problem where we'd always fail to get a
visual/config and report the test as "skip".

Note: This is a candidate for the stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-12-03 11:10:09 -07:00
Brian Paul
006918c0db mesa: remove warning message in _mesa_reference_renderbuffer_()
We were warning when there was no current context and we're about
to delete a renderbuffer, but that happens fairly often and isn't
really a problem.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=57754

Note: This is a candidate for the stable branches.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2012-12-03 11:10:09 -07:00
James Benton
16f0d70ffe llvmpipe: Implement PIPE_QUERY_TIMESTAMP and PIPE_QUERY_TIME_ELAPSED.
This required an update for the query storage in llvmpipe, there
can now be an active query per query type, so an occlusion query
can run at the same time as a time elapsed query.

Based on PIPE_QUERY_TIME_ELAPSED patch from Dave Airlie.

v2: fix up piglits for timers (also from Dave Airlie)

a) if we don't render anything the result is 0, so just
return the current time

b) add missing screen get_timestamp callback.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-12-03 17:21:57 +00:00
Roland Scheidegger
041966801e gallivm: fix srgb format fetch
we need to rely on util code for fetching those, just like before
9f06061d50.
Fixes bugs 57699 and 57756.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-12-03 14:10:36 +00:00
José Fonseca
6a2f2300a8 llvmpipe: Refactor convert_to/from_blend_type to convert in place.
This fixes the "Source and destination overlap in memcpy" valgrind
warnings.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-12-03 14:02:43 +00:00
José Fonseca
03aa3fd54b llvmpipe: Improve color buffer loads/stores alignment.
Tell LLVM the exact alignment we can guarantee, based on the fs block
dimensions, pixel format, and the alignment of the resource base pointer
and stride.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-12-03 14:02:43 +00:00
José Fonseca
0bc6ec238b llvmpipe: Recompute the fs shader key when framebuffer varies.
The fs shader now depends on the color buffer formats. The shader key was
extended to accommodate this, but llvmpipe_update_derived needs to be
updated to check the framebuffer dirty flag.

This fixes bug 57674.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-12-03 14:02:43 +00:00
Marek Olšák
54ff536823 r300g: increment num_z_clears only if we have Hyper-Z 2012-12-02 22:22:39 +01:00
Marek Olšák
838b19609f r300g: add blacklist for apps that shouldn't steal hyperz access 2012-12-02 22:18:11 +01:00
Marek Olšák
12dcbd5954 r300g: enable Hyper-Z by default on r500
I fixed the only known bugs on r500 with 0222b2bd41.
Now there are no piglit regressions with Hyper-Z and all apps I tested seem
to work.

To summarize how it works:
- Only one process can use it at a time. This is a hardware limitation.
- The first process to clear a zbuffer gets the exclusive access to use
  Hyper-Z.
- Compositors don't use any zbuffer, so they won't steal it, but some web
  browsers do, so make sure there's no web browser running if you want your
  game to use Hyper-Z.
- There's no need to restart an app which couldn't get the access to Hyper-Z.
  Just quit the app which took it, the driver can turn it on for the other app
  in the middle of rendering.
- If an app gets the access to Hyper-Z, it prints "radeon: Acquired Hyper-Z"
  to stdout.

r300-r400:
  Hyper-Z will be enabled by default on r300-r400 once sufficient testing is
  done with piglit and Lightsmark at least.
  Be sure to set the env var RADEON_HYPERZ and run piglit with parameters: -c 0
2012-12-02 18:07:26 +01:00
Marek Olšák
0222b2bd41 r300g: clear the ZB cache before clearing ZMASK or HIZ
This fixes wrong rendering in Lightsmark and
the piglit/depthstencil-render-miplevels.

I think I fixed Hyper-Z. So far every app seems to work like a charm.
2012-12-02 07:07:33 +01:00
Marek Olšák
62cba629c0 Revert "r300g: fix occlusion queries when depth test is disabled or zbuffer is missing"
It broke Hyper-Z terribly.
2012-12-02 07:07:33 +01:00
Chad Versace
e5f1f8d52e dri: Fix i965 build
The following commit broke the i965 build:

    commit 4a486f8bf2
    Author: Marek Olšák <maraeo@gmail.com>
    Date:   Fri Nov 23 18:31:42 2012 +0100

    glx/dri2: add and use new driver hook flush_with_flags

That commit added a forward declaration of enum __DRI2throttleReason to
dri_interface.h. C++ 98 does not allow forward declarations of enums.

The fix: Move the enum's definition to earlier in the file.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-12-01 17:08:41 -08:00
Marek Olšák
3039addf93 st/dri: implement new driver hook flush_with_flags
v2: added documentation for dri_flush as per Brian's request
2012-12-02 00:19:02 +01:00
Marek Olšák
4003961fbf st/mesa: make st_flush do what glFlush does 2012-12-02 00:19:02 +01:00
Marek Olšák
4a486f8bf2 glx/dri2: add and use new driver hook flush_with_flags 2012-12-02 00:19:00 +01:00
Marek Olšák
5b7e9b7360 glx: move the glFlush call one layer down 2012-12-02 00:15:00 +01:00
Marek Olšák
8ad9d42b33 r300g: refuse to create too large textures 2012-12-01 22:41:39 +01:00
Marek Olšák
e694ea09f5 r300g: fix memory leaks in texture_create error paths 2012-12-01 22:38:36 +01:00
Marek Olšák
3e3a586236 r300g: fix revoking hyperz access
The bug was uncovered by 67c8e96f5a.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57763
2012-12-01 21:43:17 +01:00
Roland Scheidegger
587bd16d0d gallivm: drop border wrap clamping code
The border clamping code is unnecessary, since we don't care if a wrapped
coord value is -1 or <-1 (same for length vs. >length), in either case the
border handling code will mask out the offset and replace the texel value with
the border color.
Note that technically this is not entirely correct. Omitting clamping on the
float coords means that flt->int conversion may result in undefined values for
values of very large magnitude.
However there's no reason we should honor this here since:
a) we don't care for that for ordinary wrap modes in the aos code when
   converting coords and the problem is worse there (as we've got only
   effectively 24 instead of 32bits)
b) at least in some cases the clamping was done already in int space hence
   doing nothing to fix that problem.
c) with sse2 flt->int conversion with such values results in 0x80000000 which
   is just perfect (for clamp to border - not so much for the ordinary clamp to
   edge).

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-12-01 17:05:48 +01:00
Marek Olšák
224d0e4a3f r300g: handle map flag DISCARD_WHOLE_RESOURCE
This should improve performance in apps which trigger this codepath.
(e.g. Wine does)
2012-12-01 14:33:11 +01:00
Vinson Lee
da7029dcb4 radeon: Fix memory leak in radeonCreateScreen2.
Fixes a memory leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-30 19:34:31 -08:00
Brian Paul
a17750b688 nouveau: Fix build.
Fixes nouveau build failure introduced at
c73245882c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57746
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-30 19:11:21 -08:00
Dave Airlie
f3476ec8fa glsl: fix uninitialised variable from constructor
Coverity pointed out this uninitialised class member.

Note: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:27:16 +10:00
Dave Airlie
906670a790 glsl: initialise killed_all field.
coverity pointed out this field was being used uninitialised.

Note: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:27:16 +10:00
Dave Airlie
d128ae347a svga: remove pointless assert on unsigned >= 0
all unsigneds are >= 0 :-)

There may be an argument for leaving this in, in case someone
changes min_lod to an integer, so feel free to apply or drop.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:25:15 +10:00
Dave Airlie
e85c9a4d28 glsl: fix cut-n-paste error in error handling. (v2)
Reported by coverity scan.

v2: fix second case

Note: This is a candidate for stable branches.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:24:16 +10:00
Dave Airlie
67c8e96f5a r300g: fix comparison of hyperz flush time.
I haven't confirmed this is doing the correct thing, but at
least this might make someone review it!

Reported by internal RH coverity scan.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-12-01 11:23:48 +10:00
Dave Airlie
a0ec9185eb dri_glx: fix use after free report
the critical error would use driverName.

Found by internal RH coverity scan.

Note: This is a candidate for stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-12-01 11:20:36 +10:00
Carl Worth
a47a0200a7 Revert "glcpp: Rewrite line-continuation support to act globally."
This reverts commit 962a1c07b4.

Further testing revealed that this commit can cause the pre-processor to enter
infinite loops. For now, simply revert this code until a cleaner,
better-tested version is available.
2012-11-30 17:17:56 -08:00
Carl Worth
962a1c07b4 glcpp: Rewrite line-continuation support to act globally.
Previously, we were only supporting line-continuation backslash characters
within lines of pre-processor directives, (as per the specification). With
OpenGL 4.2 and GLES3, line continuations are now supported anywhere within a
shader.

While changing this, also fix a bug where the preprocessor was ignoring
line continuation characters when a line ended in multiple backslash
characters.

The new code is also more efficient than the old. Previously, we would
perform a ralloc copy at each newline. We now perform copies only at each
occurrence of a line-continuation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-30 15:08:38 -08:00
Ander Conselvan de Oliveira
60a11e295b egl/wayland: Dispatch the event queue before get_buffers
When a client frame callback is executed and the client starts rendering
again, the egl event queue might not have been dispatched so that the
buffer release event for the previous frame hasn't been processed. In
that case a third buffer is allocated, even though it would be possible
to reuse the buffer that was just released.

The wl_display_dispatch_queue_pending() entry point is available from
wayland-client 1.0.2, so require that in configure.ac.  Also, just
let the pkg-config macro throw its own error, which will show what version
we were looking for and failed to find.

Note: This is a candidate for stable branches.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-11-30 17:05:50 -05:00
Kristian Høgsberg
89ba4368fd egl/wayland: Add invalidate back in eglSwapBuffers()
Commit ca3ed3e024 fixed the problem where
eglMakeCurrent would trigger a getbuffer callback that then breaks the
following wl_egl_window_resize() call.  However, we still need to
invalidate buffers in eglSwapBuffers, since in wayland we always swap
buffers, so the dri driver needs to come out and ask us for the next buffer
after each swapbuffer.

Note: this is a candidate for stable branches.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-11-30 17:04:22 -05:00
Kenneth Graunke
8d0bb74a11 i965/fs: Add fs_reg::is_zero() and is_one(); use for opt_algebraic().
These helper macros save you from writing nasty expressions like:

   if ((inst->src[1].type == BRW_REGISTER_TYPE_F &&
         inst->src[1].imm.f == 1.0) ||
        ((inst->src[1].type == BRW_REGISTER_TYPE_D ||
          inst->src[1].type == BRW_REGISTER_TYPE_UD) &&
         inst->src[1].imm.u == 1)) {

Instead, you simply get to write inst->src[1].is_one().  Simple.
Also, this makes the FS backend match the VS backend (which has these).

This patch also converts opt_algebraic to use the new helper functions.
As a consequence, it will now also optimize integer-typed expressions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-30 13:15:39 -08:00
Brian Paul
4cedb65a43 st/mesa: fix context use-after-free problem in st_renderbuffer_delete()
The use-after-free happened when the renderbuffer was shared by multiple
contexts and we tried to delete the renderbuffer using a context which
was previously deleted.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30 12:08:07 -07:00
Brian Paul
51223784d6 util: added pipe_surface_release() function
To fix a pipe_context::surface_destroy() use-after-free problem.
We previously added pipe_sampler_view_release() for similar reasons.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30 12:08:07 -07:00
Brian Paul
c73245882c mesa: pass context parameter to gl_renderbuffer::Delete()
We sometimes need a rendering context when deleting renderbuffers.
Pass it explicitly instead of trying to grab a current context
(which might be NULL).  The next patch will make use of this.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-30 12:08:06 -07:00
Ander Conselvan de Oliveira
ca3ed3e024 egl/wayland: Don't invalidate drawable on swap buffers
We used to invalidate the drawable after a call to eglSwapBuffers(),
so that a wl_egl_window_resize() would take effect for the next frame.
However, that leads to calling dri2_get_buffers() when eglMakeCurrent()
is called with the current context and surface, and a later call to
wl_egl_window_resize() would not take effect until the next buffer
swap.

Instead, add a callback from wl_egl_window_resize() back to the wayland
egl platform, and invalidate the drawable only when it is resized.

This solves a bug on wayland clients when going back to windowed mode
from fullscreen when clicking a pop up menu, where the window size
after this would be the fullscreen size.

Note: this is a candidate for stable branches.
CC: wayland-devel@lists.freedesktop.org
2012-11-30 11:08:04 -05:00
Kristian Høgsberg
b5c53245af egl: Only enable GLX backend if X11 EGL platform is enabled
We don't want to compile in a bunch of X11 dependencies in libEGL if
we can't run EGL on X11.
2012-11-30 11:08:03 -05:00
José Fonseca
e7177e362e llvmpipe: Remove remnants of lp_tile_soa from Makefile.
Completely forgot about updating Makefile when removing it. Stephane
already fixed the make build, but there were a few mentions of
lp_tile_soa left in the tree.
2012-11-30 07:07:38 +00:00
Eric Anholt
2f7915bdb9 i965/fp: Fix segfault on gen4 TXB instructions.
The gen4 simd16 workaround looks at ir->type to determine how much
storage to allocate for the simd16 value.  In fragment programs,
texturing only ever returns float vec4s (unlike GLSL, which can also
have scalar floats or vector integers), so this is the right type.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-29 22:34:28 -08:00
Vinson Lee
f126f34c1d llvmpipe: Fix incorrect sizeof.
Fixes sizeof not portable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29 21:08:48 -08:00
Stéphane Marchesin
4430d44eac llvmpipe: Fix build break from 75da95c50
The Makefile looks for a file which is gone (lp_tile_soa.c)

http://bugs.freedesktop.org/show_bug.cgi?id=57713
2012-11-29 19:54:34 -08:00
Anuj Phogat
9ab896243c mesa: Fix GL_LUMINANCE handling for textures in glGetTexImage
We need to rebase colors (ex: set G=B=0) when getting GL_LUMINANCE
textures in following cases:
1. If the luminance texture is actually stored as rgba
2. If getting a luminance texture, but returning rgba
3. If getting an rgba texture, but returning luminance

A similar fix was pushed by Brian Paul for uncompressed textures
in commit: f5d0ced.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47220

Observed no regressions in piglit and ogles2conform due to this fix.
This patch will cause failures in intel oglconform pxconv-gettex,
pxstore-gettex and pxtrans-gettex test cases. The cause of failures
is a bug in test cases. Expected luminance value is calculted
incorrectly in test cases: L = R+G+B.

V2: Set G = 0 when getting a RG texture but returning luminance.

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2012-11-29 14:05:25 -08:00
Kenneth Graunke
53ba40c156 Revert "meta: Don't try to glOrtho when the draw buffer isn't initialized."
This reverts commit 9947470655.
Apparently it caused a lot of Piglit regressions.
2012-11-29 13:49:07 -08:00
Vincent Lejeune
3fcb3fbf22 r600g: mirror simplification of if/break opcodes
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-29 22:15:18 +01:00
Vincent Lejeune
5fda2990aa r600g: separate resource_id and sampler_id tex info in tgsi-to-llvm
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-29 22:15:18 +01:00
Carl Worth
9ff6b52886 glcpp: Update README for new support of __LINE__ and __FILE__.
Drop these from the known limitations list since support was recently added
for these.

Also, fix a typo while in the area, (and the oddly missing final newline).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:02 -08:00
Carl Worth
89cd6df034 glcpp: Add test involving token pasting of INTEGER tokens.
This test file is very similar to test 113-line-and-file-macros but uses token
pasting for cleaner quiz answers (without spaces between the digits). This
test passes thanks to the recent addition of support for pasting INTEGER
tokens, (but would have failed without that).

(Note that this test is distinct from test 059-token-pasting-integer which
pastes integers parsed from the source. Those are parsed to INTEGER_STRING
tokens and are already pasted correctly as verified by that test. The only way
to generate the INTEGER tokens which currently fail to paste is with an
internal define such as __LINE__ that results in an integer.)

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:02 -08:00
Carl Worth
522d1ccd77 glcpp: Add support for pasting of INTEGER tokens.
By generalizing the current code designed to paste string tokens of various
types.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:02 -08:00
Carl Worth
e1597f0a81 glcpp: Flag invalid pastes for integer followed by non-digits
As recently tested in the additions to the invalid paste test, it is illegal
to paste a non-digit sequence onto the end of an integer.

The 082-invalid-paste test should now pass again.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
c86eb0cd65 glcpp: Extend the invalid-paste test
The current code lets a few invalid pastes through, such as an string pasted
onto the end of an integer. Extend the invalid-paste test to catch some of
these.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
01b83171c9 glcpp: More factoring-out of common code to simplify things.
This time creating a new _token_list_create_with_one_integer function
modeled after the existing _token_list_create_with_one_space function
(both implemented with new _token_list_create_with_one_ival).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
ea34ac499d glcpp: Factor out a tiny bit of repeated code.
This function is getting a little long too read. Simplify it by pulling
up one assignment from every condition.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Carl Worth
907a10378e glcpp: Add support for __LINE__ and __FILE__ macros
These tokens are easy to expand by just looking at the current, tracked
location values, (and no need to look anything up in the hash table).

Add a test which verifies __LINE__ with several values, (and verifies __FILE__
for the single value of 0). Our testing framework isn't sophisticated enough
here to have a test with multiple file inputs.

This commit fixes part of es3conform's preprocess16_frag test.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-29 13:03:01 -08:00
Paul Berry
dbd6135bc1 mesa: Rename API_OPENGL to API_OPENGL_COMPAT.
This should help avoid confusion now that we're using the gl_api enum
to distinguishing between core and compatibility API's.  The
corresponding enum value for core API's is API_OPENGL_CORE.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-29 11:33:15 -08:00
Marek Olšák
3e163a137b gallium/postprocess: share pipe_context and cso_context with the state tracker
Using one context instead of two is more efficient and
we can skip another context flush.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29 20:31:41 +01:00
Marek Olšák
135fe907a0 mesa: move some helper functions from fboobject.c to glformats.c
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-29 20:31:41 +01:00
Tapani Pälli
0fda2e9147 android: include api_exec.c in generated files list
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-29 09:14:27 -08:00
José Fonseca
9c9c18a395 gallivm: Fix lp_build_float_to_half.
The current implementation was close by not fully correct: several
operations that should be done in floating point were being done in
integer.

Fixes piglit fbo-clear-formats GL_ARB_texture_float

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 16:52:42 +00:00
Roland Scheidegger
b5918d8f1d gallivm: fix a trivial txq issue for 2d shadow and cube shadow samplers
untested (couldn't get the piglit test to run even with version overrides)
but seemed blatantly wrong.
In any case it would only affect an error case which when it would happen
probably all hope is lost anyway.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29 15:31:46 +01:00
Roland Scheidegger
6d50148742 llvmpipe: support array textures
This adds array (1d,2d) texture support to llvmpipe.
Though probably should do something about 1d array textures requiring gobs
of memory (this issue is not strictly limited to arrays but it is probably
worse there).
Initial code by Jakob Bornecrantz <jakob@vmware.com>

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29 15:30:19 +01:00
Roland Scheidegger
95e03914d8 gallivm: support array textures
Support 1d and 2d array textures (including shadow samplers),
and (as a side effect mostly) also shadow cube samplers.
Seems to pass the relevant piglit tests both for sampling and rendering
to (though some require version overrides).
Since we don't support render target indices rendering to array textures
is still restricted to a single layer at a time.
Also, the min/max layer in the sampler view (which is unnecessary for GL)
is ignored (always use all layers).

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-29 15:28:25 +01:00
José Fonseca
88e92f5bcd llvmpipe: Remove lp_build_blend_soa()
No longer used/necessary, as we always blend in AoS now.

Trivial.
2012-11-29 14:08:43 +00:00
José Fonseca
75da95c50a llvmpipe: Eliminate color buffer swizzling.
Now dead code.

Also had to remove the show_tiles/show_subtiles because now the color
buffers are always stored in their native format, so there is no longer
an easy way to paint the tile sizes.

Depth-stencil buffers are still swizzled.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:43 +00:00
José Fonseca
6916387e53 llvmpipe: Only advertise unswizzled formats.
Update llvmpipe_is_format_supported and llvmpipe_is_format_unswizzled
so that only the formats that we can render without swizzling are
advertised.

We can still render all D3D10 required formats except
PIPE_FORMAT_R11G11B10_FLOAT, which needs to be implemented in a future
opportunity.

Removal of rendertarget swizzling will be done in a subsequent change.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:42 +00:00
José Fonseca
9f06061d50 util/u_format: Kill util_format_is_array().
It is buggy (it was giving wrong results for some of the formats with
padding), and util_format_description::is_array already does precisely
what's intended.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:42 +00:00
José Fonseca
a47674ee89 util/u_format: Tighten the meaning of is_array bit to exclude mixed type formats.
This is what we want in practice.

The only change is in PIPE_FORMAT_R8SG8SB8UX8U_NORM, which no longer is
considered an array format.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-29 14:08:42 +00:00
Adhemerval Zanella
64e9ec634b util/u_format: Fix format manipulation for big-endian
This patch fixes various format manipulation for big-endian
architectures.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:23 +00:00
Adhemerval Zanella
e25abacc18 gallivm: Fix format manipulation for big-endian
This patch fixes various format manipulation for big-endian
architectures.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:18 +00:00
Adhemerval Zanella
b772d784b2 gallivm: Add byte-swap construct calls
This patch adds two more functions in type conversions header:
* lp_build_bswap: construct a call to llvm.bswap intrinsic for an
  element
* lp_build_bswap_vec: byte swap every element in a vector base on the
  input and output types.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:14 +00:00
Adhemerval Zanella
86902b5134 gallivm: Fix vector constant for shuffle
This patch fixes the vector constant generation used for vector shuffle
for big-endian machines.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:54:10 +00:00
Adhemerval Zanella
29ba79b2c9 gallivm: clear Altivec NJ bit
This patch enforces the clear of NJ bit in VSCR Altivec register so
denormal numbers are handles as expected by IEEE standards.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:52:05 +00:00
Adhemerval Zanella
43ce9efdbf gallivm: Altivec floating-point rounding
This patch adds Altivec intrinsics for float vector types. It changes
the SSE specific definitions to a platform neutral and adds the calls
to Altivec intrinsic builder.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:52:00 +00:00
Adhemerval Zanella
dd5c580816 gallivm: Altivec vector add/sub intrisics
This patch add correct vector addition and substraction intrisics when
using Altivec with PPC. Current code uses default path and LLVM backend
ends up issuing carry-out arithmetic instruction while it is expected
saturated ones.

It also includes a fix for PowerPC where char are unsigned by default,
resulting in bogus values for vector shifting.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:51:53 +00:00
Adhemerval Zanella
2ea7d3dabd gallivm: Altivec vector max/min intrisics
This patch adds the PPC Altivec instrics max/min instruction for
supported Altivec vector types (16xi8, 8xi16, 4xi32, 4xf32).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:51:46 +00:00
Adhemerval Zanella
31c63b058e gallivm: Altivec pack/unpack intrisics
This patch adds PPC Altivec support for pack/unpack operations using Altivec
supported vector type (8xi8, 16xi16, 4xi32, 4xf32).

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-29 11:51:41 +00:00
Michel Dänzer
8b6aec6533 radeonsi: Bitcast result of packf16 intrinsic to float for export intrinsic.
Fixes 7 piglit tests, and prevents many more from crashing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-and-Tested-by: Christian König <christian.koenig@amd.com>
2012-11-29 10:08:53 +01:00
Kenneth Graunke
c102360800 i965/vs: Move struct brw_compile (p) entirely inside vec4_generator.
The brw_compile structure contains the brw_instruction store and the
brw_eu_emit.c state tracking fields.  These are only useful for the
final assembly generation pass; the earlier compilation stages doesn't
need them.

This also means that the code generator for future hardware won't have
access to the brw_compile structure, which is extremely desirable
because it prevents accidental generation of Gen4-7 code.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:16:01 -08:00
Kenneth Graunke
eda9726ef5 i965/vs: Split final assembly code generation out of vec4_visitor.
Compiling shaders requires several main steps:

   1. Generating VS IR from either GLSL IR or Mesa IR
   2. Optimizing the IR
   3. Register allocation
   4. Generating assembly code

This patch splits out step 4 into a separate class named "vec4_generator."

There are several reasons for doing so:

   1. Future hardware has a different instruction encoding.  Splitting
      this out will allow us to replace vec4_generator (which relies
      heavily on the brw_eu_emit.c code and struct brw_instruction) with
      a new code generator that writes the new format.

   2. It reduces the size of the vec4_visitor monolith.  (Arguably, a lot
      more should be split out, but that's left for "future work.")

   3. Separate namespaces allow us to make helper functions for
      generating instructions in both classes: ADD() can exist in
      vec4_visitor and create IR, while ADD() in vec4_generator() can
      create brw_instructions.  (Patches for this upcoming.)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:58 -08:00
Kenneth Graunke
db6231fece i965/vs: Abort on unsupported opcodes rather than failing.
Final code generation should never fail.  This is a bug, and there
should be no user-triggerable cases where this could occur.

Also, we're not going to have a fail() method after the split.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:57 -08:00
Kenneth Graunke
8af8a26480 i965/vs: Move uses of brw_compile from do_vs_prog to brw_vs_emit.
The brw_compile structure is closely tied to the Gen4-7 hardware
encoding.  However, do_vs_prog is very generic: it just calls out to
get a compiled program and then uploads it.

This isn't ultimately where we want it, but it's a step in the right
direction: it's now closer to the code generator.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:55 -08:00
Kenneth Graunke
746fc346ea i965/vs: Rework memory contexts for shader compilation data.
During compilation, we allocate a bunch of things: the IR needs to last
at least until code generation...and then the program store needs to
last until after we upload the program.

For simplicity's sake, just keep it all around until we upload the
program.  After that, it can all be freed.

This will also save a lot of headaches during the upcoming refactoring.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:53 -08:00
Kenneth Graunke
031146736c i965/vs: Pass the brw_context pointer into brw_compute_vue_map().
We used to steal it out of the brw_compile struct, but that won't be
initialized in time soon (and is eventually going away).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:51 -08:00
Kenneth Graunke
403bb1d306 i965/vs: Pass the brw_context pointer into vec4_visitor and do_vs_prog.
We used to steal it out of the brw_compile struct...but vec4_visitor
isn't going to have one of those in the future.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:50 -08:00
Kenneth Graunke
dd50c88386 i965/vs: Move some functions from brw_vec4_emit.cpp to brw_vec4.cpp.
This leaves only the final code generation stage in brw_vec4_emit.cpp,
moving the payload setup, run(), and brw_vs_emit functions to brw_vec4.cpp.

The fragment shader backend puts these functions in brw_fs.cpp, so this
patch also helps with consistency.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-11-28 18:15:26 -08:00
Kenneth Graunke
9947470655 meta: Don't try to glOrtho when the draw buffer isn't initialized.
I ran across this while running a glGenerateMipmap() test.

_meta_GenerateMipmap sets MESA_META_TRANSFORM, which causes
_mesa_meta_begin to try and set a default orthographic projection.

Unfortunately, if the drawbuffer isn't set up, ctx->DrawBuffer->Width
and Height are 0, which just causes an GL_INVALID_VALUE error.

Fixes oglconform's fbo/mipmap.automatic, mipmap.manual, and
mipmap.manualIterateTexTargets.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-28 18:12:07 -08:00
Jason Wood
8d1ee38a4c docs: Mark some features in GL3.txt as done for r600
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-11-29 01:07:26 +01:00
Marek Olšák
aa46cc2879 st/mesa: allow forward-compatible contexts and set Const.ContextFlags
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-29 01:07:26 +01:00
Marek Olšák
249f86e3f8 st/mesa: add support for GL core profiles
The rest of the plumbing was in place already.

I have tested this by turning on all GL 3.1 features.
The drivers not supporting GL 3.1 will fail to create a core profile
as they should.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-29 01:07:26 +01:00
Marek Olšák
f9429e30aa configure.ac: remove -fomit-frame-pointer from LLVM flags
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Marek Olšák
3d59cde92e configure.ac: look for whole words in LLVM flags, not prefixes
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Marek Olšák
9b67a347f6 configure.ac: consolidate stripping unwanted LLVM flags
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Marek Olšák
a84a8da4f8 configure.ac: print LLVM flags
to see what we're mixing with ours

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-11-29 00:07:27 +01:00
Brian Paul
0904973e39 util: add more memory debugging features
Add a DEBUG_FREED_MEMORY option to help catch use-after-free errors.
Add debug_memory_check() function which can be periodically called to
check that all known blocks are good.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-28 15:03:29 -07:00
José Fonseca
1cead8845b llvmpipe: Implement logic ops for the AoS path.
It was forgotten in the previous patch series, but it is trivial to
implement, based on the SoA path.

This fixes glean logicOp failures.
2012-11-28 20:45:18 +00:00
José Fonseca
547efc76df llvmpipe: Don't use dynamically sized arrays.
Unfortunately for MSVC arrays with a constant variable size are still
considered dynamically sized.
2012-11-28 19:58:47 +00:00
Eric Anholt
c8ed9f6262 i965/gen4-5: Fix segfaults with stencil-only depth/stencil setups.
Fixes a ton of piglit regressions since the depthstencil fixes for gen6+.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57309
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-28 11:26:41 -08:00
Eric Anholt
b9b033d8e4 i965/fs: Don't generate saturates over existing variable values.
Fixes a crash in http://workshop.chromeexperiments.com/stars/ on i965,
and the new piglit test glsl-fs-clamp-5.
We were trying to emit a saturating move into a uniform, which the code
generator appropriately choked on.  This was broken in the change in
32ae8d3b32.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57166
NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-28 11:26:34 -08:00
Eric Anholt
154ef07aa7 i965/fs: Add some minimal backend-IR dumping.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-28 11:26:33 -08:00
James Benton
960ab06da0 llvmpipe: Update llvmpipe_is_format_unswizzled to reflect latest changes.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
66fdf626bb llvmpipe: Enable vertex color clamping.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
fa1b481c09 llvmpipe: Unswizzled rendering.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
1d3789bccb gallivm: Updated lp_build_const_mask_aos to input number of channels.
Also updated lp_build_const_mask_aos_swizzled to reflect this.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
d03d29a044 util: Updated util_format_is_array to be more accurate.
Will allow formats with padding, e.g. RGBX.
Will now allow swizzled formats as long as the alpha is channel 3.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
e66ec7c46b gallivm: Added support for float to half-float conversion in lp_build_conv.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
d7a8390a82 gallivm: Changed lp_build_pad_vector to correctly handle scalar argument.
Removed the lp_type argument as it was unnecessary.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
71c6fe76c0 gallivm: Add a function to generate lp_type for a format.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:36 +00:00
James Benton
cd548836a1 gallivm: Add support for unorm16 in lp_build_mul.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-28 19:14:20 +00:00
Matt Turner
c3a465ae98 glcpp: Support #elif(expression) with no intervening space.
And add test cases to ensure that this works
	- 110 verifies that glcpp rejects #elif<digits> which glcpp
	  previously accepted.
	- 111 verifies that glcpp accepts #if followed immediately by
	  (, +, -, !, or ~.
	- 112 does the same as 111 but for #elif.

See 17f9beb6 for #if change.
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-11-28 10:27:02 -08:00
Matt Turner
aed466192a glcpp: Reject #version and #line not followed by whitespace
Fixes part of es3conform's preprocess16_frag test.
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-11-28 10:26:53 -08:00
Marek Olšák
91ca053714 mesa: fix BlitFramebuffer between linear and sRGB formats
NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-28 18:48:22 +01:00
Roland Scheidegger
406b76ca32 gallivm: fix multiple lods with different min/mag filter and wide vectors
broken since 529fe420ba,
I forgot some code, only added the comment...
Fixes bug 57644.
2012-11-28 18:07:27 +01:00
Michel Dänzer
6e33b55ee1 radeonsi: Reinstate assertions against invalid colour/depth formats.
radeonsi now supports Z16 and doesn't fail these assertions anymore.

This partially reverts commit 7bba4879bb, but
leaves the error messages in place to allow diagnosing such problems even with
non-debugging builds.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-11-28 15:48:50 +01:00
Michel Dänzer
a8d46d0173 radeonsi: Re-enable Z16 depth buffers.
8 more piglits.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-11-28 13:53:54 +01:00
Marek Olšák
726fe54cbc radeonsi: remove redundant parameter in r600_init_surface
[ Cherry-picked from r600g commit f5ac60152b ]
2012-11-28 13:35:17 +01:00
Michel Dänzer
fa83d52961 radeonsi: Use explicit stencil mipmap level offsets.
Extracted from r600g commit 428e37c2da.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:17 +01:00
Marek Olšák
39b56afaa2 radeonsi: correct texture memory size for Z32F_S8X24
[ Cherry-picked from r600g commit ea72351a91 ]
2012-11-28 13:35:17 +01:00
Michel Dänzer
20f651d003 radeonsi: Depth/stencil fixes.
Adapted from r600g commit 018e3f75d6.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:17 +01:00
Michel Dänzer
1a616c1009 radeonsi: Flesh out support for depth/stencil exports from the pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:16 +01:00
Michel Dänzer
49003a5cb6 radeonsi: Fix sampler views for depth textures.
Consistently reference the flushed depth texture in the sampler view, not the
original one.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-28 13:35:16 +01:00
Jerome Glisse
3c024624fd radeonsi: Fix z/stencil texture creation.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>

[ Cherry-picked from r600g commit b4f0ab0b22 ]
2012-11-28 13:35:16 +01:00
Vinson Lee
ffc318a97a scons: Build ws_xlib on Mac OS X.
Fixes this SCons build error on Mac OS X if X11 is found.

NameError: name 'ws_xlib' is not defined:
  File "SConstruct", line 144:
    duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/SConscript", line 34:
    SConscript('gallium/SConscript')
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/gallium/SConscript", line 135:
    'targets/libgl-xlib/SConscript',
  File "scons-2.2.0/SCons/Script/SConscript.py", line 614:
    return method(*args, **kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 551:
    return _SConscript(self.fs, *files, **subst_kw)
  File "scons-2.2.0/SCons/Script/SConscript.py", line 260:
    exec _file_ in call_stack[-1].globals
  File "src/gallium/targets/graw-xlib/SConscript", line 9:
    ws_xlib,

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 23:13:57 -08:00
Johannes Obermayr
53636fdf93 configure.ac: Remove -O., -g and -Wall from LLVM_C{PP,XX}FLAGS.
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-11-28 00:19:17 +01:00
Brian Paul
f75acabb96 vbo: move another line of code after declarations
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-11-27 15:34:56 -07:00
Brian Paul
8765c0d20f vbo: move code after declarations to fix MSVC errors
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-27 14:28:56 -07:00
Brian Paul
f94e672b47 vbo: minor whitespace fix 2012-11-27 13:56:52 -07:00
Brian Paul
a547e532fc mesa: remove '(void) k' lines
Serves no purpose as the k parameter is used later in the code.
2012-11-27 13:56:52 -07:00
Kenneth Graunke
7a414fea87 mesa/vbo: Check for invalid types in various packed vertex functions.
According to the ARB_vertex_type_2_10_10_10_rev specification:
"The error INVALID_ENUM is generated by VertexP*, NormalP*,
 TexCoordP*, MultiTexCoordP*, ColorP*, or SecondaryColorP if <type>
 is not UNSIGNED_INT_2_10_10_10_REV or INT_2_10_10_10_REV."

Fixes 7 subcases of oglconform's packed-vertex test.

v2: Add "gl" prefix to error messages (pointed out by Brian).
    Also rebase atop the ctx plumbing.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 12:36:33 -08:00
Kenneth Graunke
6a529e2b48 mesa/vbo: Support the ES 3.0 signed normalized scaling rules.
Traditionally, OpenGL has had two separate equations for converting from
signed normalized fixed-point data to floating point data.  One was used
primarily for vertex data, while the other was primarily for texturing
and framebuffer data.

However, ES 3.0 and GL 4.2 change this, declaring there's only one
equation to be used in all cases.  Unfortunately, it's the other one.

v2: Correctly convert 0b10 to -1.0, as pointed out by Chris Forbes.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2012-11-27 12:36:33 -08:00
Kenneth Graunke
c8d8d5db72 mesa/vbo: Plumb ctx through to the conv_i(10|2)_to_norm_float functions.
The rules for converting these values actually depend on the current
context API and version.  The next patch will implement those changes.

v2: Mark ctx as const, as suggested by Brian.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2012-11-27 12:36:33 -08:00
Matt Turner
13f9012ad3 mesa: Set transform feedback's default buffer mode to INTERLEAVED_ATTRIBS
Fixes part of es3conform's transform_feedback_init_defaults test.
NOTE: This is a candidate for the stable branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 10:40:50 -08:00
Matt Turner
7c2060f0f0 mesa: Return 0 for XFB_VARYING_MAX_LENGTH if no varyings
v2: Perform this count the same way as elsewhere in this file, per
    Brian Paul's review.

Fixes part of es3conform's transform_feedback_init_defaults test.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-27 10:40:49 -08:00
Andreas Boll
f65741721b gallium/tests/trivial: updates for transfer functions changes
Fixes build error with configure option --enable-gallium-tests
introduced in 369e468889

Compile tested only.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-11-27 19:00:48 +01:00
Andreas Boll
cba639f2a1 gallium/tests/trivial: updates for CSO interface changes
Fixes build error with configure option --enable-gallium-tests
introduced in ea6f035ae9

Cc: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-11-27 19:00:48 +01:00
Andreas Boll
1553f5ce83 gallium/tests/trivial: updates for util_draw_vertex_buffer changes
Fixes build error with configure option --enable-gallium-tests
introduced in e73bf3b805

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-11-27 19:00:48 +01:00
James Benton
9bd4856b5c util: Modified u_rect to default to memcpy.
Previously this function would assert if the format didn't fit an expected 4 channel format size.

Now will work with any format type with any amount of channels.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 16:24:42 +00:00
James Benton
65016646e3 util/format: Fix bug in float to non-float conversion in u_format_pack.py.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 16:24:02 +00:00
James Benton
978df710f2 gallivm: Fix bug in lp_build_one which would incorrectly return a vector for length 1.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 16:23:04 +00:00
Kenneth Graunke
9bc9895c4a glsl: Support unsigned integer constants in layout qualifiers.
Fixes es3conform's explicit_attrib_location_integer_constants.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-26 21:02:45 -08:00
Kenneth Graunke
9136723214 i965/fs: Move struct brw_compile (p) entirely inside fs_generator.
The brw_compile structure contains the brw_instruction store and the
brw_eu_emit.c state tracking fields.  These are only useful for the
final assembly generation pass; the earlier compilation stages doesn't
need them.

This also means that the code generator for future hardware won't have
access to the brw_compile structure, which is extremely desirable
because it prevents accidental generation of Gen4-7 code.

v2: rzalloc p, as suggested by Eric.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
ea681a0d64 i965/fs: Split final assembly code generation out of fs_visitor.
Compiling shaders requires several main steps:

   1. Generating FS IR from either GLSL IR or Mesa IR
   2. Optimizing the IR
   3. Register allocation
   4. Generating assembly code

This patch splits out step 4 into a separate class named "fs_generator."

There are several reasons for doing so:

   1. Future hardware has a different instruction encoding.  Splitting
      this out will allow us to replace fs_generator (which relies
      heavily on the brw_eu_emit.c code and struct brw_instruction) with
      a new code generator that writes the new format.

   2. It reduces the size of the fs_visitor monolith.  (Arguably, a lot
      more should be split out, but that's left for "future work.")

   3. Separate namespaces allow us to make helper functions for
      generating instructions in both classes: ADD() can exist in
      fs_visitor and create IR, while ADD() in fs_generator() can
      create brw_instructions.  (Patches for this upcoming.)

Furthermore, this patch changes the order of operations slightly.
Rather than doing steps 1-4 for SIMD8, then 1-4 for SIMD16, we now:

   - Do steps 1-3 for SIMD8, then repeat 1-3 for SIMD16
   - Generate final assembly code for both modes together

This is because the frontend work can be done independently, but final
assembly generation needs to pack both into a single program store to
feed the GPU.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
dd1fd30047 i965/fs: Abort on unsupported opcodes rather than failing.
Final code generation should never fail.  This is a bug, and there
should be no user-triggerable cases where this could occur.

Also, we're not going to have a fail() method in a moment.

v2: Just abort() rather than assert, to cover the NDEBUG case
    (suggested by Eric).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
cd0acb1abe i965: Make it possible to create a cfg_t without a backend_visitor.
All we really need is a memory context and the instruction list; passing
a backend_visitor is just convenient at times.

This will be necessary two patches from now.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
4d09fe938e i965/fs: Move uses of brw_compile from do_wm_prog to brw_wm_fs_emit.
The brw_compile structure is closely tied to the Gen4-7 hardware
encoding.  However, do_wm_prog is very generic: it just calls out to
get a compiled program and then uploads it.

This isn't ultimately where we want it, but it's a step in the right
direction: it's now closer to the code generator.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:34 -08:00
Kenneth Graunke
3417b2f2b2 i965/fs: Pass the brw_context pointer into fs_visitor explicitly.
We used to steal it out of the brw_compile struct...but fs_visitor
isn't going to have one of those in the future.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
1f74002a98 i965/fs: Move brw_wm_compile::fp to fs_visitor.
Also change it from a brw_fragment_program to a gl_fragment_program,
since that seems to be what everything wants anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
7b0d30eb87 i965/fs: Remove struct brw_shader * parameter to fs_visitor constructor.
We can easily recover it from prog, and this makes it clear that we
aren't passing additional information in.

v2: Use an if-statement rather than the ?: operator (suggested by Eric).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
a303df86de i965/fs: Move brw_wm_compile::dispatch_width into fs_visitor.
Also, rather than having brw_wm_fs_emit poke at it directly, make it a
parameter to the fs_visitor constructor.

All other changes generated by search and replace (with occasional
whitespace fixup).

v2: Make dispatch_width const (as suggested by Paul); fix doxygen
    mistake (pointed out by Eric); update for rebase.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
47a6a7b51b i965/fs: Move brw_wm_lookup_iz() to fs_visitor::setup_payload_gen4().
This necessitates compiling brw_wm_iz.c as C++.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
2429c9d347 i965/fs: Move brw_wm_payload_setup() to fs_visitor::setup_payload_gen6()
Now that we only have the one backend, there's no real point in keeping
this separate.  Moving it should allow some future simplifications.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Kenneth Graunke
ce96f6db90 i965/fs: Remove brw_wm_compile::computes_depth field.
Everybody determines this by checking if fp's OutputsWritten field
contains the FRAG_RESULT_DEPTH bit.  Rather than having payload setup
check this and set the computes_depth flag, we can just do the check in
the only place that actually used it: emit_fb_writes().

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-26 19:52:33 -08:00
Roland Scheidegger
529fe420ba gallivm: use the new mip per quad handling in texture fetch path
No longer have to split fetching into quads dynamically if mip levels
are not the same for all quads (aos sampling still always splits due
to performance reasons).
Instead handle multiple mip levels further down, minification etc. takes
this into account.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 03:30:55 +01:00
Roland Scheidegger
0b6554ba6f gallivm,llvmpipe: handle TXF (texelFetch) instruction, including offsets
This also adds some code to handle per-quad lods for more than 4-wide fetches,
because otherwise I'd have to integrate the texelFetch function into
the splitting stuff... (but it is not used yet outside texelFetch).
passes piglit fs-texelFetch-2D, fails fs-texelFetchOffset-2D due to I believe
a test error (results are undefined for out-of-bounds fetches, we return
whatever is at offset 0, whereas the test expects [0,0,0,1]).
Texel offsets are only handled by texelFetch for now, though the interface
can handle it for everything.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-27 03:26:49 +01:00
Chris Forbes
93c689a2df i965: Enable ARB_vertex_type_2_10_10_10_rev on Gen4+.
v2 (Kayden): Move the enable into an existing intel->gen >= 4 block
(as suggested by Ian).

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:48:29 -08:00
Chris Forbes
4a64efc01b i965: emit w/a for packed attribute formats in VS
Implements BGRA swizzle, sign recovery, and normalization
as required by ARB_vertex_type_10_10_10_2_rev.

V2: Ported to the new VS backend, since that's all that's left;
	fixed normalization.

V3: Moved fixups out of the GLSL-only path, so it works for FF/VP too.

V4 (Kayden): Rework ES3 normalization, don't heap allocate registers;
	tidy comments.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:35:10 -08:00
Chris Forbes
352ae51efd i965: set attribute w/a bits for packed formats
Flag the need for various workarounds to be applied by
the vertex shader.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:35:00 -08:00
Chris Forbes
c3c680950d i965: Generalize GL_FIXED VS w/a support
Next few patches build on this to add other workarounds
for packed formats.

V2: rename BRW_ATTRIB_WA_COMPONENTS to BRW_ATTRIB_WA_COMPONENT_MASK;
V3 (Kayden): remove separate bit for ES3 signed normalization

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:34:28 -08:00
Chris Forbes
23f4411c41 i965: support 2_10_10_10 formats in get_surface_type.
Always use R10G10B10A2_UINT; Most of the other formats we'd like
don't actually work on the hardware. Will emit w/a for scaling,
sign recovery and BGRA swizzle in the VS.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:34:23 -08:00
Chris Forbes
f9a08f7f0f i965: implement get_size for 2_10_10_10 formats
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 16:34:20 -08:00
Chris Forbes
894fe54ec9 i965/vs: add support for emitting SHL, SHR, ASR
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-26 14:02:30 -08:00
Matt Turner
8f3570efc7 mesa: Use correct glGetTransformFeedbackVarying name in error msg
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-26 10:08:05 -08:00
Andreas Boll
0f5e2ce854 build: use git ls-files for adding all Makefile.in into the release tarball
Until we have proper 'make dist' this is an improvement of the current
situation, because each time some old Makefiles got converted to automake
we had to update the tarballs target.

NOTE: This is a candidate for the 9.0 branch.

Cc: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-11-26 19:03:21 +01:00
Eric Anholt
97747ac88f i965: Fix hangs with FP KIL instructions pre-gen6.
We can't support IF statements in 16-wide on these.  To get back to 16-wide
for these shaders, we need to support predicate on discard instructions in the
backend IR, which is something we've sort of got on the list to do anyway.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55828
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-25 20:22:02 -08:00
Eric Anholt
59bfd66a61 i965/gen4: Fix memory leak each time compile_gs_prog() is called.
Commit 774fb90db3 introduced a ralloc context to
each user of struct brw_compile, but for this one a NULL context was used,
causing the later ralloc_free(mem_ctx) to not do anything.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55175
NOTE: This is a candidate for the stable branches.
2012-11-25 18:25:26 -08:00
Eric Anholt
244db0855c i965/gen4: Fix LOD bias texturing since my fixed reg classes change.
We have a special case where non-shadow comparison with LOD requires using a
SIMD16 vec4 in an 8-wide shader, which appears in the register allocator as a
size 8 vgrf.

Fixes assertions in various piglit tests and webgl conformance.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56521
2012-11-25 18:25:26 -08:00
Marek Olšák
cff4c948ed r600g: fix broken streamout if streamout_begin caused a context flush
This fixes graphics corruption in the case where the DISCARD_RANGE flag
is used to map a buffer.

NOTE: This is a candidate for the stable branches.
2012-11-23 00:42:02 +01:00
Marek Olšák
d172fa825b r600g: fix ARB_map_buffer_alignment with unaligned offsets and staging buffers 2012-11-22 22:40:06 +01:00
Vinson Lee
f884005771 scons: Append x11 library path if linking x11 library.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-21 22:34:20 -08:00
Kenneth Graunke
bf75a1f092 mesa/vbo: Fix scaling issue in 2-bit signed normalized packing.
Since a signed 2-bit integer can only represent -1, 0, or 1, it is
tempting to simply to convert it directly to a float.  This maps it
onto the correct range of [-1.0, 1.0].  However, it gives different
values compared to the usual equation:

(2.0 *  1.0 + 1.0) * (1.0 / 3.0) = +1.0           (same)
(2.0 *  0.0 + 1.0) * (1.0 / 3.0) = +0.33333333... (different)
(2.0 * -1.0 + 1.0) * (1.0 / 3.0) = -0.33333333... (different)

According to the GL_ARB_vertex_type_2_10_10_10_rev extension, signed
normalization is performed using equation 2.2 from the GL 3.2
specification, which is:

   f = (2c + 1)/(2^b - 1).                                (2.2)

Comments below that equation state: "In general, this representation is
used for signed normalized fixed-point parameters in GL commands, such
as vertex attribute values."  Which is what we're doing here.

The 3.2 specification goes on to declare an alternate formula:

   f = max{c/(2^(b-1) - 1), -1.0}                         (2.3)

which is closer to the existing code, and maps the end points to exactly
-1.0 and 1.0.  Comments below the equation state: "In general, this
representation is used for signed normalized fixed-point texture or
framebuffer values."  Which is *not* what we're doing here.

It then states: "Everywhere that signed normalized fixed-point
values are converted, the equation used is specified."  This is the real
clincher: the extension explicitly specifies that we must use equation
2.2, not 2.3.  So we need to do (2x + 1) / 3.

This matches the behavior expected by oglconform's packed-vertex test,
and is correct for desktop GL (pre-4.2).  It's not correct for ES 3.0,
but a future patch will correct that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-11-21 20:32:54 -08:00
Kenneth Graunke
e9967aba61 mesa/vbo: Fix scaling issue in 10-bit signed normalized packing.
For the 10-bit components, the divisor was incorrect.  A 10-bit signed
integer can represent -2^9 through 2^9 - 1, which leads to the following
ranges:

       (float)value.x          -> [ -512,  511]
2.0F * (float)value.x          -> [-1024, 1022]
2.0F * (float)value.x + 1.0F   -> [-1023, 1023]

So dividing by 511 would incorrectly scale it to approximately:
[-2.001956947, 2.001956947].  To correctly scale to [-1.0, 1.0], we need
to divide by 1023.

This correctly implements the desktop GL rules.  ES 3.0 has different
rules, but those will be implemented in a separate patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-11-21 20:29:38 -08:00
Alex Deucher
e2df37f69a radeonsi: add a new SI pci id
Note: this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-21 18:49:00 -05:00
Vinson Lee
10f214e5b2 i915: Fix wrong sizeof argument in i915_update_tex_unit.
The bug was found by Coverity.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-21 15:02:35 -08:00
Andreas Boll
59b3d3ad6e Add .dirstamp to toplevel .gitignore 2012-11-21 18:25:10 +01:00
Andreas Boll
f7e2e864c8 gallium/tests: update .gitignore files 2012-11-21 18:24:30 +01:00
Eric Anholt
d82b873a50 i965/fs: Add helper functions for IF and CMP and use them.
v2: Rebase on gen6-if fix.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-20 13:38:38 -08:00
Eric Anholt
32d6809bb5 i965/fs: Add helper functions for generating ALU ops, like in the VS.
This gives us checking of our arguments (no more passing 1 operand to
BRW_OPCODE_MUL!), at the cost of a couple of extra parens.

v2: Rebase on gen6-if fix.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-20 12:55:08 -08:00
Eric Anholt
1665af3066 i965/gen4: Fix crash with fragment programs and texture rectangle.
This was a regression in the brw_fs_fp.cpp change.  We just need to return
something good enough to get the IR generation to the end without crashing,
but ir->type isn't initialized and we wanted something of the coordinate's
type anyway.

Fixes around 30 piglit cases on my ilk system in drawpixels and framebuffer
blit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-19 22:33:44 -08:00
Eric Anholt
d411bbd5bd i965: Disable the GB clip test when a limited viewport is set.
The theory of the guardband is that you extend the clip volume to avoid
expensive clipping computation, and just let fragments outside the viewport
get clipped by the drawable's bounds.  But if a smaller-than-window-size
viewport is set, and we don't also happen to have a scissor set, then
rendering could incorrectly extend outside of the viewport when it should have
been clipped to the viewport.

Fixes the new piglit triangle-guardband-viewport test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.0 branch.
2012-11-19 22:33:44 -08:00
Eric Anholt
23e7b81f2d i965: Use fewer temporary variables in clip setup.
When you're comparing to the spec, you're trying to immediately see what
numbered dword of the packet your bit ends up in.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.0 branch.
2012-11-19 22:33:43 -08:00
Eric Anholt
afc5a26b5c Revert "i965/fs: Fix conversions float->bool, int->bool"
This reverts commit cf0bbb30f6.  It
was just papering over the bug fixed in the previous commit.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-19 22:33:43 -08:00
Eric Anholt
0482998ccc i965/fs: Fix the gen6-specific if handling for 80ecb8f15b
Fixes oglconform shad-compiler advanced.TestLessThani.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48629
NOTE: This is a candidate for the 9.0 branch.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-19 22:33:43 -08:00
Chad Versace
c9f5126b15 intel: Use designated initializers for DRI extension structs
All Intel code is compiled with -std=c99. There is no excuse to not use
designated initializers.

As a nice benefit, the code is now more friendly to grep. Without
designated initializers, psychic prowess is required to find the
initialization of DRI extension function pointers with grep.  I have
observed several people, when they first encounter the DRI code, fail at
statically chasing the DRI function pointers due to this problem.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:09:55 -08:00
Chad Versace
62332f4125 dri: Use designated initializers for DRI extension structs
The dri directory is compiled with -std=c99. There is no excuse to not use
designated initializers.

As a nice benefit, the code is now more friendly to grep. Without
designated initializers, psychic prowess is required to find the
initialization of DRI extension function pointers with grep.  I have
observed several people, when they first encounter the DRI code, fail at
statically chasing the DRI function pointers due to this problem.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:09:55 -08:00
Eric Anholt
fdd6d146d9 i965: Use the separate stencil buffer's offsets for stencil setup.
For a packed depth/stencil buffer on separate stencil hardware, the
separate depth miptree is set up with alignment of 4,4 and the separate
stencil miptree is setup with alignment of 8,8.  We can't just use the
irb->draw_{x,y} offsets for stencil, since that is the offset in the
depth miptree.

Fixes 12 piglit depthstencil testcases on ivb.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
52ee1a7269 i965: Move all the depth/stencil/hiz offset logic into the workaround.
Given that we have the mask information here (assuming the rebase is to
the same tiling, which is safe), we can just save a set of miptrees and
offsets and the global intra-tile offset in the context and cut out a
bunch of logic.  This will also save emitting the next fix I need to do
twice.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
9ec6a54ba9 i965: When rebasing depth or stencil, update x/y before deciding the other.
Fixes a theoretical problem where we had an aligned depth buffer and a
misaligned stencil buffer with a matching tile offset, so we would fail
to rebase depth even after the needed tile offset changed due to the
rebase of stencil.

It should also fix double-rebase of a misaligned packed depth/stencil
renderbuffer, which may have been a performance issue.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
be9e664307 intel: Push face/level -> slice handling to the caller of get_image_offset().
We were always passing 0 for one of the two fields, and the code just used
whichever one wasn't 0.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
c1fabea1c5 i965: Add some checks for array textures in unsupported paths.
I noticed these in the next patch where these paths were using the Face
of a teximage but didn't have array handling.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
923c4b3f4a i965: Add a little bit more debug info for validate blits.
The kind of data you're copying is definitely an interesting variable.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
e5671040c5 intel: Remove dead function prototype.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Eric Anholt
1f35ec585f i965: Remove stale comment about wrapped_depth.
I removed that code almost a year ago.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 15:07:22 -08:00
Kenneth Graunke
1f74a5b3cc mesa: Mark GetBufferParameteri64v as implemented.
Apparently this was accidentally marked as unimplemented, and thus not
put in the dispatch table.

Fixes 7 es3conform tests:
- copy_buffer_parameters
- copy_buffer_data
- copy_buffer_usage
- pixel_buffer_object_bind
- pixel_buffer_object_parameteriv
- pixel_buffer_object_texture_read
- pixel_buffer_object_usage

v2: Also update the DispatchSanity test for this change.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:49:04 -08:00
Kenneth Graunke
bbda7d65a9 mesa: Require gen'd names in glBeginQuery on ES 3.0.
Only legacy OpenGL allows the use of non-gen'd names.  Core profiles
and ES 3 both require the use of glGenQueries().

Note that BeginQuery doesn't exist in ES 1 or ES 2.

Fixes es3conform's occlusion_query_invalid_beginquery test.

Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:49:00 -08:00
Kenneth Graunke
c6ed42a89e mesa: Support EXT_framebuffer_blit targets in ES 3.0 as well.
GL_READ_FRAMEBUFFER and GL_DRAW_FRAMEBUFFER are valid targets in ES 3.

Fixes 23 es3conform framebuffer_blit tests.  Two more go from fail to
crash, but that appears to be because they actually run now.

Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:48:56 -08:00
Kenneth Graunke
f399a707c8 mesa: Fix error code for glTexParameteri of TEXTURE_MAX_LEVEL.
Calling glTexParameteri() with pname GL_TEXTURE_MAX_LEVEL and either a
target of GL_TEXTURE_RECTANGLE or a negative value previously generated
GL_INVALID_OPERATION.  However, GL_INVALID_VALUE seems more appropriate.

Fixes oglconform's api-error/negative.glTexParameter and es3conform's
sgis_texture_lod_basic_error.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
2012-11-19 11:48:52 -08:00
Kenneth Graunke
4e907018b2 i965/vs: Don't lose attribute type when converting ATTR to FIXED_HW_REG.
The new brw_reg always had type BRW_REGISTER_TYPE_F, rather than
inheriting the original type of the ATTR file register.

In the past, this hasn't been a problem since we only execute this code
when fixing up GL_FIXED attributes, which always have float types.
However, we'll soon be using it for ARB_vertex_type_10_10_10_2 support,
which uses D and UD types.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-19 11:38:58 -08:00
Chad Versace
5cf8536690 egl/dri2: Set error code when dri2CreateContextAttribs fails
When dri2CreateContextContextAttribs failed, eglCreateContext returned
NULL yet set the error code to EGL_SUCCESS! The problem was that
eglCreateContext ignored the error code returned by
driCreateContextAttribs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56706
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 08:18:22 -08:00
Chad Versace
243cf7a924 i965: Validate requested GLES context version in brwCreateContext
For GLES1 and GLES2, brwCreateContext neglected to validate the requested
context version received from the DRI layer. If DRI requested an OpenGL
ES2 context with version 3.9, we provided it one.

Before this fix, the switch statement that validated the requested GL
context flavor was an ugly #ifdef copy-paste mess. Instead of reproducing
the copy-past-mess for GLES1 and GLES2, I first refactored it.  Now the
switch statement is readable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-19 08:17:32 -08:00
Maarten Lankhorst
ddb901fbf4 automake: strip LLVM_CXXFLAGS and LLVM_CPPFLAGS too
It seems that -NDEBUG and other flags might still be leaked through
those variables, so strip those off there as well.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2012-11-19 09:43:29 +01:00
Kenneth Graunke
5cea027341 i965/fs: Properly patch special values during VGRF compaction.
In addition to registers used by instructions, fs_visitor maintains
direct references to certain "special" values used for inputs/outputs.

When I added VGRF compaction, I overlooked these, believing that these
direct references weren't used once instructions were generated.  That
was wrong.  For example, pixel_x/y are used in virtual_grf_interferes(),
which is called by optimization passes and register allocation.

This patch treats all of them as used and patches them after compacting.
While it's not strictly necessary to patch all of them (as some aren't
used after emitting code), it seems safer to simply fix them all.

Fixes oglconform's textureswizzle/advanced.shader.targets, piglit's
glsl-fs-lots-of-tex, and glean's texCombine on pre-Gen6 hardware.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56790
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-17 14:37:16 -08:00
Eric Anholt
3c368bb307 i965/gen4: Respect the VERTEX_PROGRAM_TWO_SIDE vertex program/shader flag.
Fixes piglit "vertex-program-two-side enabled front back" and 4 others.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-17 12:55:54 -08:00
Eric Anholt
94e82b2e6c mesa: Fix linker-assigned varying component counting since 8fb1e4a462
The goal of that change was to skip counting things that aren't actually
outputs from the VS to the FS.  However, explicit_location isn't set in
the case of linker-assigned locations (the common case), so basically
varying component counting got disabled.  At this stage of the linker,
we've already ensured that var->location is set, so we can just look at
it without worrying.

Fixes i965 assertion failure with the new
piglit glsl-max-varyings --exceed-limits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51545
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
5c99697f74 mesa: Fix segfault on reading from a missing color read buffer.
The diff looks funny, but it's moving the integer vs non-integer check
below the _mesa_source_buffer_exists() check that ensures
_ColorReadBuffer is non-null, so we get a GL_INVALID_OPERATION instead
of a segfault.  This looks like it had regressed in the
_mesa_error_check_format_and_type() changes, which removed the first of
the two duplicated checks for the source buffer.  Fixes segfault in the
new piglit ARB_framebuffer_object/negative-readpixels-no-rb.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45877
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
df3361df01 intel: Use core mesa support for determining lastLevel.
We had similar issues with using depth in determining the lastLevel of array
textures.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
02652eaa25 mesa: Also handle GL_TEXTURE_EXTENRAL_OES in max num levels.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-17 12:55:54 -08:00
Eric Anholt
a43b107403 i965/fs: Unify the param pointer allocation for FP/non-FP.
Now that we're using the new backend, we may actually put things into push
constants if you have too many uniform values uploaded.  Also, correctly
account for texture rectangle params and drop the old special case for the
0.0/1.0 params from the old backend.
2012-11-17 12:39:27 -08:00
Maarten Lankhorst
c64adedc5f st/vdpau: Fix vlVdpVideoSurfaceSize for interlaced buffers
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2012-11-17 13:25:08 +01:00
Andreas Boll
a204e26495 docs: import release notes for 9.0.1, add news item 2012-11-17 09:02:03 +01:00
Vinson Lee
acc1e59013 util: Only use open coded snprintf for MSVC.
MinGW has snprintf.

The patch fixes these warnings with the MinGW SCons build.

src/gallium/auxiliary/util/u_snprintf.c:459:1: warning: no previous prototype for ‘util_vsnprintf’ [-Wmissing-prototypes]
src/gallium/auxiliary/util/u_snprintf.c:1436:1: warning: no previous prototype for ‘util_snprintf’ [-Wmissing-prototypes]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Brian Paul <brianp@vmware.com>
2012-11-16 23:18:23 -08:00
Tom Stellard
b36b6fdb32 clover: Fix build with clang 3.2 2012-11-16 17:07:56 -05:00
Tom Stellard
71877143b6 r300/compiler: Avoid generating MOV instructions for invalid IMM swizzles v2
If an instruction reads from a constant register that contains
immediates using an invalid swizzle, we can avoid generating MOV
instructions to fix up the swizzle by loading the immediates into a
different constant register that can be read using a valid swizzle.

This only affects r300 and r400 cards.

For example:

CONST[1] = {    -3.5000     3.5000     2.5000     1.5000 }

MAD temp[4].xy, const[0].xy__, const[1].xz__, input[0].xy__;

========== Before this change would be lowered to: =========

CONST[1] = {    -3.5000     3.5000     2.5000     1.5000 }

MOV temp[0].x, const[1].x___;
MOV temp[0].y, const[1]._z__;
MAD temp[4].xy, const[0].xy__, temp[0].xy__, input[0].xy__;

========== After this change is lowered to:  ===============

CONST[1] = {    -3.5000     3.5000     2.5000     1.5000 }
CONST[2] = {     0.0000    -3.5000     2.5000     0.0000 }

MAD temp[4].xy, const[0].xy__, const[2].yz__, input[0].xy__;

============================================================

This change reduces one of the Lightsmark shaders from 133 to 91
instructions.

v2:
  - Fix crash caused by swizzles with only inline constants.
2012-11-16 17:07:11 -05:00
Alex Deucher
26463b8996 radeonsi: clean up some magic numbers
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-16 13:02:42 -05:00
Alex Deucher
ce17964fe5 radeonsi: emit PA_SC_RASTER_CONFIG
Use per asic golden values.

Programming this register doesn't seem to be strictly
necessary on SI, but programming it wrong leads to
rendering issues or reduced performance so just
go ahead and program the golden values explicitly
to avoid any potential problems down the road.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-16 13:02:42 -05:00
Maarten Lankhorst
4f0537e645 [PATCH] makefiles: use configured name for -ldrm* where possible
For precise lts support I had to do some magic with the library names, which works fine
as long as the libraries from pkg-config are used.

The parts with src/gallium/targets/va-*/Makefile will not apply on the master branch,
but do apply to the 9.0 branch.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-11-16 18:50:57 +01:00
Andreas Boll
6346214f05 docs: add note about removal of OpenVMS support 2012-11-16 10:01:47 +01:00
Matt Turner
1f82bf12ed Remove OpenVMS support
Not maintained since 2008. Doubtful that it's worked in quite a while.

Also see commit 32ac8cb05 which removed VMS stuff from Makefile in 2009.

Cc: Jouk Jansen <j.jansen@tudelft.nl>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-11-16 10:01:46 +01:00
Andreas Boll
900f5eb7a8 build: add missing Makefile.in files to tarballs target
Those are recently introduced on master.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-16 10:01:26 +01:00
Andreas Boll
4a38926601 build: fix make tarballs target
fixes regression introduced in 9078441072

Targets for making lex.yy.c program_parse.tab.c and program_parse.tab.h
got moved into its own Makefile

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-16 10:01:06 +01:00
Matt Turner
5c78ad84f4 gles2: Update gl2ext.h to revision 19436
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
88ec004381 gles2: Update gl2.h to revision 16803
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
e565260b30 gles: Update glext.h to revision 19260
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
aec36a10dd egl: Update eglext.h to revision 19571
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-15 15:21:28 -08:00
Matt Turner
47d862517e mesa: return INVALID_VALUE from WaitSync if timeout != GL_TIMEOUT_IGNORED
This was added in version 22 of the GL_ARB_sync spec.

Fixes gles3conform's sync_error_waitsync_timeout test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
32cc20d9f5 mesa: return INVALID_VALUE from WaitSync if flags != 0
Fixes gles3conform's sync_error_waitsync_flags test.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
5b0012f5c2 mesa: return INVALID_VALUE from ClientWaitSync if flags contains an unsupported flag
Fixes gles3conform's sync_error_clientwaitsync_flags test.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
ae1f09babb mesa: return INVALID_VALUE from VertexAttribDivisor if index out of range
All the other range checks on index already return the proper error,
INVALID_VALUE.

Fixes gles3conform's instanced_arrays_invalid test.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Matt Turner
e21debbf75 glcpp: Don't define macros for extensions that aren't in ES
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-15 15:21:28 -08:00
Alex Deucher
7bba4879bb radeonsi: remove new asserts and replace with warnings
Fixes piglit regressions.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-15 15:46:02 -05:00
Kenneth Graunke
d010e70a07 i965/fs: Don't calculate_live_intervals() in opt_algebraic().
There's no point: opt_algebraic() doesn't use any liveness information.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:50 -08:00
Kenneth Graunke
b02492fd33 i965: Remove duplicate brw_opcodes table in favor of opcode_descs.
brw_optimize.c's brw_opcodes table was a copy of brw_disasm.c's
opcode_descs table, but with an additional field: is_arith.  Now that
I've deleted that, the two are identical.  Keep the one in brw_disasm.c.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:47 -08:00
Kenneth Graunke
a405717b88 i965/vs: Remove dead vec4_visitor::src_reg_for_float prototype.
No such function exists.  src_reg's constructor does that.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:45 -08:00
Kenneth Graunke
eec5669bc9 i965/fs: Remove bblock field of fs_visitor.
All users of basic block analysis simply create their own local
variables.  Nobody uses the visitor-wide field.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:43 -08:00
Kenneth Graunke
e7668609a7 i965: Remove brw_instruction_info::is_arith().
Nobody uses it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:40 -08:00
Kenneth Graunke
c4b99c1857 i965: Remove some dead code optimization passes.
The old brw_remove_grf_to_mrf_moves() pass is obsolete and replaced by
fs_visitor::compute_to_mrf().

The old brw_remove_duplicate_mrf_moves() pass is obsolete and replaced
by fs_visitor::remove_duplicate_mrf_writes().

The remaining pass, brw_set_dp4_dependency_control(), is currently
unused, but could be, so I'm leaving it for now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:38 -08:00
Kenneth Graunke
1484faa0f4 i965: Remove unused BRW_PACKCOLOR8888 macro.
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:36 -08:00
Kenneth Graunke
80b3af5b6d i965: Remove brw_shader_program wrapper struct.
At this point, it's just gl_shader_program.  Nobody even uses it; even
the program that creates them only returns gl_shader_program pointers.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:34 -08:00
Kenneth Graunke
eb18e3d32a i965: Remove unused struct brw_vs_ouput_sizes.
With a name like that, it can't be used.  Sure enough, it's not.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-15 11:14:24 -08:00
José Fonseca
35e28b4583 util/u_debug: Fix DEBUG_NAMED_VALUE.
"#__symbol" doesn't work with nested macro expansions, at least not on gcc.
2012-11-15 17:38:03 +00:00
Roland Scheidegger
94f9ea03a1 draw: fix crashes with out-of-bounds indices
The passthrough pipeline needs to check index values (which might be passed
through) as they can be invalid (which causes crashes and various assertion
failures if the clip code runs). Obviously, rendering won't be well-defined,
but those bogus indices might come directly from apps.
There were already debug printfs which reported the out-of-bounds indices but
we really ought to not crash.
While checking at that point doesn't seem like the most efficient solution,
it seems there isn't really another appropriate function to do it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-15 17:37:06 +00:00
Alex Deucher
3893593732 radeonsi: cleanup si_db()
Clean up a few magic numbers and rework the code a bit.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-15 12:11:28 -05:00
Alex Deucher
565c29f221 radeonsi: assert the CB format is valid (v2)
Assert the the CB format is valid and default to
the INVALID hw format rather than ~0U when the format
doesn't match for non-debug builds.

v2: use INVALID hw format rather than ~0U

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-15 12:10:48 -05:00
Alex Deucher
34d487b64d radeonsi: assert that the DB format is valid (v2)
Assert that the DB format is valid and default to
the INVALID hw format rather than ~0U when the format
doesn't match for non-debug builds.

v2: use INVALID hw format rather than ~0U

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-15 12:08:17 -05:00
Dmitry Cherkassov
fd1196c412 gallium: fix some function comments in p_context.h
Signed-off-by: Dmitry Cherkassov <dcherkassov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-15 07:54:38 -07:00
Andreas Boll
8a9f0fdeab build: add missing files to tarballs target
fixes errors ./configure and make was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-14 23:13:34 +01:00
Andreas Boll
bc08f26485 build: add missing Makefile.in files to tarballs target
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-14 23:13:14 +01:00
Andreas Boll
a0a90ea920 build: add config.sub and config.guess to tarballs target
fixes errors ./configure was complaining about

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-14 23:12:58 +01:00
Andreas Boll
ca8988673b mesa: use .cherry-ignore in the get-pick-list.sh script
NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-14 20:45:33 +01:00
Paul Berry
b85a8cd208 mesa: Add .gitignore for hashtable collision unit test.
This test was introduced in commit
35fd61bd99.
2012-11-14 11:23:51 -08:00
Michel Dänzer
73d9703a93 radeonsi: Set STENCILOPVAL fields to 1.
This is necessary for backwards compatibility with pre-SI for stencil.

Fixes a number of stencil related piglit tests, and real apps using stencil.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-14 16:08:34 +01:00
Michel Dänzer
91c1d4472f radeonsi: Bump SI_PM4_MAX_DW.
Fixes assertion failure with Mesa demo glsl/samplers.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-14 12:08:25 +01:00
Michel Dänzer
56ae9be957 radeonsi: Handle TGSI TXL opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-14 12:08:19 +01:00
Michel Dänzer
3e20513b8f radeonsi: Handle TGSI TXB opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-14 12:08:10 +01:00
Vinson Lee
ca5840afb0 mesa: Include compiler.h in hash_table.h.
Include the header for the inline symbol. MSVC does not have the inline
keyword for C.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-13 21:19:50 -08:00
Marek Olšák
186579e724 r600g: use LINEAR_ALIGNED tiling for 1D array textures and if height0 <= 3
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 17:17:05 +01:00
Tom Stellard
2e6b81ff7a auxillary: Append LLVM_CXXFLAGS to CXXFLAGS 2012-11-13 15:13:07 +00:00
Marek Olšák
e3813ecfa3 r300g: don't call buffer_unmap in draw functions
It's been a no-op anyway.
2012-11-13 15:53:17 +01:00
Marek Olšák
7a8affb6a1 r300g: fix crash since the set_vertex_buffers(start_slot) change 2012-11-13 15:53:16 +01:00
Marek Olšák
d4780fddb1 r600g: untiled window-system buffers should be LINEAR_ALIGNED
though I guess the DDX allocates them as LINEAR_GENERAL

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 15:00:37 +01:00
Marek Olšák
c9e5309223 r600g: use LINEAR_ALIGNED tiling for 1D textures
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 15:00:37 +01:00
Marek Olšák
ac4f61b232 r600g: use LINEAR_ALIGNED tiling for staging textures, reorder the code
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-13 15:00:37 +01:00
Kenneth Graunke
fe2ef4b810 i965/vs: Fix user clip plane setup on Gen4-5.
On Gen6-7, we don't compact clip planes, and nr_userclip_plane_consts
is the last bit set, so iterating from i = 0..nr_userclip_plane_consts
covers all active clip planes and is the right thing to do.
works and is the right thing to do.

However, that doesn't work at all on Gen4-5.  Since we don't compact
clip planes, we skip over ones which aren't active (via the continue
statement).  We also set set nr_userclip_plane_consts to the number of
active clip planes, which means that we end the loop after checking that
many bits.  If the set of clip planes wasn't contiguous, this means we'd
fail to find the last few.

By changing the iteration to MAX_CLIP_PLANES, we correctly find all of
the active clip planes.

Fixes regressions since 66c8473e02 (replacing the old VS backend) in
Piglit's spec/glsl-1.20/execution/clipping/fixed-clip-enables and
oglconform's mustpass(basic.clip) and userclip(basic.allCases).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56791
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-13 01:27:33 -08:00
Kenneth Graunke
3262857843 i965/vs: Simplify the Gen6-7 part of setup_uniform_clipplane_values().
There's no compaction, so we can drop that code and simply use 'i'.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-13 01:27:31 -08:00
Kenneth Graunke
0ad4360ca1 i965/vs: Split setup_uniform_clipplane_values() into Gen4-5/6-7 parts.
Since Gen4-5 compacts clip planes and Gen6-7 doesn't, it makes sense to
split them into separate code paths.  This patch simply copies the code
to both halves; the next commits will simplify it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-13 01:27:15 -08:00
Vinson Lee
bb284669f8 mesa: Replace random with standard C rand.
BSD random is not available on some compilers.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-12 22:15:42 -08:00
Brian Paul
9b67460223 automake: Remove empty file variable.
Fixes SCons build regression introduced with commit
a665cf1226.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-11-12 21:29:34 -08:00
Eric Anholt
3a5ad21cd3 mesa: Fix gallium build since 6991c2922f
Looks like I screwed up and didn't test gallium again after tweaking the
Makefile.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57044
2012-11-12 19:35:31 -08:00
Eric Anholt
6991c2922f mesa: Convert the hash table for GL object ids to the open-addressing hash.
The previous 1023-entry chaining hash table never resized, so it was very
inefficient when there were many objects live.  While one could have an even
more efficient implementation than this (keep an array for genned names with
packed IDs, or take advantage of the fact that key == hash or key ==
*(uint32_t *)data to store less data), this is fairly fast, and I want a nice
replacement hash table for other parts of Mesa, too.

It improves Minecraft performance 12.3% +/- 1.4% (n=9), dropping hash lookups
from 8% of the profile to 0.5%.

I also tested cairo-gl, which should be a pessimal workload for this hash
table: around 247000 FBOs created and destroyed, only around 65 live at any
time, and few lookups of them between creation and destruction.  No
statistically significant performance difference at n=76 (mean 20.3/20.4
seconds, sd 2.8/3.2 seconds).  If I remove the >20 seconds outliers that
appear to be due to thermal throttling, there's possibly a .97% +/- 0.31%
performance win (n=61/59).  The choice of cutoff for outliers feels a lot like
cooking the data, but I've gone through this process 3 times for minor
iterations of the code with the same conclusion each time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-12 15:52:43 -08:00
Eric Anholt
35fd61bd99 mesa: Import a copy of the open-addressing hash table code I wrote.
Mesa's chaining hash table for object names is slow, and this should be much
faster.  I namespaced the functions under _mesa_*, to avoid visibility
troubles that we may have had before with hash_table_* functions.

v2: Move .c file to main/, const a few things, clean up loop conditions,
    add/extend some comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-12 15:52:42 -08:00
Eric Anholt
1e8dd15311 automake: Remove libdricore clip.c workaround lib.
sparc/clip.c got moved to sparc/sparc-clip.c to avoid doing this workaround in
the parent directory.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-11-12 15:52:42 -08:00
Eric Anholt
9078441072 automake,android: Build program/ into a helper lib (v2)
While simplifying mesa/Makefile.am, the more important feature of this commit
is allowing a file with the same name to appear in both main/ and program/.

v2: [chadv] Add changes to Android makefiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com> (v2)
2012-11-12 15:52:42 -08:00
Chad Versace
0ef8535747 android: Moves rules for libmesa_st_mesa to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for libmesa_st_mesa.a from Android.mk to
Android.libmesa_st_mesa.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Chad Versace
7071ffb464 android: Moves rules for libmesa_dricore to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for libmesa_dricore.a from Android.mk to
Android.libmesa_dricore.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Chad Versace
5f935af675 android: Moves rules for mesa_gen_matypes to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for host executable mesa_gen_matypes from
Android.mk to Android.mesa_gen_matypes.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Chad Versace
f2b638a997 android: Moves rules for libmesa_glsl_utils to separate makefile
The pair of files src/mesa/Android.mk and src/mesa/Android.gen.mk are too
long and complex to be easily understood. This patch belongs to a series
that decomposes them into several easily digestible makefiles.

This patch move the rules for the host and target libmesa_glsl_utils.a
from Android.mk to Android.libmesa_glsl_utils.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-12 15:52:42 -08:00
Eric Anholt
a665cf1226 automake: Merge *_CXX_FILES variables in the glsl build.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:42 -08:00
Eric Anholt
34d4216e64 automake: Merge per-type *_FILES variables in intel drivers.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:42 -08:00
Eric Anholt
e9e8e194e2 automake: Merge separated *_CXX_FILES variables to *_FILES in core mesa.
They were always used with the corresponding *_FILES variables now that
automake handles rule generation.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:41 -08:00
Eric Anholt
be655ec617 automake: Remove dead *_OBJECTS variables from the old build system.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:41 -08:00
Eric Anholt
906d832db5 automake: Fix a comment typo.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-12 15:52:41 -08:00
Marek Olšák
f5ac60152b r600g: remove redundant parameter in r600_init_surface 2012-11-13 00:34:35 +01:00
Marek Olšák
e7dde5c8fb st/mesa: fix computation of last_level in GenerateMipmap
Array textures were broken.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:31 +01:00
Marek Olšák
6dd839f23a st/mesa: fix computation of last_level during texture creation
Array textures were broken.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:31 +01:00
Marek Olšák
c06258dd02 st/mesa: fix guessing the base level size
It was pretty broken with array textures, where the array size (height or
depth depending on the target) shouldn't be magnified.

The guessing also doesn't fail with 1D and cube textures.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:31 +01:00
Marek Olšák
985f2aec4a mesa: fix error checking of TexStorage(levels) for array and rect textures
NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:30 +01:00
Marek Olšák
12a4fd7e45 mesa: use MaxNumlevels in _mesa_test_texobj_completeness
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:37:30 +01:00
Marek Olšák
8111342e81 mesa: add MaxNumLevels to gl_texture_image, remove MaxLog2
MaxLog2 led to bugs, because it didn't work well with 1D and 3D textures.

NOTE: This is a candidate for the stable branches.

v2: correct the comment at MaxNumlevels

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-11-12 21:36:56 +01:00
Roland Scheidegger
26097c4855 gallivm,draw,llvmpipe: use base ptr + mip offsets instead of mip pointers
This might have a slight overhead but handling mip offsets more like
the width (and image) strides should make some things easier (mip level
being just part of the offset calculation) later.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-12 21:02:59 +01:00
Roland Scheidegger
8257bb963f llvmpipe: always allocate whole miptrees not individual levels
This is preparation work for using mip level offsets + base_ptr for texture
sampling instead of per-mip pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-11-12 21:02:59 +01:00
Kenneth Graunke
df3cecab7d i965: Add comments for each of the surface state table's columns.
I can never remember what "AB" means, and having to constantly consult
the docs is annoying.  Just add comments to the top which explain each
of the abbreviations.
2012-11-12 11:24:38 -08:00
Paul Berry
21e23fbe21 glapi: Stop handling XML annotation exec="{es,check,loopback}".
Previously, we used these XML annotations to make the code generation
scripts aware of any instances where the Mesa implementation of a
function had a prefix other than "_mesa_".  Now that all of the mesa
implementation functions have been renamed to match the XML, we only
need to handle exec="skip", exec="dynamic", and the default case of
exec="mesa".

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:58 -08:00
Paul Berry
55b81ff56b glapi: Remove handling of mesa_name XML attribute.
Previously, we used the mesa_name XML attribute to make the code
generation scripts aware of any instances where the Mesa
implementation of a function had a different function name suffix than
the primary name in the XML.  Now that all of the Mesa implementation
functions have been renamed to match the XML, this attribute is no
longer necessary.

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:57 -08:00
Paul Berry
bb3db388d8 mesa: Fix const correctness of API implementation functions.
This patch changes the use of const in the type signatures of
_mesa_ShaderSource() and _mesa_TransformFeedbackVaryings(), to match
the type signatures in the GL spec.  This avoids warnings when
building the code-generated api_exec.c file.

Note: previously we avoided the build warnings because these functions
were being type-checked against ShaderSourceARB and
TransformFeedbackVaryingsEXT; those functions are semantically
equivalent, but have fewer const qualifiers in their type signatures.

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:57 -08:00
Paul Berry
1a1db1746d mesa: Standardize names of OpenGL functions.
This patch adjusts the aliasing pattern in the GL API description XML,
and the functions that implement the GL API within Mesa, to
consistently follow these naming conventions:

- When several function names are aliases of each other, the primary
  name is the one with no extension suffix (or the name with the
  suffix "ARB", if no unsuffixed name is available).  (By "primary
  name", I mean the name that all the other functions point to using
  the XML "alias" attribute).

- The name of the mesa implementation of each function is the same as
  the primary name, with the prefix "_mesa_".

This patch renames the following mesa functions:
  _check_GetTexGenxvOES => _mesa_GetTexGenxvOES
  _check_TexGenxOES => _mesa_TexGenxOES
  _check_TexGenxvOES => _mesa_TexGenxvOES
  _es_AlphaFuncx => _mesa_AlphaFuncx
  _es_ClearColorx => _mesa_ClearColorx
  _es_ClearDepthx => _mesa_ClearDepthx
  _es_ClipPlanef => _mesa_ClipPlanef
  _es_ClipPlanex => _mesa_ClipPlanex
  _es_Color4x => _mesa_Color4x
  _es_DepthRangex => _mesa_DepthRangex
  _es_DrawTexxOES => _mesa_DrawTexxOES
  _es_DrawTexxvOES => _mesa_DrawTexxvOES
  _es_Fogx => _mesa_Fogx
  _es_Fogxv => _mesa_Fogxv
  _es_Frustumf => _mesa_Frustumf
  _es_Frustumx => _mesa_Frustumx
  _es_GetClipPlanef => _mesa_GetClipPlanef
  _es_GetClipPlanex => _mesa_GetClipPlanex
  _es_GetLightxv => _mesa_GetLightxv
  _es_GetMaterialxv => _mesa_GetMaterialxv
  _es_GetTexEnvxv => _mesa_GetTexEnvxv
  _es_GetTexParameterxv => _mesa_GetTexParameterxv
  _es_LightModelx => _mesa_LightModelx
  _es_LightModelxv => _mesa_LightModelxv
  _es_Lightx => _mesa_Lightx
  _es_Lightxv => _mesa_Lightxv
  _es_LineWidthx => _mesa_LineWidthx
  _es_LoadMatrixx => _mesa_LoadMatrixx
  _es_Materialx => _mesa_Materialx
  _es_Materialxv => _mesa_Materialxv
  _es_MultMatrixx => _mesa_MultMatrixx
  _es_MultiTexCoord4x => _mesa_MultiTexCoord4x
  _es_Normal3x => _mesa_Normal3x
  _es_Orthof => _mesa_Orthof
  _es_Orthox => _mesa_Orthox
  _es_PointParameterx => _mesa_PointParameterx
  _es_PointParameterxv => _mesa_PointParameterxv
  _es_PointSizex => _mesa_PointSizex
  _es_PolygonOffsetx => _mesa_PolygonOffsetx
  _es_QueryMatrixxOES => _mesa_QueryMatrixxOES
  _es_Rotatex => _mesa_Rotatex
  _es_SampleCoveragex => _mesa_SampleCoveragex
  _es_Scalex => _mesa_Scalex
  _es_TexEnvx => _mesa_TexEnvx
  _es_TexEnvxv => _mesa_TexEnvxv
  _es_TexParameterx => _mesa_TexParameterx
  _es_TexParameterxv => _mesa_TexParameterxv
  _es_Translatex => _mesa_Translatex
  _mesa_ActiveTextureARB => _mesa_ActiveTexture
  _mesa_BeginQueryARB => _mesa_BeginQuery
  _mesa_BindAttribLocationARB => _mesa_BindAttribLocation
  _mesa_BindBufferARB => _mesa_BindBuffer
  _mesa_BindFramebufferEXT => _mesa_BindFramebuffer
  _mesa_BindProgram => _mesa_BindProgramARB
  _mesa_BindRenderbufferEXT => _mesa_BindRenderbuffer
  _mesa_BlendEquationSeparateEXT => _mesa_BlendEquationSeparate
  _mesa_BlendEquationSeparatei => _mesa_BlendEquationSeparateiARB
  _mesa_BlendEquationi => _mesa_BlendEquationiARB
  _mesa_BlendFuncSeparateEXT => _mesa_BlendFuncSeparate
  _mesa_BlendFuncSeparatei => _mesa_BlendFuncSeparateiARB
  _mesa_BlendFunci => _mesa_BlendFunciARB
  _mesa_BlitFramebufferEXT => _mesa_BlitFramebuffer
  _mesa_BufferDataARB => _mesa_BufferData
  _mesa_BufferSubDataARB => _mesa_BufferSubData
  _mesa_CheckFramebufferStatusEXT => _mesa_CheckFramebufferStatus
  _mesa_ClampColorARB => _mesa_ClampColor
  _mesa_ClientActiveTextureARB => _mesa_ClientActiveTexture
  _mesa_ColorMaskIndexed => _mesa_ColorMaski
  _mesa_CompileShaderARB => _mesa_CompileShader
  _mesa_CompressedTexImage1DARB => _mesa_CompressedTexImage1D
  _mesa_CompressedTexImage2DARB => _mesa_CompressedTexImage2D
  _mesa_CompressedTexImage3DARB => _mesa_CompressedTexImage3D
  _mesa_CompressedTexSubImage1DARB => _mesa_CompressedTexSubImage1D
  _mesa_CompressedTexSubImage2DARB => _mesa_CompressedTexSubImage2D
  _mesa_CompressedTexSubImage3DARB => _mesa_CompressedTexSubImage3D
  _mesa_DeleteBuffersARB => _mesa_DeleteBuffers
  _mesa_DeleteFramebuffersEXT => _mesa_DeleteFramebuffers
  _mesa_DeletePrograms => _mesa_DeleteProgramsARB
  _mesa_DeleteQueriesARB => _mesa_DeleteQueries
  _mesa_DeleteRenderbuffersEXT => _mesa_DeleteRenderbuffers
  _mesa_DeleteVertexArraysAPPLE => _mesa_DeleteVertexArrays
  _mesa_DisableIndexed => _mesa_Disablei
  _mesa_DisableVertexAttribArrayARB => _mesa_DisableVertexAttribArray
  _mesa_DrawBuffersARB => _mesa_DrawBuffers
  _mesa_DrawTexf => _mesa_DrawTexfOES
  _mesa_DrawTexfv => _mesa_DrawTexfvOES
  _mesa_DrawTexi => _mesa_DrawTexiOES
  _mesa_DrawTexiv => _mesa_DrawTexivOES
  _mesa_DrawTexs => _mesa_DrawTexsOES
  _mesa_DrawTexsv => _mesa_DrawTexsvOES
  _mesa_EnableIndexed => _mesa_Enablei
  _mesa_EnableVertexAttribArrayARB => _mesa_EnableVertexAttribArray
  _mesa_EndQueryARB => _mesa_EndQuery
  _mesa_FogCoordPointerEXT => _mesa_FogCoordPointer
  _mesa_FramebufferRenderbufferEXT => _mesa_FramebufferRenderbuffer
  _mesa_FramebufferTexture1DEXT => _mesa_FramebufferTexture1D
  _mesa_FramebufferTexture2DEXT => _mesa_FramebufferTexture2D
  _mesa_FramebufferTexture3DEXT => _mesa_FramebufferTexture3D
  _mesa_FramebufferTextureLayerEXT => _mesa_FramebufferTextureLayer
  _mesa_GenBuffersARB => _mesa_GenBuffers
  _mesa_GenFramebuffersEXT => _mesa_GenFramebuffers
  _mesa_GenPrograms => _mesa_GenProgramsARB
  _mesa_GenQueriesARB => _mesa_GenQueries
  _mesa_GenRenderbuffersEXT => _mesa_GenRenderbuffers
  _mesa_GenerateMipmapEXT => _mesa_GenerateMipmap
  _mesa_GetActiveAttribARB => _mesa_GetActiveAttrib
  _mesa_GetActiveUniformARB => _mesa_GetActiveUniform
  _mesa_GetAttribLocationARB => _mesa_GetAttribLocation
  _mesa_GetBooleanIndexedv => _mesa_GetBooleani_v
  _mesa_GetBufferParameterivARB => _mesa_GetBufferParameteriv
  _mesa_GetBufferPointervARB => _mesa_GetBufferPointerv
  _mesa_GetBufferSubDataARB => _mesa_GetBufferSubData
  _mesa_GetCompressedTexImageARB => _mesa_GetCompressedTexImage
  _mesa_GetFramebufferAttachmentParameterivEXT => _mesa_GetFramebufferAttachmentParameteriv
  _mesa_GetIntegerIndexedv => _mesa_GetIntegeri_v
  _mesa_GetQueryObjecti64vEXT => _mesa_GetQueryObjecti64v
  _mesa_GetQueryObjectivARB => _mesa_GetQueryObjectiv
  _mesa_GetQueryObjectui64vEXT => _mesa_GetQueryObjectui64v
  _mesa_GetQueryObjectuivARB => _mesa_GetQueryObjectuiv
  _mesa_GetQueryivARB => _mesa_GetQueryiv
  _mesa_GetRenderbufferParameterivEXT => _mesa_GetRenderbufferParameteriv
  _mesa_GetShaderSourceARB => _mesa_GetShaderSource
  _mesa_GetUniformLocationARB => _mesa_GetUniformLocation
  _mesa_GetUniformfvARB => _mesa_GetUniformfv
  _mesa_GetUniformivARB => _mesa_GetUniformiv
  _mesa_GetVertexAttribPointervARB => _mesa_GetVertexAttribPointerv
  _mesa_GetVertexAttribdvARB => _mesa_GetVertexAttribdv
  _mesa_GetVertexAttribfvARB => _mesa_GetVertexAttribfv
  _mesa_GetVertexAttribivARB => _mesa_GetVertexAttribiv
  _mesa_IsBufferARB => _mesa_IsBuffer
  _mesa_IsEnabledIndexed => _mesa_IsEnabledi
  _mesa_IsFramebufferEXT => _mesa_IsFramebuffer
  _mesa_IsQueryARB => _mesa_IsQuery
  _mesa_IsRenderbufferEXT => _mesa_IsRenderbuffer
  _mesa_IsVertexArrayAPPLE => _mesa_IsVertexArray
  _mesa_LinkProgramARB => _mesa_LinkProgram
  _mesa_LoadTransposeMatrixdARB => _mesa_LoadTransposeMatrixd
  _mesa_LoadTransposeMatrixfARB => _mesa_LoadTransposeMatrixf
  _mesa_MapBufferARB => _mesa_MapBuffer
  _mesa_MultTransposeMatrixdARB => _mesa_MultTransposeMatrixd
  _mesa_MultTransposeMatrixfARB => _mesa_MultTransposeMatrixf
  _mesa_MultiDrawArraysEXT => _mesa_MultiDrawArrays
  _mesa_PointSizePointer => _mesa_PointSizePointerOES
  _mesa_ProvokingVertexEXT => _mesa_ProvokingVertex
  _mesa_RenderbufferStorageEXT => _mesa_RenderbufferStorage
  _mesa_SampleCoverageARB => _mesa_SampleCoverage
  _mesa_SecondaryColorPointerEXT => _mesa_SecondaryColorPointer
  _mesa_ShaderSourceARB => _mesa_ShaderSource
  _mesa_Uniform1fARB => _mesa_Uniform1f
  _mesa_Uniform1fvARB => _mesa_Uniform1fv
  _mesa_Uniform1iARB => _mesa_Uniform1i
  _mesa_Uniform1ivARB => _mesa_Uniform1iv
  _mesa_Uniform2fARB => _mesa_Uniform2f
  _mesa_Uniform2fvARB => _mesa_Uniform2fv
  _mesa_Uniform2iARB => _mesa_Uniform2i
  _mesa_Uniform2ivARB => _mesa_Uniform2iv
  _mesa_Uniform3fARB => _mesa_Uniform3f
  _mesa_Uniform3fvARB => _mesa_Uniform3fv
  _mesa_Uniform3iARB => _mesa_Uniform3i
  _mesa_Uniform3ivARB => _mesa_Uniform3iv
  _mesa_Uniform4fARB => _mesa_Uniform4f
  _mesa_Uniform4fvARB => _mesa_Uniform4fv
  _mesa_Uniform4iARB => _mesa_Uniform4i
  _mesa_Uniform4ivARB => _mesa_Uniform4iv
  _mesa_UniformMatrix2fvARB => _mesa_UniformMatrix2fv
  _mesa_UniformMatrix3fvARB => _mesa_UniformMatrix3fv
  _mesa_UniformMatrix4fvARB => _mesa_UniformMatrix4fv
  _mesa_UnmapBufferARB => _mesa_UnmapBuffer
  _mesa_UseProgramObjectARB => _mesa_UseProgram
  _mesa_ValidateProgramARB => _mesa_ValidateProgram
  _mesa_VertexAttribPointerARB => _mesa_VertexAttribPointer
  _mesa_WindowPos2dMESA => _mesa_WindowPos2d
  _mesa_WindowPos2dvMESA => _mesa_WindowPos2dv
  _mesa_WindowPos2fMESA => _mesa_WindowPos2f
  _mesa_WindowPos2fvMESA => _mesa_WindowPos2fv
  _mesa_WindowPos2iMESA => _mesa_WindowPos2i
  _mesa_WindowPos2ivMESA => _mesa_WindowPos2iv
  _mesa_WindowPos2sMESA => _mesa_WindowPos2s
  _mesa_WindowPos2svMESA => _mesa_WindowPos2sv
  _mesa_WindowPos3dMESA => _mesa_WindowPos3d
  _mesa_WindowPos3dvMESA => _mesa_WindowPos3dv
  _mesa_WindowPos3fMESA => _mesa_WindowPos3f
  _mesa_WindowPos3fvMESA => _mesa_WindowPos3fv
  _mesa_WindowPos3iMESA => _mesa_WindowPos3i
  _mesa_WindowPos3ivMESA => _mesa_WindowPos3iv
  _mesa_WindowPos3sMESA => _mesa_WindowPos3s
  _mesa_WindowPos3svMESA => _mesa_WindowPos3sv
  loopback_Color3b_f => _mesa_Color3b
  loopback_Color3bv_f => _mesa_Color3bv
  loopback_Color3d_f => _mesa_Color3d
  loopback_Color3dv_f => _mesa_Color3dv
  loopback_Color3i_f => _mesa_Color3i
  loopback_Color3iv_f => _mesa_Color3iv
  loopback_Color3s_f => _mesa_Color3s
  loopback_Color3sv_f => _mesa_Color3sv
  loopback_Color3ub_f => _mesa_Color3ub
  loopback_Color3ubv_f => _mesa_Color3ubv
  loopback_Color3ui_f => _mesa_Color3ui
  loopback_Color3uiv_f => _mesa_Color3uiv
  loopback_Color3us_f => _mesa_Color3us
  loopback_Color3usv_f => _mesa_Color3usv
  loopback_Color4b_f => _mesa_Color4b
  loopback_Color4bv_f => _mesa_Color4bv
  loopback_Color4d_f => _mesa_Color4d
  loopback_Color4dv_f => _mesa_Color4dv
  loopback_Color4i_f => _mesa_Color4i
  loopback_Color4iv_f => _mesa_Color4iv
  loopback_Color4s_f => _mesa_Color4s
  loopback_Color4sv_f => _mesa_Color4sv
  loopback_Color4ub_f => _mesa_Color4ub
  loopback_Color4ubv_f => _mesa_Color4ubv
  loopback_Color4ui_f => _mesa_Color4ui
  loopback_Color4uiv_f => _mesa_Color4uiv
  loopback_Color4us_f => _mesa_Color4us
  loopback_Color4usv_f => _mesa_Color4usv
  loopback_EdgeFlagv => _mesa_EdgeFlagv
  loopback_EvalCoord1d => _mesa_EvalCoord1d
  loopback_EvalCoord1dv => _mesa_EvalCoord1dv
  loopback_EvalCoord1fv => _mesa_EvalCoord1fv
  loopback_EvalCoord2d => _mesa_EvalCoord2d
  loopback_EvalCoord2dv => _mesa_EvalCoord2dv
  loopback_EvalCoord2fv => _mesa_EvalCoord2fv
  loopback_FogCoorddEXT => _mesa_FogCoordd
  loopback_FogCoorddvEXT => _mesa_FogCoorddv
  loopback_Indexd => _mesa_Indexd
  loopback_Indexdv => _mesa_Indexdv
  loopback_Indexi => _mesa_Indexi
  loopback_Indexiv => _mesa_Indexiv
  loopback_Indexs => _mesa_Indexs
  loopback_Indexsv => _mesa_Indexsv
  loopback_Indexub => _mesa_Indexub
  loopback_Indexubv => _mesa_Indexubv
  loopback_Materialf => _mesa_Materialf
  loopback_Materiali => _mesa_Materiali
  loopback_Materialiv => _mesa_Materialiv
  loopback_MultiTexCoord1dARB => _mesa_MultiTexCoord1d
  loopback_MultiTexCoord1dvARB => _mesa_MultiTexCoord1dv
  loopback_MultiTexCoord1iARB => _mesa_MultiTexCoord1i
  loopback_MultiTexCoord1ivARB => _mesa_MultiTexCoord1iv
  loopback_MultiTexCoord1sARB => _mesa_MultiTexCoord1s
  loopback_MultiTexCoord1svARB => _mesa_MultiTexCoord1sv
  loopback_MultiTexCoord2dARB => _mesa_MultiTexCoord2d
  loopback_MultiTexCoord2dvARB => _mesa_MultiTexCoord2dv
  loopback_MultiTexCoord2iARB => _mesa_MultiTexCoord2i
  loopback_MultiTexCoord2ivARB => _mesa_MultiTexCoord2iv
  loopback_MultiTexCoord2sARB => _mesa_MultiTexCoord2s
  loopback_MultiTexCoord2svARB => _mesa_MultiTexCoord2sv
  loopback_MultiTexCoord3dARB => _mesa_MultiTexCoord3d
  loopback_MultiTexCoord3dvARB => _mesa_MultiTexCoord3dv
  loopback_MultiTexCoord3iARB => _mesa_MultiTexCoord3i
  loopback_MultiTexCoord3ivARB => _mesa_MultiTexCoord3iv
  loopback_MultiTexCoord3sARB => _mesa_MultiTexCoord3s
  loopback_MultiTexCoord3svARB => _mesa_MultiTexCoord3sv
  loopback_MultiTexCoord4dARB => _mesa_MultiTexCoord4d
  loopback_MultiTexCoord4dvARB => _mesa_MultiTexCoord4dv
  loopback_MultiTexCoord4iARB => _mesa_MultiTexCoord4i
  loopback_MultiTexCoord4ivARB => _mesa_MultiTexCoord4iv
  loopback_MultiTexCoord4sARB => _mesa_MultiTexCoord4s
  loopback_MultiTexCoord4svARB => _mesa_MultiTexCoord4sv
  loopback_Normal3b => _mesa_Normal3b
  loopback_Normal3bv => _mesa_Normal3bv
  loopback_Normal3d => _mesa_Normal3d
  loopback_Normal3dv => _mesa_Normal3dv
  loopback_Normal3i => _mesa_Normal3i
  loopback_Normal3iv => _mesa_Normal3iv
  loopback_Normal3s => _mesa_Normal3s
  loopback_Normal3sv => _mesa_Normal3sv
  loopback_Rectd => _mesa_Rectd
  loopback_Rectdv => _mesa_Rectdv
  loopback_Rectfv => _mesa_Rectfv
  loopback_Recti => _mesa_Recti
  loopback_Rectiv => _mesa_Rectiv
  loopback_Rects => _mesa_Rects
  loopback_Rectsv => _mesa_Rectsv
  loopback_SecondaryColor3bEXT_f => _mesa_SecondaryColor3b
  loopback_SecondaryColor3bvEXT_f => _mesa_SecondaryColor3bv
  loopback_SecondaryColor3dEXT_f => _mesa_SecondaryColor3d
  loopback_SecondaryColor3dvEXT_f => _mesa_SecondaryColor3dv
  loopback_SecondaryColor3iEXT_f => _mesa_SecondaryColor3i
  loopback_SecondaryColor3ivEXT_f => _mesa_SecondaryColor3iv
  loopback_SecondaryColor3sEXT_f => _mesa_SecondaryColor3s
  loopback_SecondaryColor3svEXT_f => _mesa_SecondaryColor3sv
  loopback_SecondaryColor3ubEXT_f => _mesa_SecondaryColor3ub
  loopback_SecondaryColor3ubvEXT_f => _mesa_SecondaryColor3ubv
  loopback_SecondaryColor3uiEXT_f => _mesa_SecondaryColor3ui
  loopback_SecondaryColor3uivEXT_f => _mesa_SecondaryColor3uiv
  loopback_SecondaryColor3usEXT_f => _mesa_SecondaryColor3us
  loopback_SecondaryColor3usvEXT_f => _mesa_SecondaryColor3usv
  loopback_TexCoord1d => _mesa_TexCoord1d
  loopback_TexCoord1dv => _mesa_TexCoord1dv
  loopback_TexCoord1i => _mesa_TexCoord1i
  loopback_TexCoord1iv => _mesa_TexCoord1iv
  loopback_TexCoord1s => _mesa_TexCoord1s
  loopback_TexCoord1sv => _mesa_TexCoord1sv
  loopback_TexCoord2d => _mesa_TexCoord2d
  loopback_TexCoord2dv => _mesa_TexCoord2dv
  loopback_TexCoord2i => _mesa_TexCoord2i
  loopback_TexCoord2iv => _mesa_TexCoord2iv
  loopback_TexCoord2s => _mesa_TexCoord2s
  loopback_TexCoord2sv => _mesa_TexCoord2sv
  loopback_TexCoord3d => _mesa_TexCoord3d
  loopback_TexCoord3dv => _mesa_TexCoord3dv
  loopback_TexCoord3i => _mesa_TexCoord3i
  loopback_TexCoord3iv => _mesa_TexCoord3iv
  loopback_TexCoord3s => _mesa_TexCoord3s
  loopback_TexCoord3sv => _mesa_TexCoord3sv
  loopback_TexCoord4d => _mesa_TexCoord4d
  loopback_TexCoord4dv => _mesa_TexCoord4dv
  loopback_TexCoord4i => _mesa_TexCoord4i
  loopback_TexCoord4iv => _mesa_TexCoord4iv
  loopback_TexCoord4s => _mesa_TexCoord4s
  loopback_TexCoord4sv => _mesa_TexCoord4sv
  loopback_Vertex2d => _mesa_Vertex2d
  loopback_Vertex2dv => _mesa_Vertex2dv
  loopback_Vertex2i => _mesa_Vertex2i
  loopback_Vertex2iv => _mesa_Vertex2iv
  loopback_Vertex2s => _mesa_Vertex2s
  loopback_Vertex2sv => _mesa_Vertex2sv
  loopback_Vertex3d => _mesa_Vertex3d
  loopback_Vertex3dv => _mesa_Vertex3dv
  loopback_Vertex3i => _mesa_Vertex3i
  loopback_Vertex3iv => _mesa_Vertex3iv
  loopback_Vertex3s => _mesa_Vertex3s
  loopback_Vertex3sv => _mesa_Vertex3sv
  loopback_Vertex4d => _mesa_Vertex4d
  loopback_Vertex4dv => _mesa_Vertex4dv
  loopback_Vertex4i => _mesa_Vertex4i
  loopback_Vertex4iv => _mesa_Vertex4iv
  loopback_Vertex4s => _mesa_Vertex4s
  loopback_Vertex4sv => _mesa_Vertex4sv
  loopback_VertexAttrib1dARB => _mesa_VertexAttrib1d
  loopback_VertexAttrib1dNV => _mesa_VertexAttrib1dNV
  loopback_VertexAttrib1dvARB => _mesa_VertexAttrib1dv
  loopback_VertexAttrib1dvNV => _mesa_VertexAttrib1dvNV
  loopback_VertexAttrib1sARB => _mesa_VertexAttrib1s
  loopback_VertexAttrib1sNV => _mesa_VertexAttrib1sNV
  loopback_VertexAttrib1svARB => _mesa_VertexAttrib1sv
  loopback_VertexAttrib1svNV => _mesa_VertexAttrib1svNV
  loopback_VertexAttrib2dARB => _mesa_VertexAttrib2d
  loopback_VertexAttrib2dNV => _mesa_VertexAttrib2dNV
  loopback_VertexAttrib2dvARB => _mesa_VertexAttrib2dv
  loopback_VertexAttrib2dvNV => _mesa_VertexAttrib2dvNV
  loopback_VertexAttrib2sARB => _mesa_VertexAttrib2s
  loopback_VertexAttrib2sNV => _mesa_VertexAttrib2sNV
  loopback_VertexAttrib2svARB => _mesa_VertexAttrib2sv
  loopback_VertexAttrib2svNV => _mesa_VertexAttrib2svNV
  loopback_VertexAttrib3dARB => _mesa_VertexAttrib3d
  loopback_VertexAttrib3dNV => _mesa_VertexAttrib3dNV
  loopback_VertexAttrib3dvARB => _mesa_VertexAttrib3dv
  loopback_VertexAttrib3dvNV => _mesa_VertexAttrib3dvNV
  loopback_VertexAttrib3sARB => _mesa_VertexAttrib3s
  loopback_VertexAttrib3sNV => _mesa_VertexAttrib3sNV
  loopback_VertexAttrib3svARB => _mesa_VertexAttrib3sv
  loopback_VertexAttrib3svNV => _mesa_VertexAttrib3svNV
  loopback_VertexAttrib4NbvARB => _mesa_VertexAttrib4Nbv
  loopback_VertexAttrib4NivARB => _mesa_VertexAttrib4Niv
  loopback_VertexAttrib4NsvARB => _mesa_VertexAttrib4Nsv
  loopback_VertexAttrib4NubARB => _mesa_VertexAttrib4Nub
  loopback_VertexAttrib4NubvARB => _mesa_VertexAttrib4Nubv
  loopback_VertexAttrib4NuivARB => _mesa_VertexAttrib4Nuiv
  loopback_VertexAttrib4NusvARB => _mesa_VertexAttrib4Nusv
  loopback_VertexAttrib4bvARB => _mesa_VertexAttrib4bv
  loopback_VertexAttrib4dARB => _mesa_VertexAttrib4d
  loopback_VertexAttrib4dNV => _mesa_VertexAttrib4dNV
  loopback_VertexAttrib4dvARB => _mesa_VertexAttrib4dv
  loopback_VertexAttrib4dvNV => _mesa_VertexAttrib4dvNV
  loopback_VertexAttrib4ivARB => _mesa_VertexAttrib4iv
  loopback_VertexAttrib4sARB => _mesa_VertexAttrib4s
  loopback_VertexAttrib4sNV => _mesa_VertexAttrib4sNV
  loopback_VertexAttrib4svARB => _mesa_VertexAttrib4sv
  loopback_VertexAttrib4svNV => _mesa_VertexAttrib4svNV
  loopback_VertexAttrib4ubNV => _mesa_VertexAttrib4ubNV
  loopback_VertexAttrib4ubvARB => _mesa_VertexAttrib4ubv
  loopback_VertexAttrib4ubvNV => _mesa_VertexAttrib4ubvNV
  loopback_VertexAttrib4uivARB => _mesa_VertexAttrib4uiv
  loopback_VertexAttrib4usvARB => _mesa_VertexAttrib4usv
  loopback_VertexAttribI1iv => _mesa_VertexAttribI1iv
  loopback_VertexAttribI1uiv => _mesa_VertexAttribI1uiv
  loopback_VertexAttribI4bv => _mesa_VertexAttribI4bv
  loopback_VertexAttribI4sv => _mesa_VertexAttribI4sv
  loopback_VertexAttribI4ubv => _mesa_VertexAttribI4ubv
  loopback_VertexAttribI4usv => _mesa_VertexAttribI4usv
  loopback_VertexAttribs1dvNV => _mesa_VertexAttribs1dvNV
  loopback_VertexAttribs1fvNV => _mesa_VertexAttribs1fvNV
  loopback_VertexAttribs1svNV => _mesa_VertexAttribs1svNV
  loopback_VertexAttribs2dvNV => _mesa_VertexAttribs2dvNV
  loopback_VertexAttribs2fvNV => _mesa_VertexAttribs2fvNV
  loopback_VertexAttribs2svNV => _mesa_VertexAttribs2svNV
  loopback_VertexAttribs3dvNV => _mesa_VertexAttribs3dvNV
  loopback_VertexAttribs3fvNV => _mesa_VertexAttribs3fvNV
  loopback_VertexAttribs3svNV => _mesa_VertexAttribs3svNV
  loopback_VertexAttribs4dvNV => _mesa_VertexAttribs4dvNV
  loopback_VertexAttribs4fvNV => _mesa_VertexAttribs4fvNV
  loopback_VertexAttribs4svNV => _mesa_VertexAttribs4svNV
  loopback_VertexAttribs4ubvNV => _mesa_VertexAttribs4ubvNV

And changes the primary name assignment in the XML as follows:
  ActiveTextureARB => ActiveTexture
  AlphaFuncxOES => AlphaFuncx
  BeginConditionalRenderNV => BeginConditionalRender
  BeginQueryARB => BeginQuery
  BeginTransformFeedbackEXT => BeginTransformFeedback
  BindAttribLocationARB => BindAttribLocation
  BindBufferARB => BindBuffer
  BindBufferBaseEXT => BindBufferBase
  BindBufferRangeEXT => BindBufferRange
  BindFragDataLocationEXT => BindFragDataLocation
  BindFramebufferEXT => BindFramebuffer
  BindProgramNV => BindProgramARB
  BindRenderbufferEXT => BindRenderbuffer
  BlendEquationSeparateEXT => BlendEquationSeparate
  BlendFuncSeparateEXT => BlendFuncSeparate
  BlitFramebufferEXT => BlitFramebuffer
  BufferDataARB => BufferData
  BufferSubDataARB => BufferSubData
  CheckFramebufferStatusEXT => CheckFramebufferStatus
  ClampColorARB => ClampColor
  ClearColorxOES => ClearColorx
  ClearDepthxOES => ClearDepthx
  ClientActiveTextureARB => ClientActiveTexture
  ClipPlanefOES => ClipPlanef
  ClipPlanexOES => ClipPlanex
  Color4xOES => Color4x
  ColorMaskIndexedEXT => ColorMaski
  CompileShaderARB => CompileShader
  CompressedTexImage1DARB => CompressedTexImage1D
  CompressedTexImage2DARB => CompressedTexImage2D
  CompressedTexImage3DARB => CompressedTexImage3D
  CompressedTexSubImage1DARB => CompressedTexSubImage1D
  CompressedTexSubImage2DARB => CompressedTexSubImage2D
  CompressedTexSubImage3DARB => CompressedTexSubImage3D
  DeleteBuffersARB => DeleteBuffers
  DeleteFramebuffersEXT => DeleteFramebuffers
  DeleteProgramsNV => DeleteProgramsARB
  DeleteQueriesARB => DeleteQueries
  DeleteRenderbuffersEXT => DeleteRenderbuffers
  DeleteVertexArraysAPPLE => DeleteVertexArrays
  DepthRangexOES => DepthRangex
  DisableIndexedEXT => Disablei
  DisableVertexAttribArrayARB => DisableVertexAttribArray
  DrawBuffersARB => DrawBuffers
  EnableIndexedEXT => Enablei
  EnableVertexAttribArrayARB => EnableVertexAttribArray
  EndConditionalRenderNV => EndConditionalRender
  EndQueryARB => EndQuery
  EndTransformFeedbackEXT => EndTransformFeedback
  FogCoordPointerEXT => FogCoordPointer
  FogCoorddEXT => FogCoordd
  FogCoorddvEXT => FogCoorddv
  FogxOES => Fogx
  FogxvOES => Fogxv
  FramebufferRenderbufferEXT => FramebufferRenderbuffer
  FramebufferTexture1DEXT => FramebufferTexture1D
  FramebufferTexture2DEXT => FramebufferTexture2D
  FramebufferTexture3DEXT => FramebufferTexture3D
  FramebufferTextureLayerEXT => FramebufferTextureLayer
  FrustumfOES => Frustumf
  FrustumxOES => Frustumx
  GenBuffersARB => GenBuffers
  GenFramebuffersEXT => GenFramebuffers
  GenProgramsNV => GenProgramsARB
  GenQueriesARB => GenQueries
  GenRenderbuffersEXT => GenRenderbuffers
  GenerateMipmapEXT => GenerateMipmap
  GetActiveAttribARB => GetActiveAttrib
  GetActiveUniformARB => GetActiveUniform
  GetAttribLocationARB => GetAttribLocation
  GetBooleanIndexedvEXT => GetBooleani_v
  GetBufferParameterivARB => GetBufferParameteriv
  GetBufferPointervARB => GetBufferPointerv
  GetBufferSubDataARB => GetBufferSubData
  GetClipPlanefOES => GetClipPlanef
  GetClipPlanexOES => GetClipPlanex
  GetCompressedTexImageARB => GetCompressedTexImage
  GetFixedvOES => GetFixedv
  GetFragDataLocationEXT => GetFragDataLocation
  GetFramebufferAttachmentParameterivEXT => GetFramebufferAttachmentParameteriv
  GetIntegerIndexedvEXT => GetIntegeri_v
  GetLightxvOES => GetLightxv
  GetMaterialxvOES => GetMaterialxv
  GetQueryObjecti64vEXT => GetQueryObjecti64v
  GetQueryObjectivARB => GetQueryObjectiv
  GetQueryObjectui64vEXT => GetQueryObjectui64v
  GetQueryObjectuivARB => GetQueryObjectuiv
  GetQueryivARB => GetQueryiv
  GetRenderbufferParameterivEXT => GetRenderbufferParameteriv
  GetShaderSourceARB => GetShaderSource
  GetTexEnvxvOES => GetTexEnvxv
  GetTexParameterIivEXT => GetTexParameterIiv
  GetTexParameterIuivEXT => GetTexParameterIuiv
  GetTexParameterxvOES => GetTexParameterxv
  GetTransformFeedbackVaryingEXT => GetTransformFeedbackVarying
  GetUniformLocationARB => GetUniformLocation
  GetUniformfvARB => GetUniformfv
  GetUniformivARB => GetUniformiv
  GetUniformuivEXT => GetUniformuiv
  GetVertexAttribIivEXT => GetVertexAttribIiv
  GetVertexAttribIuivEXT => GetVertexAttribIuiv
  GetVertexAttribPointervNV => GetVertexAttribPointerv
  GetVertexAttribdvARB => GetVertexAttribdv
  GetVertexAttribfvARB => GetVertexAttribfv
  GetVertexAttribivARB => GetVertexAttribiv
  IsBufferARB => IsBuffer
  IsEnabledIndexedEXT => IsEnabledi
  IsFramebufferEXT => IsFramebuffer
  IsProgramNV => IsProgramARB
  IsQueryARB => IsQuery
  IsRenderbufferEXT => IsRenderbuffer
  IsVertexArrayAPPLE => IsVertexArray
  LightModelxOES => LightModelx
  LightModelxvOES => LightModelxv
  LightxOES => Lightx
  LightxvOES => Lightxv
  LineWidthxOES => LineWidthx
  LinkProgramARB => LinkProgram
  LoadMatrixxOES => LoadMatrixx
  LoadTransposeMatrixdARB => LoadTransposeMatrixd
  LoadTransposeMatrixfARB => LoadTransposeMatrixf
  MapBufferARB => MapBuffer
  MaterialxOES => Materialx
  MaterialxvOES => Materialxv
  MultMatrixxOES => MultMatrixx
  MultTransposeMatrixdARB => MultTransposeMatrixd
  MultTransposeMatrixfARB => MultTransposeMatrixf
  MultiDrawArraysEXT => MultiDrawArrays
  MultiTexCoord1dARB => MultiTexCoord1d
  MultiTexCoord1dvARB => MultiTexCoord1dv
  MultiTexCoord1iARB => MultiTexCoord1i
  MultiTexCoord1ivARB => MultiTexCoord1iv
  MultiTexCoord1sARB => MultiTexCoord1s
  MultiTexCoord1svARB => MultiTexCoord1sv
  MultiTexCoord2dARB => MultiTexCoord2d
  MultiTexCoord2dvARB => MultiTexCoord2dv
  MultiTexCoord2iARB => MultiTexCoord2i
  MultiTexCoord2ivARB => MultiTexCoord2iv
  MultiTexCoord2sARB => MultiTexCoord2s
  MultiTexCoord2svARB => MultiTexCoord2sv
  MultiTexCoord3dARB => MultiTexCoord3d
  MultiTexCoord3dvARB => MultiTexCoord3dv
  MultiTexCoord3iARB => MultiTexCoord3i
  MultiTexCoord3ivARB => MultiTexCoord3iv
  MultiTexCoord3sARB => MultiTexCoord3s
  MultiTexCoord3svARB => MultiTexCoord3sv
  MultiTexCoord4dARB => MultiTexCoord4d
  MultiTexCoord4dvARB => MultiTexCoord4dv
  MultiTexCoord4iARB => MultiTexCoord4i
  MultiTexCoord4ivARB => MultiTexCoord4iv
  MultiTexCoord4sARB => MultiTexCoord4s
  MultiTexCoord4svARB => MultiTexCoord4sv
  MultiTexCoord4xOES => MultiTexCoord4x
  Normal3xOES => Normal3x
  OrthofOES => Orthof
  OrthoxOES => Orthox
  PointParameterfEXT => PointParameterf
  PointParameterfvEXT => PointParameterfv
  PointParameteriNV => PointParameteri
  PointParameterivNV => PointParameteriv
  PointParameterxOES => PointParameterx
  PointParameterxvOES => PointParameterxv
  PointSizexOES => PointSizex
  PolygonOffsetxOES => PolygonOffsetx
  PrimitiveRestartIndexNV => PrimitiveRestartIndex
  ProvokingVertexEXT => ProvokingVertex
  RenderbufferStorageEXT => RenderbufferStorage
  RotatexOES => Rotatex
  SampleCoverageARB => SampleCoverage
  SampleCoveragexOES => SampleCoveragex
  ScalexOES => Scalex
  SecondaryColor3bEXT => SecondaryColor3b
  SecondaryColor3bvEXT => SecondaryColor3bv
  SecondaryColor3dEXT => SecondaryColor3d
  SecondaryColor3dvEXT => SecondaryColor3dv
  SecondaryColor3iEXT => SecondaryColor3i
  SecondaryColor3ivEXT => SecondaryColor3iv
  SecondaryColor3sEXT => SecondaryColor3s
  SecondaryColor3svEXT => SecondaryColor3sv
  SecondaryColor3ubEXT => SecondaryColor3ub
  SecondaryColor3ubvEXT => SecondaryColor3ubv
  SecondaryColor3uiEXT => SecondaryColor3ui
  SecondaryColor3uivEXT => SecondaryColor3uiv
  SecondaryColor3usEXT => SecondaryColor3us
  SecondaryColor3usvEXT => SecondaryColor3usv
  SecondaryColorPointerEXT => SecondaryColorPointer
  ShaderSourceARB => ShaderSource
  TexBufferARB => TexBuffer
  TexEnvxOES => TexEnvx
  TexEnvxvOES => TexEnvxv
  TexParameterIivEXT => TexParameterIiv
  TexParameterIuivEXT => TexParameterIuiv
  TexParameterxOES => TexParameterx
  TexParameterxvOES => TexParameterxv
  TransformFeedbackVaryingsEXT => TransformFeedbackVaryings
  TranslatexOES => Translatex
  Uniform1fARB => Uniform1f
  Uniform1fvARB => Uniform1fv
  Uniform1iARB => Uniform1i
  Uniform1ivARB => Uniform1iv
  Uniform1uiEXT => Uniform1ui
  Uniform1uivEXT => Uniform1uiv
  Uniform2fARB => Uniform2f
  Uniform2fvARB => Uniform2fv
  Uniform2iARB => Uniform2i
  Uniform2ivARB => Uniform2iv
  Uniform2uiEXT => Uniform2ui
  Uniform2uivEXT => Uniform2uiv
  Uniform3fARB => Uniform3f
  Uniform3fvARB => Uniform3fv
  Uniform3iARB => Uniform3i
  Uniform3ivARB => Uniform3iv
  Uniform3uiEXT => Uniform3ui
  Uniform3uivEXT => Uniform3uiv
  Uniform4fARB => Uniform4f
  Uniform4fvARB => Uniform4fv
  Uniform4iARB => Uniform4i
  Uniform4ivARB => Uniform4iv
  Uniform4uiEXT => Uniform4ui
  Uniform4uivEXT => Uniform4uiv
  UniformMatrix2fvARB => UniformMatrix2fv
  UniformMatrix3fvARB => UniformMatrix3fv
  UniformMatrix4fvARB => UniformMatrix4fv
  UnmapBufferARB => UnmapBuffer
  UseProgramObjectARB => UseProgram
  ValidateProgramARB => ValidateProgram
  VertexAttrib1dARB => VertexAttrib1d
  VertexAttrib1dvARB => VertexAttrib1dv
  VertexAttrib1sARB => VertexAttrib1s
  VertexAttrib1svARB => VertexAttrib1sv
  VertexAttrib2dARB => VertexAttrib2d
  VertexAttrib2dvARB => VertexAttrib2dv
  VertexAttrib2sARB => VertexAttrib2s
  VertexAttrib2svARB => VertexAttrib2sv
  VertexAttrib3dARB => VertexAttrib3d
  VertexAttrib3dvARB => VertexAttrib3dv
  VertexAttrib3sARB => VertexAttrib3s
  VertexAttrib3svARB => VertexAttrib3sv
  VertexAttrib4NbvARB => VertexAttrib4Nbv
  VertexAttrib4NivARB => VertexAttrib4Niv
  VertexAttrib4NsvARB => VertexAttrib4Nsv
  VertexAttrib4NubARB => VertexAttrib4Nub
  VertexAttrib4NubvARB => VertexAttrib4Nubv
  VertexAttrib4NuivARB => VertexAttrib4Nuiv
  VertexAttrib4NusvARB => VertexAttrib4Nusv
  VertexAttrib4bvARB => VertexAttrib4bv
  VertexAttrib4dARB => VertexAttrib4d
  VertexAttrib4dvARB => VertexAttrib4dv
  VertexAttrib4ivARB => VertexAttrib4iv
  VertexAttrib4sARB => VertexAttrib4s
  VertexAttrib4svARB => VertexAttrib4sv
  VertexAttrib4ubvARB => VertexAttrib4ubv
  VertexAttrib4uivARB => VertexAttrib4uiv
  VertexAttrib4usvARB => VertexAttrib4usv
  VertexAttribDivisorARB => VertexAttribDivisor
  VertexAttribI1ivEXT => VertexAttribI1iv
  VertexAttribI1uivEXT => VertexAttribI1uiv
  VertexAttribI4bvEXT => VertexAttribI4bv
  VertexAttribI4svEXT => VertexAttribI4sv
  VertexAttribI4ubvEXT => VertexAttribI4ubv
  VertexAttribI4usvEXT => VertexAttribI4usv
  VertexAttribIPointerEXT => VertexAttribIPointer
  VertexAttribPointerARB => VertexAttribPointer
  WindowPos2dMESA => WindowPos2d
  WindowPos2dvMESA => WindowPos2dv
  WindowPos2fMESA => WindowPos2f
  WindowPos2fvMESA => WindowPos2fv
  WindowPos2iMESA => WindowPos2i
  WindowPos2ivMESA => WindowPos2iv
  WindowPos2sMESA => WindowPos2s
  WindowPos2svMESA => WindowPos2sv
  WindowPos3dMESA => WindowPos3d
  WindowPos3dvMESA => WindowPos3dv
  WindowPos3fMESA => WindowPos3f
  WindowPos3fvMESA => WindowPos3fv
  WindowPos3iMESA => WindowPos3i
  WindowPos3ivMESA => WindowPos3iv
  WindowPos3sMESA => WindowPos3s
  WindowPos3svMESA => WindowPos3sv

Acked-by: Brian Paul <brianp@vmware.com>
2012-11-12 10:53:57 -08:00
Michel Dänzer
7708a86464 radeonsi: Implement alpha testing in pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-12 15:45:42 +01:00
Michel Dänzer
e44dfd4b3c radeonsi: Initialize uses_kill boolean from TGSI info.
Fixes discarded pixels incorrectly updating the depth buffer.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-12 15:45:42 +01:00
Vincent Lejeune
557d4918ad glsl: store read vector in a temp in vec_index_to_cond
Vector indexing on matrixes generates several copy of the
constant matrix, for instance vec=mat4[i][j] generates :
vec=mat4[i].x;
vec=(j==1)?mat4[i].y;
vec=(j==2)?mat4[i].z;
vec=(j==3)?mat4[i].w;
In the case of constant matrixes, the mat4[i] expression generates
copy of the 16 elements of the matrix 4 times ; indirect addressing
also prevents some conservative CSE algorithms (like the one in LLVM)
from factoring the mat4[i] expression.
This patch will make the vec_index_to_cond pass generates :
temp = mat4[i];
vec=temp.x;
vec=(j==1)?temp.y;
vec=(j==2)?temp.z;
vec=(j==3)?temp.w;

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-11 22:20:15 +01:00
Marek Olšák
05a2f66cde gallium/u_blitter: handle PIPE_TEXTURE_CUBE_ARRAY in is_box_inside_resource 2012-11-11 13:33:01 +01:00
Andreas Boll
5ecbc3a9e8 build: fix enable/disable language in ./configure --help
Based on patch from Brian Paul.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-10 21:32:09 +01:00
Kenneth Graunke
e639385064 i965: Fix AA Line Distance Mode in 3DSTATE_SF on Ivybridge.
We were accidentally setting bit 14 in DWord 2 (which is Reserved/MBZ)
rather than bit 14 in DWord 3 (which is AA Line Distance Mode).

There's also no reason to ever set it to legacy mode; the bit is only
used when drawing antialiased lines anyway.  Set it unconditionally.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-10 12:14:23 -08:00
Ian Romanick
5581954c3a dri_util: Fix prologue comment for driCreateConfigs
The parameters and operation of this function changed, but I didn't
bother to change the prologue comment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-09 18:38:19 -08:00
Ian Romanick
3ec3201f31 swrast: swrastFillInModes doesn't do 8-bit modes, so don't try
Support for 8-bit modes was removed in commits 0398a26 and bda208a4.
However, I didn't notice code in dri_init_screen that explicitly tries
to create this modes.  This is structurally different from other drivers
(that only create modes that match the display color depth).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56555
Cc: Vinson Lee <vlee@freedesktop.org>
2012-11-09 18:38:19 -08:00
Darren Salt
d2a6dd9a95 Fix use of glsl_parser.{cc,h} where source dir != build dir.
Fixes a regression caused by commit 9948a3365.

https://bugs.freedesktop.org/show_bug.cgi?id=56787
https://bugs.freedesktop.org/show_bug.cgi?id=56685
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-09 16:56:35 -08:00
Brian Paul
2951a9dd51 Revert "mesa: assert that key->fragprog_inputs_read value isn't too large"
This reverts commit 0d61f879a1.

Assigning the FS inputs to the 12 bit field is fine since we don't care
about the higher FS inputs.  Maybe I'll revisit silencing the compiler
warning another day.
2012-11-09 16:31:22 -07:00
Matt Turner
c6f426c02d glcpp: wire up glcpp-test to make check
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
68414bc868 glcpp/tests: Add tests for multiline #elif
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
28e397660c glcpp/tests: Add test for multiline #if
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
b44423cf75 glcpp/tests: Add test for multiline #line
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
c3a15d9a35 glcpp/tests: Add test to check #line followed by code
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51802
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Fabian Bieler
9ad71c44fa glcpp: don't push #line directives into next line
By moving the HASH_LINE rule out of control_line: and into line:, we avoid
adding control_line's additional \n (as seen in the first hunk).

mattst88: Carl and I determined independently of Fabian that the 091
test needed to be modified identically to this, and our patch to fix the
test was more complicated.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Matt Turner
060e696799 glcpp: Reject garbage after #else and #endif tokens
Previously we were accepting garbage after #else and #endif tokens when
the previous preprocessor conditional evaluated to false (eg, #if 0).

When the preprocessor hits a false conditional, it switches the lexer
into the SKIP state, in which it ignores non-control tokens. The parser
pops the SKIP state off the stack when it reaches the associated #elif,
#else, or #endif. Unfortunately, that meant that it only left the SKIP
state after the lexing the entire line containing the #token and thus
would accept garbage after the #token.

To fix this we use a mid-rule, which is executed immediately after the
#token is parsed.

NOTE: This is a candidate for the stable branch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56442
Fixes: preprocess17_frag.test from oglconform
Reviewed-by: Carl Worth <cworth@cworth.org> (glcpp-parse.y)
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-09 14:33:08 -08:00
Dave Airlie
afcaa03f7e r600g: fix printk warnings
Brian reported seeing:
r600_texture.c: In function ‘r600_texture_create_object’:
r600_texture.c:468:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
r600_texture.c:468:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’
r600_texture.c:485:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
r600_texture.c:485:12: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’

this should wrap over them fine.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie
aafdc5bda4 softpipe: fix unused variable warning.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie
add3a0709f gallium: fix unused cap warnings in drivers for cube map array cap.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:39:38 +10:00
Dave Airlie
eb44c36df8 r600g: add initial cube map array support (v2)
This contains the evergreen support.

Support is possible on rv670 upwards and the code in here
should work, but it doesn't and I haven't debugged it to
figure out why.

Beyond just adding support for the cube map array sampling,
r600 resinfo isn't conformant with the GL specification,
which states the number of layers should be returned for
the textureSize, so we have to track in an external
constant buffer the layers for each sampler if we need
them in the shader.

v2: only update the sampler constants if the sampler views have changed,
as suggested by Marek.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:20:46 +10:00
Dave Airlie
e9cf40142d u_blitter: fix cube array check
Pointed out by Marek on irc,

no committing after beer!

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-10 06:20:45 +10:00
José Fonseca
5dbc84ecb0 util/u_surface: Support 3D/array textures in util_resource_copy_region().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
c84dd7a940 draw: Remove redundant draw_geometry_shader_delete().
draw_delete_geometry_shader() seems to be the real one.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
dc53e1b410 trace: Support geometry shaders.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
bbb48a4a55 util/u_surface: Fix util_clear_depth_stencil for Z32_FLOAT_S8X24_UINT.
util_pack_z_stencil was being unconditionally invoked for all formats,
causing an assertion failure for Z32_FLOAT_S8X24_UINT.

NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
49dff2cb05 galahad: Support geometry shader / stream-output methods.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
658b73a246 softpipe,util: Fix blending of R and RG formats.
Alpha is also 1 for formats like R32G32_FLOAT.

NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
48ce928900 softpipe: Fix rgb_dst_factor == PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE.
We must multiply the factor against the destination, not the source.

NOTE: Candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
e5f0ae0bd8 tgsi: Lift the requirement of indirection being done by ADDR register.
For drivers with native integer / SM4 support this is just an hindrance.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
7e112c604e util: Fix reduction of line adjacency primitives.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
b7283834dc softpipe: Handle adjacency primitives.
Not fully tested.

Based on diagrams from
http://msdn.microsoft.com/en-us/library/windows/desktop/bb205124.aspx#Primitive_Adjacency

v2: Fix based on Brian's feedback.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:19 +00:00
José Fonseca
5d12c7b755 util/u_rect: Make it C++ safe.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-11-09 13:43:18 +00:00
Dave Airlie
1d9738dab3 u_blitter: don't create fragment program for cube maps unless supported.
should fix http://bugs.freedesktop.org/56906

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 20:34:23 +10:00
Mario Kleiner
eabbe5c45f mesa: Don't glPopAttrib() GL_POINT_SPRITE_COORD_ORIGIN on < OpenGL-2.0
The GL_POINT_BIT state attribute GL_POINT_SPRITE_COORD_ORIGIN
is only supported on OpenGL-2.0 or later. Prevent glPopAttrib()
from trying to restore it on OpenGL-1.4 implementations which
support GL_ARB_POINT_SPRITE, as otherwise the sequence...

glPushAttrib(GL_POINT_BIT);
glPopAttrib();

throws an GL_INVALID_ENUM error in glPopAttrib().

See also commit f778174ea1

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-08 22:53:54 -08:00
Kenneth Graunke
c299f44782 mesa: Fix glGetVertexAttribI[u]iv now that we have real integer attribs.
Since cf438f5375e242, we store actual integers for the attribute data.
We just need to reinterpret the GLfloat array as a GLint/GLuint array
so we can read the proper data.

Fixes oglconform's glsl-vertex-attrib/basic.VertexAttribI[1234][u]i
subtests (after fixing an unrelated bug in those test cases).

v2: Use the COPY_4V macro to be concise.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com> [v1]
2012-11-08 22:53:54 -08:00
Kenneth Graunke
6ccfa1c543 mesa: Fix typo in glDeleteQueriesARB debug message.
"Deleete" all the extra letters!
2012-11-08 22:53:39 -08:00
Vinson Lee
2aa783318d svga: Fix memory leak in svga_buffer_transfer_map.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-08 21:28:15 -08:00
Dave Airlie
2c8f088132 docs: update with ARB_texture_cube_map_array support
just mention softpipe is done, r600g will come soon.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:58:49 +10:00
Dave Airlie
308a03f1ab u_blitter: add cube map array support.
This adds cube array support to the blitter.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:29:26 +10:00
Dave Airlie
309fda2fb2 softpipe: add ARB_texture_cube_map_array support (v1.1)
This adds support to the softpipe texture sampler and tgsi exec.

In order to handle the extra input to the texture sampling,
I've had to expand the interfaces to take a c1 value for storing
the texture compare value for the TEX2 case.

v1.1: add comments (Brian)

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:29:26 +10:00
Dave Airlie
8c0ccce300 st/mesa: add support for ARB_texture_cube_map_array (v2)
This adds mesa state tracker support for the new extension,
along with glsl->tgsi conversion to use the new opcodes
where appropriate.

v2: fix assert found running textureSize tests.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:29:13 +10:00
Dave Airlie
c4427ceff7 gallium: add defines/shader opcode for texture cube map array
This just adds the texture target and capability along
with 3 new opcodes required to support this extension.

As this extension requires some texture opcodes with samp + 5 args,
we need to use another src register, this is only required
for TEX, TXL and TXB opcodes to implement this spec.

TEX2 is required for shadow cube map arrays
TXL2 is required for cube map array sampler + explicit lod
TXB2 is required for cube map array sampler + lod bias

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:26:37 +10:00
Dave Airlie
5b115864d2 mesa: arb_texture_cube_map_array: fix attrib push/pop
fdo9833 piglit test caught this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:26:37 +10:00
Dave Airlie
4c8750015b glsl: add ARB_texture_cube_map_array support (v2)
This adds all the new builtins + the new sampler types,
and hooks them up if the extension is supported.

v2: fix missing signatures for grad/lod
fix missing textureSize clarifications
fix compare vs starts with usage

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 10:26:33 +10:00
Dave Airlie
2c52c0e1ce mesa: add get support for TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
e0e7e29554 mesa: add fbo/texture support for ARB_texture_cube_map_array (v2)
This adds the mesa core + texture + fbo support for the
texture cube map array extension.

v2:
add comment to _mesa_num_tex_faces related to cube map arrays (Brian)
drop wrong comment cut-n-paste (Brian)
fix / 6 maximum check issue (Kenneth)
coalsece some array case statements (Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
5a5a80e021 mesa: add ARB_texture_cube_map_array extension bits
This just adds the bit + extension name.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
d078c4fb92 glapi: add ARB_texture_cube_map_array.
This adds the ARB_texture_cube_map_array enums.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:41 +10:00
Dave Airlie
037b4f8038 r600g: fix lod bias/explicit lod with cube maps.
While developing cube map array support I found that we didn't
support this properly, also piglit didn't test for it at all.

I've submitted a test to piglit to check for this, and this
fixes explicit lod and lod bias with cube maps.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:40 +10:00
Dave Airlie
7356579540 r600g: clarify const buffer numbering and handling
For cube map arrays I'll need another driver private constant
buffer, and looking forward to UBOs. So clean up with some
defines, that can be modified when adding cube map array and ubos
later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 09:24:40 +10:00
Eric Anholt
2fcaf4eae8 i965: Fix slow leak of brw->wm.compile_data->store
We were successfully freeing our compile data at context destroy, but until
then we were allocating a new store every compile without freeing it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56019
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-08 14:50:32 -08:00
Eric Anholt
177c82555b i965/fs: Add support for global copy propagation.
It is common for complicated shaders, particularly code-generated ones, to
have a big array of uniforms or attributes, and a prologue in the shader that
dereferences from the big array to more informatively-named local variables.
Then there will be some small control flow operation (like a ? : statement),
and then use of those informatively-named variables.  We were emitting extra
MOVs in these cases, because copy propagation couldn't reach across control
flow.

Instead, implement dataflow analysis on the output of the first copy
propagation pass and re-run it to propagate those extra MOVs out.

On one future Steam release, reduces VS+FS instruction count from 42837 to
41437.  No statistically significant performance difference (n=48), though, at
least at the low resolution I'm running it at.

shader-db results:

total instructions in shared programs: 722170 -> 702545 (-2.72%)
instructions in affected programs:     260618 -> 240993 (-7.53%)

Some shaders do get hurt by up to 2 instructions, because a choice to copy
propagate instead of coalesce or something like that results in a dead write
sticking around.  Given that we already have instances of those instructions
in the affected programs (particularly unigine), we should just improve dead
code elimination to fix the problem.
2012-11-08 14:50:32 -08:00
Dave Airlie
9785ae0973 glsl_to_tgsi: fix dst register for texturing fetches.
I've no idea why there isn't a piglit that triggers this behaviour,
but while enabling TBOs for softpipe and r600g, I noticed all the
integer tests failed. I tracked it back to the TXF returning a float
when it should be returning an int. This fixed it and I haven't
seen any regressions in a full piglit run on softpipe.

http://bugs.freedesktop.org/55010

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-11-09 06:05:54 +10:00
Vincent Lejeune
e6b3858c89 r600g: fix pre eg export with llvm
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-08 13:21:57 +01:00
Vinson Lee
4cb8b946d9 i965: Fix assertion in brw_alu3.
Fixes side effect in assertion defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-07 22:54:26 -08:00
Jonas Ådahl
a3b6b2d305 wayland: Destroy frame callback when destroying surface
If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.

This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().

Note: This is a candidate for stable branches.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-11-07 16:13:03 -05:00
Alex Deucher
0b61f0b148 r600g/compute: fix call to r600_bytecode_init
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-11-07 11:51:16 -05:00
Kenneth Graunke
65faedb0d9 mesa: Remove PROG_EMIT_VERTEX and PROG_END_PRIMITIVE opcodes.
These were only used for geometry shader support back in the days before
the new GLSL compiler.  Future geometry shader support will not use
these.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-07 00:00:46 -08:00
Vinson Lee
57049219f5 svga: Ensure vb_transfer in svga_swtnl_draw_vbo in initialized.
Fixes a uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-06 23:33:00 -08:00
Vinson Lee
5cbc0f0036 scons: Build src/mesa/main/es1_conversion.c for all builds.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-06 23:16:29 -08:00
Fredrik Höglund
f42518962a egl_dri2/x11: Fix eglPostSubBufferNV()
This got broken in commit 0a523a8820.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
2012-11-07 00:51:09 +01:00
Paul Berry
91b828ea74 dispatch: Delete unused init_dispatch functions.
The new code-generated version of _mesa_create_exec_table() populates
the entire dispatch table (except for dynamic functions) by itself; it
no longer calls separate functions to initialize parts of the dispatch
table.  This patch removes those no-longer-needed functions.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:46 -08:00
Paul Berry
98874ec30b dispatch: Code generate api_exec.c.
This patch adjusts makefiles to cause src/mesa/main/api_exec.c to be
generated using src/mapi/glapi/gen/gl_genexec.py.  There should be no
functional change.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:45 -08:00
Paul Berry
38a1039a42 glapi/gen: Add code generation script for _mesa_create_exec_table().
This script generates the file api_exec.c, which contains just the
function _mesa_create_exec_table(), based on the XML files in
src/mapi/glapi/gen.

The following XML attributes, in particular, are used:
- "es1" indicates functions that should be available in ES1 contexts.
- "es2" indicates functions that should be available in ES2/ES3
  contexts.
- "exec" indicates which Mesa function should be dispatched to.  E.g.
  if the GL function is glFoo(), then:
  - exec="mesa" (the default) dispatches to _mesa_Foo().
  - exec="check" dispatches to _check_Foo().
  - exec="es" dispatches to _es_Foo().
  - exec="loopback" dispatches to loopback_Foo().
  - exec="skip" or exec="dynamic" causes this function to be skipped;
    either it is not yet supported ("skip"), or its dispatch table
    entry will be dynamically populated based on GL state ("dynamic").
- "desktop" indicates functions that should be available in desktop GL
  (non-ES) contexts.
- "deprecated" indicates functions that should not be available in
  core contexts.
- "mesa_name" indicates functions whose implementation in Mesa has a
  different suffix than the corresponding GL function name.

The generated code looks roughly like this (showing just a single
statement in each block for brevity):

    struct _glapi_table *
    _mesa_create_exec_table(struct gl_context *ctx)
    {
       struct _glapi_table *exec;

       exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
       if (exec == NULL)
          return NULL;

       if (_mesa_is_desktop_gl(ctx)) {
          SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
          SET_BeginQueryARB(exec, _mesa_BeginQueryARB);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES) {
          SET_GetPointerv(exec, _mesa_GetPointerv);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) {
          SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB);
          /* other functions not shown */
       }
       if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2) {
          SET_AttachShader(exec, _mesa_AttachShader);
          /* other functions not shown */
       }
       if (ctx->API == API_OPENGL) {
          SET_Accum(exec, _mesa_Accum);
          /* other functions not shown */
       }
       if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
          SET_AlphaFunc(exec, _mesa_AlphaFunc);
          /* other functions not shown */
       }
       if (ctx->API == API_OPENGLES) {
          SET_AlphaFuncxOES(exec, _es_AlphaFuncx);
          /* other functions not shown */
       }

       return exec;
    }

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:45 -08:00
Paul Berry
679df028e7 glapi/gen: handle new XML attributes.
This patch updates gl_XML.py to parse the new XML attributes "exec",
"desktop", "deprecated", and "mesa_name", which will be needed to code
generate _mesa_create_exec_table().

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:44 -08:00
Paul Berry
91b5a741f6 glapi/gen: Gather API version info across aliased functions.
gl_XML.py's gl_function class keeps track of an entry_point_api_map
property that tracks, for each set of aliased functions, which ES1 or
ES2 version the given function name first appeared in.

This patch aggregates that information together across aliased
functions, into an easier-to-use api_map property.

Future patches will use this information when code generating
_mesa_create_exec_table(), to determine which set of dispatch table
entries should be populated based on the API.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:44 -08:00
Paul Berry
ccd872824b glapi/gen: Comment fix.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:44 -08:00
Paul Berry
f7fa946d1d dispatch: Make all API functions non-static.
Some of the functions that we store in the dispatch table are declared
as non-static in their .c files and are inserted into the dispatch
table directly by _mesa_create_exec_table().  Other functions are
declared as static, and are inserted into the dispatch table by a
dedicated function that lives in the same .c file
(e.g. _mesa_loopback_init_api_table() in api_loopback.c).

This patch makes all of these functions non-static, and creates
appropriate prototypes for them, so that in future patches we can
populate the entire dispatch table using a single code-generated
function.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:43 -08:00
Paul Berry
e41d1a4e74 glapi: Annotate XML with function name suffix anomalies.
When the XML lists one or more GL api functions as aliases for another
GL function, the mesa function that implements the functionality is
usually named after the canonical version of the function (the one
that is the target of the aliases).  For example, FogCoordd is listed
as an alias of FogCoorddEXT, and the Mesa function implementing the
functionality is called loopback_FogCoorddEXT.

However, there are exceptions.  For example, Enablei is listed as an
alias of EnableIndexedEXT, but the Mesa function implementing the
functionality is called _mesa_EnableIndexed.

To account for these anomalies, this patch annotates the XML with
"mesa_name" attributes, which describe how to adjust the function name
to find the corresponding Mesa function.

For example:

  <function name="EnableIndexedEXT" mesa_name="-EXT">...</function>
  <function name="IsProgramNV" mesa_name="-NV+ARB">...</function>

means that EnableIndexedEXT is implemented by a Mesa function called
_mesa_EnableIndexed, and IsProgramNV is implemented by a Mesa function
called _mesa_IsProgramARB.

Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine the name of the Mesa function
that should be stored in each dispatch table entry.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:43 -08:00
Paul Berry
4b37fa8581 glapi: Annotate XML with desktop="false" for GLES-only functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped when the API is desktop GL.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:42 -08:00
Paul Berry
3c474657f7 glapi: Annotate XML with exec="{es,check}" for special GLES1 functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to ES-specific implementations.  exec="es" indicates that
the ES-specific implementation has a name beginning with "_es_"
(e.g. _es_QueryMatrixxOES), and exec="check" indicates that the
ES-specific implementation has a name beginning with "_check_"
(e.g. _check_GetTexGenxvOES).

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:42 -08:00
Paul Berry
d1b2bd5191 glapi: Annotate XML with exec="loopback" for loopback functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to functions in api_loopback.c.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:42 -08:00
Paul Berry
784d2f303c glapi: Annotate XML with exec="dynamic" for dynamic functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because Mesa dispatches them differently depending on GL
state.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:41 -08:00
Paul Berry
3464bce419 glapi: Annotate XML with exec="skip" for unimplemented functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because they aren't implemented by Mesa.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:41 -08:00
Paul Berry
89a577080f glapi: Annotate XML with deprecated="3.1" for deprecated functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped in core contexts.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:41 -08:00
Paul Berry
11e9d8dd05 glapi: Mark GLX extensions as window_system="glX".
We were already doing this for some GLX extensions, but not others.
This patch makes our use of window_system="glX" consistent.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:40 -08:00
Paul Berry
e70b1a1379 glapi: Use GL_ or GLX_ prefix for all category names.
This patch standardizes the category names used in the glapi XML files
to begin each extension name with the prefix "GL_" or "GLX_".  There
is no functional change, because these category names are not used in
the generated code.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:40 -08:00
Paul Berry
5708e27113 dispatch: Remove a few FEATURE_ES1 conditionals.
This allows the GLES1.1 dispatch sanity test to be run on all builds,
even builds that do not include GLES1 support.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:39 -08:00
Brian Paul
0d61f879a1 mesa: assert that key->fragprog_inputs_read value isn't too large
fragprog_inputs_read is a 12-bit bitfield so check the assigned value.
MSVC warns on the assignment.  Not easy to fix but let's do a sanity check.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
406df38a66 mesa: fix MSVC signed/unsigned warnings in context.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
27d70b7266 mesa: fix MSVC signed/unsigned warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
085d81c370 swrast: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
cb5fb15578 tnl: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
5c05d28a43 mesa: silence MSVC signed/unsigned warning in texgetmage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
0dddf592ed mesa: silence MSVC signed/unsigned warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
15cb1a9029 vbo: use GLuint for numInstances to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
859c387603 mesa: fix signed/unsigned MSVC warnings in fbobject.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
d4e18764c6 mesa: s/GLint/GLuint/ in matrix.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
49cea4d40c mesa: s/int/GLuint/ in get.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
cc6c887cca mesa: fix assorted MSVC conversion warnings in format_pack.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
75f2ccf3a2 st/mesa: change glsl_to_tgsi_visitor from class to struct
To match the declaration in the .h file and silence an MSVC warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
80b3dfa704 st/mesa: add int cast to silence warning
MSVC warns that negating an unsigned value yields an unsigned value.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
ab8c5347f1 glsl: fix signed/unsigned comparision warnings on MSVC
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
78d3cfb5b4 glsl: remove incorrect 'struct' keyword
ir_variable is a class, not a struct.  Fixes an MSVC warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
e9dd5895dd glsl: add 'f' suffix to floats to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul
c3466315c0 glsl: change int->unsigned to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Vinson Lee
e87a57843c scons: Require libdrm_radeon 2.4.40.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-05 22:00:01 -08:00
Marek Olšák
428e37c2da r600g: add in-place DB decompression and texturing with DB tiling
The decompression is done in-place and only the compressed tiles are
decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F.

The texture unit is programmed to use non-displayable tiling and depth
ordering of samples, so that it can fetch the texture in the native DB format.

The latest version of the libdrm surface allocator is required for stencil
texturing to work. The old one didn't create the mipmap tree correctly.
We need a separate mipmap tree for stencil, because the stencil mipmap
offsets are not really depth offsets/4.

There are still some known bugs, but this should save some memory and it also
improves performance a little bit in Lightsmark (especially with low
resolutions; tested with Radeon HD 5000).

The DB->CB copy is still used for transfers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-11-06 02:54:16 +01:00
Marek Olšák
c80ceded6f configure.ac: require libdrm_radeon 2.4.40 2012-11-06 02:36:12 +01:00
Marek Olšák
acf438f537 vbo: fix glVertexAttribI* functions
The functions were broken, because they converted ints to floats.
Now we can finally advertise OpenGL 3.0. ;)

In this commit, the vbo module also tracks the type for each attrib
in addition to the size. It can be one of FLOAT, INT, UNSIGNED_INT.

The little ugliness is the vertex attribs are declared as floats even though
there may be integer values. The code just copies integer values into them
without any conversion.

This implementation passes the glVertexAttribI piglit test which I am going
to commit in piglit soon. The test covers vertex arrays, immediate mode and
display lists.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: cosmetic changes as suggested by Brian
2012-11-06 01:13:48 +01:00
Anuj Phogat
a196f43596 meta: Remove redundant code in _mesa_meta_GenerateMipmap
Integer textures generate invalid operation in glGenerateMipmap.
So, the code related to integer textures is now redundant.

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-05 10:17:48 -08:00
Anuj Phogat
c0a78d7d7b mesa: Generate invalid operation in glGenerateMipMap for integer textures
Khronos has reached a conclusion and disallowed following texture formats in
glGenerateMipMap():
 (a) ASTC textures
 (b) integer internal formats (e.g., RGBA8UI, RG16I)
 (c) textures with stencil formats (e.g., STENCIL_INDEX8)
 (d) textures with packed depth/stencil formats (e.g, DEPTH24_STENCIL8)

https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9471

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-05 10:17:48 -08:00
José Fonseca
3700bd1158 trace: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
2012-11-05 11:18:07 +00:00
José Fonseca
99c45c5aa4 galahad: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
2012-11-05 11:05:34 +00:00
José Fonseca
f1034e944b util: Make u_framebuffer.h C++ safe. 2012-11-05 10:39:42 +00:00
Eric Anholt
ccbfe3dde9 mesa: Use "non-gen name" more consistently as an error message in GL core.
I used this to help verify that my test was actually testing the paths I
wanted to.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:46 -08:00
Eric Anholt
4fce0230fc mesa: Fix core GL genned-name handling for glBeginQuery().
Fixes piglit gl-3.1/genned-names.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:36 -08:00
Eric Anholt
947d8ff4a7 mesa: Fix the core GL genned-name handling for glBindBufferBase()/Range().
This is part of fixing gl-3.1/genned-names.

v2: Fix a missing return value.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:03 -08:00
Vandrus Zoltán
5ac46da588 i965: Fix oversized initial allocation of the state cache table pointers.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55030
2012-11-04 12:24:13 -08:00
Eric Anholt
3a937daf3f i965: Force border color A to 1 when it's not present in the GL format.
It's usually forced to 1 by the surface format, but sometimes we actually have
alpha present because it's the only format available.

Fixes piglit texwrap bordercolor tests for OpenGL 1.1, GL_EXT_texture_sRGB and
GL_ARB_texture_float.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 12:23:59 -08:00
Eric Anholt
1e08d5452e i965: Fix uploading user vertex arrays with basevertex set.
If the index buffer is full of values like "0 1 2 3", but basevertex is 4, we
need to upload at least vertex data for elements 4 5 6 7.  Whether we also
upload 0 1 2 3 is a question of whether there are VBOs present or not -- see
the code setting start_vertex_bias in brw_draw_upload.c.

Fixes piglit draw-elements*base-vertex user_varrays

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
29a6307e12 i965: Set dirty state for brw_draw_upload.c when num_instances changes.
Otherwise, if we had a set of prims passed in with a num_instances varying
between them, we wouldn't upload enough (or too much!) from user vertex
arrays.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
13170321f6 i965: Remove the vbo_rebase_prims() path.
The brw_draw_upload.c start_vertex_bias code has support for doing the rebase
without rewriting the index buffer by applying a basevertex.  It looks like
vbo_rebase_prims() is not equipped to handle basevertex.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
9864a5b098 i965/fs: Fix a comment in copy propagation.
We haven't been only tracking raw GRF-GRF moves since the constant propagation
merge, and also the extension for source modifiers and uniforms.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
545b59b62a i965/fs: Allow copy-propagation on pull constant load values.
Given that we handle similarly-regioned GRFs registers for our copy
propagation from our UNIFORM file, there's no reason not to allow it.

The shader-db impact is negligible -- +90 instructions total, 2 shaders helped
and 7 hurt (slightly increased register pressure increased spilling), but this
is to prevent regression in other shaders when fixing copy_propagation to
reduce register pressure in the shaders that are hurt here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt
cf26b4569a i965/fs: Do dead code elimination just after copy propagation.
If we put the register coalescing in between the two, then we end up with code
sequences involving dead writes that the dead code elimination doesn't know
how to remove.  In place of making dead code elimination smart (which we
should do, too), make it less important for the moment.

shader-db results:

total instructions in shared programs: 722240 -> 721275 (-0.13%)
instructions in affected programs:     50573 -> 49608 (-1.91%)

(no shaders regressed).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Lucas Stach
d8988f048f nv50,nvc0: expose ARB_map_buffer_alignment
All HW buffers (also suballocated ones) are already aligned.
Just make sure that also the initial sysram buffers have proper
alignment.
2012-11-04 12:33:38 +01:00
Kenneth Graunke
05882b0d3b i965/fs: Compact the virtual GRF arrays.
During code generation, we create tons of temporary variables, many of
which get immediately killed and are never used.  Later optimization and
analysis passes, such as compute_live_intervals, loop over all the
virtual GRFs.  By compacting them, we can save a lot of overhead.

Reduces compilation time in L4D2's largest fragment shader from 10.2
seconds to 5.2 seconds (50%).  Drops compute_live_variables() from
10-12% of another game's startup time to 8%.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-03 20:28:57 -07:00
Jordan Justen
e3542ea51b dispatch_sanity test: add GL CORE 3.1 test
The function list was generated from glcorearb.h for GL 4.3.

Note that many GL 4.X functions are commented out, and indicate
that they need to be added to Mesa's XML.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
3b64f4b4fb dispatch_sanity test: create common context creation function
We also no longer call _swrast_CreateContext, _tnl_CreateContext
or _swsetup_CreateContext when creating the context.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
83b6a7cdaa dispatch_sanity test: allow newer functions to be set to NOP
If a GL function was introduced in a later GL version than the
context we are testing, then it is okay if it is set to the
_mesa_generic_nop function.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
7e64fe583f dispatch_sanity test: pass ctx to validate_functions/nops
This will allow validate_functions to access ctx->Version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
2ad1b13508 dispatch_sanity test: add version to function list
This will be used by GL CORE contexts to differentiate functions that
can be set to nop from functions that are required for a particular
context version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
4d62cb64a5 mesa: remove unimplemented FramebufferTextureFaceARB
This function can be re-added with an actual implementation
when ARB_geometry_shader4 is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
f625cb580a mesa: remove unimplemented FramebufferTextureARB
This function can be re-added with an actual implementation
when ARB_geometry_shader4 is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
f862be0d7c mesa: disable ProgramParameteri until it is needed
ProgramParameteri will be required for ARB_geometry_shader4
or GLES3. Don't enable this function until either of those
is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
31c03f2f8c glapi: alias ProgramParameteriARB to ProgramParameteri
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
1c3a64793a glapi: move include for ARB_get_program_binary.xml to gl_API.xml
These functions are part in GL 4.3. Moving this will allow
ProgramParameteriARB to alias ProgramParameteri.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen
dd6660038e glapi: alias FramebufferTextureARB to FramebufferTexture
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Jordan Justen
9e036966bb mesa shaderapi: don't enable various functions for GL CORE
These EXT_separate_shader_objects function will no longer be
enabled for CORE profiles:
* UseShaderProgramEXT
* ActiveProgramEXT
* CreateShaderProgramEXT

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Jordan Justen
5ae8c9c0ca mesa api_exec: disable StencilFuncSeparateATI for API_OPENGL_CORE
This was mistakenly enabled in a21116f.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Jordan Justen
86d5c28580 mesa api_exec: add comment regarding GetPointerv & CORE profiles
GetPointerv was de-deprecated in 893ddb.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Vincent Lejeune
84b4372132 r600g: make tgsi-to-llvm generates store.pixel* intrinsic for fs
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-02 23:19:11 +01:00
Vincent Lejeune
1feb6b79ab configure.ac: Prevent build of radeon llvm backend with llvm < 3.2
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-02 23:18:16 +01:00
Thierry Reding
c0def90ede android: Update for builtin_stubs.cpp move
This fixes the Android build after the move of builtin_stubs.cpp into
the builtin_compiler subdirectory. This patch is untested.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-02 10:37:03 -07:00
Michel Dänzer
c5c3d2f933 radeonsi: Implement support for vertex shader samplers.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-02 18:27:18 +01:00
Johannes Obermayr
ebf0a96250 glsl: Fix builtin_compiler build by -I $(top_srcdir)/include.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56664
2012-11-02 08:53:31 -07:00
José Fonseca
8ac4b82699 scons: Update for builtin_stubs.cpp
Note this by itself is not enough to fix scons build -- it will fail
until you remove:

   rm -rf build/*/glsl/builtin_compiler

because that node was a filei before, but it will be now a directory.

This also means that bisecting across this change will require wiping
the build directory..
2012-11-02 09:43:42 +00:00
Thierry Reding
9948a33653 build: Don't cross-compile GLSL builtin compiler
The builtin_compiler binary is used during the build process to generate
code for the builtin GLSL functions. Since this binary needs to be run
on the build host, it must not be cross-compiled.

This patch fixes the build system to compile a second version of the
source files and the builtin_compiler binary itself for the build
system. It does so by defining the CC_FOR_BUILD and CXX_FOR_BUILD
variables, which are searched for by the configure script and point to
the location of native C and C++ compilers.

In order for this to work properly, builtin_function.cpp is removed
from BUILT_SOURCES, otherwise the build system would try to generate it
before having had a chance to descend into the builtin_compiler
subdirectory. With the builtin_compiler and glsl_compiler now being
generated at different stages, the build instructions for glsl_compiler
can be simplified a bit.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 18:18:21 -07:00
Brian Paul
8d3fb1be6b libgl-xlib: include glheader.h instead of GL/gl.h to fix build
GL/gl.h doesn't define GLfixed but glapitable.h uses it.
2012-11-01 17:38:42 -06:00
Kenneth Graunke
df8a4001f5 i965: Remove unused variables after removing the old VS backend.
Fixes compiler warnings about unused variables.
2012-11-01 16:13:16 -07:00
Kenneth Graunke
60c008dde6 i965: Remove unnecessary walk through Mesa IR in ProgramStringNotify().
Variable indexing of non-uniform arrays only exists in GLSL.  Likewise,
OPCODE_CAL/OPCODE_RET only existed to try and support GLSL's function
calls.  We don't use Mesa IR for GLSL, and these features are explicitly
disallowed by ARB_vertex_program/ARB_fragment_program and never
generated by ffvertex_prog.c.

Since they'll never happen, there's no need to check for them, which
saves us from walking through all the Mesa IR instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:36 -07:00
Kenneth Graunke
109a97dbd2 i965: Remove VS constant buffer read support from brw_eu_emit.c.
brw_vec4_emit.cpp implements this directly; only the old backend used
the brw_eu_emit.c code.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:34 -07:00
Kenneth Graunke
31c1ea5ed4 i965: Update comment about clipper constants.
The old VS backend doesn't exist, but I believe these still need to be
delivered to the clipper thread.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:32 -07:00
Kenneth Graunke
b68e662e61 i965/vs: Remove brw_vs_compile::constant_map.
It was only used for the old backend.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:30 -07:00
Kenneth Graunke
ab973403e4 i965/vs: Remove support for the old parameter layout.
Only the old backend used it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:29 -07:00
Kenneth Graunke
4b2457b548 i965/vs: Delete the old vertex shader backend.
It's no longer used for anything.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:26 -07:00
Kenneth Graunke
66c8473e02 i965/vs: Replace brw_vs_emit.c with dumping code into the vec4_visitor.
Rather than having two separate backends, just create a small layer that
translates the subset of Mesa IR used for ARB_vertex_program and fixed
function programs to the Vec4 IR.  This allows us to use the same
optimization passes, code generator, register allocator as for GLSL.

v2: Incorporate Eric's review comments.
- Fix use of uninitialized src_swiz[] values in the SWIZZLE_ZERO/ONE
  case: just initialize it to 0 (.x) since the value doesn't matter
  (those channels get writemasked out anyway).
- Properly reswizzle source register's swizzles, rather than overwriting
  the swizzle.
- Port the old brw_vs_emit code for computing .x of the EXP2 opcode.
- Update comments, removing mention of NV_vertex_program, etc.
- Delete remaining #warning lines and debug comments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:23 -07:00
Kenneth Graunke
1f0093720d i965/vs: Refactor min/max handling to share code.
v2: Properly use "conditionalmod" pre-Gen6, rather than the incorrectly
copy-and-pasted "BRW_CONDITIONAL_G".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:21 -07:00
Kenneth Graunke
fd8655aa7a i965/vs: Add support for emitting DPH opcodes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:19 -07:00
Kenneth Graunke
6bc021bc78 i965/vs: Only do INTEL_DEBUG=perf when there's a GLSL shader.
This will become necessary once we start supporting ARB programs and
fixed function in this backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:12 -07:00
Paul Berry
a8ab7e335d dispatch: stop generating separate GLES1 API code.
This patch removes the generated files api_exec_es1.c,
api_exec_es1_dispatch.h, and api_exec_es1_remap_helper.h (and the
source files and build rules used to generate them), since they are no
longer used.  GLES1 now uses the same dispatch table layout as all the
other APIs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 11:26:30 -07:00
Paul Berry
8386088e3d dispatch: stop using _mesa_create_exec_table_es1() for GLES1.
This patch modifies context creation code for GLES1 to use
_mesa_create_exec_table() (which is used for all other APIs) instead
of the GLES1-specific _mesa_create_exec_table_es1().

There is a slight change in functionality.  As a result of a mistake
in the code generation of _mesa_create_exec_table_es1(), it does not
include glFlushMappedBufferRangeEXT or glMapBufferRangeEXT (this is
because when support for those two functions was added in commit
762d9ac, src/mesa/main/APIspec.xml wasn't updated).  With this patch,
glFlushMappedBufferRangeEXT and glMapBufferRangeEXT are properly
included in the dispatch table.  Accordingly, dispatch_sanity.cpp is
modified to expect these two functions to be present.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Leave GLES1.1 dispatch sanity test disabled when not building
GLES1 support.
2012-11-01 11:26:07 -07:00
Paul Berry
a21116f87e dispatch: GLES1 fixes for _mesa_create_exec_table().
Currently, _mesa_create_exec_table() (in api_exec.c) is used for all
APIs except GLES1.  In GLES1, _mesa_create_exec_table_es1() (a code
generated function) is used instead.

In principle, this shouldn't be necessary.  It should be possible for
api_exec.c to contain the logic for populating the dispatch table for
all API's.

This patch paves the way for using _mesa_create_exec_table() instead
of _mesa_create_exec_table_es1(), by making _mesa_create_exec_table()
(and the functions it calls) expose the correct subset of desktop GL
functions for GLES1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 11:25:27 -07:00
Paul Berry
5a1b40acf5 dispatch: Make a header to go along with querymatrix.c.
This patch creates a header querymatrix.h, to allow functions defined
in querymatrix.c to be used from other .c files.  It also switches
from the nonstandard GL_APIENTRY to GLAPIENTRY.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Don't declare _mesa_Get{Integer,Float}v in querymatrix.c.
Instead, just include main/get.h.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:25:14 -07:00
Paul Berry
b60244cfb9 dispatch: Add standard boilerplate and GL_APIENTRY to es1_conversion.h.
This patch adds the usual boilerplate (copyright notice and guards
against redundant inclusion) to es1_conversion.h.  It also moves the
definition of GL_APIENTRY from es1_conversion.c.

This allows es1_conversion.h to be safely included from other .c files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Use copyright notice from src/mesa/main/es_generator.py (the
script that used to generate this file).
2012-11-01 11:24:57 -07:00
Paul Berry
dd3218d73b dispatch: Include GLES1-only functions in dispatch table.
Previously dispatch table-related code was generated from gl_API.xml,
so it did not include slots for GLES1-only functions (such as those
taking fixed-point arguments).

This patch generates dispatch table-related code from
gl_and_es_API.xml, so that GLES1-only functions are included.  This
paves the way for future patches that will unify the GLES1 dispatch
table with the dispatch tables for the other APIs.

The following generated files are affected:
- glapi_x86.S
- glapi_x86-64.S
- glapi_sparc.S
- glprocs.h
- glapitemp.h
- glapitable.h
- glapi_gentable.c
- dispatch.h
- remap_helper.h

Since this change affects makefiles, a full rebuild is required.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Adjust dependencies to ensure that generated files will be rebuilt
whenever any ES-related XML source files are changed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:23:22 -07:00
Paul Berry
571d5c353a dispatch: properly handle parameter name mismatches in glapitemp.h.
Previously, when code-generating aliased functions in glapitemp.h, we
weren't consistent about which function alias we used to obtain the
parameter names, with the risk that we would generate incorrect code
like this:

  KEYWORD1 void KEYWORD2 NAME(Foo)(GLint x)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFoo(%d);\n", x));
  }
  KEYWORD1 void KEYWORD2 NAME(FooEXT)(GLint y)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFooEXT(%d);\n", x));
  }

At the moment there are no aliased functions with mismatched parameter
names, so this isn't the problem.  But when we introduce GLES1
functions into the dispatch table, there will be
(MapBufferRange/MapBufferRangeEXT).  This patch paves the way for that
by fixing the code generation script to handle the mismatch correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:49 -07:00
Paul Berry
33e0004720 dispatch: Include glheader.h in dispatch-related files.
This ensures that GLES1-only typedefs are available in these files.
In a future patch, this will allow us to expand the dispatch table to
include GLES1-only functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:24 -07:00
Paul Berry
47deaf6175 dispatch: Update check_table.cpp to reflect recent aliasing changes.
In commits bad96f6 and e7dd2e5 I added the following aliases:
- ClampColor -> ClampColorARB
- VertexAttribDivisor -> VertexAttribDivisorARB

But I neglected to update check_table.cpp, causing "make check" to
fail for non-shared-glapi builds.

This patch removes the functions that are now aliased from
check_table.cpp, so that "make check" works correctly again.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:09 -07:00
Eric Anholt
56f8ed4c35 i965/gen4: Fix assertion failures in depthstencil piglit tests.
Don't forget to set depth_mt even if !hiz_mt.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 09:22:09 -07:00
Kenneth Graunke
b57d2dfbf6 i965: Add "alpha to coverage" to performance debug recompile messages.
This was missing and got labeled "Something else".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-31 19:54:36 -07:00
Kenneth Graunke
369419e847 i965: Don't replicate data for zero-stride arrays when copying to VBOs.
When copy_array_to_vbo_array encountered an array with src_stride == 0
and dst_stride != 0, we would replicate out the single element to the
whole size (max - min + 1).  This is unnecessary: we can simply upload
one copy and set the buffer's stride to 0.

Decreases vertex upload overhead in an upcoming Steam for Linux title.
Prior to this patch, copy_array_to_vbo_array appeared very high in the
profile (Eric quoted 20%).  After the patch, it disappeared completely.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 19:54:36 -07:00
Kenneth Graunke
3d2b4291c2 i965: Don't bother trying to extend the current vertex buffers.
This essentially reverts the following:

  commit c625aa19cb
  Author: Chris Wilson <chris@chris-wilson.co.uk>
  Date:   Fri Feb 18 10:37:43 2011 +0000

      intel: extend current vertex buffers

While working on optimizing an upcoming Steam title, I broke this code.
Eric expressed his doubts about this optimization, and noted that the
original commit offered no performance data.

I ran before and after benchmarks on Xonotic and Citybench, and found
that this code made no difference.  So, remove it to reduce complexity
and make future work simpler.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-31 19:54:36 -07:00
Marek Olšák
1eedebc65b r600g: re-enable handling of DISCARD_RANGE, improving performance
It seems to work for me now. Even the graphics corruption is gone.

This also boosts performance in Reaction Quake.
2012-11-01 03:17:58 +01:00
Marek Olšák
fa58644855 r600g: fix abysmal performance in Reaction Quake
The problem was we set VRAM|GTT for relocations of STATIC resources.
Setting just VRAM increases the framerate 4 times on my machine.

I rewrote the switch statement and adjusted the domains for window
framebuffers too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-11-01 03:17:58 +01:00
Marek Olšák
4cf6acc3d0 gallium/u_vbuf: document how it works 2012-11-01 03:17:58 +01:00
Marek Olšák
46b0893fb9 gallium/u_vbuf: optimize looping over the list of buffers to upload 2012-11-01 03:17:58 +01:00
Marek Olšák
a97b053fdd gallium/u_vbuf: skip processing of buffers unused by the vertex element state 2012-11-01 03:17:58 +01:00
Brian Paul
fc2cf14038 swrast: remove explicit size from texfetch_funcs array
By removing the array size, the static assertion to check for missing
elements can do its job properly.  This will catch cases where a new
Mesa format is added but the swrast texfetch code isn't updated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 13:37:11 -06:00
José Fonseca
f69fc36127 llvmpipe: Obey back writemask.
Tested with a modified glean tstencil2 test.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 16:50:40 +00:00
Jerome Glisse
470952f751 r600g: avoid shader needing too many gpr to lockup the gpu v2
On r6xx/r7xx shader resource management need to make sure that the
shader does not goes over the gpr register limit. Each specific
asic has a maxmimum register that can be split btw shader stage.
For each stage the shader must not use more register than the
limit programmed.

v2: Print an error message when discarding draw. Don't add another
    boolean to context structure, but rather propagate the discard
    boolean through the call chain.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-10-31 10:49:15 -04:00
Marek Olšák
183e122bdf draw: fix assertion failure in draw_emit_vertex_attr
This is a regression since b3921e1f53.

The array stores VS outputs, not FS inputs.
Now llvmpipe can do 32 varyings too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 02:06:11 +01:00
Marek Olšák
91107a3522 r600g: use SQ_VTX_SEMANTIC_CLEAR to clear the semantic registers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-31 02:06:11 +01:00
Marek Olšák
d6600f9d39 mesa: remove NV_read_buffer extension enable flag
It's been enabled by default, so the flag isn't really useful.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 02:05:12 +01:00
Marek Olšák
b8380e54b8 mesa: remove SGIS_texture_lod extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:05:11 +01:00
Marek Olšák
01f0bedc2d mesa: remove NV_texgen_reflection extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
7857dbeb17 mesa: remove NV_light_max_exponent extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
cc07149276 mesa: remove IBM_rasterpos_clip extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
f5543d6eb2 mesa: remove IBM_multimode_draw_arrays extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
271b6aeccd mesa: remove APPLE_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
55bf57dbb4 mesa: don't always enable OES_standard_derivatives
For Intel, expose it only if gen >= 4.
For Gallium, expose it only if PIPE_CAP_SM3 is advertised.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák
b6f5c37ac3 mesa: move EXT_texture3D enabling to _mesa_init_extensions 2012-10-31 02:04:16 +01:00
Marek Olšák
2266b1df23 mesa: remove EXT_separate_specular_color extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:26 +01:00
Marek Olšák
39a0223a87 mesa: remove EXT_rescale_normal extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:23 +01:00
Marek Olšák
6f5fc612f3 mesa: remove EXT_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:21 +01:00
Marek Olšák
57b00c85b1 mesa: remove EXT_draw_range_elements extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:19 +01:00
Marek Olšák
cf9acc3833 mesa: remove EXT_compiled_vertex_array extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:17 +01:00
Marek Olšák
1301f91b31 mesa: remove ARB_window_pos extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:15 +01:00
Marek Olšák
d012e6d8fe mesa: remove ARB_transpose_matrix extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:12 +01:00
Marek Olšák
3bba7c5ab4 mesa: remove ARB_copy_buffer extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:57:25 +01:00
Marek Olšák
c9f2af3df7 gallium: expose ARB_map_buffer_alignment on Radeon
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: update relnotes-9.1
v3: use align_malloc and align_free for malloced buffers in r300g
v4: document the new CAP in the docs
2012-10-31 01:53:50 +01:00
Marek Olšák
f2f782d50f mesa: implement ARB_map_buffer_alignment
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:48:40 +01:00
Marek Olšák
0ebd0b78c6 st/mesa: don't use _NEW_PROGRAM where ST_NEW_xxx_PROGRAM is sufficient
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:44:58 +01:00
Marek Olšák
c0c26ddaef r600g: use better sample positions for 8x MSAA
Taken from the intel driver. The sample positions are actually a solution
to the 8 queens puzzle.  It gives more accurate and smoother AA.
2012-10-31 00:55:23 +01:00
Marek Olšák
e73bf3b805 gallium: add start_slot parameter to set_vertex_buffers
This allows updating only a subrange of buffer bindings.

set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that
range. Binding NULL resources unbinds buffers too (both buffer and user_buffer
must be NULL).

The meta ops are adapted to only save, change, and restore the single slot
they use. The cso_context can save and restore only one vertex buffer slot.
The clients can query which one it is using cso_get_aux_vertex_buffer_slot.
It's currently set to 0. (the Draw module breaks if it's set to non-zero)

It should decrease the CPU overhead when using a lot of meta ops, but
the drivers must be able to treat each vertex buffer slot as a separate
state (only r600g does so at the moment).

I can imagine this also being useful for optimizing some OpenGL use cases.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 00:55:13 +01:00
Marvin Schmidt
a7c5be098a st/xorg: Remove superfluous miInitializeBackingStore() call
It was defined as an empty function since Nov 2010 and was ultimately
removed completely.

See xserver commit 1cb0261

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-10-30 11:36:31 +01:00
Vinson Lee
0a66ced8f8 xlib: Do not undefine _R, _G, and _B.
Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-29 22:25:56 -07:00
Brian Paul
aab0ea9352 mesa: remove array size so the static assert can work
With the explit NUM_TEXTURE_TARGETS array size, the assertion that
Elements(targets) == NUM_TEXTURE_TARGETS would pass even if elements
were missing.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-29 17:56:05 -06:00
Brian Paul
1e46d810c8 mesa: use GLuint for more gl_constants fields
To silence assorted MSVC warnings.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul
ec5341800b vbo: silence MSVC double/float conversion warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul
f6c83e1661 mesa: silence some MSVC conversion warnings in get.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul
06bb81f01d mesa: silence MSVC signed/unsigned comparision warnings in hash_table.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
8e45e38512 mesa: silence MSVC signed/unsigned comparision warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
03503daa21 mesa: silence MSVC signed/unsigned comparision warnings in accum.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
db0136ae3e mesa: silence MSVC signed/unsigned comparison warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul
298d7a20e1 mesa: silence MSVC double/float assignment warnings in pixel unpack code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Vincent Lejeune
5ab82e0ccf r600g: tgsi-to-llvm emits right input intrinsics
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-30 00:28:42 +01:00
Tapani Pälli
e4e3b07181 intel: support for 16 bit config with 24 depth and 8 stencil
Patch adds additional singlesample config with 565 color buffer,
24 bit depth and 8 bit stencil buffer. This makes Quadrant benchmark
work on Android. Tested with Sandybridge and Ivybridge machines.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 11:58:47 -07:00
Ian Romanick
e8f2bec25e dri: Support MESA_FORMAT_SARGB8 in driCreateConfigs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:56 -07:00
Ian Romanick
749ac8b73a intel: If the visual is sRGB, use an sRGB internal format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:53 -07:00
Ian Romanick
1f6e10f67b dri: Convert driCreateConfigs to use a gl_format enum
This is instead of the pair of GLenums for format and type that were
previously used.  This is necessary for the Intel drivers to expose sRGB
framebuffer formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 09:55:42 -07:00
Ian Romanick
43d6fe156b dri_util: Elminiate the bytes_per_pixel table
With fewer formats to support, it's kind of useless.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:38 -07:00
Ian Romanick
bda208a4d4 dri_util: Remove support for RGB332 framebuffers
None of the remaining DRI drivers in Mesa use this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:32 -07:00
Ian Romanick
0398a26097 swrast: Remove the 2_3_3_REV framebuffer format
There is no gl_format in Mesa that corresponds to this arrangement, so I
have a very hard time believing that this works.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:27 -07:00
Ian Romanick
386282b5c2 glx: Add the extension string for GLX_ARB_framebuffer_sRGB
From the GLX perspective, the ARB and EXT extensions are identical.  Use
a single bit for both.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:23 -07:00
Ian Romanick
7b0f912e70 glx: Set sRGBCapable to a default value
Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1).  Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:15 -07:00
Bryan Cain
170f0459a2 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-29 15:49:00 +01:00
Marek Olšák
96ed6c90ef r600g: implement texturing with 8x MSAA compressed surfaces for Evergreen
The 2x and 4x MSAA cases are completely broken. The lfdptr instruction returns
garbage there.

The 8x MSAA case is broken on Cayman, though at least the result looks somewhat
correct.

Only the 8x MSAA case works on Evergreen and is enabled.
2012-10-29 12:51:41 +01:00
Marek Olšák
b3921e1f53 mesa: bump MAX_VARYING to 32
We're starting to get apps utilizing more than 16 varyings and
most current hardware supports 32 anyway.

Tested with r600g.
swrast, softpipe and llvmpipe still advertise 16 varyings.

This fixes a WebGL crash after launching this demo:
https://developer.mozilla.org/en-US/demos/detail/falling-cubes

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54402

NOTE: This is a candidate for the stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 12:51:41 +01:00
Andreas Boll
00e6819e99 Revert "glsl_to_tgsi: set correct register type for array and structure elements"
This reverts commit ebd8df7a31.

accidentally pushed.
2012-10-29 12:21:07 +01:00
Vinson Lee
d37ae64203 scons: Add -fno-rtti to CXXFLAGS with llvm-3.2.
llvm-3.2svn r166772 no longer requires RTTI for lib/Support.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-10-28 11:31:25 -07:00
Christoph Bumiller
9ae7d8bb79 nv50/ir: restore use of long immediate encodings
NOTE: This is a candidate for the 9.0 branch.
2012-10-28 14:57:20 +01:00
Christoph Bumiller
351d3c59f2 nv50,nvc0: fix 2d engine stencil-only copies 2012-10-28 14:25:56 +01:00
Alexander V. Nikolaev
eaa8e56108 gallium/gallivm: code generation options for LLVM 3.1+
LLVM 3.1+ haven't more "extern unsigned llvm::StackAlignmentOverride"
and friends for configuring code generation options, like stack
alignment.

So I restrict assiging of lvm::StackAlignmentOverride and other
variables to LLVM 3.0 only, and wrote similiar code using
TargetOptions.

This patch fix segfaulting of WINE using llvmpipe built with LLVM 3.1

Signed-off-by: Alexander V. Nikolaev <avn@daemon.hole.ru>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-10-28 10:34:26 +00:00
Eric Anholt
459b28aba7 i965: Merge brw_prepare_query_begin() and brw_emit_query_begin().
This is a leftover from when we had to split those two functions due to
the separate BO validation step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:54 -07:00
Eric Anholt
99dc870613 i965: Rename misleading "active" field of brw->query.
"Active" is an already-used term for the query being between
glBeginQuery() and glEndQuery(), while this is tracking whether the
start of the packet pair for emitting state has been inserted into the
current batchbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:01 -07:00
Marek Olšák
b78b62497f r600g: advertise 32 streamout vec4 outputs
to match the varying limit.
2012-10-26 19:01:16 +02:00
Brian Paul
80bc3206aa softpipe: remove extraneous whitespace 2012-10-26 10:59:29 -06:00
Brian Paul
369b5a311c gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Use the PRIx64 and PRIu64 format macros from inttypes.h.  We made a
similar change in prog_print.c in df2d81ea59.
2012-10-26 10:59:29 -06:00
Marek Olšák
8b63512be0 r600g: advertise 32 fragment shaders inputs, not 34 2012-10-26 18:01:14 +02:00
José Fonseca
8eb2b331ef graw/fs-test: Use user constant buffers.
Much simpler. More interesting.
2012-10-26 16:02:59 +01:00
José Fonseca
ce10624e9e trace: Flush before drawing. 2012-10-26 16:02:59 +01:00
José Fonseca
91332e455a graw: Ensure new members are zeroed.
Several new state members were added, and they were not being zeroed,
causing random crashes.
2012-10-26 16:02:59 +01:00
José Fonseca
2532f0d063 tests/graw: Update occlusion query example. 2012-10-26 16:02:58 +01:00
Michel Dänzer
97078b198d radeonsi: Handle TGSI_SEMANTIC_FACE.
Fixes two piglit tests using gl_FrontFacing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:18 +02:00
Michel Dänzer
691f08dbea radeonsi: Handle TGSI_SEMANTIC_BCOLOR.
Put the back face colour right after the front face colour in the LDS parameter
space.

Fixes 18 piglit tests related to two sided lighting.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer
44ef033c25 radeonsi: Don't snoop context state while building shaders.
Let's use the shader key describing the state.

Ported from r600g commit b652180107.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer
f3257d80b0 radeon/llvm: Add intrinsic for reading SI FRONT_FACE VGPR in the pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Alex Deucher
bd274eb8f4 r600g: split cayman common state out into a shared function
And use it for compute.  This should improve compute support
on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:32 -04:00
Alex Deucher
67c875117c r600g: emit some additional regs on cayman
These are common to both evergreen and cayman, but were
not emitted on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:06 -04:00
Alex Deucher
d781f0c73c r600g: there are 16 const buffer size regs for each shader stage
we were previously only setting 8 of them.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:55 -04:00
Alex Deucher
20d268b350 r600g: rework evergreen_init_common_regs()
Move gfx specific bits out as the code is shared with
compute.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:40 -04:00
Alex Deucher
480e146305 r600g/compute: always CONTEXT_CONTROL packet at start of CS
It's required.  The CP uses this to properly allocate new
contexts.  Also do a CS partial flush since we are updating
CONFIG regs which are single state.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:33 -04:00
José Fonseca
4a93414985 tools/trace: More helpful message when no args are provided. 2012-10-26 10:50:48 +01:00
José Fonseca
54536686b2 scons: Build xlib swrast too.
Helpful for debugging.
2012-10-26 10:50:48 +01:00
Christian König
59d4bc8c48 vl: fix the dri winsys helper screen init
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-26 09:53:04 +02:00
Vinson Lee
8cb2a4a7f5 tests: Use printf instead of debug_printf in u_format_compatible_test.
Use printf instead of debug_printf to be consistent with print
statements in rest of unit tests.

This also fixes the lack of print output with the MinGW build of
u_format_compatible_test.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-25 23:09:59 -07:00
Marek Olšák
8fb4b1dce1 r300g: fix texture border color for sRGB formats
NOTE: This is a candidate for the stable branches.
2012-10-26 01:27:05 +02:00
Kenneth Graunke
b45a68eebf glsl: Allow ir_if in the linker's move_non_declarations function.
Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements.  For example,

   float foo = some_boolean ? 0.0 : 1.0;

becomes:

   (declare (temporary) float conditional_tmp)
   (if (var_ref some_boolean)
       ((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
       ((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations.  As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine.  So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:53:39 -07:00
Kenneth Graunke
03ea156f1b i965/vs: Preserve the type when copy propagating into an instruction.
Consider the following code, which reinterprets a register as a
different type:

mov(8)          g6<1>F          g1.4<0,4,1>.xF
and(8)          g5<1>.xUD       g6<4,4,1>.xUD   0x7fffffffUD

Copy propagation would notice that we can replace the use of g6 with
g1.4 and eliminate the MOV.  Unfortunately, it failed to preserve the UD
type, incorrectly generating:

and(8)          g5<1>.xUD       g6<4,4,1>.xF    0x7fffffffUD

Found while debugging Ian's uncommitted ARB_vertex_program LOG opcode
test with my new Mesa IR -> Vec4 IR translator.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke
10ff6772c8 i965/vs: Don't lose the MRF writemask when doing compute-to-MRF.
Consider the following code sequence:

   mul(8)          g4<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mov.sat(8)      m1<1>.xyF       g4<4,4,1>F
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

The compute-to-MRF pass will discover the first mov.sat and attempt to
replace it by rewriting earlier instructions.  Everything works out,
so it replaces scan_inst's destination file, reg, and reg_offset,
resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          g4<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
   mov.sat(8)      m1<1>.zwF       g4<4,4,1>F

Unfortunately, it loses the .xy writemask on the mov.sat's MRF
destination.  While this doesn't pose an immediate problem, it then
proceeds to transform the second mov.sat, resulting in:

   mul(8)          m1<1>F          g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
   mul(8)          m1<1>F          g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF

Instead of writing both halves of the vector (like the original code),
it overwrites the full vector both times, clobbering the desired .xy
values.

When encountering a MOV, the compute-to-MRF code scans for instructions
which generate channels of the MOV source.  It ensures that all
necessary channels are available (possibly written by several
instructions).  In this case, *more* channels are available than
necessary, so we want to take the subset that's actually used.
Taking the bitwise and of both writemasks should accomplish that.

This was discovered by analyzing an ARB_vertex_program test
(glean/vertProg1/MUL test (with swizzle and masking)) with my new
Mesa IR -> Vec4 IR translator code.  However, it should be possible
with GLSL programs as well.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:54 -07:00
Kenneth Graunke
9142ade154 glcpp: Don't use infinite lookhead for #define differentiation.
Previously, we used lookahead patterns to differentiate:

   #define FOO(x)  function macro
   #define FOO (x) object macro

Unfortunately, our rule for function macros:

   {HASH}define{HSPACE}+/{IDENTIFIER}"("

relies on infinite lookahead, and apparently triggers a Flex bug where
the generated code overflows a state buffer (see YY_STATE_BUF_SIZE).

There's no need to use infinite lookahead.  We can simply change state,
match the identifier, and use a single character lookahead for the '('.
This apparently makes Flex not generate the giant state array, which
avoids the buffer overflow, and should be more efficient anyway.

Fixes piglit test 17000-consecutive-chars-identifier.frag.

NOTE: This is a candidate for every release branch ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
2012-10-25 14:52:53 -07:00
Kenneth Graunke
eeb2fb72eb i965/vs: Fix debug dumping of VS push constants.
While copying the values into the batch space, we advance the param
pointer.  The debug code then tries to iterate over all the uploaded
values, starting at param...which is now the end of the uploaded data,
rather than the start.

This patch saves a pointer to the start of push constant space before
it gets altered and switches the debug code to use that.

Tested by uncommenting the code and examining the output of
glsl-vs-clamp-1.shader_test.  Previously all values appeared to be zero.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-25 14:52:53 -07:00
Matt Turner
df924d82e2 mesa/tests: Add ES3.0 dispatch table sanity test
Since ES3.0 is backward compatible with 2.0, we check that all the 2.0
functions and additional 3.0 functions exist.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Matt Turner
355f507f2a Split dispatch sanity's validate_function test into two
Will be useful for the next patch, adding GLES 3 testing.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-25 14:29:05 -07:00
Paul Berry
1cf6360f89 dispatch_sanity: print names of functions that shouldnt be in dispatch table.
Previously we just printed the dispatch table index and the user had
to convert it to a function name.  That was a pain because when
FEATURE_remap_table is defined, the assignment of functions to
dispatch table entries is done at run time.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Paul Berry
03984b26c4 shared-glapi: implement _glapi_get_proc_name().
Previously this function was only implemented for non-shared-glapi
builds.  Since the function is only intended for debugging purposes we
use a simple O(n) algorithm.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-25 14:23:01 -07:00
Matt Turner
67f1e7bf5f src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS
When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
are not used. AM_CPPFLAGS should be used for includes anyway.

Fixes a build problem since 41b14d125:

CC       ralloc_test-ralloc.o
In file included from ../../../src/glsl/ralloc.c:42:0:
../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-10-25 13:31:24 -07:00
Matt Turner
d654afd892 egl: Import eglext.h revision 19332
The version number (14) wasn't updated.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-25 10:49:09 -07:00
Matt Turner
41b14d1251 ralloc: Annotate printf functions with PRINTFLIKE(...)
Catches problems such as (in the gles3 branch)

glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
	'long long int', but argument 4 has type 'int' [-Wformat]

As a side-effect, remove ralloc.c's likely/unlikely macros and just use
the ones from main/compiler.h.

NOTE: This is a candidate for the release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-25 10:47:43 -07:00
Matt Turner
ec57fbbc72 build: Ship install-sh in the tarball
Fixes the problem where configure from the tarball would report missing
files:

$ ./configure
configure: error: cannot find install-sh, install.sh, or shtool in bin

NOTE: This is a candidate for the 9.0 branch.
2012-10-25 10:47:43 -07:00
José Fonseca
0cb0c38cce mesa/st: Don't use 4bits for GL_UNSIGNED_BYTE_3_3_2(_REV)
4bits and 3bits quantitization values differ significantly for
values other than 0 and 1.

Fixes piglit draw-pixels for softpipe/llvmpipe.

NOTE: Probably a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-25 17:57:57 +01:00
José Fonseca
4efcdd1e7a trace: Fix dumping of set_constant_buffer method. 2012-10-25 15:30:19 +01:00
Andreas Boll
86cd77d0a9 docs: add another fixed bug to mesa 8.0.5 release notes
Reported-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 23:59:51 +02:00
Andreas Boll
2574d10398 docs: Add 8.0.5 release notes
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 23:51:09 +02:00
Bryan Cain
ebd8df7a31 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.
2012-10-24 23:51:08 +02:00
Vincent Lejeune
0f35702d79 r600g: force bank_swizzle if already set
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:37:02 +02:00
Vincent Lejeune
d1eaa9ea70 r600g: rewrite tgsi-to-llvm load-input to handle fragcoord
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-24 23:31:41 +02:00
Christoph Bumiller
d310e29302 nv50/ir/tgsi: fix srcMask for TXP with SHADOW1D 2012-10-24 20:47:38 +02:00
Ian Romanick
be1c5f4498 mesa: Use MIN instead of CLAMP for unsigned source data
This silences a zillion GCC warnings like:

../../../src/mesa/main/pack.c: In function '_mesa_pack_rgba_span_from_uints':
../../../src/mesa/main/pack.c:560:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 11:03:16 -07:00
Michel Dänzer
eee1ff423c st/mesa: Fix assertions for copying texture image to finalized miptree.
The layer dimension of array textures is not subject to mipmap minification.
OTOH we were missing an assertion for the depth dimension.

Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
For some reason, they only resulted in piglit 'warn' results for me, not
failures.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56211

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-24 17:54:25 +02:00
Andreas Boll
ecb02c27fc gallium/docs: fix sphinx warning
src/gallium/docs/source/context.rst:495: WARNING:
malformed hyperlink target.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-24 14:14:03 +02:00
Vinson Lee
016897cc66 scons: Do not use -fvisibilty=hidden on Cygwin.
This is a follow-up to commit db78643182.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-23 23:22:45 -07:00
Andreas Boll
3e3ff4cd73 mesa: fix indentation in get-pick-list.sh script
NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Andreas Boll
135ec3a1db mesa: grep for commits with cherry picked in commit message only once
and save them temporary in already_picked

NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Andreas Boll
b2991526ed mesa: optimize get-pick-list.sh script
cuts down the while loop iterations from 4600 to 380 commits at the
moment

NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Andreas Boll
fa27a0db43 mesa: simplify get-pick-list.sh script
and add a description for the script

NOTE: This is a candidate for the stable branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 19:26:56 +02:00
Ian Romanick
2d95db660e mesa: add get-pick-list.sh script into bin/
NOTE: This is a candidate for the stable branches.
2012-10-23 19:26:56 +02:00
Paul Berry
2e0de80751 _mesa_create_exec_table: GLES3 fixes.
This patch sets up the dispatch table for the following GLES3
functions when a GLES3 context is in use:

- BeginQuery
- BeginTransformFeedback
- BindSampler
- BindTransformFeedback
- BlitFramebuffer
- ClearBufferfi
- ClearBufferfv
- ClearBufferiv
- ClearBufferuiv
- ClientWaitSync
- CopyBufferSubData
- DeleteQueries
- DeleteSamplers
- DeleteSync
- DeleteTransformFeedbacks
- EndQuery
- EndTransformFeedback
- FenceSync
- FramebufferTextureLayer
- GenQueries
- GenSamplers
- GenTransformFeedbacks
- GetInteger64v
- GetQueryObjectuiv
- GetQueryiv
- GetSamplerParameterfv
- GetSamplerParameteriv
- GetStringi
- GetSynciv
- GetTransformFeedbackVarying
- GetVertexAttribIiv
- GetVertexAttribIuiv
- IsQuery
- IsSampler
- IsSync
- IsTransformFeedback
- PauseTransformFeedback
- RenderbufferStorageMultisample
- ResumeTransformFeedback
- SamplerParameterf
- SamplerParameterfv
- SamplerParameteri
- SamplerParameteriv
- TransformFeedbackVaryings
- VertexAttribDivisor
- VertexAttribIPointer
- WaitSync

And it avoids setting up the dispatch table for these non-GLES3
functions:

- ColorMaski
- GetBooleani_v
- Enablei
- Disablei
- IsEnabledi
- ClearColorIiEXT
- ClearColorIuiEXT
- TextureStorage2DEXT
- TextureStorage3DEXT
- GetActiveUniformName
- GetnUniformdv
- GetnUniformfv
- GetnUniformiv
- GetnUniformuiv

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: Make the ctx argument to _mesa_init_transform_feedback_dispatch()
a const pointer.  Add a comment to remind us to add
GetBufferParameteri64v once tests exist for it.  Also add
VertexAttribDivisor for GLES3, and remove GetActiveUniformName and
GetnUniform{dv,fv,iv,uiv} for GLES3.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:40 -07:00
Paul Berry
5863e3d16e _mesa_create_exec_table(): deprecate ProgramStringARB.
This function is only useful for the ARB_{vertex,fragment}_program
extensions, which we don't expose in core contexts.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:40 -07:00
Paul Berry
893ddb068f _mesa_create_exec_table: de-deprecate GetPointerv.
glGetPointerv was de-deprecated in GL 4.3, because GL 4.3 adds
functionality from KHR_debug and ARB_debug_output, which require
glGetPointerv.

This patch modifies _mesa_create_exec_table() to populate
glGetPointerv in the dispatch table for core contexts.

Technically this is not in compliance with the spec--what we really
ought to do for core contexts is expose glGetPointerv only when a GL
4.3 context is in use or one of the two extensions is present.
However, it seems silly to go to that extra work, since the only
client-visible effect would be for glGetPointerv to raise an
INVALID_OPERATION error instead of an INVALID_ENUM error.  Besides,
the other functions set up by _mesa_create_exec_table() only depend on
the API in use, not on the GL version or extensions supported.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry
e7dd2e5213 glapi: Alias VertexAttribDivisor and VertexAttribDivisorARB.
There's no reason to have separate slots in the dispatch table for
these two functions, since they are synonymous.

Note: previous to this patch, we never populated the dispatch table
slot for VertexAttribDivisor, which was ok, since it is not required
until 3.3.  After this patch, both functions will be usable provided
that the ARB_instanced_arrays extension is present.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry
bad96f6ada glapi: Alias ClampColor and ClampColorARB.
There's no reason to have separate slots in the dispatch table for
these two functions, since they are synonymous.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Paul Berry
992ed68ed6 main: Fix warning ('struct gl_context' declared inside parameter list).
This eliminates a warning in GCC 4.7.1.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-23 10:24:39 -07:00
Eric Anholt
ab7188e199 mesa: Return 0 for GL_CURRENT_QUERY with a mismatched query target.
With the previous two commits, this fixes piglit
GL_ARB_occlusion_query2/api.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:53 -07:00
Eric Anholt
8f1131fcc0 mesa: Refuse to EndQuery with a mismatched query target.
v2: Add a comment about what we're checking for.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:53 -07:00
Eric Anholt
ce086ebd89 mesa: Throw an error for a new query on an already-active query target.
There's a similar test below, but it's not the same: that one checks whether
this query object is already active (potentially on another target).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-22 17:36:52 -07:00
Eric Anholt
e755c1a36b i965: Actually add support for GL_ANY_SAMPLES_PASSED from GL_ARB_oq2.
v2: Fix mangled sentence in the comment, and make the loop exit early.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
2012-10-22 17:35:59 -07:00
Brian Paul
11070105f0 st/mesa: free TGSI tokens with ureg_free_tokens()
since they're allocated by ureg_get_tokens().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
2012-10-22 15:49:31 -06:00
Brian Paul
bb93439873 st/mesa: replace REALLOC() with realloc()
We should use the later since we're freeing the memory with free(),
not the gallium FREE() macro.

This fixes a mismatch when using the gallium debug memory functions.

NOTE: This is a candidate for the 9.0 branch.
2012-10-22 15:49:31 -06:00
Brian Paul
140f1d9207 docs: GL_ARB_texture_storage is supported for all gallium drivers 2012-10-22 15:49:31 -06:00
Matt Turner
9a51edfb5a Re-add HAVE_PTHREADS preprocessor macro
Broken in commit 814345f54b.

NOTE: This is a candidate for the 9.0 branch.
2012-10-22 10:52:47 -07:00
Kristian Høgsberg
259fc154f1 gbm: Use the kms dumb ioctls for cursor instead of libkms
We need to create bos suitable for cursor usage that we can map and
write data into.  The kms dumb ioctls is all we need for this, so drop
the dependency on libkms.
2012-10-21 13:00:49 -04:00
Tom Stellard
d2b0338e33 r600g: Remove special handling of PRED_SET* insructions for LLVM 3.2
The 3.2 version of the backend now sets all the correct fields for
PRED_SET* instructions.
2012-10-19 21:25:01 +00:00
Tom Stellard
8030cb0ed4 radeon/llvm: Sort tgsi opcode action initialization
This was done in order to identify and remove duplicate entries.
2012-10-19 21:25:01 +00:00
Tom Stellard
bd8af8a3dc radeon/llvm: Fix lowering TGSI_OPCODE_SSG 2012-10-19 21:25:00 +00:00
Eric Anholt
cae077cd0f i965: Stop flushing the batch on timestamp queries, too.
Given the usecase we have of trying to measure timestamps across individual
draw calls, flushing will totally mess up what people are trying to measure.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-19 11:47:01 -07:00
Eric Anholt
1973845fbd i965: Don't flush the batch immediately on EndQuery.
The theory I had when I wrote the code was that you wanted to minimize latency
on your queries because the app was going to ask soon.  Only, it turns out
that everybody batches up their queries and asks for the results later (often
after the next SwapBuffers!), so this was a pessimization.

Until now, I had no workload where it mattered enough to benchmark.  Recently
I started playing some Minecraft, which uses tons of queries to decide whether
to render chunks of the terrain.  For that app, avoiding the flush in the
query-generation loop improves performance 22.7% +/- 4.7% (n=3) on an apitrace
capture of it (confirmed in game by watching the fps meter found by pressing
F3, 15/16 -> 20/21 fps).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-19 11:47:01 -07:00
Eric Anholt
804469c58d i965/fs: Fix typo in refactor of brw_fs_reg_allocate.cpp.
I'm amazed that my usual warnings check didn't catch this, and that this
passed piglit.
2012-10-19 11:47:01 -07:00
Tapani Pälli
f593acd577 i965/vs: include format argument in debug printf
otherwise some compilers will throw error
"error: format not a string literal and no format arguments"

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-19 10:00:19 -07:00
Michel Dänzer
c2e37b1d2e st/mesa: Fix source miptree level for copying data to finalized miptree.
Fixes WebGL texture mips conformance test, no piglit regressions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44912

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-19 16:01:14 +02:00
Francisco Jerez
26fc30ef83 clover: No need for clover::is_zero() to be a functor.
Simplify is_zero() somewhat, and as a side effect work around a gcc compiler
bug that causes build failure.

https://bugs.freedesktop.org/show_bug.cgi?id=56140

Reported-by: Dmitry Cherkassov <dcherkassov@gmail.com>
2012-10-19 12:38:44 +02:00
Brian Paul
6551c4ea3c st/mesa: improve the guess_and_alloc_texture() heuristic
If GL_BASE_LEVEL==0 and GL_MAX_LEVEL==0 that's a pretty good hint that
there'll be a single mipmap level in the texture.

Google Earth sets the texture's state this way before the first glTexImage
call.  This saves a bit of texture memory.
2012-10-18 18:00:50 -06:00
Marek Olšák
e5a9bf5523 gallium: remove unused data pointer from pipe_transfer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-18 22:54:53 +02:00
Chad Versace
0da72d3502 intel: Skip texsubimage fastpath for more pixel unpack state (v2)
Fixes piglit tests "unpack-teximage2d --pbo=* --format=GL_BGRA" on
Sandybridge+.

The fastpath was checking an incomplete set of pixel unpack state. This
patch adds checks for all the fields of gl_pixelstore_attrib that affect
2D texture uploads.  Also, it begins permitting the case where
GL_UNPACK_ROW_LENGTH is 0.

Ideally, we would just ask a unicorn to JIT this fastpath for us in
a way that safely handles the unpacking state. Until then, it's safer if
only a small set of situations activate the fastpath.

v2: Use _mesa_is_bufferobj(), per Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-18 08:53:59 -07:00
Matt Turner
6c28174969 Finish _HAVE_FULL_GL removal
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 19:30:34 -07:00
Dmitry Cherkasov
b21455f27d configure.ac: Fix LLVM 3.2 r600/radeonsi error message
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Dmitry Cherkasov <Dmitrii.Cherkasov@amd.com>
2012-10-17 17:43:35 -04:00
Brian Paul
0d1ee26489 svga: add svga_screen_cache_dump() debug helper 2012-10-17 15:30:33 -06:00
Kristian Høgsberg
e20a0f14b5 wayland: Drop support for ill-defined, unused wl_egl_pixmap
It doesn't provide the cross-process buffer sharing that a window system
pixmap could otherwise support and we don't have anything left that uses
this type of surface.
2012-10-17 16:32:13 -04:00
Kristian Høgsberg
2b8e90a338 wayland: Remove 0.85 compatibility #ifdefs 2012-10-17 16:32:13 -04:00
Kristian Høgsberg
0229e3ae41 egl/wayland: Update to Wayland 0.99 API
The 0.99.0 Wayland release changes the event API to provide a thread-safe
mechanism for receiving events specific to a subsystem (such as EGL) and
we need to use it in the EGL platform.

The Wayland protocol now also requires a commit request to make changes
take effect, issue that from eglSwapBuffers.
2012-10-17 16:32:13 -04:00
Eric Anholt
be4c0a243e i965/fs: Statically allocate the reg_sets at context initialization.
Now that we've replaced all the variable settings other than reg_width, it's
easy to hang on to this (the expensive part of setting up the allocator).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:02:16 -07:00
Eric Anholt
8757fa65b8 i965/fs: Allocate registers in the unused parts of the gen7 MRF hack range.
This should also reduce register pressure on gen7+, like the previous commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:02:06 -07:00
Eric Anholt
a087e9f27f i965/fs: Reduce the interference between payload regs and virtual GRFs.
Improves performance of the Lightsmark penumbra shadows scene by 15.7% +/-
1.0% (n=15), by eliminating register spilling. (tested by smashing the list of
scenes to have all other scenes have 0 duration -- includes additional
rendering of scene description text that normally doesn't appear in that
scene)

v2: Allow allocation of all but g0/g1 of the payload.
v3: Pull count_to_loop_end() out to a helper function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2, recommended v3)
2012-10-17 13:01:57 -07:00
Eric Anholt
551e1cd44f i965/fs: Expose the payload registers to the register allocator.
For now, nothing else can get allocated over them, but that will change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:54 -07:00
Eric Anholt
6c69df1e0f i965/fs: Remove extra allocation for classes[].
This was to slot in the magic aligned pairs class, but it got moved to a
descriptive name later.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:51 -07:00
Eric Anholt
5d90b98879 i965/fs: Make the register allocation class_sizes[] choice static.
Based on split_virtual_grfs(), we choose the same set every time, so set it in
stone.  This will help us avoid regenerating the somewhat expensive
class/register set setup every compile.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 13:01:37 -07:00
Eric Anholt
20ebebac51 i965/vs: Improve live interval calculation.
This is derived from the FS visitor code for the same, but tracks each channel
separately (otherwise, some typical fill-a-channel-at-a-time patterns would
produce excessive live intervals across loops and cause spilling).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48375
          (crash -> failure, can turn into pass by forcing unrolling still)
2012-10-17 12:24:01 -07:00
Eric Anholt
e1a518e2b1 i965/vs: Fix the mlen of scratch read/write messages.
These messages always have m0 = g0 and m1 = offset, and write has m2 = data.
Avoids regression in opt_compute_to_mrf() with a change to scratch writes to
set up the data as an MRF write in the IR.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
c226b7a4d3 i965: Make the cfg reusable from the VS.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
54679fcbca i965: Share the predicate field between FS and VS.
Note that BRW_PREDICATE_NONE is 0 and BRW_PREDICATE_NORMAL is 1, so that's a
lot like the true/false we had in the FS before.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
7abfb67dc4 i965: Rename fs_cfg types to not mention fs.
fs_bblock_link -> bblock_link
fs_bblock -> bblock_t (to avoid conflicting with all the fs_bblock *bblock)
fs_cfg -> cfg_t (to avoid conflicting with all the fs_cfg *cfg)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
5ed57d9543 i965: Move brw_fs_cfg.* to brw_cfg.*.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
24aeeb2fdc i965: Make the FS and VS share a few visitor/instruction fields.
This will let us reuse brw_fs_cfg.cpp from brw_vec4_*.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
338fd85e62 i965/vs: Trim the swizzle of the scratch write temporary.
This fixes confusion by the upcoming live variable analysis which saw e.g. use
of temp.w when only temp.xyz were initialized in the basic block, and
concluded that temp.w must have come from outside of the block (even though it
was never initialized anywhere).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:24:00 -07:00
Eric Anholt
af911b2819 i965/vs: Do the temporary allocation in emit_scratch_write().
Both callers were doing basically the same thing, just written differently.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Eric Anholt
9499f7984e i965/vs: Simplify emit_scratch_write() prototype.
Both callers used (effectively) inst->dst as the argument, so just reference
it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Eric Anholt
914d8f9f84 i965/vs: Add a little bit of IR-level debug ability.
This is super basic, but it let me visualize a problem I had with
opt_compute_to_mrf().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-17 12:23:59 -07:00
Adam Jackson
a30d14635d glx: Add GLXBadProfileARB to the error string list
Note: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-10-17 15:12:14 -04:00
Owen W. Taylor
1d0c621121 glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()
Due to a string mismatch, INTEL_swap_event wasn't listed among GLX
extensions for the connection, even when present on both client and
server. That is, glXQueryServerString and glXGetClientString reported the
extension, but glXQueryExtensionsString did not.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56057
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-17 10:16:23 -07:00
José Fonseca
aa2067c757 gallivm: Hide AVX support when requested by LP_NATIVE_VECTOR_WIDTH or unsupported by LLVM.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-10-17 18:07:43 +01:00
Will Schmidt
54821c0e99 gallivm: Use mcjit for ppc_64 architecture
Per commentary and direction in the LLVM community, support for ppc64 is
going into MCJIT rather than the old JIT.  There is no existing support
in prior llvm versions, so no need to specify LLVM version numbers.

Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-10-17 18:07:43 +01:00
Brian Paul
32638737c5 st/mesa: silence MSVC signed/unsigned comparison warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
ead664e506 st/mesa: silence MSVC double/unsigned assignment warning
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
198d1bdb5f tgsi: silence MSVC signed/unsigned comparison warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
34a5fd2a39 util: fix MSVC signed/unsigned comparison warning in u_upload_mgr.c code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
ba7bfdeff2 util: fix MSVC signed/unsigned comparison warning in u_vbuf.c code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
a0785544e3 util: fix MSVC double/float conversion warning in u_format_r11g11b10f.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
f031910486 draw: silence MSVC signed/unsigned comparison warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
a115a29153 util/blitter: silence assorted MSVC warnings
Fix signed/unsigned comparison warnings and float/int assignment warnings.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-17 10:13:30 -06:00
Brian Paul
7abd136e91 wmesa: remove old, unused span code 2012-10-17 10:13:30 -06:00
José Fonseca
879894552b scons: Fix graw-xlib lib order.
Avoids "undefined symbol: XShmCreateImage" error.
2012-10-17 15:28:26 +01:00
José Fonseca
ea2978b11c tgsi: Add support to parse IMM[x] too.
Thanks to Brian for pointing this out.
2012-10-17 15:27:26 +01:00
José Fonseca
2ab6e67d90 Revert "gallivm: Don't use llvm.x86.avx.max/min.ps.256 inadvertently."
This reverts commit bf2edc776b.
2012-10-17 15:04:20 +01:00
Vinson Lee
53e36d333c build: Build on Cygwin with gnu99 instead of c99.
The GCC c99 standard on Cygwin sets __STRICT_ANSI__ and symbols such as
strdup are not available.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-16 23:28:22 -07:00
Matt Turner
0199ff7fe3 es2api: Add GL ES 3 headers 2012-10-16 19:31:22 -07:00
Matt Turner
c9155c9317 glapi: Add es2="3.0" attributes to XML.
Note that we are missing the ARB_internalformat_query extension, which
provides the glGetInternalformativ function needed by GL ES 3.0.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-10-16 19:31:22 -07:00
Brian Paul
1284543a44 svga: whitespace fixes, remove useless comments 2012-10-16 18:11:58 -06:00
Brian Paul
0087f5ce51 svga: silence MSVC warning about negating an unsigned value 2012-10-16 17:55:39 -06:00
Brian Paul
ffbac58746 svga: silence MSVC double/float assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul
ce3faa993c svga: fix MSVC double/float parameter warning 2012-10-16 17:55:39 -06:00
Brian Paul
d21e6c87c0 svga: silence MSVC float/int assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul
200291e087 svga: silence MSVC double/float assignment warnings 2012-10-16 17:55:39 -06:00
Brian Paul
25cd2c2a8a svga: silence some MSVC signed/unsigned comparison warnings 2012-10-16 17:55:39 -06:00
Ian Romanick
4d0458dc6e mesa/tests: Add ES1.1 dispatch table sanity test
This test actually depends on FEATURE_ES1 because
_mesa_create_exec_table_es1 doesn't exist without it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-10-16 14:57:20 -07:00
Ian Romanick
95b76eab71 mesa/tests: Compile ES2 test regardless of FEATURE_ES2 setting
The relevant ES2 code is always in Mesa.  Always building the tests
ensures that things aren't accidentally broken when people don't build
with --enable-es2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-10-16 14:57:20 -07:00
Brian Paul
c50d6a2abc mesa: remove FEATURE_ES1 tests in enable.c code
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
1633fa1627 mesa: remove FEATURE_ES test in _mesa_get_compressed_formats()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
4936aadcd1 mesa: remove FEATURE_ES test in _mesa_is_compressed_format()
The code already has a runtime ES1 test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
920f331cf1 mesa: remove FEATURE_GL test from updated_drawbuffers()
There's already a runtime test for full OpenGL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
99940eef48 mesa: remove #if _HAVE_FULL_GL checks
This is basically more of the "remove FEATURE_x" clean-up.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Brian Paul
198fa6452b mesa: remove ASSERT_NO_FEATURE macro
Was only used in one place.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 14:57:20 -07:00
Eric Anholt
7139ab80ca i965: Fix rendering to small mipmaps of depth/stencil buffers using a temp mt.
Fixes 51 piglit tests (fbo-clear-formats, and most of the remaining failures
in depthstencil).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
5c8dd6cf79 i965: Share the draw x/y offset masking code between main/blorp and all gens.
This code is twisty, and the comment before most of the blocks was actually
giving me the opposite impression from its intention: We want to apply as much
of our offset as possible through coarse tile-aligned adjustment, since we can
do so independently per buffer, and apply the minimum we can through
fine-grained drawing offset x/y, since it has to agree between all buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
ddfa346e4a i965: Make a helper function for the renderbuffer temporary mt workaround.
We now have a case of wanting to do that on gen6+ as well, so make this logic
usable elsewhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
4bec2e31bf i965: Warn on a couple of workarounds in blending.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Eric Anholt
1fe71848b6 intel: Add a macro for printing a debug warning once.
There are a number of places where some obscure piece of the code is not
currently worth fixing, and we have some workaround behavior available.  It's
nicer for users to do some lame workaround than to just assert, but without
asserts we never knew when the workaround was at fault.

This should give us a nice compromise: Execute the workaround, but mention
that the obscure workaround was hit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 13:13:44 -07:00
Andreas Boll
85067d4bab docs: add note about removal of GL_NV_fragment_program 2012-10-16 21:24:04 +02:00
Paul Berry
381186dbf8 glapi: Delete gles_api.py, since it is no longer used.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
c8ad6ef1c6 mapi_abi: Use GLES information from XML rather than gles_api.py.
Note: mapi_abi can consume API information from either XML or a .csv
file.  A side effect of this change is that the ES1 and ES2 API
printers can only be used with XML input now.  That's ok, since the
.csv input format is only used for the OpenVG API.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
137f8ef225 mapi_abi: Override 'hidden' and 'handcode' attributes using polymorphism.
Previously, the ES1, ES2, and shared GLAPI printers passed a list of
function names to the base class constructor, which was used by the
_override_for_api() function to loop over all the API functions and
adjust their 'hidden' and 'handcode' attributes as appropriate for the
API flavour being code-generated.

This patch lifts the loop from _override_for_api() into its caller,
and makes it into a polymorphic function, so that the derived classes
can customize its behaviour directly.  In a future patch, this will
allow us to override the 'hidden' and 'handcode' attributes based on
information from the XML rather than a list of functions.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
4f6fc905c6 mapi_abi: Get rid of unnecessary copy.
Previously, _get_api_entries() would make a deep copy of each element
in the entries table before modifying the 'hidden' and 'handcode'
attributes.  This was unnecessary, since the entries aren't used again
after this function.  Removing the copy simplifies the code, because
it is no longer necessary to adjust the alias pointers to point to the
copied entries.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
77ed171f27 mapi_abi: Remove sanity check that all GLES functions are present.
Currently mapi_abi.py uses hardcoded lists of function names (in
gles_api.py) to determine which functions need to be included in the
GLES 1 or GLES 2 API.  This patch removes a sanity check which
verified that all GLES functions listed in the hardcoded lists were
actually present in the XML.

Later patches in this series will modify mapi_abi.py to determine
which functions need to be included in the GLES 1 or GLES 2 API based
directly on the XML.  Once that is done, the sanity check will be
redundant.  Removing the sanity check now will simplify the patches to
come.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:56 -07:00
Paul Berry
155eff56b1 mapi_abi: Collect all imports at top of file.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
e378cd77bc glapi: Use GLES information from XML rather than gles_api.py.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
cd4ce16c45 glapi: Read GLES information from XML.
Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
81a7f50781 glapi: Add es1 and es2 attributes to XML.
Currently, the set of functions which exist in GLES1 or GLES2 is
determined by hardcoded lists of function names in gles_api.py.  This
patch encodes that information into the XML files using new
attributes, es1 and es2.

The es1 attribute denotes the first version of GLES 1 in which the
function exists (e.g. es1="1.1" means the function exists in GLES 1.1
but not GLES 1.0).  "none" (the default) means the function is not
available in any version of GLES 1.

The es2 attribute denotes the first version of GLES 2/3 in which the
function exists (e.g. es2="2.0" means the function exists in both GLES
2.0 and GLES 3.0).  "none" (the default) means the function is not
available in any version of GLES 2 or GLES 3.

Note that since GLES 3 is a strict superset of GLES 2, there is no
need for a separate attribute for it; instead, 'es2="3.0"' should be
used to denote functions that are present in GLES 3 but not GLES 2.

This patch only adds information about GLES versions 1.0, 1.1, and
2.0.

Later patches will modify the python code generation scripts to use
this information rather than the hardcoded lists in gles_api.py.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Paul Berry
7dc052b12b glapi: use new-style Python classes.
An unfortunate quirk of Python 2 is that there are two types of
classes: "classic" classes (which are backward compatible with some
unfortunate design decisions made early in Python's history), and
"new-style" classes.  Classic classes have a number of limitations
(for example they don't support super()) and are unavailable in Python
3.  There's really no reason to use classic classes, except in
unmaintained legacy code.  For more information see
http://www.python.org/download/releases/2.2.3/descrintro/.

This patch upgrades the Python code in src/mapi/glapi/gen to use
exclusively new-style classes.

Tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 12:03:55 -07:00
Kenneth Graunke
41954107c0 i965/fs: Fix segfault when using INTEL_DEBUG=perf with non-GLSL.
Now that ARB programs and fixed function are routed through the new
backend, shader might be NULL.  Don't do INTEL_DEBUG=perf support in
that case, since it relies on shader->compiled_once.

Since INTEL_DEBUG=perf wasn't previously supported, this maintains the
status quo.  It might be nice to support it someday, however.

This could be moved to brw_shader_program instead of brw_shader, but
it appears even prog can be NULL in that case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 12:02:01 -07:00
Kenneth Graunke
56705cd36b mesa: Don't flatten IF statements by default.
MaxIfDepth of 0 means "flatten all the time", not "never flatten".
This is only desirable on hardware that can't support control flow;
software rasterization and most hardware drivers want this.

This alters behavior for swrast as well as i915.  Tested on i915.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-16 12:01:39 -07:00
Kenneth Graunke
b2e0293213 mesa: Remove PROGRAM_WRITE_ONLY register type.
More dead code.  I'm not sure what it was for.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:25 -07:00
Kenneth Graunke
01d2bd34f4 mesa: Remove dead _mesa_num_parameters_of_type() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
1366db2ef6 mesa: Remove dead _mesa_add_attribute() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
d0021cb0fb mesa: Remove remnants of PROGRAM_VARYING.
The previous patch removed the producer of things in this file.
Since there aren't any, we can remove it.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
eda4a4ae81 mesa: Remove dead _mesa_add_varying() function.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
f7cfe3fc70 mesa: Remove dead program_parameter::Flags field.
All flags are now gone, so we can stop storing and passing this around.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
5bb6f15f79 st/mesa: Remove the PROG_PARAM_BIT_CYL_WRAP flag. [v2]
Nobody ever set the flag, which makes this dead code.

v2: Leave the ureg_DECL_fs_input_cyl function in place, even though it's
    unused, since VMWare uses it for their internal projects.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
4b13252bba mesa: Remove GLSL-related PROG_PARAM_BIT flags.
GLSL doesn't use the program code anymore.  Accordingly, there were no
consumers of these flags, so there's no need to define them.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
8d418d1616 mesa: Remove support for named parameters.
These were only part of NV_fragment_program, so we can kill them.

The fact that PROGRAM_NAMED_PARAM appears in r200_vertprog.c is rather
comedic, but also demonstrates that people just spam the various types
of parameters everywhere because they're confusing.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:24 -07:00
Kenneth Graunke
d67e52b027 driconf: Remove force enable for NV_vertex_program.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
58c466519d mesa: Remove yet more remnants of NV_fragment_program.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
e5f03f23a0 mesa: Remove some miscellaneous NV program stuff from arbprogram.c.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
d213d27f84 mesa: Simplify _mesa_BindProgram() by removing NV program remnants.
Without NV programs, there's no need for the compatible_program_targets
function.  A simple (non-)equality check will do.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:35:23 -07:00
Kenneth Graunke
2f350f360b mesa: Remove get and enable bits for NV_fragment_program.
Also remove a leftover remnant from NV_vertex_program.

v2: Update for Imre's get changes.

Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-10-16 11:35:23 -07:00
Kenneth Graunke
d711717b4a mesa: Remove prog_print support for NV programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
2254569bda mesa: Remove support for parsing NV fragment programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
9dc2c28983 mesa: Remove the gl_program::Resident flag.
It apparently was only used for NV programs.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
7742952f7e mesa: Remove the EmitNVTempInitialization shader compiler option.
Nobody uses it anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
7487b16128 mesa: Remove the NV program API functions.
These are all unused now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
16d8161962 mesa: Switch to the other glGetVertexAttribPointervARB implementation.
Previously, Mesa used nvprogram.c's _mesa_GetVertexAttribPointervNV()
function to implement this GL call.  There was also a second
implementation in varray.c, _mesa_GetVertexAttribPointervARB(), which
was entirely unused.

The varray.c variant has an additional assertion and checks the index
against ctx->Const.VertexProgram.MaxAttribs rather than
MAX_VERTEX_GENERIC_ATTRIBS.  However, that variable is defined to the
same value, so it should be fine.

This will allow us to kill the duplicate function.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
070ba30c36 mesa: Remove some shared NV_vp/fp functions from the dispatch table.
Also kill the resulting dead code for display list handling.

v2: Also kill dlist's OPCODE_REQUEST_RESIDENT_PROGRAMS_NV.

Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
ff1943dec9 mesa: Unhook NV_fragment_program API from the dispatch table.
The NamedParameter functions were introduced in NV_fragment_program, and
are not shared with any other extensions.

Although this patch appears to remove the LocalParameter functions, it
does not: the ARB_fragment_program section also set them up.  Now we
simply initialize them a single time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:34 -07:00
Kenneth Graunke
492feddb03 swrast: Remove support for the NV_fragment_program extension.
No hardware drivers support this, it's obsolete, and unlikely to be
useful without NV_vertex_program, which is gone now.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 11:24:33 -07:00
Alex Deucher
ed8d87c6a6 radeonsi: add some new SI pci ids
Note: this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-16 13:11:38 -04:00
Tom Stellard
b1e7bd7690 r600g: Fix segfault in r600_compute_global_transfer_map()
This segfault was caused by commit
369e468889, however it is my fault for not
testing the patch while it was on the list.
2012-10-16 14:39:16 +00:00
Tom Stellard
a73c5d3f9d r600g: Fix build with --enable-opencl 2012-10-16 14:39:15 +00:00
Fredrik Höglund
762d9ace6b mesa/es: Enable GL_EXT_map_buffer_range
This extension is functionally the same as GL_ARB_map_buffer_range.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-16 13:21:41 +02:00
Kristian Høgsberg
017c6fb324 gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-10-15 22:33:04 -04:00
Fredrik Höglund
0978707917 glx: Fix a regression in the new XCB code
dri2DrawableGetMSC(), dri2WaitForMSC() and dri2WaitForSBC() were
inadvertently changed to return 0 on success.  This resulted in the callers
returning an error to the client.

Restore the previous behavior and also check that the reply pointers are
valid before accessing them.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-16 02:24:42 +02:00
Brian Paul
df3721fd2e st/mesa: remove OPCODE_BRA switch case 2012-10-15 13:17:53 -06:00
Eric Anholt
59c4420fac docs: Add note about removal of GL_NV_vertex_program. 2012-10-15 11:53:24 -07:00
Eric Anholt
bc74c4bbaf mesa: Remove defines for NV_vertex_program limits.
Note that _mesa_GetVertexAttribPointervNV() is actually
glGetVertexAttribPointerv(), which operates on the generic attributes.  The
geometry shader initialization looks like arbitrary cruft to me.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
09c006da9f mesa: Fix comments for NV_vp code that's now only used by other extensions.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
37fc983d03 mesa: Add notes about remaining NV_vertex_program code.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
8b2fe73897 mesa: Remove miscellaneous remains of NV_vertex_program.
v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:24 -07:00
Eric Anholt
cb9a1bf316 mesa: Remove API specific to GL_NV_vertex_program's aliased attribs.
v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:24 -07:00
Eric Anholt
8058a70763 mesa: Remove prog_instruction.h field for never-supported NV_vertex_program3.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
cc763f0f3f mesa: Remove support for GL_VERTEX_STATE_PROGRAMs and their execution.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
363643f540 mesa: Remove NV_vertex_program-specific parameters support.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:24 -07:00
Eric Anholt
c0120c2509 mesa: Remove support for NV_vertex_program's attribute evaluation.
Note that the MAP2 getters were missing from the implementation.  Neat.

v2: Rebase on top of get.c changes.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:23 -07:00
Eric Anholt
4f9d351ef1 mesa: Remove support for NV_vertex_program's special attributes aliasing
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
6a20f0e561 mesa: Fix NV_fragment_program's display list opcode for RequestResident.
While nuking NV_vertex_program, I noticed that one of my opcodes was used in a
strange place.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
6ab9c04769 mesa: Remove support for NV_vertex_program's tracked matrices.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
bcfd51f8c4 mesa: Remove Mesa IR opcodes that existed only for NV_vertex_program.
v2: Remove dead positive() function, caught by Matt.

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2012-10-15 11:53:23 -07:00
Eric Anholt
422566e1c7 mesa: Remove support for parsing NV vertex programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
cff1b1df4b swrast: Remove support for GL_NV_vertex_program.
It's not supported in any hardware drivers, and doesn't appear to be useful on
Linux.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:23 -07:00
Eric Anholt
a1998673ba gallium: Remove #if 0-ed enable of NV_vp. It's going away.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt
63c233cf08 r200: Remove support for software-only NV_vertex_program.
It wasn't supported in hardware, and the comments in the code indicated no
known uses (similar to my experience on Intel) and a possible intent to remove
it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt
af90c8c511 intel: Remove NV_vertex_program support.
We were holding on to this code because we were aware that NWN 1 had some
support for vertex programs -- no other linux programs I've come across would
use it (since other software also has ARB_vp or GLSL support).  Only, it turns
out that NWN doesn't even give us any vertex programs.  Given that we have
known issues where the extension has never been fully supported, just give up
on it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46795
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Eric Anholt
1a8a0418f2 i965/vp: Remove more code for unused opcodes.
These don't appear in ARB_vp or NV_vp and I missed that fact on the first
pass of removing dead opcodes.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 11:53:22 -07:00
Andreas Boll
c5adfb21b3 r600g: drop useless switch statement
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-15 20:34:02 +02:00
Andreas Boll
0ce21660c2 gallium/docs: update some distro information
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-15 16:11:49 +02:00
Marek Olšák
023dae71ef r600g: emit the border color only when it's needed
That depends on the texture wrap modes and filtering.
2012-10-15 16:04:09 +02:00
Marek Olšák
33dda8f4fb r600g: cleanup create_sampler_state functions
- stopped using util_color
- reformatted to occupy less characters per line.
- used memcpy for the border color
- used pipe_color_union in the state structure
2012-10-15 16:04:09 +02:00
Marek Olšák
2bbd307fa6 st/mesa: fix integer texture border color for some formats (v2)
And the clear color too, though that may be an issue only with GL_RGB if it's
actually RGBA in the driver.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: The types of st_translate_color parameters were changed to gl_color_union
    and pipe_color_union as per Brian's comment.
2012-10-15 16:04:09 +02:00
Brian Paul
1ec12c53ba util: added debug_print_transfer_flags() function 2012-10-15 07:49:14 -06:00
Abdiel Janulgue
bcb10ca172 mesa: Fix a crash in update_texture_state() for external texture type
NOTE: This is a candidate for the stable branch.

Signed-off-by: Abdiel <abdiel.janulgue@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-15 07:49:14 -06:00
Brian Paul
88ecd0ddb9 svga: remove needless debug-mode linked list code
LIST_DEL() always sets the prev/next pointers to NULL now.
2012-10-15 07:49:14 -06:00
Chris Fester
3fffe8f7b7 util: null-out the node's prev/next pointers in list_del()
Note: This is a candidate for the 9.0 branch.
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-15 07:49:14 -06:00
Daniel Stone
4004620d34 build: Don't fail if libX11 isn't installed
configure.ac would previously refuse to complete if libX11 wasn't
installed, even if we'd disabled GLX and weren't building an X11 EGL
platform.  Make the check simply set the no_x variable that's used (but
never set) immediately below for what looks like this very case.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-10-14 20:41:35 -07:00
Christoph Bumiller
43e6c51aed nouveau: fix offset in nouveau_buffer_transfer_map
Before 369e468889, the transfer was
initialized before the call to map and had the correct value already.
2012-10-14 18:58:04 +02:00
Matt Turner
fb85b204d3 u_format_s3tc.c: Don't call getenv() twice
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-12 12:26:03 -07:00
Tapani Pälli
60565b564b android: generate matching remap_helper to dispatch table
commit a010215463 removed ES2 specific dispatch
table and remap_helper, since now we are using dispatch.h which is generated
from gl_and_es_API.xml we need to generate a matching remap_helper using the
same xml.

Note: This is a candidate for the 9.0 branch.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-12 11:42:09 -07:00
José Fonseca
bf2edc776b gallivm: Don't use llvm.x86.avx.max/min.ps.256 inadvertently.
Could happen when CPU supports AVX, but LLVM doesn't.
2012-10-12 18:52:28 +01:00
José Fonseca
9ccf91f9ef tgsi: Dump register number when dumping immediates.
For example:

VERT
DCL IN[0]
DCL OUT[0], POSITION
DCL OUT[1], GENERIC[12]
DCL CONST[0..4]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
IMM[0] UINT32 {4294967295, 0, 0, 0}
IMM[1] FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
  0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx
  1: F2I TEMP[0].x, -TEMP[0]
  2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx
  3: F2I TEMP[1].x, -TEMP[1]
  4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
  5: IF TEMP[0].xxxx :0
  6:   MOV TEMP[0], IMM[1].xyxy
  7: ELSE :0
  8:   MOV TEMP[0], IMM[1].yxxy
  9: ENDIF
 10: MOV OUT[1], TEMP[0]
 11: MOV OUT[0], IN[0]
 12: END

instead of

VERT
DCL IN[0]
DCL OUT[0], POSITION
DCL OUT[1], GENERIC[12]
DCL CONST[0..4]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
IMM UINT32 {4294967295, 0, 0, 0}
IMM FLT32 {    0.0000,     1.0000,     0.0000,     0.0000}
  0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx
  1: F2I TEMP[0].x, -TEMP[0]
  2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx
  3: F2I TEMP[1].x, -TEMP[1]
  4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx
  5: IF TEMP[0].xxxx :0
  6:   MOV TEMP[0], IMM[1].xyxy
  7: ELSE :0
  8:   MOV TEMP[0], IMM[1].yxxy
  9: ENDIF
 10: MOV OUT[1], TEMP[0]
 11: MOV OUT[0], IN[0]
 12: END
2012-10-12 18:52:14 +01:00
Roland Scheidegger
d366520e85 gallivm: fix rsqrt failures
lp_build_rsqrt initially did not do any newton-raphson step. This meant that
precision was only ~11 bits, but this handled both input 0.0 and +infinity
correctly. It did not however handle input 1.0 accurately, and denormals
always generated infinity result.
Doing a newton-raphson step increased precision significantly (but notably
input 1.0 still doesn't give output 1.0), however this fails for inputs
0.0 and infinity (both result in NaNs).
Try to fix this up by using cmp/select but since this is all quite fishy
(and still doesn't handle denormals) disable for now. Note that even with
workarounds it should still have been faster since the fallback uses sqrt/div
(which both use the usually unpipelined and slow divider hw).
Also add some more test values to lp_test_arit and test lp_build_rcp() too while
there.

v2: based on José's feedback, avoid hacky infinity definition which doesn't
work with msvc (unfortunately using INFINITY won't cut it neither on non-c99
compilers) in lp_build_rsqrt, and while here fix up the input infinity case
too (it's disabled anyway). Only test infinity input case if we have c99,
and use float cast for calculating reference rsqrt value so we really get
what we expect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-10-12 18:51:18 +01:00
José Fonseca
2a4105cbc0 galahad: galahad_context_blit
must unwrap.
2012-10-12 18:38:05 +01:00
Marek Olšák
555c8d500a r600g: move shader structures into r600_shader.h 2012-10-12 19:00:30 +02:00
José Fonseca
23c6b8f2ed mesa/st: Fix assertions.
Can't access ptDraw before it is written.
2012-10-12 17:04:34 +01:00
Andreas Boll
c3dd8c358c doxygen: add gbm to .gitignore 2012-10-12 17:45:49 +02:00
Marek Olšák
7997b3c97c r600g: implement MSAA resolving for 8-bit and 16-bit integer formats
by changing the format to NORM.
2012-10-12 15:23:27 +02:00
Oliver McFadden
1b921acd5f intel: print debug either to stdout or `logcat' depending on platform.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-12 11:14:54 +03:00
Brian Paul
743d859e62 util: fix broken pipe_get_tile_rgba() call
Fix breakage from commit 369e468.
2012-10-11 15:53:16 -06:00
Tom Stellard
4cc530f452 radeon/llvm: Fix build with LLVM 3.2 2012-10-11 21:33:00 +00:00
Tom Stellard
dc54c49df9 clover: Fix build with LLVM 3.2
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-10-11 21:32:54 +00:00
Tom Stellard
c6b0132d1e clover: Don't link against libclangRewrite
This library does not exist in LLVM 3.2 and libOpenCL.so links fine
without it on LLVM 3.1

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-10-11 21:32:36 +00:00
Marek Olšák
7b01bc1e4c radeonsi: handle unhandled CAPs 2012-10-11 21:36:26 +02:00
Marek Olšák
dd9274df4f radeonsi: fixup the return type of is_format_supported 2012-10-11 21:32:47 +02:00
Marek Olšák
8e3e4145ce radeonsi: remove unused local variables 2012-10-11 21:31:36 +02:00
Marek Olšák
47b7af6337 r600g: put user indices in the command stream for small index counts
This improves performance a little bit if there are lots of small indexed
draw commands.
2012-10-11 21:21:59 +02:00
Marek Olšák
0369fc9725 r600g: inline r600_translate_index_buffer 2012-10-11 21:21:34 +02:00
Marek Olšák
369e468889 gallium: unify transfer functions
"get_transfer + transfer_map" becomes "transfer_map".
"transfer_unmap + transfer_destroy" becomes "transfer_unmap".

transfer_map must create and return the transfer object and transfer_unmap
must destroy it.

transfer_map is successful if the returned buffer pointer is not NULL.
If transfer_map fails, the pointer to the transfer object remains unchanged
(i.e. doesn't have to be NULL).

Acked-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:16 +02:00
Marek Olšák
ec4c74a9dc st/mesa: use the renderbuffer chosen by core Mesa in CopyTexSubImage
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:12 +02:00
Marek Olšák
9fe06f8815 softpipe: remove unused functions
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:10 +02:00
Marek Olšák
1c02075df0 st/mesa: use transfer_inline_write in st_texture_image_data
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:07 +02:00
Marek Olšák
ce7ebdd29a st/mesa: remove useless checking in reset_cache
It's always NULL here.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-11 21:12:03 +02:00
Andreas Boll
f04a6a65cc docs: start release notes file for 9.1 2012-10-11 19:26:10 +02:00
Brian Paul
60a9390978 svga: don't use uninitialized framebuffer state
Only the first 'nr_cbufs' color buffers in the pipe_framebuffer_state are
valid.  The rest of the color buffer pointers might be unitialized.
Fixes a regression in the piglit fbo-srgb-blit test since changes in the
gallium blitter code.

NOTE: This is a candidate for the 9.0 branch (just to be safe).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-11 09:13:59 -06:00
John Kåre Alsaker
6c53ec1ef2 svga: Remove wierd code which forces non-sRGB formats.
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-10 18:22:22 -06:00
John Kåre Alsaker
1a4aad11b0 svga: Add support for 16-bit per channel RGBA
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-10-10 18:19:44 -06:00
Eric Anholt
34c58acb59 i965/vs: Add support for splitting virtual GRFs.
This should improve our ability to register allocate without spilling.
Unfortuantely, due to the live variable analysis being ignorant of loops, we
still have register allocation failures on some programs.

v2: Add more context to the comment explaining the function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-10-10 13:22:56 -07:00
Eric Anholt
d4bcc65918 i965/vs: Try again when we've successfully spilled a reg.
Before, we'd spill one reg, then continue on without actually register
allocating, then assertion fail when we tried to use a vgrf number as a
register number.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-10 13:22:56 -07:00
Kenneth Graunke
9237f0ea8d i965/vs: Implement register spilling.
To validate this code, I ran piglit -t vs quick.tests with the "go spill
everything" debugging code enabled.  There was only one regression:
glsl-vs-unroll-explosion simply ran out of registers.  This should be
fine in the real world, since no one actually spills every single
register.

NOTE: This is a candidate for the 9.0 branch. Even if it proves to have
bugs, it's likely better than simply failing to compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-10 13:22:56 -07:00
Kenneth Graunke
46e529672b i965/vs: Fix unit mismatch in scratch base_offset parameter.
move_grf_array_access_to_scratch() calculates scratch buffer offsets in
bytes.  However, emit_scratch_read/write() expects the base_offset
parameter to be measured in OWords.

As a result, a shader using a scratch read/write offset greater than
zero (in practice, a shader containing more than one variable in
scratch) would use too large an offset, frequently exceeding the
available scratch space.

This patch corrects the mismatch by removing spurious conversion from
OWords to bytes in move_grf_array_access_to_scratch().

This is based on a patch by Paul Berry.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-10 13:22:55 -07:00
Matt Turner
587d5db11d egl: Return EGL_BAD_MATCH for invalid profile attributes
Version 12 of the EGL_KHR_create_context spec changed this behavior.

NOTE: This is a candidate for the 9.0 branch
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-10 13:15:06 -07:00
Vincent Lejeune
5090ce42e4 radeon/llvm: use ceil intrinsic instead of llvm.AMDIL.round.posinf
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:33 +02:00
Vincent Lejeune
9a6bb3f645 radeon/llvm: use floor intrinsic instead of llvm.AMDIL.floor
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:20 +02:00
Vincent Lejeune
bfdf26892c radeon/llvm: use llvm fabs intrinsic
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:03:03 +02:00
Vincent Lejeune
8db11bc4ed radeon/llvm: use llvm intrinsic for flog2
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:45 +02:00
Vincent Lejeune
23e11ac835 radeon/llvm: add support for cos/sin intrinsic
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:28 +02:00
Vincent Lejeune
876b42663c radeon/llvm: add a pattern for fsqrt
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-10 22:02:13 +02:00
Paul Berry
99802519b4 glapi: Reformat python code generation scripts to use 4-space indentation.
This brings us into accordance with the official Python style guide
(http://www.python.org/dev/peps/pep-0008/#indentation).

To preserve the indentation of the c code that is generated by these
scripts, I've avoided re-indenting triple-quoted strings (unless those
strings appear to be docstrings).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-10 11:19:14 -07:00
José Fonseca
856464979b mesa: Avoid C99 indexed initializers.
Not supported by MSVC.

Reviewed-by: Imre Deak <imre.deak@intel.com>
2012-10-10 17:55:04 +01:00
José Fonseca
3f228ed090 mesa: Prevent CONST macro re-definition.
Should fix MSVC build, as windows.h also defines CONST.

CONST usage in get.c is not new, so probably this just appeared now due
to changes in the includes.
2012-10-10 11:40:34 +01:00
José Fonseca
a555888151 mesa: Silence 'assignment makes integer from pointer without a cast' warnings. 2012-10-10 11:35:34 +01:00
Imre Deak
9c1c23331a glget: fix make check for glGet GL_POLYGON_OFFSET_BIAS
This got broken by:
7182a1f glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension
section

Fix it by appending the _EXT suffix to the enum in the test too.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:56:02 +03:00
Imre Deak
dd6479160c mesa: glGet: remove the unused TYPE_API_MASK flags
Since we generate the hash tables in build time, these flags aren't used
any more, remove them.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:26 +03:00
Imre Deak
d220435416 mesa: glGet: use the build time generated hash tables
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:23 +03:00
Imre Deak
98f880e0c4 mesa: glGet: add script to generate hash tables in build time
This will be needed by the next patch, which will switch to using
the parameter descriptor- and hash tables generated by the script.

The hash algorithm remains the same, the output parameter descriptor
table format changes slightly. There the TYPE_API_MASK entries are
removed and an invalid NULL entry is inserted at the beginning. This is
ok, as get.c:find_value() doesn't rely on TYPE_API_MASK any more to
detect an invalid enum.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:19 +03:00
Imre Deak
6678125eae scons/android: add flag to check for enabled GL APIs
Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:16 +03:00
Imre Deak
ea637c5b64 mesa: glGet: rename *{_EXT,_ARB} enums missing from the XML spec
The following enums used to be extensions but later became part of the
core specification. The _EXT/_ARB versions of these are not present in
in the current XML spec files, only defined in GL/glext.h

Later we'll need to look up these in a python script using the XML spec.
As a preparation for that remove the _EXT,_ARB suffix from these enums
and rename GL_DISTANCE_ATTENUATION_EXT to GL_POINT_DISTANCE_ATTENUATION.
Naturally, all enums keep their numerical values.

Note that similar renames shouldn't be necessary in the future: in case
of a new extension the XML spec is updated with the new _EXT/_ARB etc.
name and this name is added to the enum table in get.c.  Later the
extension may become part of the core spec, at which point the name w/o
the _EXT/_ARB suffix is added to the XML spec and the table in get.c
remains the same.

GL_BLEND_DST_ALPHA_EXT
GL_BLEND_DST_RGB_EXT
GL_BLEND_SRC_ALPHA_EXT
GL_BLEND_SRC_RGB_EXT
GL_COLOR_SUM_EXT
GL_COMPRESSED_TEXTURE_FORMATS_ARB
GL_CURRENT_FOG_COORDINATE_EXT
GL_CURRENT_SECONDARY_COLOR_EXT
GL_DISTANCE_ATTENUATION_EXT
GL_FOG_COORDINATE_ARRAY_EXT
GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
GL_FOG_COORDINATE_ARRAY_TYPE_EXT
GL_FOG_COORDINATE_SOURCE_EXT
GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
GL_PACK_IMAGE_HEIGHT_EXT
GL_PACK_SKIP_IMAGES_EXT
GL_SECONDARY_COLOR_ARRAY_EXT
GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
GL_UNPACK_IMAGE_HEIGHT_EXT
GL_UNPACK_SKIP_IMAGES_EXT

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:11 +03:00
Imre Deak
59d3bf6542 mesa: glGet: simplify the 'enum not found' condition
When traversing the hash table looking up an enum that is invalid we
eventually reach the first element in the descriptor array. By looking
at the type of that element, which is always TYPE_API_MASK, we know that
we can stop the search and return error. Since this element is always
the first it's enough to check for its index being 0 without looking at
its type.

Later in this patchset, when we generate the hash tables during build
time, this will allow us to remove the TYPE_API_MASK and related flags
completly.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:08 +03:00
Imre Deak
2ad4a47547 mesa: glGet: fix parameter lookup for apps using multiple APIs
The glGet hash was initialized only once for a single GL API, even if
the application later created a context for a different API. This
resulted in glGet failing for otherwise valid parameters in a context
if that parameter was invalid in another context created earlier.

Fix this by using a separate hash table for each API.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:43:05 +03:00
Imre Deak
7182a1fc5e glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section
This should be named GL_POLYGON_OFFSET_BIAS_EXT and listed under the
EXT_polygon_offset section. (Solution by Ian Romanick)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-10 12:42:42 +03:00
Marek Olšák
87a34131c4 r600g: move SQ_GPR_RESOURCE_MGMT_1 into new config_state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:07 +02:00
Marek Olšák
c5584e93b1 r600g: move DB_SHADER_CONTROL into db_misc_state
Also update the register value in more appropriate places
than r600_update_derived_state.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:05 +02:00
Marek Olšák
ae25b93245 r600g: emit PS_PARTIAL_FLUSH at the beginning of CS
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:03 +02:00
Marek Olšák
ef723613e0 r600g: atomize depth-stencil-alpha state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:17:01 +02:00
Marek Olšák
711f3bae9d r600g: atomize rasterizer state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:58 +02:00
Marek Olšák
9a683d1bd8 r600g: sort variables in r600_context
Some variables have been removed from there too.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:55 +02:00
Marek Olšák
30bcc5538f r600g: initialize SQ_VTX_SEMANTIC_* in the start_cs command buffer
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:49 +02:00
Marek Olšák
18a189188a r600g: atomize scissor state
The workaround for R600 lacking VPORT_SCISSOR_ENABLE has also been simplified.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:45 +02:00
Marek Olšák
ab075de53b r600g: atomize polygon offset state
POLY_OFFSET_DB_FMT_CNTL is moved to the framebuffer state, because it only
depends on the zbuffer format.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:42 +02:00
Marek Olšák
a50edc8ed8 r600g: atomize fetch shader
The state object is actually a buffer, it's literally a buffer containing
the shader code.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:38 +02:00
Marek Olšák
8bf7044ec6 r600g: remove the dual_src_blend flag from the shader key
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:35 +02:00
Marek Olšák
faaba52aed r600g: atomize blend state
This is not so trivial, because we disable blending if the dual src
blending is turned on and the number of color outputs is less than 2.
I decided to create 2 command buffers in the blend state object and just
switch between them when needed, because there are other states unrelated
to blending (like the color mask) and those shouldn't be changed
(the old code had it wrong).

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:32 +02:00
Marek Olšák
eb65fefa4b r600g: inline r600_atom_dirty
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:28 +02:00
Marek Olšák
d8ea64697b r600g: remove the "atom" variable from r600_command_buffer
r600_command_buffer is not an atom.

The "atoms" have evolved into state slots (or groups of state slots) where
you can bind states. There is a fixed amount of atoms (state slots)
in the context.

The command buffers are nothing like that. They represent states, not state
slots.

We could probably give r600_atom a better name someday.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-10-10 00:16:25 +02:00
Eric Anholt
1e7776ca2b egl: Remove bogus invalidate code.
The invalidate event support is a careful dance between driver and loader,
where both have to say they can handle it, and then the loader reports
invalidate events for the driver so the driver can do the optimization.

The EGL code doesn't report __DRIuseInvalidateExtension to the driver, so it
has no responsibility to call the driver's invalidate function, and the driver
is doing the glViewport hack because it assume.  This is not
the only time invalidate would need to be called (we need it *any* time an
invalidate event comes down the pipe, but we don't watch for them), so just
stop calling the driver's function.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:04 -07:00
Eric Anholt
7e9bd2b2ed egl: Add support for driconf control of swapinterval.
This behavior mostly matches glx_dri2.  It's slightly complicated in
comparison because EGL exposes the implementation limits in the EGL config.

Note that platform_x11 was the only one setting swap_available, so the move of
the MaxSwapInterval into it is appropriate.

Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
8c472b8f6a glx: Replace DRI2SwapBuffers() custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
f02242a4fa glx: Fix some indentation.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
811602885b glx: Replace DRI2SwapInterval custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
7acf8ae0e1 glx: Reuse setSwapInterval for setting initial swap interval. 2012-10-09 14:32:03 -07:00
Eric Anholt
d0937759db glx: Allow glXSwapInterval(0) when vblank_mode=0.
There's no reason to say no in this case.
2012-10-09 14:32:03 -07:00
Eric Anholt
ab8ae9301f glx: Replace DRI2GetMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
8e61b9028a glx: Replace DRI2WaitForMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
183ab9e14e glx: Replace DRI2WaitForSBC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:03 -07:00
Eric Anholt
1e74910bb7 glx/dri1: Remove uncompiled __DRI_SWAP_BUFFER_COUNTER code.
It's been in place but never enabled since 2010.  Note how one piece called a
DRI2 function, suggesting never being tested.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
da3f7c127b egl: Quit checking for a bug in old xcb when we require new xcb.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
b477384f40 egl: Drop xcb ifdefs by just requiring a version from this year.
glx and gallium's xcb_dri2 usage already require this version, so this is
nothing really new.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
b49cd8495f egl: Unifdef dri_interface.h defines.
dri_interface.h comes from our tree, so why litter our tree with ifdefs for
older versions of it?

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
c35a9388a3 glx: Unifdef some dri_interface.h defines.
dri_interface.h comes from our tree, so why litter our tree with ifdefs for
older versions of it?

I left in the DRI_TEX_BUFFER_VERSION ifdefs, which is broken and uncompiled
(the version wasn't bumped from 2 to 3 when the patch was landed), but I don't
know what should be done with it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
bb01f671bb glx: Require xcb_dri2 for building glxdri2.c.
I'm going to transition a bunch of the protocol to using XCB so we can stop
rolling it ourselves.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
dc6fa41076 glx: Remove the last user of -DUSE_XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
3f0e3a7ad5 glx: Unifdef USE_XCB.
It's been required for building glx since
b518dfb513 in january.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:02 -07:00
Eric Anholt
31c7d4ec18 egl: Cleanly cast EGLNative* pointers to X11 types.
The EGLNative* types are all defined to be pointers across all our EGL
implementations, but in the X11 platform they're actually just XIDs (32-bit
integers).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 14:32:01 -07:00
Vincent Lejeune
11e08f42e4 r600g: use a select to handle front/back color in llvm
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-09 23:19:09 +02:00
Vincent Lejeune
80663cb185 r600g: frontcolor tracks its associated backcolor
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-09 23:19:09 +02:00
Matt Turner
900cc7cf80 Remove VAAPI support.
Not working and unmaintained.

Reviewed-by: Christian König <christian.koenig@amd.com>
2012-10-09 14:00:05 -07:00
Marcin Slusarz
63a15117a5 nv50: fix build after "nv50: fix printf warning"
When compiled with C++ compiler, inttypes.h defines PRI* macros only when
__STDC_FORMAT_MACROS is defined.
2012-10-09 22:42:54 +02:00
Marcin Slusarz
93eba26935 nouveau: use pre-calculated stride for resource_get_handle
Fixes FDO#55294.

NOTE: This is a candidate for the 9.0 branch.
2012-10-09 22:23:09 +02:00
Tom Stellard
45288cd2b6 r600g: Fix build with --enable-opencl 2012-10-09 19:54:12 +00:00
Ian Romanick
b25fbceb86 mesa/tests: Remove driverCtx parameter from call to _mesa_initialize_context
Fixes 'make check' breakage since 733dba2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-09 11:21:14 -07:00
Quentin Glidic
7cb8764ca3 intel: Add missing #include <time.h>
Commit 006c1a3c65 introduced a call to
clock_gettime, but failed to include <time.h>, breaking the build in
some cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-09 09:12:41 -07:00
Kenneth Graunke
b6346749a8 i965: Delete some dead code from brw_eu_emit.c.
Presumably some of this was used by the old fragment shader backend.
2012-10-09 09:11:26 -07:00
Andreas Boll
840d8484c0 docs: add missing release date 2012-10-09 17:50:29 +02:00
Andreas Boll
c833d98ff9 docs: update release notes for 9.0 2012-10-09 17:36:41 +02:00
Andreas Boll
3699150d3b docs: add news item for 9.0 release
Reviewed-by: Brian Paul <brianp@vmware.com>

ported manually from
8e73273cb9
2012-10-09 17:29:37 +02:00
Brian Paul
541158fbb9 mesa: remove unused _mesa_cpal_compressed_format_type() function
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-09 07:05:47 -06:00
Marek Olšák
30ebc8650c nv50: fix printf warning 2012-10-09 14:38:43 +02:00
Marek Olšák
51872e8bb3 nv30: fix type conversion warning 2012-10-09 14:34:27 +02:00
Marek Olšák
cf9081b37c i915g: fix unused variable and type conversion warnings 2012-10-09 14:33:16 +02:00
Daniel Stone
4f310984a9 teximage: Remove unnecessary compressed format check
Ever since df4a88ac, the check for compressed formats has been
unnecessary.  And ever since cb72ec5f, the build has been broken with
FEATURE_ES.  Remove it, as it does nothing.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-10-09 14:32:03 +02:00
Andreas Boll
b534c39ece docs: update FAQ
Reported-by: Fabio Pedretti <fabio.ped@libero.it>

v2: (Chad Versace <chad.versace@linux.intel.com>)
  - Rewrite FAQ - proper place for installing mesa.

v3: fix some typos

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-09 09:00:18 +02:00
Ben Skeggs
63c3a799ae nv50: point vertex runout at a valid address
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-09 09:56:36 +10:00
Ben Skeggs
c47a01c29c nvc0: point vertex runout at a valid address
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-09 09:56:34 +10:00
Ben Skeggs
d53bbabe61 nvc0: fix missing permanent bo reference on poly cache
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-10-09 09:56:12 +10:00
Brian Paul
1aa8ad8b50 Revert "st/mesa: remove unused variables to fix compile warnings"
This reverts commit 810d2e167c.

The pscreen variable is used in an assertion.  Use "(void) pscreen;"
to silence the warning.
2012-10-08 17:32:54 -06:00
Brian Paul
bad1b271a0 mesa: minor whitespace fixes in teximage.c 2012-10-08 17:30:21 -06:00
Marek Olšák
810d2e167c st/mesa: remove unused variables to fix compile warnings 2012-10-09 01:14:55 +02:00
Marek Olšák
cb72ec5fc5 mesa: remove unused variables to fix compile warnings 2012-10-09 01:14:55 +02:00
Marek Olšák
fd3219962d softpipe: initialize quadColor2 to fix compile warnings 2012-10-09 01:14:24 +02:00
Marek Olšák
d0349c91c8 r600g: remove unused variables to fix compile warnings 2012-10-09 01:11:56 +02:00
Marek Olšák
d284613422 llvmpipe: remove unused variables to fix compile warnings 2012-10-09 01:10:58 +02:00
Stéphane Marchesin
437a2560b1 i915g: Don't clobber I915_NEW_FS on new framebuffer.
This snuck in with a previous commit.
2012-10-08 12:30:46 -07:00
Eric Anholt
6a514494fa i965/fs: Improve performance of copy/constant propagation.
Use a simple chaining hash table for the ACP.  This is not really very good,
because we still do a full walk of the tree per destination write, but it
still reduces fp-long-alu runtime from 5.3 to 3.9s.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:38 -07:00
Eric Anholt
fb5bf03a20 i965/fs: Move constant propagation to the same codebase as copy prop.
This means that we don't get constant prop across into the first block after a
BRW_OPCODE_IF or a BRW_OPCODE_DO, but we have hope for properly doing it
across control flow at some point.  More importantly, with the next commit it
will help avoid O(n^2) with instruction count runtime for shaders that have
many constant moves.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:38 -07:00
Eric Anholt
098acf6c84 i965: Remove the old ARB_fragment_program backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:38 -07:00
Eric Anholt
97615b2d8c i965: Replace brw_wm_* with dumping code into the fs_visitor.
This makes a giant pile of code newly dead.  It also fixes TXB on newer
chipsets, which has been totally broken (I now have a piglit test for that).
It passes the same set of Ian's ARB_fragment_program tests.  It also improves
high-settings ETQW performance by 3.2 +/- 1.9% (n=3), thanks to better
optimization and having 8-wide along with 16-wide shaders.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=24355
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:50:27 -07:00
Eric Anholt
014aaa97d3 i965: Reduce maximum GL_ARB_fragment_program instruction count to 1024.
I don't know of any programs that would need more than this.  The larger
programs I've seen have neared 100 instructions.  This prevent excessive
runtimes of automatic tests that attempt to test up to the exposed maximums
(like fp-long-alu).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
9cfc00a84c i965/fs: Add a couple more algebraic cases that help some ARB_fp patterns.
ARB_fp doesn't go through the GLSL optimizer, and these were things you see
frequently thanks to conditionals being lowered to SLT/SGE and MUL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
d81d7a4b65 i965/fs: Pull ir_binop_min/ir_binop_max handling to a separate function.
This will be reused from the ARB_fp compiler.  I touched up the pre-gen6 path
to not overwrite dst in the first instruction, which prevents the need for
aliasing checks (we'll need that in the ARB_fp compiler, but it actually
hasn't been needed in this codebase since the revert of the nasty old
MOV-avoidance code).  I also made the conditional_mod between gen6 and
pre-gen6 consistent, which shouldn't matter except for denorm/(+/-)0
comparisons where the choice between left and right hand side of the
comparison changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
5c26874546 i965/fs: Refactor rectangle/GL_CLAMP texture coordinate adjustment.
We'll want to reuse this for ARB_fp handling.

v2: Fold the remaining bit of emit_texcoord back into visit(ir_texture).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
e7149d390c i965/fs: Pass fragment depth to the fb write as a fs_reg, not an ir_variable.
This will be used for the ARB_fp change to use this backend.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
Eric Anholt
6589c0bd56 mesa: Note that OPCODE_RFL is not part of ARB_fp (it's NV_fp only).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-08 08:38:49 -07:00
José Fonseca
88e417d761 st/wgl: Don't cache HDC anywhere.
Applications may destroy HDC at any time. So always get a HDC as needed.

Fixes lack of presents with Solidworks eDrawings when screen resolution is
changed.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-08 15:42:50 +01:00
Ian Romanick
86de501f14 meta: Make shader template literal strings be parameters to asprintf
This enables the C compiler to generate warnings if the formats and the
arguments don't match.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:50 -07:00
Ian Romanick
751737f497 meta: Always enable GL_EXT_texture_array in mipmap shader
'#extension foo: enable' is harmless.  The functionality is only
actually enabled if the extension is supported.  The shader won't use
the functionality if it's not supported, so we're fine.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:47 -07:00
Ian Romanick
0e973b7498 meta: Since mipmap output type is always vec4, don't sprintf it
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:45 -07:00
Ian Romanick
0242381f06 meta: Don't use GLSL 1.30 shader on OpenGL ES 2
Fixes GLES2 CoverageGL conformance test.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:42 -07:00
Ian Romanick
3308c079bd meta: Rearrange shader creation in setup_glsl_generate_mipmap
The diff looks weird, but this moves the code from the first 'if
(ctx->Const.GLSLVersion < 130)' block down into the second block.  It
also moves some variable decalarations closer to their use.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:35:39 -07:00
Ian Romanick
ab097dde0c meta: Remove unsafe global mem_ctx pointer
NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-10-07 20:34:17 -07:00
Stéphane Marchesin
6ef37f71b0 i915g: Call draw_set_mapped_vertex_buffer from draw_vbo
This regressed with the draw rework. Fixes glest and vdrift crash.
2012-10-06 13:15:04 -07:00
Marek Olšák
9dfca930d7 r600g: fix possible issue with stencil mipmap rendering
Somehow I only hit this issue with my latest libdrm changes.
This won't be needed with DB texturing.

NOTE: This is a candidate for the 9.0 branch.
2012-10-06 05:31:01 +02:00
Marek Olšák
6fa22b840e r600g: ensure PERFECT_ZPASS+NOOP_CULL_DISABLE are 0 for blits+decompression
When an occlusion query was active, the derived DB state wasn't changed
for u_blitter even though all the occlusion queries were suspended.

It's fixed by moving the state update into the emit functions, which are
called whenever queries are stopped or suspended.
2012-10-06 04:31:16 +02:00
Marek Olšák
6db53ca490 r600g: don't modify pipe_resource in resource_copy_region, fixing race condition
pipe_resource can be shared between contexts, we shouldn't modify its
description. Instead, let's use the resource "views" (sampler views and
surfaces), where we can freely change almost any property of a resource.
2012-10-06 04:31:16 +02:00
Marek Olšák
d063c7b142 r600g: fix streamout on RS780 and RS880
The latest kernel from git is required. Transform feedback (along with GL3.0)
is turned off on older kernels.
2012-10-06 03:49:29 +02:00
Marek Olšák
588263e7a7 gallium: allow debug helpers in the release build
No idea why this is #ifdef'd. Trace and Noop are definitely useful no matter
how Mesa is built.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-06 03:34:40 +02:00
Brian Paul
733dba2a08 mesa: remove the driverCtx parameter to _mesa_create/initialize_context()
No longer used.
2012-10-05 17:13:03 -06:00
Brian Paul
917d273928 mesa: remove unused gl_context::DriverCtx field 2012-10-05 17:13:03 -06:00
Brian Paul
4c9042d21d radeon/r200: remove use of gl_context::DriverCtx field 2012-10-05 17:13:03 -06:00
Brian Paul
5a63634a13 radeon/r200: make radeon_context subclass of gl_context
radeon_context now contains a gl_context, rather than a pointer to one.
This will allow some minor core Mesa clean-up.
2012-10-05 17:13:03 -06:00
Kenneth Graunke
7fa0f10cd8 mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.
The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either
GLSL or ARB vp/fp) are in use.  If either TNL or TexEnv programs are
active, at least one stage is using fixed function.

On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance
tests, as well as missing textures in Xonotic.  These were all
regressions since commit fb4a34e60e.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-05 13:19:53 -07:00
Stéphane Marchesin
74b6ea49df i915g: Get rid of the fixup state functions.
Now that the saved_* state is gone, we don't need those any longer.
2012-10-05 12:45:02 -07:00
Stéphane Marchesin
dca9e3c477 i915g: Remove the i915_context->saved_* stuff.
When using u_blitter, the state was being saved from saved_*, but we
don't use that. So after u_blitter resumed we got some corrupted
state in.

So let's just remove the saved_* stuff. I thought it was weird but
harmless, it's actually broken.
2012-10-05 12:45:01 -07:00
Stéphane Marchesin
98600c5ff6 i915g: Don't update I915_HW_PROGRAM in update_framebuffer
It's already going to be updated in update_dst_buf_vars.
2012-10-05 12:45:00 -07:00
Stéphane Marchesin
762ac0a218 Revert "i915g: Don't bind 0-length programs"
This reverts commit 8c28a9bd73.
2012-10-05 12:44:58 -07:00
Vinson Lee
df0de93206 glapi: Do not use backtrace on Cygwin.
execinfo.h is not available on Cygwin.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-04 22:28:15 -07:00
Paul Berry
8f0b81bf7d mesa: don't enable glVertexPointer() when using API_OPENGLES2.
This function is only present in GLES1 and in the OpenGL compatibility
profile.

Fixes the following "make check" failure:

    [----------] 1 test from DispatchSanity_test
    [ RUN      ] DispatchSanity_test.GLES2
    Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
    compression/decompression unavailable
    dispatch_sanity.cpp:122: Failure
    Value of: table[i]
       Actual: 0x4de54e
    Expected: (_glapi_proc) _mesa_generic_nop
    Which is: 0x41af72
    i = 321
    [  FAILED  ] DispatchSanity_test.GLES2 (4 ms)
    [----------] 1 test from DispatchSanity_test (4 ms total)

NOTE: This is a candidate for stable release branches.

Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-04 12:46:42 -07:00
Stéphane Marchesin
8c28a9bd73 i915g: Don't bind 0-length programs
Since we started doing fixups for different render target formats,
this has been an issue. Instead just don't do anything, when the
program gets emitted later it'll get the correct fixup.

Fixes a bunch of piglit tests.
2012-10-04 12:39:06 -07:00
Brian Paul
91d8409649 mesa: don't call TexImage driver hooks for zero-sized images
This simply avoids some failed assertions but there's no reason to
call the driver hooks for storing a tex image if its size is zero.

Note: This is a candidate for the stable branches.
2012-10-04 07:59:11 -06:00
Rob Bradford
185d6df3c1 intel: Fix intel_texsubimage_tiled_memcpy to skip GL_EXT_unpack_subimage case
413c49141 added an optimisation to improve the performance of teximage
under a limited set of circumstances. If GL_EXT_unpack_subimage has been
used then we we must also skip this optimisation since the optimised
codepath does not take the packing values into consideration.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-03 16:44:22 -07:00
Matt Turner
31ab61cac1 dri drivers: Link dricommon before dynamic libraries
I think libtool should be handling this for us, but the build fails for
Jordan because libdricommon (a static library, which uses expat) appears
before -lexpat on the linker command.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
2012-10-03 13:41:09 -07:00
Paul Berry
551c991606 register_allocate: don't consider trivially colorable registers for spilling.
Previously, we considered all registers as candidates for spilling.
This was counterproductive--for any registers that have already been
removed from the interference graph, there is no benefit to spilling
them, since they don't contribute to register pressure.

This patch ensures that we will only try to spill registers that are
still in the interference graph after register allocation has failed.

This is consistent with the recommendations of the paper "Retargetable
Graph-Coloring Register Allocation for Irregular Architectures", on
which our register allocator is based.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-03 12:54:42 -07:00
Marek Olšák
53d06ecdd0 glx/dri2: use uint64_t instead of double to represent time for FPS calculation
Wine or a windows app changes fpucw to 0x7f, causing doubles to be equivalent
to floats, which broke the calculation of FPS.
We should be very careful about using doubles in Mesa.

Henri Verbeet adds:
  For reference, this is done by for example d3d9 when a D3D device is
  created without D3DCREATE_FPU_PRESERVE set. In the general case
  applications can do all kinds of terrible things to the FPU control
  word of course.
2012-10-03 16:55:48 +02:00
Oliver McFadden
ff835724b5 mesa: tests: EnumStrings.LookUpByNumber
[ RUN      ] EnumStrings.LookUpByNumber
enum_strings.cpp:43: Failure
Value of: _mesa_lookup_enum_by_nr(everything[i].value)
  Actual: "GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE"
Expected: everything[i].name
Which is: "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT"
enum_strings.cpp:43: Failure
Value of: _mesa_lookup_enum_by_nr(everything[i].value)
  Actual: "GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE"
Expected: everything[i].name
Which is: "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT"
[  FAILED  ] EnumStrings.LookUpByNumber (2 ms)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55505
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-10-03 14:11:58 +03:00
Andreas Boll
336cc6499b docs: add link to the GLSL compiler page
This reverts commit 9e0931e355

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-03 08:54:12 +02:00
Andreas Boll
d495669965 docs: update shading documentation
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-03 08:53:46 +02:00
Matt Turner
159ca32fec build: Remove autoconf check for signbit
rebase failure in 7da12426f7.
2012-10-02 22:50:02 -07:00
Stéphane Marchesin
fe3aeb7ea3 i915g: Implement srgb textures the easy way.
Since the hw can do it, let's use the hw. It's less accurate
but doesn't have the shader instruction count shortcomings.
2012-10-02 17:54:50 -07:00
Stéphane Marchesin
2acc719374 i915g: Use X tiling for textures
This is what the classic driver does, and it allows faster
texture uploads.
2012-10-02 17:54:48 -07:00
Robert Bragg
0a523a8820 SwapBuffersRegionNOK: invert rectangles on y axis
The EGL_NOK_swap_region2 spec states that the rectangles are specified
with a bottom-left origin within a surface coordinate space also with a
bottom left origin, so this patch ensures the rectangles are flipped
before passing them on to dri2_copy_region.

Fixes piglit's egl-nok-swap-region test.

Tested-by: Matt Turner <mattst88@gmail.com>
2012-10-02 14:49:00 -07:00
Brian Paul
df4a88ac43 mesa: remove bogus compressed texture size checks
A compressed texture image size doesn't have to be a multiple of the
compressed block size (only sub-images do).  Fixes issues when building
compressed mipmaps because we often wind up with non-block-size images
for the higher mipmap levels.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=55445

Note: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Sven Arvidsson <sa@whiz.se>
2012-10-02 15:19:00 -06:00
Michel Dänzer
82e38ac91f radeonsi: Fix double compilation of shader variants.
Fixes crash in piglit glsl-max-varyings.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-02 17:53:47 +02:00
Michel Dänzer
c3db19efba radeonsi: Better indexing of parameters in the pixel shader.
We were previously using the TGSI input index, which can exceed the number of
parameters passed from the vertex shader via the parameter cache. Now we use
a separate index which only counts those parameters.

Prevents piglit regressions with the following fix.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-02 17:50:58 +02:00
Michel Dänzer
dbb4a7f950 radeon/llvm: Disable SI flow control again for now.
It makes piglit unreliable due to VM protection faults and GPU lockups.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-02 16:50:36 +02:00
Andreas Boll
48e4eb695a docs/helpwanted: cleanup todo list links
split into common and driver specific To-Do lists
add an explanation for each To-Do list

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-02 15:44:34 +02:00
Andreas Boll
1f38fb2697 docs: document how to apply a candidate to a stable branch
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-02 15:44:28 +02:00
Andreas Boll
f07784d9ba docs: document how to mark a candidate for a stable branch
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-02 15:44:00 +02:00
Negreanu Marius Adrian
e00abb00f0 android: glcpp: fix abuse of yylex
Port the 'glcpp: fix abuse of yylex' commit to Android.mk
Also, since the Android.*.mk are sourced in a global namespace,
the local-y-to-c-and-h is prefixed with the LOCAL_MODULE name,

The initial fix commit is 53d46bc787

There's also a bugzilla for this: 54947

Signed-off-by: Negreanu Marius Adrian <adrian.m.negreanu@intel.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-10-02 08:14:34 +03:00
Matt Turner
523c015246 build: Don't build libdricore if not building classic drivers 2012-10-01 15:23:05 -07:00
Matt Turner
b6c0fa1280 libdricore: Remove dead C(XX)FLAGS_NOVISIBILITY 2012-10-01 15:23:05 -07:00
Matt Turner
24ded89876 build: Add visibility CFLAGS to OSMesa 2012-10-01 15:23:05 -07:00
Matt Turner
1762ec28db build: Link OSMesa with glapi, libdl, libstdc++
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=399813
          https://bugs.freedesktop.org/show_bug.cgi?id=53179
2012-10-01 15:23:05 -07:00
Matt Turner
4cfff7211c build: Set visibility CFLAGS in dri/swrast 2012-10-01 15:23:05 -07:00
Matt Turner
3628402707 build: Set visibility CFLAGS in dri/r200 2012-10-01 15:23:05 -07:00
Matt Turner
55d45efdd8 build: Set visibility CFLAGS in dri/radeon 2012-10-01 15:23:05 -07:00
Matt Turner
340637d54d build: Set visibility CFLAGS in dri/nouveau 2012-10-01 15:23:04 -07:00
Matt Turner
381d120b8a build: Set visibility CFLAGS in dri/i915 2012-10-01 15:23:04 -07:00
Matt Turner
d2872b5612 build: Set visibility CFLAGS in dri/common 2012-10-01 15:23:04 -07:00
Matt Turner
8746f641bb build: Build src/glsl with visibility CFLAGS 2012-10-01 15:23:04 -07:00
Matt Turner
710a90ccaf build: Turn on visibility CFLAGS for core mesa 2012-10-01 15:23:04 -07:00
Matt Turner
63c3a051cd build: Order src/Makefile correctly 2012-10-01 15:23:04 -07:00
Matt Turner
814345f54b build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definition 2012-10-01 15:23:04 -07:00
Matt Turner
b6651ae6ad build: Use PTHREAD_LIBS and PTHREAD_CFLAGS 2012-10-01 15:23:04 -07:00
Matt Turner
dd4fde8f67 build: Set PTHREAD_LIBS for pkgconfig files if empty 2012-10-01 15:20:50 -07:00
Tom Stellard
00d80b3a6f llvmpipe: Fix build with LLVM 2.8
Commit 8d9778589f added all-targets to the
LLVM_COMPONENTS list, but this component does not exist with LLVM 2.8.

Adding all-targets is not necessary for any drivers, and it seems to be
left over from earlier versions of the commit mentioned above.

Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-10-01 17:42:56 -04:00
Tom Stellard
67fcb3c2b4 configure.ac: Use amdgpu component for LLVM 3.2
The amdgpu component actually does exist.  I must have been using an
older version of llvm-config by accident when I first made this change.
2012-10-01 21:14:10 +00:00
Tom Stellard
f2f17fc348 radeon/llvm: Only initialize the AMDGPU target 2012-10-01 21:14:10 +00:00
Tom Stellard
cbd09a9e5c radeon: Fix build with LLVM 3.1
The build was broken by commit 8d9778589f
2012-10-01 15:47:31 -04:00
Tom Stellard
8d9778589f radeon: Support LLVM 3.2
LLVM 3.2 and newer requires that the R600/SI backend be part of the
LLVM tree.
2012-10-01 15:37:17 +00:00
Tom Stellard
91ee735001 r600g: Re-enable growing of the compute memory pool 2012-10-01 15:37:16 +00:00
Tom Stellard
44b1050e6c r600g: Fix bug when adding new items to the compute memory pool
The items are ordered in the item list by their offsets, with the lowest
offset coming first in the list.  The old code was assuming that new
items being added to the list would always have a greater offset than
the first item in the list, however this is not always the case.
2012-10-01 15:37:16 +00:00
Tom Stellard
eacca90f43 r600g: Use a RAT buffer as the backing bo for the compute memory pool 2012-10-01 15:37:16 +00:00
Tom Stellard
5cd1c65dc1 r600g: Make sure to init the compute memory pool with enough memory 2012-10-01 15:37:16 +00:00
Tom Stellard
2508d43c36 r600g: Add evergreen_init_color_surface_rat() v2
This can be used to initialize the CB* registers for buffers without a
radeon_surface.

v2:
  - Get correct group_bytes value from r600_screen
  - Stop setting unnecessary fields

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-01 15:37:16 +00:00
Tom Stellard
d13c3b19f9 r600g: Add register field definitions for 028C70_RESOURCE_TYPE
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-10-01 15:37:16 +00:00
Oliver McFadden
9545d9611f intel: add support for ANGLE_texture_compression_dxt.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-01 17:21:51 +03:00
Alex Deucher
304beb81bb radeonsi: emit PA_SU_PRIM_FILTER_CNTL
has no default value.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:51 +02:00
Alex Deucher
7d76767f21 radeonsi: remove some old r600g cruft
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Alex Deucher
918e302a19 radeonsi: fix range checking for state regs
end value is exclusive, but in practice we shouldn't
hit this.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Alex Deucher
f1a3de5e9d radeonsi: drop some cayman remnants
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Christian König
22ae062fa1 radeonsi: define SGPR register numbers
Instead of hardcoding them.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-10-01 10:29:50 +02:00
Christoph Bumiller
c321b1bef1 nvc0: make sure handles for unbound textures/samplers are uploaded on nve4 2012-09-30 23:09:37 +02:00
Christoph Bumiller
2149ce41ed nv50,nvc0: fix 3d engine blit for nvc0 2012-09-30 23:09:29 +02:00
Christoph Bumiller
36ea744f58 nv50,nvc0: implement blit 2012-09-30 21:31:45 +02:00
Marek Olšák
de80660c2b gallium: remove resource_resolve
The functionality is provided by the new blit function.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
d37e6b15ad st/mesa: implement decompress_with_blit using gallium blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
d1b929a137 st/mesa: implement BlitFramebuffer using gallium blit
This also fixes a lot tests, especially all the clip-and-scissor-blit MSAA
piglit tests.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
ad3d5dbcc5 svga: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
3d9d4b1ce6 softpipe: implement blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
5f3054dcc4 radeonsi: implement blit
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
fc887d687b r600g: implement blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:57 +02:00
Marek Olšák
95b777e688 r300g: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
ced065a079 nv30: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
db85443922 nv30: use util_format_is_supported
Hardware drivers *must* use it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
ff2d192ec5 llvmpipe: implement blit
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
6d2f59ce54 i915g: implement blit
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
2a309dc2b4 gallium: implement blit in driver wrappers
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
ab3070c5fa gallium: add helpers for dumping pipe_box and pipe_blit_info
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
cecfb452ab gallium/u_blitter: add helper for blitting via resource_copy_region
v2: fix off-by-one error in is_box_inside_resource, add comments

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
0b0697e80d gallium/u_blitter: add gallium blit implementation
The original blit function is extended and the otAher functions reuse it.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
84d2f2295e gallium/u_blitter: add ability to disable and restore the render condition
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
59dfe0af60 gallium/u_blitter: facilitate co-existence with the Draw module
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
9cc257ad40 gallium/u_blitter: check PIPE_CAP_TEXTURE_MULTISAMPLE
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
c4df2e3337 gallium: add blit into the interface
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
b9c9dd4783 gallium: add PIPE_CAP_TEXTURE_MULTISAMPLE
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Marek Olšák
c15dbd7ef2 softpipe: fix set_framebuffer_state with uninitialized surfaces past nr_cbufs-1
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-30 18:57:56 +02:00
Vinson Lee
0615e8324c scons: Use full path of texture_builtins.py.
Fixes this build error on Cygwin.
Explicit dependency `src/glsl/builtins/tools/texture_builtins.py' not
found, needed by target
`build/cygwin-x86-debug/glsl/builtin_function.cpp'.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-29 14:38:37 -07:00
Brian Paul
46328296bd mesa: add fall-through comment, just to be clear 2012-09-29 08:53:59 -06:00
Brian Paul
bd81ebf085 mesa: remove useless GLenum casts 2012-09-29 08:53:59 -06:00
Brian Paul
e77fc1279a mesa: add const qualifier in check_for_ending() to silence warning 2012-09-29 08:24:44 -06:00
Kenneth Graunke
225276c696 i965: Complain about variable index lowering when INTEL_DEBUG=perf.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:36:56 -07:00
Kenneth Graunke
33dbac78a8 i965: Dump linked shaders on MESA_GLSL=dump.
Often, the original shader IR isn't terribly interesting because a lot
of crucial optimizations haven't been done (such as inlining built-ins).

ir_to_mesa used to print this out for us, but since we don't use it, we
have to do it ourselves.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:36:45 -07:00
Kenneth Graunke
5cadb3ef7e glsl: Rename variable_entry2 back to variable_entry in struct splitting.
The anonymous namespace should keep these private classes to file scope,
preventing clashes with other symbols of the same name elsewhere.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:36:01 -07:00
Anuj Phogat
ea0d088727 intel/i965: Disable SampleAlphaToOne if dual source blending enabled
From SandyBridge PRM, volume 2 Part 1, section 12.2.3, BLEND_STATE:
DWord 1, Bit 30 (AlphaToOne Enable):
"If Dual Source Blending is enabled, this bit must be disabled"

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-29 00:10:09 -07:00
Vinson Lee
9549e55f11 scons: Disable build of assembly sources on Cygwin.
The assembly sources currently do not build on Cygwin.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-28 23:29:10 -07:00
Jordan Justen
00905dbf19 mesa: allow MESA_GL_VERSION_OVERRIDE to override the API type
Change the format to MAJOR.MINOR[FC]
For example: 2.1, 3.0FC, 3.1

The FC suffix indicates a forward compatible context, and
is only valid for versions >= 3.0.

Examples:
2.1:   GL Legacy/Compatibility context
3.0:   GL Legacy/Compatibility context
3.0FC: GL Core Profile context + Forward Compatible
3.1:   GL Core Profile context
3.1FC: GL Core Profile context + Forward Compatible

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 16:15:51 -07:00
Ian Romanick
e87c63f288 i965: brwInitVtbl needs to know the chipset generation
Fixes major regressions since de958de.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 15:39:17 -07:00
Ian Romanick
de958de71b i915: Don't free the intel_context structure when intelCreateContext fails.
intelDestroyContext will eventually be called, and it will clean things up.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
2012-09-28 15:05:24 -07:00
Ian Romanick
87f26214d6 i965: Don't free the intel_context structure when intelCreateContext fails.
intelDestroyContext will eventually be called, and it will clean things
up.  The call to brwInitVtbl is moved earlier so that
intelDestroyContext can call the device-specific destructor.  This also
makes the code look more like the i915 code.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
2012-09-28 15:05:24 -07:00
Ian Romanick
22897c7497 intel: Don't call intelDestroyContext if there is no context to destroy
Some error paths in the device-specific context creation functions can exit
before the deintel_context structure is allocated.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
2012-09-28 15:05:24 -07:00
Ian Romanick
f93cb0bebb dri_util: Use calloc to allocate __DRIcontext
The __DRIcontext contains some pointers, and some drivers check for them to be
NULL in some failure paths.  Instead of sprinkling NULL assignments across the
various drivers, just zero out the whole thing.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
2012-09-28 15:05:24 -07:00
Jordan Justen
4c704e5949 main/version: add "(Core Profile) to version string for core profiles
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-28 14:17:12 -07:00
Eric Anholt
7ae332dc6d glx: Fix compile warnings since 99fee476a1
_glapi_table is a struct full of named function pointers, while the generated
code just wants to treat it as an array of function pointers.  Cast to avoid
the compiler warning.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 14:00:24 -07:00
Ian Romanick
66159f94a5 mesa/tests: Sanity check the ES2 dispatch table
This test is only built when shared-glapi is used.  Because of changes
elsewhere in the tree that were necessary to make shared-glapi work
correct with GLX, it's not feasible to make the test function both ways.

The list of expected functions originally came from the functions set by
api_exec_es2.c.  This file no longer exists in Mesa (but api_exec_es1.c
is still generated).  It was the generated file that configured the
dispatch table for ES2 contexts.  This test verifies that all of the
functions set by the old api_exec_es2.c (with the recent addition of VAO
functions) are set in the dispatch table and everything else is a NOP.

When adding ES2 (or ES3) extensions that add new functions, this test
will need to be modified to expect dispatch functions for the new
extension functions.

v2: Expect VAO functions be non-NOP.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 08:19:54 -07:00
Ian Romanick
d0e1428349 mesa/main: Make no-op dispatch function public
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 08:19:54 -07:00
Ian Romanick
9c59d11cd2 mesa/tests: Move stub function to a separate file
When building with shared-glapi, we can just use Mesa's _mesa_warning without
problems.  stubs.cpp is only used when shared-glapi is not used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-28 08:19:54 -07:00
Ian Romanick
6c01a0e770 mesa: Don't set uniform dispatch pointers for many things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
be66cf950e mesa: Don't set shaderapi dispatch pointers for many things in ES2 or core
v2: Allow GL_ARB_shader_objects functions in core profile because we
still expose the extension string there.  Don't allow
glBindFragDataLocation in GLES3 because it's not part of that API.
Based (mostly) on review comments from Eric Anholt.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
aa0f588e2d mesa: Don't set vtxfmt dispatch pointers for many things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
a13c07f752 mesa: Don't set loopback dispatch pointers for most things in ES2 or core
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:54 -07:00
Ian Romanick
3ef9e43865 mesa: Pass GL context to _mesa_create_save_table
This isn't used by this patch, but it will be necessary for several
follow-on patches.  Separating this out will make it easier to reorder
patches later.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
ee77061277 mesa: Don't set dispatch pointer for glTexStorage in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
7f7268d385 mesa: Don't set dispatch pointer for glGetProgramivARB in ES2
This function is not the same as glGetProgramiv.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
a83b01371e mesa: Don't set dispatch pointer for glResizeBuffersMESA in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
1c0a44aaf5 mesa: Don't set dispatch pointers for glPointParameter[if][v] in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
2a3a68e4c7 mesa: Don't set dispatch pointers for glClearDepth or glDepthRange in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
11927bfc4a mesa: Don't set dispatch pointer for glGetBufferSubData in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
850412b8ab mesa: Don't set dispatch pointer for glGetDoublev in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
aa129b0833 mesa: Don't set dispatch pointer for glPointSize in ES2
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
66b956618e mesa: Set dispatch pointer for glShaderBinary
NOTE: This is a candiate for stable branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-28 08:19:53 -07:00
Ian Romanick
23ff634c9c gles2: Alias glReadBufferNV with desktop glReadBuffer
NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kristian Høgsberg <krh@bitplanet.net>
2012-09-28 08:19:53 -07:00
Chad Versace
b589128620 intel: Fix yet-another-bug in intel_texsubimage_tiled_memcpy
The most recent commit that touched this function,

    commit b1d0fe022d
    Author: Chad Versace <chad.versace@linux.intel.com>
    Date:   Wed Sep 26 11:05:12 2012 -0700

        intel: Fix segfault in intel_texsubimage_tiled_memcpy

did fix the segfault, but introduced yet another bug. From Anholt: """You
need to still test format/type, because that's the incoming format (e.g.
GL_RGBA/GL_FLOAT) that you're trying to memcpy."""

This patch re-introduces the checks on the incoming format and type.

Note: This is a candidate for the 9.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-28 05:04:33 -07:00
Vinson Lee
d239cb1ccf mesa: Fix typo in error message.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-09-27 22:32:10 -07:00
Vincent Lejeune
92b3a99ce5 r600g: add some members to radeon_llvm_context
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-28 01:46:38 +02:00
Vincent Lejeune
a1a3792b18 r600g: tgsi-to-llvm path is taken after declarations have been parsed
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-28 01:46:23 +02:00
Kenneth Graunke
3767b25bd3 meta: Use float for temporary images, not (un)signed normalized.
In commit 091eb15b69, Jordan changed get_temp_image_type() to use
_mesa_get_format_datatype() instead of returning GL_FLOAT.  That has
several possible return values: GL_FLOAT, GL_INT, GL_UNSIGNED_INT,
GL_SIGNED_NORMALIZED, and GL_UNSIGNED_NORMALIZED.

We do want to use GL_INT/GL_UNSIGNED_INT for integer formats.  However,
we want to continue using GL_FLOAT for the normalized fixed-point types.
There isn't any code in pack.c to handle GL_(UN)SIGNED_NORMALIZED.

Fixes oglconform's fboarb advanced.blit.copypix, which was regressed by
commit 091eb15b69.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 15:37:04 -07:00
Chad Versace
7dc0be8a8b intel: Don't advertise GLX_SWAP_COPY_OML
This patch removes all gl_config's with swapMethod=GLX_SWAP_COPY_OML. When
page flipping, we are unable to comply with swap-copy semantics.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-27 14:32:40 -07:00
Eric Anholt
e917ed6eee i965: Remove stale comment about rebuilding tnl_program.
It gets built in Mesa core before we're called these days.

Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 13:22:52 -07:00
Eric Anholt
7f9e1a7720 i965: Add a comment explaining one of the brw_draw_upload.c loops.
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 13:22:49 -07:00
Eric Anholt
0334e8dc25 i965: Remove broken non-interleaved-to-interleaved upload code.
This failed when all the uploads to occur were uniform-type vertex data (like
glColor4f being active across a DrawArrays), because it would upload 1 element
instead of 1 element per vertex.  There was no citation for how this code
helped any particular application, and it breaks ETQW, so just remove it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47170
NOTE: This is a candidate for the 9.0 and 8.0 branches.
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 13:22:43 -07:00
Eric Anholt
f3984fbe33 intel: Remove dead intel_format_to_rb_datatype.
This was for some of the old spans-related code that is now gone.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
9ba6f4733c intel: Mark some file-local code as static.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
e0cd633f17 i965: Mark brw_disasm.c tables as static const.
v2: Make the strings in the tables const, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
837f06b42f i965: Use visibility cflags on the driver code.
The only symbols that need to be public (those in intel_screen.c that the
loader looks for) are already marked public.  Saves 100k of compiled driver
size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-27 12:52:53 -07:00
Eric Anholt
0f331bd385 i965/vp: Remove support for non-ARB_vp, non-NV_vp opcodes.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
57bd069849 i965/vp: Remove support for relative addressing of destination registers.
This was added for GLSL support back in the day.  It's prohibited by both
ARB_vp and NV_vp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
410197974b i965/vp: Remove support for reading destination registers.
It's prohibited by ARB_vp and NV_vp, and not used by fixed function t&l.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Eric Anholt
7a7081c45a i965/vp: Remove support for GLSL flow control from the old VS backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-27 12:52:53 -07:00
Matt Turner
9ed00075d8 build: Link libglapi with pthreads
NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=839060
          https://bugs.gentoo.org/show_bug.cgi?id=435152
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-09-27 10:25:26 -07:00
Matt Turner
7da12426f7 build: Use AX_PTHREAD to detect pthreads
NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-09-27 10:25:20 -07:00
Marek Olšák
96f50d0cf7 r600g: fix EXP on Cayman
NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
fd5c538464 r600g: fix RSQ of negative value on Cayman
NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
836325bf7e r600g: fix instance divisor on Cayman
Not sure if this is the best way to fix it.

NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
933faae2b8 r600g: flush FMASK and CMASK when changing colorbuffers on Evergreen
This fixes rare graphical corruption.

NOTE: This is a candidate for the stable branches.
2012-09-27 19:14:44 +02:00
Marek Olšák
9f5d6320f2 r600g: use invalid DB hardware formats to disable depth/stencil 2012-09-27 19:14:44 +02:00
Chad Versace
b1d0fe022d intel: Fix segfault in intel_texsubimage_tiled_memcpy
The function segfaulted when a game called glTexSubImage2D on a texture
with internalformat/format/type = GL_SLUMINANCE8/GL_BGRA/GL_UNSIGNED_BYTE.

The function only supports MESA_FORMAT_ARGB8888 and returns early if it
detects an unsupported format. Clearly, its detection condition was
insufficient. This patch fixes it to explicity check for
MESA_FORMAT_ARGB8888.

Note: This is a candidate for the 9.0 branch (fixes 413c491).
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-27 07:35:53 -07:00
Kenneth Graunke
6d6aef7974 i965: Do texture swizzling in hardware on Haswell.
Haswell supports EXT_texture_swizzle and legacy DEPTH_TEXTURE_MODE
swizzling by setting SURFACE_STATE entries.  This means we don't have to
bake the swizzle settings into the shader code by emitting MOV
instructions, and thus don't have to recompile shaders whenever the
swizzles change.

Unfortunately, we can't handle GL_ALPHA this way: unlike all the others,
which store the comparison result in the .r channel (and possibly others
as well), GL_ALPHA puts it in the .a channel.  The GLSL 1.30+ style
functions which return a float always simply return the .r channel,
which would be zero if we handled this as a surface override.  In this
case, fall back to doing it the old way.  DEPTH_TEXTURE_MODE = GL_ALPHA
isn't an interesting performance path anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 22:58:30 -07:00
Kenneth Graunke
b5a042a657 i965: Refactor texture swizzle generation into a helper.
It's going to be reused in a second place soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 22:58:30 -07:00
Vincent Lejeune
ff947c6d65 radeon/llvm: improve select_cc lowering to generate CND* more often
v2: - Simplify isZero()
    - Remove a unused function prototype
    - Clean whitespace trails

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-27 01:43:35 +02:00
Chad Versace
bb7ecb29fb intel: Fix size of temporary etc1 buffer
Fixes valgrind errors in piglit test
oes_compressed_etc1_rgb8_texture-miptree: an invalid write in
_mesa_store_compressed_store_texsubimage() at line 4406 and invalid reads
in texcompress_etc_tmp.h:etc1_parse_block().

The calculation of the size of the temporary etc1 buffer allocated by
intel_miptree_map_etc1() was incorrect. Sometimes the allocated buffer was
too small, sometimes too large.  This patch corrects the size to that
expected by _mesa_store_compressed_store_texsubimage().

Note: This is candidate for the 9.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-26 09:47:46 -07:00
Alex Deucher
0aa47b2d8b radeonsi: fix truncated register define.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-26 10:07:46 -04:00
Brian Paul
3ba9dbbabf mesa: move _mesa_es_error_check_format_and_type() to glformats.c
Where the non-ES _mesa_error_check_format_and_type() function lives.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 07:43:49 -06:00
Brian Paul
8348076ae4 mesa: move GL_HALF_FLOAT_OES definition to glheader.h
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-26 07:43:49 -06:00
Brian Paul
b52e05cecb mesa: minor fix to glTexSubImage error message 2012-09-26 07:43:49 -06:00
Brian Paul
d3aa6a5c56 mesa: consolidate sub-texture error checking code
Do all error checking of glTexSubImage, glCopyTexSubImage and
glCompressedTexSubImage's xoffset, yoffset, zoffset, width, height, and
depth params in one place.
2012-09-26 07:43:49 -06:00
Brian Paul
7e1ad9cd37 mesa: consolidate glTexSubImage() error checking 2012-09-26 07:43:49 -06:00
Brian Paul
f830f10a37 mesa: consolidate glCompressedTexSubImage() error checking
Do all the checking in one function instead of two and fix up some of
the error checking.alignment check
2012-09-26 07:43:49 -06:00
Brian Paul
bd3caa50a5 mesa: consolidate subtexture xoffset/yoffset/width/height error checking code
This is the code that checks if a subtexture region is aligned to the
compressed format's block size.
2012-09-26 07:43:49 -06:00
Brian Paul
2558af7e93 mesa: consolidate glCopyTexSubImage error checking
Do all the checking in one function instead of two.
2012-09-26 07:43:49 -06:00
Brian Paul
1f586684d6 mesa: fix incorrect error for glCompressedSubTexImage
If a subtexture region isn't aligned to the compressed block size,
return GL_INVALID_OPERATION, not gl_INVALID_VALUE.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-26 07:43:49 -06:00
Christian Koenig
421eeff463 radeonsi: move draw cmds to si_commands.c
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:35 +02:00
Christian Koenig
7773c7109c radeonsi: start seperating commands into si_commands.c
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:31 +02:00
Christian Koenig
3c51c60ed0 radeonsi: get rid of evergreen_hw_context.c
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:27 +02:00
Christian Koenig
fcc9c125f4 radeonsi: remove unused code
Signed-off-by: Christian Koenig <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:05:23 +02:00
Christian König
04473db38a radeonsi: start reworking inferred state handling
Instead of tracking the inferred state changes separately
just check if queued and emitted states are the same.

This patch just reworks the update of the SPI map between
vs and ps, but there are probably more cases like this.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-26 11:04:36 +02:00
Paul Berry
112caa853d gles3: Prohibit set/get of GL_FRAMEBUFFER_SRGB.
GLES 3 supports sRGB functionality, but it does not expose the
GL_FRAMEBUFFER_SRGB enable/disable bit.  Instead the implementation
is expected to behave as though that bit is always enabled.

This patch ensures that ctx->Color.sRGBEnabled (the internal variable
tracking GL_FRAMEBUFFER_SRGB) is initially true in GLES 2/3 contexts,
and that it cannot be modified through the GLES 3 API.

This is safe for GLES 2, since ctx->Color.sRGBEnabled has no effect on
non-sRGB formats, and GLES 2 doesn't support any sRGB formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-25 15:02:43 -07:00
Paul Berry
414f69aaad meta: Properly save/restore GL_FRAMEBUFFER_SRGB in Meta.
Previously, meta logic was saving and restoring the value of
GL_FRAMEBUFFER_SRGB in an ad-hoc fashion.  As a result, it was not
properly disabled and/or restored for some meta operations.

This patch causes GL_FRAMEBUFFER_SRGB to be saved/restored in the
conventional way of meta-ops (using _mesa_meta_begin() and
_mesa_meta_end()).  It is now reliably saved/restored for
_mesa_meta_BlitFramebuffer, _mesa_meta_GenerateMipmap, and
decompress_texture_image, and preserved for all other meta ops.

Fixes piglit tests "ARB_framebuffer_sRGB/blit renderbuffer
{linear_to_srgb,srgb} scaled {disabled,enabled}".

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-25 15:01:13 -07:00
Paul Berry
8faa79764c enable: Create _mesa_set_framebuffer_srgb() function for use by meta ops.
GLES3 supports sRGB formats, but it does not support the
GL_FRAMEBUFFER_SRGB enable/disable flag (instead it behaves as if this
flag is always enabled).  Therefore, meta ops that need to disable
GL_FRAMEBUFFER_SRGB will need a backdoor mechanism to do so when the
API is GLES3.

We were already doing a similar thing for GL_MULTISAMPLE, which has
the same constraints.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-25 15:01:13 -07:00
Matt Turner
399a03fdd6 targets/xorg-i915: Rename driver to i915_drv.so.
modesetting_drv.so is undescriptive and collides with
xf86-video-modesetting.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-09-25 12:04:10 -07:00
Chad Versace
413c491412 intel: Improve teximage perf for Google Chrome paint rects (v3)
This patch reduces the time spent in glTexImage and glTexSubImage by
over 5x on Sandybridge for the workload described below.

It adds a new fast path for glTexImage2D and glTexSubImage2D,
intel_texsubimage_tiled_memcpy, which is optimized for Google Chrome's
paint rectangles. The fast path is implemented only for 2D GL_BGRA
textures for chipsets with a LLC.

=== Performance Analysis ===

Workload description:

    Personalize your google.com page with a wallpaper.  Start chromium
with flags "--ignore-gpu-blacklist --enable-accelerated-painting
--force-compositing-mode".  Start recording with chrome://tracing. Visit
google.com and wait for page to finish rendering.  Measure the time spent
by process CrGpuMain in GLES2DecoderImpl::HandleTexImage2D and
HandleTexSubImage2D.

System config:

    cpu: Sandybridge Mobile GT2+ (0x0126)
    kernel 3.4.9 x86_64
    chromium 21.0.1180.89 (154005)

Statistics:

                  | N   Median  Avg   Stddev
    --------------|-------------------------
    before (msec) | 8   472.5  463.75 72.6
    after  (msec) | 8    78.0   79.6   5.7

    Arithmetic difference at 95.0% confidence:
       -384.1  +/- 55.2 msec
        -82.8% +/- 11.9%

    Ratio at 95.0% confidence:
          5.81 +/- 0.119

v2:
    - Replace check for `intel->gen >= 6` with `intel->has_llc`, per
      danvet.
    - Fix typo in comment, s/throuh/through/.
    - Swap 'before' and 'after' rows in stat table.

v3:
    - If the current batch references the bo, then flush batch before mapping
      the bo. Found by Chris.
    - Restrict supported texture images to level 0 of target
      GL_TEXTURE_2D. This avoids an arithmetic bug in calculating image
      offsets within the miptree, found by Paul. This restriction does not
      diminish this patch's benefit to Chrome OS performance.
    - Use less instructions for bit6 swizzling, suggested by Paul.
    - Remove erroneous comment about Y-tiling, for Paul.
    - Print perf_debug messages when flushing and stalling.
    - Update stats in commit message; run workload under a release build
      rather than a debug build.

Note: This is a candidate for the 9.0 branch.
Acked-by: Eric Anholt <eric@anholt.net>
CC: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-25 10:58:45 -07:00
Tom Stellard
581619f5a7 clover: Fix build with libclang v3.2
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-25 14:36:51 +00:00
Tom Stellard
71682cf65b clover: Query device for CL_DEVICE_MAX_MEM_ALLOC_SIZE v2
v2:
  - Use driver reported values and don't correct them to the OpenCL
    required minimum.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-25 14:36:50 +00:00
Tom Stellard
0e3c30cd6f gallium: Add PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE v2
v2:
  - Add comment in screen.rst
  - Report OpenCL required minimum for r600g
2012-09-25 14:36:50 +00:00
Tom Stellard
b57eba3654 r600g: Handle multiple kernels in the same program v2
v2:
  - Use pc parameter of launch_grid
2012-09-25 14:36:46 +00:00
Blaž Tomažič
e59505e34b clover: Handle multiple kernels in the same program v2
v2: Tom Stellard
  - Use pc parameter of launch_grid()

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-25 14:27:47 +00:00
Brian Paul
68a4bb553b mesa: remove 'struct' from texenv_fragment_program
texenv_fragment_program is declared as a class.  Fixes warnings with MSVC.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-25 08:23:18 -06:00
Kenneth Graunke
097b4a3b28 i965: Allow fast depth clears if scissoring doesn't do anything.
A game we're working with leaves scissoring enabled, but frequently sets
the scissor rectangle to the size of the whole screen.  In that case,
scissoring has no effect, so it's safe to go ahead with a fast clear.

Chad believe this should help with Oliver McFadden's "Dante" as well.

v2/Chad: Use the drawbuffer dimensions rather than the miptree slice
dimensions.  The miptree slice may be slightly larger due to alignment
restrictions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-and-tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
2012-09-25 07:03:59 -07:00
Paul Berry
ab5ce2789f i965: Don't spill "smeared" registers.
Fixes an assertion failure when compiling certain shaders that need both
pull constants and register spilling:

brw_eu_emit.c:204: validate_reg: Assertion `execsize >= width' failed.

NOTE: This is a candidate for release branches.

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-25 07:02:14 -07:00
Jay Cornwall
374925bec9 nv50/ir/ra: Fix register interference tracking.
See fdo bug 55224.
2012-09-25 14:00:51 +02:00
Paul Berry
124b214f09 i965/blorp: Fix sRGB MSAA resolves.
Commit e2249e8c4d (i965/blorp: Add
support for blits between SRGB and linear formats) changed blorp to
always configure surface states for in linear format (even if the
underlying surface is sRGB).  This allowed sRGB-to-linear and
linear-to-sRGB blits to occur without causing the image to be
inappropriately brightened or darkened.

However, it broke sRGB MSAA resolves, since they rely on the
destination buffer format being sRGB in order to ensure that samples
are averaged together in sRGB-correct fashion.

This patch fixes the problem by instead configuring the source buffer
to use the *same* format as the destination buffer.  This ensures that
the image won't be brightened or darkened, but preserves proper sRGB
averaging.

Fixes piglit tests "EXT_framebuffer_multisample/accuracy srgb".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55265

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-24 17:03:36 -07:00
Jonas Maebe
5fdf1f784b darwin: do not create double-buffered offscreen pixel formats
http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2012-09-24 16:06:07 -07:00
Tom Stellard
92b033a89e radeon/llvm: Fix instruction encoding for r600 family GPUs
Tested-by: Michel Dänzer <michel.daenzer@amd.com>

https://bugs.freedesktop.org/show_bug.cgi?id=55217
2012-09-24 17:01:31 -04:00
Brian Paul
24a8e0c3da build: remove signbit check in configure.ac
We now have a fallback macro in imports.h
This reverts part of 0f3ba405.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-24 14:48:23 -06:00
Brian Paul
14ca76646a mesa: add signbit() macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-24 14:48:06 -06:00
Tom Stellard
defe8f0da2 r600g: Set RADEON_FLUSH_KEEP_TILING_FLAGS when emitting compute cs 2012-09-24 18:35:50 +00:00
Robert Bragg
dda49c3cb7 build: substitute X11_INCLUDES variable
There are a few automake files that reference $(X11_INCLUDES) such as
src/glx/Makefile.am but configure.ac wasn't declaring the variable for
substitution. This would break builds of glx if libxcb, for example, was
installed in its own prefix since AM_CFLAGS wouldn't coincidentally
list the needed include path in that case.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-24 09:49:53 -07:00
Matt Turner
0f3ba405ea Use signbit() in IS_NEGATIVE and DIFFERENT_SIGNS
signbit() appears to be available everywhere (even MSVC according to
MSDN), so let's use it instead of open-coding some messy and confusing
bit twiddling macros.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54805
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Suggested-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-24 09:45:17 -07:00
Francisco Jerez
959fe586fb clover: Silence narrowing conversion warnings in resource.cpp. 2012-09-24 18:36:34 +02:00
Tom Stellard
01877a6fd0 clover: Handle NULL value for clEnqueueNDRangeKernel local_work_size
[ Francisco Jerez: Slight simplification. ]
2012-09-24 18:35:43 +02:00
Paul Berry
a33ce665a5 i965/blorp: Increase Y alignment for multisampled stencil blits.
This patch is a band-aid fix for a bug in commit 5fd67fa (i965/blorp:
Reduce alignment restrictions for stencil blits), which causes
multisampled stencil blits to work incorrectly on Sandy Bridge.

When blitting to or from a normal stencil buffer, we have to use a
coordinate transformation that swizzles coordinates to account for the
fact that stencil buffers use W tiling, but the most similar tiling
format available for textures and render targets is Y tiling.  The
differences between W and Y tiling cause pixels to be scrambled within
a block of size 8x4 (width x height) as measured relative to a W tile,
or 16x2 as measured relative to a Y tile.  So in order to make sure
that pixels at the edges of the blit aren't lost, we need to align the
rendering rectangle (and the buffer sizes) to multiples of the 8x4
block size.  This alignment happens in the brw_blorp_blit_params
constructor, whereas the determination of how to swizzle the
coordinates happens during code generation, in the
brw_blorp_blit_program class.

When blitting to or from a multisampled stencil buffer, the coordinate
swizzling is more complex, because it has to account for the
interleaving pattern of samples, which uses 4x4 blocks for 4x MSAA and
8x4 blocks for 8x MSAA.  The end result is that if multisampling is in
use, the 16x2 block size (relative so a Y tile) needs to be expanded
to 16x4, and the corresponding size relative to a W tile expands to
8x8.

The problem doesn't affect Ivy Bridge severely enough to crop up in
Piglit tests because on Ivy Bridge we have to disable multisampling
when blitting *to* a multisampled stencil buffer (the blorp compiler
generates code to compensate for the fact that multisampling is
disabled).  However I suspect a bug is still present because we don't
disable multisampling when blitting *from* a multisampled stencil
buffer.

This patch fixes the problem by doubling the vertical alignment
requirement when blitting to or from a multisampled stencil buffer,
and multisampling has not been disabled.

In the long run I would like to rework the brw_blorp_blit_params
constructor--it's difficult to follow and has had several subtle bugs
like this one.  However this band-aid fix should be suitable for
cherry-picking to release branches.

Fixes Piglit tests "unaligned-blit {2,4} stencil {msaa,upsample}" on
Sandy Bridge.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-24 09:07:31 -07:00
Brian Paul
68060cfb2b upgrade glext.h to version 85
NOTE: This is a candidate for the stable branches.
2012-09-24 08:07:08 -06:00
Brian Paul
f1c448d2e5 st/mesa: check for zero-size image in st_TestProxyTexImage()
Fixes divide by zero issue in llvmpipe driver.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-09-24 07:58:45 -06:00
Kenneth Graunke
c432c86e6a mesa: Silence narrowing warnings in ff_fragment_shader's emit_texenv().
Recent version of GCC report a warning for the implicit conversion from
int to float:

  ff_fragment_shader.cpp:897:3: warning: narrowing conversion of '(1 << ((int)rgb_shift))' from 'int' to 'float' inside { } is ill-formed in C++11 [-Wnarrowing]

This is because floats cannot precisely represent all possible 32-bit
integer values.  However, texenv code is all expected to be floating
point, so this should not be a problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-23 22:38:58 -07:00
Marek Olšák
60e610e042 docs: fixup GL4.3 TODO list
From the OpenGL Registry:
  "2012/08/13: specs named GL_ARB_debug_group, GL_ARB_debug_label, and
   GL_ARB_debug_output2 were published in error during the initial OpenGL 4.3
   release. All functionality in these documents was combined into
   the extension GL_KHR_debug. They have been withdrawn from the registry,
   and a few other extensions were renumbered to avoid holes in the numbering
   scheme."
2012-09-23 17:19:52 +02:00
Vincent Lejeune
fb40f88338 radeon/llvm: support for interpolation intrinsics
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-22 18:12:11 +02:00
Marek Olšák
2988fa940e draw: fix non-indexed draw calls if there's an index buffer
pipe_draw_info::indexed determines if it should be indexed and not
the presence of an index buffer.

This fixes crashes in r300g.

NOTE: This is a candidate for the stable branches.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-22 14:20:37 +02:00
Tom Stellard
bbb2ebe2fc r600g: Fix build with LLVM compiler 2012-09-21 20:07:14 -04:00
Marek Olšák
bfe489c76b r600g: set QUANT_MODE on Cayman too
This fixes piglit/fbo-blit-stretched.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:59 +02:00
Marek Olšák
11e2a41b84 r600g: use CS helpers to emit streamout state
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:59 +02:00
Marek Olšák
669bfaaa1e r600g: remove initialization of unused loop register tables
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:59 +02:00
Marek Olšák
b71701d43e r600g: remove now-unused SURFACE_BASE_UPDATE logic
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Marek Olšák
e3ecfecada r600g: remove unused CB registers from register lists
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Marek Olšák
c8b06dccff r600g: atomize framebuffer state
Tested on RS880, Evergreen and Cayman.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Marek Olšák
b652180107 r600g: don't snoop context state while building shaders
Let's use the shader key describing the state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-22 00:31:58 +02:00
Anuj Phogat
eb1d87fb94 meta: Add on demand compilation of per target shader programs
A call to glGenerateMipmap() follows the generation of a relevant
shader program in setup_glsl_generate_mipmap().

To support all texture targets and to avoid compiling shaders
everytime, per target shader programs are compiled on demand
and saved for the next call.

Fixes float-texture(mipmap.manual):
See Comment 6: https://bugs.freedesktop.org/show_bug.cgi?id=54296

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-21 13:31:58 -07:00
Tom Stellard
8ed9aaea51 clover: Initialize height and depth to 1 for transfers
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-21 19:45:17 +00:00
Tom Stellard
024e1732cb pipe-loader: Remove a few debug_printfs
On debug builds these were always being printed.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-09-21 19:45:07 +00:00
Tom Stellard
438b1da7e5 radeon/llvm: Handle loads from the constants address space.
Reading from constant memory is not supported yet, so constant reads use
global memory.
2012-09-21 19:30:58 +00:00
Tom Stellard
3882d7b5e4 radeon/llvm: Add support for v4f32 stores on R600 2012-09-21 19:30:58 +00:00
Tom Stellard
e866dbd1b5 radeon/llvm: Add support for i8 reads on R600 2012-09-21 19:30:57 +00:00
Tom Stellard
b282c9611e radeon/llvm: Expand vector fadd and fmul on R600 2012-09-21 19:30:57 +00:00
Tom Stellard
aa8367dd13 radeon/llvm: Add optimization for FP_ROUND 2012-09-21 19:30:57 +00:00
Tom Stellard
87decd6e66 radeon/llvm: Replace AMDGPU pow intrinsic with the llvm version 2012-09-21 19:30:53 +00:00
Paul Berry
aa3c2e3186 i965/blorp: Fix narrowing warnings.
Blorp has to convert rectangle coordinates from integers to floats in
order to send them down the GPU pipeline.  Recent versions of GCC
issue a warning for this, since a float is not capable of precisely
representing all possible 32-bit integer values.  Suppress the warning
with an explicit type cast in the case of blorp, since rectangle
coordinates will never be large enough to cause a loss of precision.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-21 10:53:25 +02:00
Kenneth Graunke
cd49025aff i965: Remove brw_set_predicate_inverse(p, true) from scratch offset code
Given that it exists between a push/pop of instruction state, this call
can only affect the MOV or ADD instruction generated just below it.
Neither of those instructions are predicated, so it makes no sense to
ask for the inverse predicate.

This fixes grumblings from the simulator debugger, which was
complaining about an invalid predicate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-21 01:29:40 -07:00
Kenneth Graunke
328961d955 mesa: Don't override S3TC internalFormat if data is pre-compressed.
Commit 42723d88d intended to override an S3TC internalFormat to a
generic compressed format when the application requested online
compression of uncompressed data.  Unfortunately, it also broke
pre-compressed textures when libtxc_dxtn isn't installed but the
extensions are forced on.

Both glCompressedTexImage2D() and glTexImage2D() call teximage(), which
calls _mesa_choose_texture_format(), hitting this override code.  If we
have actual S3TC source data, we can't treat it as any other format, and
need to avoid the override.

Since glCompressedTexImage2D() passes in a format of GL_NONE (which is
illegal for glTexImage), we can use that to detect the pre-compressed
case and avoid the overrides.

Fixes a regression since 42723d88d3.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-20 14:49:19 -07:00
Kenneth Graunke
e2249e8c4d i965/blorp: Add support for blits between SRGB and linear formats.
Fixes colorspace issues in L4D2 when multisampling is enabled (the
scene was far too dark, but the flashlight area was way too bright).

The nVidia and AMD binary drivers both allow this kind of blit.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-20 14:48:02 -07:00
Kenneth Graunke
c96828ecb4 mesa: Ignore SRGB when determining compatible resolve formats.
MSAA resolves and other blit-like operations ignore SRGB state anyway,
so we should be able to safely allow resolves between compatible
SRGB/linear formats like SRGBA8 and RGBA8888.

This matches the behavior of the nVidia and AMD binary drivers.

Fixes completely black rendering when using multisampling in L4D2.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-20 14:47:23 -07:00
Andreas Boll
8504f18c3d docs: update some more FAQs
v2: remove mention of XFree86

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:37 +02:00
Andreas Boll
0188b9371f docs: remove utility.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:37 +02:00
Andreas Boll
19195781c8 docs: remove science.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:37 +02:00
Andreas Boll
19fe84d8df docs: remove modelers.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
ca6ff299c5 docs: remove libraries.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
b1c75e7257 docs: remove games.html
This page is very old and some of the links are dead.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
9e2af606b6 docs/contents: add autoconf.html link
make it easier to find the docs/autoconf.html site

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
7b314b3b14 docs: convert last traces of progs to mesa/demos repository
v2: fix typo

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
356a73145e docs: add IRC info
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
76d4f9e404 docs/egl: improve markup
replace unordered list <ul> with defined list <dl>

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
63eade4b60 docs/autoconf: improve markup
replace unordered list <ul> with defined list <dl>

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
ab06629d5d docs/autoconf: remove obsolete demo options
removed with commit 56c3cce2a1
two years ago

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Andreas Boll
d61707d0f8 docs: improve quality of gears.png
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 20:00:36 +02:00
Brian Paul
58f386b20b gallium: mention PIPE_TIMEOUT_INFINITE in the fence_finish() comment 2012-09-20 09:49:12 -06:00
Brian Paul
0bcad02955 llvmpipe: fix overflow bug in total texture size computation
v2: use uint64_t for the total_size variable, per Jose.

Also add two earlier checks for exceeding the max texture size.
For example a 1K^3 RGBA volume would overflow the lpr->image_stride
variable.

Use simple algebra to avoid overflow in intermediate values.
So instead of "x * y > z" use "x > z / y".

This should work if we happen to be on a platform that doesn't have
64-bit types.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-20 09:47:09 -06:00
Alex Deucher
7b4aefd3c9 r600g/llvm: rs780/rs880 are r600 asics
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-20 11:17:52 -04:00
Ian Romanick
ae3023e967 mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXT
This was already (correctly) supported for glGetSamplerParameter paths.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-20 11:42:56 +02:00
Tom Stellard
bd8fb9e805 r300/compiler: Use precomputed q values in the register allocator 2012-09-19 19:25:53 -04:00
Tom Stellard
886a4d4a6a r300g: Init regalloc state during context creation
Initializing the regalloc state is expensive, and since it is always
the same for every compile we only need to initialize it once per
context.  This should help improve shader compile times for the driver.
2012-09-19 19:25:53 -04:00
Tom Stellard
9282adcae9 r300/compiler: Don't create register classes for inputs 2012-09-19 19:25:53 -04:00
Tom Stellard
e0f64a837f ra: Add q_values parameter to ra_set_finalize()
This allows the user to pass precomputed q values to the allocator.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-19 19:25:53 -04:00
Tom Stellard
cfeb99c7da ra: Clarify usage of ra_set_node_reg()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-19 19:25:53 -04:00
Tom Stellard
69b387fbdc r600g: Invalidate texture cache when creating vertex buffers for compute v2
Compute shaders fetch data from vertex buffers via the texture cache, so
we need to make sure the texture cache is flushed.

v2:
  - Fix rebase mistake
  - Fix spelling in comment

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
810345492e r600g: Use LOOP_START_DX10 for loops
LOOP_START_DX10 ignores the LOOP_CONFIG* registers, so it is not limited
to 4096 iterations like the other LOOP_* instructions.  Compute shaders
need to use this instruction, and since we aren't optimizing loops with
the LOOP_CONFIG* registers for pixel and vertex shaders, it seems like
we should just use it for everything.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
3e3ca92718 r600g: Set the correct value of COLOR*_DIM for RATs
For buffers (which is what is being used for RATs), the
COLOR*_DIM.WIDTH_MASK field needs to be set to the low 16-bits of the
buffer size, and the COLOR*_DIM.HEIEGHT_MAX needs to be set to the
high bits.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
9db64530bb r600g: Make sure to initialize DB_DEPTH_CONTROL register for compute
The kernel CS checker will fail if this register is not initialized.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
69d814885b r600g: Add some comments and debug printfs to compute code
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 14:58:53 -04:00
Tom Stellard
6bd11bc9d5 r600g: Add missing break to case statement 2012-09-19 15:27:32 -04:00
Michal Sciubidlo
0e0c21e00e radeon/llvm: Emit ISA for ALU instructions in the R600 code emitter
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-19 13:17:41 -04:00
Tom Stellard
d525ed1a84 radeon/llvm: Only support 512 constant registers on R600
This is necessary upcoming encoding changes, since we will only be
using 9-bits for register encoding.
2012-09-19 13:11:36 -04:00
Andreas Boll
5abb1f8bde docs: update faq 2012-09-19 18:23:45 +02:00
Andreas Boll
0aad2e400c docs: update sourcetree
- add OpenCL state tracker Clover

- add XvMC state tracker

- remove progs
  directory got moved into its own repository mesa/demos

- remove vf
  directory removed with abda64efce
2012-09-19 18:23:45 +02:00
Andreas Boll
7a40dc1992 docs: remove obsolete r300c traces 2012-09-19 18:23:45 +02:00
Brian Paul
ead9cfdcc4 Revert "mesa: consolidate subtexture x/y/width/height error checking code"
This reverts commit 5b807400a8.

accidentally pushed.
2012-09-19 10:07:45 -06:00
Brian Paul
e1e302c7f6 Revert "more comment"
This reverts commit 5205db6a7c.

accidentally pushed
2012-09-19 10:07:34 -06:00
Brian Paul
f51d232e5f Revert "mesa: clean-up and fix glCompressedTexSubImage error checking"
This reverts commit 0c67fe5d2d.

accidentally pushed.
2012-09-19 10:07:22 -06:00
Brian Paul
7c8c90c4e4 docs: fix "Cppyright" typo 2012-09-19 10:01:04 -06:00
Brian Paul
0c67fe5d2d mesa: clean-up and fix glCompressedTexSubImage error checking 2012-09-19 09:21:03 -06:00
Brian Paul
5205db6a7c more comment 2012-09-19 09:21:03 -06:00
Brian Paul
5b807400a8 mesa: consolidate subtexture x/y/width/height error checking code
This is the code that checks if a subtexure region is aligned to the
compressed format's block size.
2012-09-19 09:21:03 -06:00
Andreas Boll
a73c59b7a6 docs: remove obsolete target attribute 2012-09-19 17:15:48 +02:00
Andreas Boll
7b09254883 docs: news.html is the new index.html 2012-09-19 17:15:47 +02:00
Andreas Boll
ac5cee934f docs: remove obsolete frame layout 2012-09-19 17:15:47 +02:00
Andreas Boll
b5da52ac58 docs: add new iframe layout 2012-09-19 17:15:47 +02:00
Andreas Boll
ad05f2e429 docs/news: linkify some active links 2012-09-19 17:15:45 +02:00
Andreas Boll
cc7eea955a docs/news: deactivate dead links
I have left the links as <code> elements for the purpose of
documentation.
2012-09-19 17:15:39 +02:00
Andreas Boll
6e0c2702e3 docs/news: drop redundant link 2012-09-19 17:15:34 +02:00
Andreas Boll
9ddf74d443 docs/news: update link 2012-09-19 17:15:31 +02:00
Andreas Boll
83937a2c0f docs/news: remove link to a non-existent page 2012-09-19 17:15:24 +02:00
Andreas Boll
6fb8aeb2c5 docs: fix some issues in relnotes
improve markup
fix link to relnotes-9.0
add missing relnotes links
2012-09-19 12:12:38 +02:00
Andreas Boll
abb1c847ac docs/devinfo: fix typo 2012-09-19 12:10:32 +02:00
Vadim Girlin
9aa8bac98b winsys/radeon: fix relocs caching
Don't cache pointers to elements of reallocatable array.
In some circumstances it caused false cache hits resulting in incorrect
command stream and gpu lockup.

Note: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-09-19 04:48:16 +04:00
Vincent Lejeune
175fdd7b86 radeon/llvm: Add a fdiv pattern.
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-09-18 18:00:20 +02:00
Vincent Lejeune
12c4526157 radeon/llvm: reserve also corresponding 128bits reg
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-09-18 17:59:51 +02:00
Andreas Boll
88c3647e0b docs: drop obsolete sourceforge link
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-18 08:32:50 -06:00
Brian Paul
7d624799b9 softpipe: implement the new can_create_resource() function
And define a SP_MAX_TEXTURE_SIZE value as we do in llvmpipe.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
b9e88c5592 llvmpipe: implement the new can_create_resource() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
ead8847d44 st/mesa: implement new proxy texture code
If the gallium driver implements the can_create_resource() function, call
it to do proxy texture size checks.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
bd8b43a9f4 gallium: add new pipe_screen::can_create_resource() function
Used to implement proxy textures.  If a gallium driver doesn't implement
this function we'll just continue to use the core Mesa fallback code.

Without this hook we really have no good way to implement OpenGL proxy
textures with gallium drivers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:27 -06:00
Brian Paul
a0fc7620f5 mesa: take cube faces into account in _mesa_test_proxy_teximage()
There will always be six cube faces so take that into consideration when
computing the texture size and comparing against the limit.
2012-09-17 19:49:27 -06:00
Brian Paul
90ca4c0c62 mesa: handle GL_PROXY_TEXTURE_CUBE_MAP in _mesa_num_tex_faces() 2012-09-17 19:49:27 -06:00
Brian Paul
df73be9105 llvmpipe: set max cube texture size to 4K x 4K
Before, the limit was 8K.  For 32-bit RGBA that would be require 1.5 GB
of memory (w/out mipmaps).  That's well beyond the LP_MAX_TEXTURE_SIZE
of 1GB.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
7dc76e9424 mesa: move/fix levels check for glTexStorage()
Fix copy&paste error and move min levels check closer to max levels check.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
ff24ed09fa mesa: rewrite glTexStorage() code
Simplify the code and make it more like the other glTexImage commands.
Call _mesa_legal_texture_dimensions() to validate width, height, depth.
Call ctx->Driver.TestProxyTexImage() to make sure texture is not too large.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
e6eaa85a43 mesa: rework texture size error checking
There are two aspects to texture image size checking:
1. Are the width, height, depth legal values (not negative, not larger
   than the max size for the mipmap level, etc)?
2. Is the texture just too large to handle?  For example, we might not be
   able to really allocate memory for a 3D texture of maxSize x maxSize x
   maxSize.

Previously, we did (1) via the ctx->Driver.TestProxyTextureImage() hook
but those tests are really device-independent.  Now we do (2) via that
hook since the max texture memory and texture shape are device-dependent.

Also, (1) is now done outside the general texture parameter error checking
functions because of the special interaction with proxy textures.  The
recently introduced PROXY_ERROR token is removed.

The teximage() and copyteximage() functions are bit simpler now (less
if-then nesting, etc.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
ce2ae3c3a2 mesa: refactor _mesa_test_proxy_teximage() code
Basically, move the body into a new _mesa_legal_texture_dimensions() function.
More refactoring to come.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
b1874ec931 mesa: move glTexImage 'level' error checking
Move level checking out of _mesa_test_proxy_teximage() and into
the other error-checking functions.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-17 19:49:26 -06:00
Brian Paul
35f16600b3 mesa: change create_version_string() return type to void
Fixes "warning: no return statement in function returning non-void"
2012-09-17 19:46:20 -06:00
Dave Airlie
1ce9f25fde glsl: make _mesa_builtin_uniform_desc static
I can't see any reason this is global (unless for debugging)

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-18 07:57:42 +10:00
Tom Stellard
bfd55711c1 radeon/llvm: Inital flow control support for SI
This adds basic flow control support for If-Then-Else blocks using
predicates (stored in the EXEC register) and a predicate stack for
nested flow control.
2012-09-17 21:09:43 +00:00
Xinya Zhang
ef0d7e13d7 r600g: Close a memory leak of llvm byte streams
No regressions found in the tests of opencl-example/run_tests.sh.

Signed-off-by: Xinya Zhang <zxy_thf@hotmail.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 21:09:43 +00:00
Tom Stellard
0b1a182905 radeon/llvm: Fix unused variable warning 2012-09-17 21:09:43 +00:00
Tom Stellard
059a56bddb radeon/llvm: Move kernel arg lowering into R600TargetLowering class 2012-09-17 21:09:43 +00:00
Jordan Justen
9fac1d1c3a main/version: consolodate version string creation for ES/Desktop GL
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-17 13:42:09 -07:00
Eric Anholt
81dff4f752 i965: Stop putting 8 NOPs after each prorgam.
As far as I can see, the intention of the requirement that we do so is to
prevent instruction prefetch from wandering out into either unmapped memory or
memory with a different caching type, and hanging the chip.  The kernel makes
sure that the page after your BO has a valid page of the same caching type,
which meets this requirement, so there's no need to waste space between our
programs (and in instruction cache) on this.

Saves another 9kb instructions in l4d2 shaders.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-17 12:32:52 -07:00
Eric Anholt
3e165ba62c i965: Test instruction compaction on gen7 2012-09-17 12:32:52 -07:00
Kenneth Graunke
bce72170ea i965: Add support for instruction compaction on Gen7.
Reduces l4d2 program size from 1195kb to 919kb.  Improves performance by 0.22%
+/- 0.11% (n=70).

v2: Rebase on compaction v2, fix up flag reg handling (by anholt).
v3: Fix uncompaction of the flag register number.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-17 12:32:52 -07:00
Eric Anholt
f25aefcebe i965: Support instruction compaction between control flow.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
077d01b673 i965: Add support for instruction compaction.
This reduces program size by using some smaller encodings for common bit
patterns in the Gen ISA, with the hope of making programs fit in the
instruction cache better.

v2: Use larger bitshifts for the uncompressed field setups, in line with the
    way it's described in the spec.  Consistently name a brw_compile "p" like
    all other code.  Add a couple more tests.  Consistently call things
    "compacted" not "compressed" (which is a different feature).  Drop the
    explicit check for not compacting SENDs, which is unjustified and already
    implied by our lack of support for immediate values.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
f5e2706395 i965: Prepare the break/cont uip/jip setting for compacted instructions.
The first cut at instruction compaction won't compact things that
would change control flow jump distances, but we do need to still be
able to walk the instruction stream, which involves jumping by 8 or 16
bytes between instructions.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:52 -07:00
Eric Anholt
f2bd3e70b5 i965: Move program dump to a helper function in brw_eu.c.
It's going to get more complicated when we do instruction compaction.  This
also introduces putting the program offset in the output.

v2: Use next_insn_offset in brw_get_program(), too.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
826ecbbe6e i965: Make a linkable library for the contents of i965_dri.so.
To do unit testing of i965, we want to be able to link against the
driver's symbols and prod them.  If we don't have a separate lib from
our loadable module, libtool gets super whiny.

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
5dafee1853 dri: Reuse dri_test.c for stub glapi symbols for unit testing.
This file is used to provide stubs for the link test in gallium dri drivers.
But the same stubs without the main can be used for making unit tests for code
in a dri driver.

Acked-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Eric Anholt
3f98ba9c43 i965: Clear brw_compile on setup.
I noticed in valgrind that p->single_program_flow was used while
uninitialized.  Everything else zeroed out brw_compile, but this is better
API.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-17 12:32:51 -07:00
Andreas Boll
99f14bc789 docs: remove obsolete mesa subset documentation
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-17 10:34:12 -06:00
Michel Dänzer
14c12ca331 radeon/llvm: Match integer add/sub for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:05:49 +02:00
Michel Dänzer
8d7dd68d2a radeon/llvm: Complete integer comparison patterns for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:03:41 +02:00
Michel Dänzer
97d3d25e1c radeon/llvm: Match AMDGPUfract on SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 18:02:01 +02:00
Michel Dänzer
39fb7faf95 radeon/llvm: Match int_AMDGPU_floor for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 17:30:09 +02:00
Michel Dänzer
6d3a1a5361 radeon/llvm: Match vector logical operations on SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-17 17:12:08 +02:00
Brian Paul
7b6b447fa3 softpipe: update SP_MAX_TEXTURE_3D_LEVELS comment
9 levels = max size of 256 texels.
2012-09-16 19:00:20 -06:00
Tomeu Vizoso
68d1a3afd4 mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs
instead of just for GL and ES1.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-16 12:03:29 -07:00
Chris Forbes
d30a7d2eb4 mesa: fix dropped && in glGetStringi()
This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously,
all extension names returned would be NULL.

NOTE: This is a candidate for release branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-16 01:47:00 -07:00
Kenneth Graunke
679c93ff89 meta: Don't _mesa_set_enable() invalid targets in ES 1.
GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and
GL_TEXTURE_GEN_S/T/R/Q don't exist in ES 1 contexts, so any meta ops
that used _mesa_meta_begin with MESA_META_TEXTURE would trigger GL
errors.  One such operation is _mesa_meta_Clear().

On ES 1, we want to disable GL_TEXTURE_GEN_STR_OES instead.

Fixes the ES1 conformance test miplin.c, which was regressed by commit
08be1d288f.

NOTE: This is a candidate for the 9.0 branch.

v2: Also blacklist GL_TEXTURE_3D, per Brian's comment.
v3: Disable GL_TEXTURE_GEN_STR_OES, per Ian's comment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-15 20:13:09 -07:00
José Fonseca
b6c2234c22 Temporarily revert "mesa: remove remaining FEATURE_* defines where protected by API check."
This reverts commit 9f37b405a3.

Fixes windows builds.
2012-09-15 18:18:39 +01:00
Brian Paul
e78ebbc5f9 scons: add new -p (prefix) options for yacc
These were recently added to the Makefiles.
2012-09-15 09:01:15 -06:00
Brian Paul
2f5f7bd687 swrast: remove unused ati_fs_opcodes array 2012-09-15 08:29:47 -06:00
Brian Paul
e656c4a074 mesa: remove FEATURE_ES test in texcompress_cpal.c
Fixes a regression after removing the #if FEATURE_x tests.
2012-09-15 08:28:21 -06:00
Oliver McFadden
2bc8f03f49 mesa: remove never-defined FEATURE_histogram conditional.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:59 +03:00
Oliver McFadden
9f37b405a3 mesa: remove remaining FEATURE_* defines where protected by API check.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:57 +03:00
Oliver McFadden
ab1a9430c3 mesa: remove obsolete comments from mfeatures.h
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:55 +03:00
Oliver McFadden
961fcc45ad mesa: remove FEATURE_ATI_fragment_shader define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:52 +03:00
Oliver McFadden
dd44f80f81 mesa: remove FEATURE_APPLE_object_purgeable define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:51 +03:00
Oliver McFadden
dda982f1a7 mesa: remove FEATURE_EXT_transform_feedback define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:49 +03:00
Oliver McFadden
88233b0bc3 mesa: remove FEATURE_EXT_texture_sRGB define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:48 +03:00
Oliver McFadden
e9ccb5fe52 mesa: remove FEATURE_EXT_framebuffer_blit define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:46 +03:00
Oliver McFadden
d05d5d9a91 mesa: remove FEATURE_ARB_sync define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:45 +03:00
Oliver McFadden
02a19684f9 mesa: remove FEATURE_ARB_sampler_objects define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:43 +03:00
Oliver McFadden
c609bf9786 mesa: remove FEATURE_ARB_pixel_buffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:42 +03:00
Oliver McFadden
e8ba24cbfd mesa: remove FEATURE_ARB_map_buffer_range define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:41 +03:00
Oliver McFadden
32c3ba8753 mesa: remove FEATURE_ARB_framebuffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:39 +03:00
Oliver McFadden
e8a72d8282 mesa: remove FEATURE_ARB_(fragment|vertex)_program defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:38 +03:00
Oliver McFadden
b7d15977f6 mesa: remove FEATURE_NV_(fragment|vertex)_program defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:36 +03:00
Oliver McFadden
ae241747c8 mesa: remove unused FEATURE_NV_fence define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:26 +03:00
Oliver McFadden
b874db09cf mesa: remove unused FEATURE_OES_framebuffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:24 +03:00
Oliver McFadden
740cdfdea3 mesa: remove unused FEATURE_OES_mapbuffer define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:22 +03:00
Oliver McFadden
f88393afbe mesa: remove FEATURE_OES_EGL_image define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:20 +03:00
Oliver McFadden
cd28a19bd9 mesa: remove FEATURE_EXT_pixel_buffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:19 +03:00
Oliver McFadden
0c1ff721e1 mesa: remove FEATURE_EXT_framebuffer_object define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:18 +03:00
Oliver McFadden
528f48432e mesa: remove FEATURE_ARB_shader_objects and related defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:16 +03:00
Oliver McFadden
7ada8d371e mesa: remove FEATURE_ARB_fragment_shader define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:14 +03:00
Oliver McFadden
6c4cddadaa mesa: remove FEATURE_ARB_vertex_shader define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:13 +03:00
Oliver McFadden
5489fc7b9f mesa: remove FEATURE_OES_draw_texture define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:11 +03:00
Oliver McFadden
009250a096 mesa: remove FEATURE_es2_glsl and related defines.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:10 +03:00
Oliver McFadden
d09428c9cc mesa: remove FEATURE_point_size_array define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:07 +03:00
Oliver McFadden
fd232c6bd4 mesa: remove unused FEATURE_extra_context_init define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:06 +03:00
Oliver McFadden
ab8d76357f mesa: remove FEATURE_texture_s3tc define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:04 +03:00
Oliver McFadden
beb293e4cd mesa: remove FEATURE_texture_fxt1 define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:02 +03:00
Oliver McFadden
d4c2b1e8f8 mesa: remove FEATURE_rastpos define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:57:00 +03:00
Oliver McFadden
25ee9617ff mesa: remove FEATURE_queryobj define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:53 +03:00
Oliver McFadden
0ba82f9108 mesa: remove FEATURE_pixel_transfer define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:52 +03:00
Oliver McFadden
26a26e9992 mesa: remove FEATURE_feedback define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:50 +03:00
Oliver McFadden
fa9fc2332b mesa: remove FEATURE_evaluators define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:48 +03:00
Oliver McFadden
24c3d16f3b mesa: remove FEATURE_drawpix define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:46 +03:00
Oliver McFadden
53514b0326 mesa: remove FEATURE_draw_read_buffer define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:44 +03:00
Oliver McFadden
09df07373b mesa: remove FEATURE_dlist define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:42 +03:00
Oliver McFadden
dce8602251 mesa: remove FEATURE_convolve define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:40 +03:00
Oliver McFadden
97a8ca47ae mesa: remove FEATURE_colortable define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:37 +03:00
Oliver McFadden
004f032baf mesa: remove FEATURE_beginend define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:35 +03:00
Oliver McFadden
985b0cb22f mesa: remove FEATURE_attrib_stack define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:33 +03:00
Oliver McFadden
d6543599da mesa: remove FEATURE_arrayelt define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:31 +03:00
Oliver McFadden
016ba4cc2c mesa: remove FEATURE_accum define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:29 +03:00
Oliver McFadden
fc66313c96 mesa: remove FEATURE_userclip define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:27 +03:00
Oliver McFadden
eeed210c7d mesa: remove FEATURE_texgen define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:22 +03:00
Oliver McFadden
e5870d97eb mesa: remove FEATURE_dispatch define.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-15 12:56:09 +03:00
Dave Airlie
72f657c950 vbo: add a prefix to count_tessellated_primitives
Just to make it consistent with the rest of vbo, since it would
be an exported symbol anyways.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:04:09 +10:00
Dave Airlie
ee9f576637 mesa/fxt1: make fxt1_decode_1 static
No users outside this file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:37 +10:00
Dave Airlie
da86e62d3c mesa/ati_fragshader: no need for opcodes to be global.
I can't see these in use anywhere outside this file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:30 +10:00
Dave Airlie
14b4e727fb glsl: make tex_opcode_strs static
No reason for this to be global from what I can see

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:24 +10:00
Dave Airlie
7b10d81fc8 mesa/dxtn: make function pointers static
These aren't used outside thie file from what I can see.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:10 +10:00
Dave Airlie
36639ec6e9 meta: make mem_ctx non-global.
I can't see any external users, and this is a global symbol,

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:03:03 +10:00
Dave Airlie
7056193a43 glsl: make builtin_mem_ctx a static
This isn't used outside the generated file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:02:46 +10:00
Dave Airlie
0b45bd146a ir_to_mesa: make some global variable static
nothing outside this file uses these.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:02:20 +10:00
Dave Airlie
6f3deeae96 mesa: make global perm variable static const
this array doesn't look like it needs to be global or unconst.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 18:01:02 +10:00
Mike Frysinger
8f9bae615d mklib: clean up abi flags for x86 targets
The current code is duplicated in two places and relies on `uname` to
detect the flags.  This is no good for cross-compiling, and the current
logic uses -m64 for the x32 ABI which breaks things.

Unify the code in one place, avoid `uname` completely, and add support
for the new x32 ABI.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-09-14 15:27:16 -07:00
Dave Airlie
88b0790b1a mesa/glsl: rename preprocess to glcpp_preprocess
This symbol with dricore escapes into the namespace, its too generic,
we should prefix it with something just to be nice.

Should be applied to stable + 9.0

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 08:22:55 +10:00
Dave Airlie
53d46bc787 glcpp: fix abuse of yylex
So glcpp tried to workaround yylex its own way, but failed,
do it properly.

This fixes another crash found after fixing the first crash.

this is a candidate for 9.0 and stable branches

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 08:20:56 +10:00
Dave Airlie
cc943c8470 mesa: use a prefix for the program lex
This avoids us making a global yylex symbol which will interfere will
all sorts of apps.

with libdricore which can't do symbol visibility currently we pollute
the namespace with this.

This is a candidate for 9.0 & stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-09-15 08:20:56 +10:00
Paul Berry
a29a456635 meta: Refactor handling of GL_MULTISAMPLE.
In commit 055093e (meta: remove call to _meta_in_progress(), fix
multisample enable/disable), we created a meta_set_enable() function
that could be used by meta ops to enable and disable GL_MULTISAMPLE
even when the GLES API was in use (the GLES API doesn't support
GL_MULTISAMPLE; it behaves as if it is always enabled).  This created
some unfortunate code duplication between meta_set_enable() and the
existing _mesa_set_enable() function.

This patch eliminates the duplication by creating a
_mesa_set_multisample() function, which is used by both meta ops and
_mesa_set_enable() to enable/disable GL_MULTISAMPLE.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-14 14:50:41 -07:00
Anuj Phogat
15bf3103b4 _mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130
glsl version of _mesa_meta_GenerateMipmap() would require separate
shaders for glsl 120 and 130.

V2: Removed the code for integer textures as ARB is planning to
    disallow automatic mipmap generation for integer textures.

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-14 11:23:03 -07:00
Anuj Phogat
299acac849 _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime
glsl path of _mesa_meta_GenerateMipmap() function would require different fragment
shaders depending on the texture target. This patch adds the code to generate
appropriate fragment shader programs at run time.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296

V2: Removed the code for integer textures as ARB is planning to
    disallow automatic mipmap generation for integer textures.
    Now using ralloc_asprintf in setup_glsl_generate_mipmap().

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-14 11:23:03 -07:00
Christian König
fb541662eb radeon/llvm: Support frint on SI
Gets VDPAUs shaders working again.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-14 17:03:24 +02:00
Marek Olšák
fac7031a04 r600g: consolidate decompression code for the blitter 2012-09-14 05:55:00 +02:00
Marek Olšák
df5e2c058f r600g: do not require MSAA renderbuffer support if not asked for
to allow stencil-only sampler-only formats (like X24S8)

NOTE: This is a candidate for the stable branches.
2012-09-14 05:55:00 +02:00
Marek Olšák
61706915a3 gallium/u_blitter: fix stencil-only blits
NOTE: This is a candidate for the stable branches.
2012-09-14 05:55:00 +02:00
Marek Olšák
1e51d368eb r300g: fix colormask with non-BGRA formats
NOTE: This is a candidate for the stable branches.
2012-09-14 05:55:00 +02:00
Alex Deucher
b33d7eaa5e r600g: reduce quant mode on evergreen+
Seems to have an affect on the allowable range of
values.  Set evergreen+ to 1/256 to match 6xx/7xx.

fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=54877

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-13 17:33:35 -04:00
Marek Olšák
ee50d365ea radeonsi: don't use a staging resource for large transfers
It kills performance if the resource is linear.
2012-09-13 20:26:21 +02:00
Marek Olšák
e386972f5b r600g: don't use a staging resource for large transfers
It kills performance if the resource is linear.
2012-09-13 20:25:47 +02:00
Marek Olšák
1f5a7567e8 r600g: convert the remnants of VGT state into immediate register writes/atoms v4
v2: Group vgt register together to avoid lockup
v3: Split multi primitive register and index bias register
v4: Bump R600_NUM_ATOMS

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
150decffb4 r600g: emit the primitive type and associated regs only if the type is changed
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
c56dca909a r600g: add clip_misc_state for clip registers emitted in draw_vbo
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
51d839edc8 r600g: fix computing how much space is needed for a draw command
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
8faf3bcf07 r600g: fix the number of CS dwords of cb_misc_state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:45 +02:00
Marek Olšák
2b8d39bbfc r600g: atomize clip state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
de89fe1e5d r600g: atomize blend color
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
605fd0c14a r600g: atomize viewport state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
63bf0f905a r600g: atomize stencil ref state
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
fd19aa4e12 r600g: remove unused state ID definitions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
c383a3cfb2 r600g: initialize the first CS just like any other CS
by reusing the CS initialization in r600_context_flush.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
263045afbc r600g: add support for geometry shader samplers and constant buffers
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
f2eac1423a r600g: put sampler states and views into an array indexed by shader type
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
3fe78594b1 r600g: do fine-grained sampler state updates
Update only those sampler states which are changed in a shader stage,
instead of always updating all sampler states in the shader stage.
That requires keeping a bitmask of those states which are enabled, and those
states which are dirty at a given point (subset of enabled states).

This is similar to how sampler views, constant buffers, and vertex buffers
are handled.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
6c86124157 r600g: consolidate set_viewport_state functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
48de30e760 r600g: consolidate set_sampler_views functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
1bce17ee01 r600g: put constant buffer state into an array indexed by shader type
to easily and robustly handle multiple shader stages

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
3bffd8a5eb r600g: cleanup state function names
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
f96df32d62 r600g: consolidate initialization of common state functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Marek Olšák
fd2e34d557 r600g: simplify flushing
Based on the patch called "simplify and fix flushing and synchronization"
by Jerome Glisse.

Rebased, removed unneded code, simplified more and cleaned up.

Also, SH_ACTION_ENA is not set when changing shaders (hw doesn't seem
to need it). It's only used to flush constant buffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-09-13 20:18:44 +02:00
Tom Stellard
6a5a4d59ce radeon/llvm: Fix lowering of vbuild
Some of the old AMDIL code was hard-coding subreg indices when creating
the VBUILD node, which was making it difficult to match the
vector_insert patterns.
2012-09-13 10:38:02 -04:00
Tom Stellard
70a50685a8 radeon/llvm: Support fmul on SI 2012-09-13 10:38:02 -04:00
Kenneth Graunke
28f4be9eb9 i965: Fix out-of-order sampler unit usage in ARB fragment programs.
ARB fragment programs use texture unit numbers directly, unlike GLSL
which has an extra indirection.  If a fragment program only uses one
texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single
bit, which would make us only upload a single surface/sampler state
entry.  However, it needs to be the second entry.

Using _mesa_fls() instead of _mesa_bitcount() solves this.  For ARB
programs, this makes num_samplers the ID of the highest texture unit
used.  Since GLSL uses consecutive integers assigned by the linker,
_mesa_fls() should give the same result as _mesa_bitcount()..

Fixes a regression since 85e8e9e000,
which caused GPU hangs in ETQW (and probably others), as well as
breaking piglit test fp-fragment-position.

v2: Add a comment, as suggested by Matt.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: meng <mengmeng.meng@intel.com>
2012-09-12 22:13:05 -07:00
Kenneth Graunke
0fc163408e mesa: Add a _mesa_fls() function to find the last bit set in a word.
ffs() finds the least significant bit set; _mesa_fls() finds the /most/
significant bit.

v2: Make it an inline function in imports.h, per Brian's suggestion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-12 22:13:05 -07:00
Paul Berry
1a5d4f7cb2 i965/blorp: Fix offsets and width/height for stencil blits.
Fixes piglit test "framebuffer-blit-levels draw stencil".

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
5fd67fac14 i965/blorp: Reduce alignment restrictions for stencil blits.
Previously, we aligned all stencil blit operations to multiples of the
size of a tile, since stencil buffers use W-tiling, and blorp has to
approximate this by configuring the 3D pipeline for Y-tiling and
swizzling coordinates.

However, this was unnecessarily conservative; it turns out that the
differences between W-tiling and Y-tiling are confined to 32-byte
sub-tiles within the 4k tiling pattern; the layout of these 32-byte
sub-tiles within the larger 4k tile is the same (8 sub-tiles across by
16 sub-tiles down, in column-major order).  Therefore we only need to
align stencil blit operations to multiples of the sub-tile size.

Note: although the performance improvement of this change is probably
quite small, the fact that W-tiling and Y-tiling formats only differ
within 32-byte sub-tiles will be essential in a future patch to ensure
that stencil blits work correctly between parts of the miptree other
than level/layer 0.  Making this change provides handy documentation
(and validation) of this fact.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
1a75063d5f i965/blorp: don't reduce stencil alignment restrictions when multisampling.
When blitting to a stencil buffer, we need to align the rectangle we
send down the rendering pipeline, to account for the fact that the
stencil buffer uses a W-tiled layout, but we are configuring its
surface state as Y-tiled.

Previously, when the stencil buffer was multisampled, we assumed that
we could reduce the amount of alignment that was necessary, since each
pixel occupies a block of 2x2 or 4x2 samples in the stencil buffer.
That would have been correct if the coordinates we were adjusting were
measured in pixels.  However, the conversion from pixel coordinates to
coordinates within the interleaved buffer has already been done;
therefore the full alignment restriction applies.

Note: the reason this mistake wasn't previously uncovered by piglit
tests is because it is being masked by another mistake: the blorp
engine is using overly conservative alignment restrictions when doing
stencil blits.  The overly conservative alignment restrictions will be
removed in the patch that follows.  Doing this fix now will prevent
the subsequent patch from introducing regressions.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
b760c9913d intel: Add map_stencil_as_y_tiled to intel_region_get_aligned_offset.
This patch modifies intel_region_get_aligned_offset() to make the
appropriate calculation when the blorp engine sets up a W-tiled
stencil buffer using a Y-tiled SURFACE_STATE.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
50dec7fc2d intel: Add map_stencil_as_y_tiled to intel_region_get_tile_masks.
When the blorp engine is performing a blit from one stencil buffer to
another, it sets up the surface state for these buffers as Y-tiled, so
it needs to be able to force intel_region_get_tile_masks() to return
the appropriate masks for a Y-tiled region.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:13 -07:00
Paul Berry
f04f219906 i965/blorp: Account for offsets when emitting SURFACE_STATE.
Fixes piglit tests "framebuffer-blit-levels {read,draw} depth".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
3123f06215 i965/blorp: Thread level and layer through brw_blorp_blit_miptrees().
Previously, when performing a blit using the blorp engine, we failed
to account for the level and layer of the source and destination.  As
a result, all blits would occur between miplevel 0 and layer 0 of the
corresponding textures, regardless of which level/layer was bound to
the framebuffer.

This patch passes the correct level and layer through
brw_blorp_miptrees() into the brw_blorp_blit_params data structure.

Further patches in the series will adapt
gen{6,7}_blorp_emit_surface_state to make use of these parameters.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
bc6cafa045 i965/blorp: Don't create a dummy renderbuffer just to fetch image offsets.
This is unnecessary--the image offsets can be read directly out of the
miptree using intel_miptree_get_image_offset.
2012-09-12 14:44:12 -07:00
Paul Berry
c130ce7b2b i965/blorp: store x and y offsets in brw_blorp_mip_info.
Currently, gen{6,7}_blorp_emit_surface_state assumes that the src and
dst surfaces are mapped to miplevel 0 and layer 0 (thus no surface
offset is required).  This is a bug, since the user might try to blit
to and from levels/layers other than 0.

To fix this bug, it will not be sufficient to have
gen6_{6,7}_blorp_emit_surface_state look up the surface offset at the
time they set up the surface state, since these offsets will need to
be tweaked when blitting stencil buffers (due to the fact that stencil
buffer blits have to swizzle between W and Y tiling formats).

So, to pave the way for the bug fix, this patch causes the x and y
offsets to be computed during blit setup and stored in
brw_blorp_mip_info.

As a result of this change, brw_blorp_mip_info doesn't need to store
the level and layer anymore.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
09b0fa8499 i965/blorp: store surface width/height in brw_blorp_mip_info.
Previously, gen{6,7}_blorp_emit_surface_state would look up the width
and height of the surface at the time they set up the surface state,
and then tweak it if necessary (it's necessary when a W-tiled surface
is being mapped as Y-tiled).  With this patch, we look up the width
and height when setting up the blit, and store them in
brw_blorp_mip_info.  This allows us to do the necessary tweak in the
brw_blorp_blit_params constructor (where it makes more sense).  It
also reduces the need to keep track of level and layer in
brw_blorp_mip_info, so that a future patch can eliminate them
entirely.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
e14b1288ef i965/blorp: Change gl_renderbuffer* params to intel_renderbuffer*.
This makes it more convenient for blorp functions to get access to
Intel-specific data inside the renderbuffer objects.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
32c7b2769c i965/blorp: Clarify why width/height must be adjusted for Gen6 IMS surfaces.
Also add a clarifying comment for why the width/height doesn't need
adjustment for Gen7.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Paul Berry
bde833c9d0 i965/gen6+: Adjust stencil buffer size after computing miptree layout.
Since Gen6+ stencil buffers use W-tiling (a tiling arrangement which
drm and the kernel are not aware of) we need to round up the width and
height of a stencil buffer to multiples of the W-tile size (64x64)
before allocating a stencil buffer.  Previously, we rounded up the
size of the base miplevel, and then computed the miptree layout based
on the rounded up size.  This was incorrect, because it meant that the
total size of the miptree would not be properly W-tile aligned, and
therefore we would not always allocate enough pages.

(Note: even though the GL API doesn't allow creation of mipmapped
stencil textures, it does allow mipmapping of a combined depth/stencil
texture, and on Gen6+, a combined depth/stencil texture is internally
implemented as a pair of separate depth and stencil buffers.)

For example, on Sandy Bridge, when allocating a mipmapped stencil
texture of size 128x128, we would first round up to the nearest
multiple of 64x64 (causing no change to the size), and then compute
the miptree layout (whose size worked out to 128x196).  Then we would
request an allocation of 128*196 bytes (6.125 pages), causing 7 pages
to be allocated to the texture.  However, the texture needs 8 pages,
since each W-tile occupies a page, and it takes 2 W-tiles to cover a
width of 128 and 4 W-tiles to cover a height of 196.

This patch changes the order of operations so that the miptree layout
is computed first and then the total size of the miptree is rounded up
to be W-tile aligned.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-12 14:44:12 -07:00
Matt Turner
af6aeae4e1 build: Don't list glproto and dri2proto in pkg-config file
No files provided by glproto or dri2proto are needed for building
something with Mesa.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=342393
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-09-12 11:26:28 -07:00
Michel Dänzer
7443e4e697 radeonsi: Properly handle NULL sampler views.
Fixes piglit shaders/glsl-fs-uniform-sampler-array and many other similar
tests.

In fact, I just completed a piglit quick-driver.tests run without any GPU
lockups or even VM protection faults. Yay!

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-12 15:53:51 +02:00
Michel Dänzer
d67d8e2471 radeonsi: Fix calculation of number of records in buffer resource.
The value was too small by 1 in some cases (non-first of several vertex
elements interleaved in a single buffer).

Fixes intermittent incorrect geometry in many apps, e.g. piglit
spec/EXT_texture_snorm/fbo-generatemipmap-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-12 13:23:09 +02:00
Imre Deak
9f30cbe9ee mesa: glGet: fix API check for EGL_image_external enums
These enums are valid only in ES1 and ES2. So far they were marked valid
incorrectly, depending on the previous API mask in the enum list.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Imre Deak
ae310e37fb mesa: glGet: fix indentation of print_table_stats
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Imre Deak
97a693d1fa mesa: glGet: fix indentation of find_value
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Imre Deak
746e82fff4 mesa: glGet: fix indentation of _mesa_init_get_hash
No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-09-11 17:38:21 -06:00
Brian Paul
35c75f6777 mesa: fix proxy texture error handling in glTexStorage()
This is basically a follow-on to 1f5b1f9846.
Basically, generate GL errors for ordinary invalid parameters for proxy
targets the same as for non-proxy targets.  Only texture size and OOM
errors should be handled specially for proxies.

Note: This is a candidate for the stable branches.
2012-09-11 17:38:21 -06:00
Brian Paul
d17440dcaa mesa: make _mesa_get_proxy_target() non-static
Needed for the next patch.

Note: This is a candidate for the stable branches.
2012-09-11 17:38:21 -06:00
Brian Paul
2e4fc54977 mesa: do internal format error checking for glTexStorage()
Turns out we weren't doing any format checking before.  Now check
the internal format and, in particular, make sure that unsized internal
formats aren't accepted.

Note: This is a candidate for the stable branches.
2012-09-11 17:38:21 -06:00
Paul Berry
5d5f0f3491 mesa/msaa: Allow X and Y flips in multisampled blits.
From the GL 4.3 spec, section 18.3.1 "Blitting Pixel Rectangles":

    If SAMPLE_BUFFERS for either the read framebuffer or draw
    framebuffer is greater than zero, no copy is performed and an
    INVALID_OPERATION error is generated if the dimensions of the
    source and destination rectangles provided to BlitFramebuffer are
    not identical, or if the formats of the read and draw framebuffers
    are not identical.

It is not clear from the spec whether "dimensions" should mean both
sign and magnitude, or just magnitude.

Previously, Mesa interpreted "dimensions" as meaning both sign and
magnitude, so any multisampled blit that attempted to flip the image
in the X and/or Y direction would fail.

However, Y flips are likely to be commonplace in OpenGL applications
that have been ported from DirectX applications, as a result of the
fact that DirectX and OpenGL differ in their orientation of the Y
axis.  Furthermore, at least one commercial driver (nVidia) permits Y
filps, and L4D2 relies on them being permitted.  So it seems prudent
for Mesa to permit them.

This patch changes Mesa to allow both X and Y flips, since there is no
language in the spec to indicate that X and Y flips should be treated
differently.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-09-11 15:50:55 -07:00
Tom Stellard
843ac06ad2 radeon/llvm: Fix operand order of V_CNDMASK in custom inserter
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:48 -04:00
Tom Stellard
d399ce7615 radeon/llvm: Assert if we try to encode an unknown register
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:48 -04:00
Tom Stellard
0df2753ad2 radeon/llvm: Add register encoding for VCC
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
056d9c6ef1 radeon/llvm: Ignore special registers when calculating reg count
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
0fb1e68a0b radeonsi: Handle position input parameter for pixel shaders v2
v2:
  - Don't increment ninterp or set any of the have_* flags for
    TGSI_SEMANTIC_POSITION

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
0410e9e8c7 radeon/llvm: Coding style fixes
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
d3e58f75d2 radeonsi: Move interpolation mode check into the compiler
The compiler needs to know which interpolation modes are enabled, so
it knows which values will be preloaded into the VGPRs.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
5fff032dd5 radeonsi: Add missing interpolation mode to check for enabled modes
At least one interpolation mode must be enable, but the code that checks
this was not checking for perspective center.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
cc571a367e radeonsi: Pass shader type to the compiler
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Tom Stellard
dfd3d61abf radeon/llvm: Add SHADER_TYPE instruction
This allows the program to specify the type of shader being compiled
(e.g. PXEL, VERTEX, etc.)

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-11 14:53:47 -04:00
Jerome Glisse
841c1b5f54 r600g: avoid GPU doing constant preload from random address
Previous command stream might have set any of the constant buffer
and the previous address might no longer be valid thus GPU might
preload constant from random invalid address and possibly triggering
lockup.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-11 12:57:54 -04:00
Michel Dänzer
9ccaa24f84 radeonsi: Texture border colour fixes.
* Handle arbitrary border colours.
* Use correct packing format for detecting special border colours.

Fixes piglit tex-border-1 and probably many other tests using border colours.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-11 11:06:56 +02:00
Michel Dänzer
03dfa30596 radeonsi: Handle NULL sampler states.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-11 11:06:16 +02:00
Kenneth Graunke
23cd6c43da i965: Remove incorrect comment above opt_algebraic.
The comment was cut-and-pasted from propagate_constants(), and had no
relation at all to opt_algebraic().
2012-09-10 22:58:25 -07:00
Kenneth Graunke
354f2cb5c7 glsl: Generate compile errors for explicit blend indices < 0 or > 1.
According to the GLSL 4.30 specification, this is a compile time error.
Earlier specifications don't specify a behavior, but since 0 and 1 are
the only valid indices for dual source blending, it makes sense to
generate the error.

Fixes (the fixed version of) piglit's layout-12.frag.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-09-10 20:56:11 -07:00
Marek Olšák
87389d4e5c r600g: remove unused function 2012-09-11 00:02:58 +02:00
Marek Olšák
830b6f3273 r600g: fix printf warning 2012-09-11 00:02:58 +02:00
Andreas Boll
e81ee67b51 mesa: bump version to 9.1 (devel)
Now that branch 9.0 is created, bump the minor version in
master.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-09 03:00:17 -07:00
Johannes Obermayr
10a96f4a4d Set OSMESA_VERSION=8.
VERSION_NUMBER is not required anymore. So it will be removed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-09-07 14:44:48 -04:00
Christoph Bumiller
3433471e8b nvc0/ir: add initial code to support GK110 ISA encoding 2012-09-07 19:03:40 +02:00
Michel Dänzer
8a497e5955 radeonsi: Float format fixups.
Fixes piglit spec/ARB_texture_float/fbo-generatemipmap-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-07 18:23:08 +02:00
Michel Dänzer
15c009af28 radeonsi: Handle more SNORM formats.
Fixes piglit spec/EXT_texture_snorm/fbo-generatemipmap-formats (except for
what seems like a random fluke).

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-07 18:23:08 +02:00
Eric Anholt
39aca5076f i965: Fix virtual_grf_interferes() between calculate_live_intervals() and DCE.
This fixes the blue zombies bug in l4d2.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-07 08:29:49 -07:00
Eric Anholt
7b3fe776e2 i965: Make the param pointer arrays for the VS dynamically sized.
Saves 96MB of wasted memory in the l4d2 demo.

v2: Rebase on compare func change, change brace style.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-07 08:29:49 -07:00
Eric Anholt
f144b78dfb i965: Make the param pointer arrays for the WM dynamically sized.
Saves 26.5MB of wasted memory allocation in the l4d2 demo.

v2: Rebase on compare func change, fix comments.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-07 08:29:48 -07:00
Eric Anholt
99596cba78 i965: Add functions for comparing two brw_wm/vs_prog_data structs.
Currently, this just avoids comparing all unused parts of param[] and
pull_param[], but it's a step toward getting rid of those giant statically
sized arrays.

v2: Actually use the new function instead of just looking at its
    address.  This required changing the args to const pointers.
    (review by Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-07 08:29:48 -07:00
Eric Anholt
5bb94f2bc4 glsl: Count builtin uniforms against uniform component limits.
We don't fully process the builtin uniforms, but at least
num_uniform_components reflects reality now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-09-07 08:29:48 -07:00
Michel Dänzer
30b303743d radeonsi: Handle TGSI_SEMANTIC_FOG.
Fixes exponential fog. The pixel shaders for linear fog seem to get
miscompiled still somehow.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-07 16:12:04 +02:00
Michel Dänzer
3144821ef6 radeon/llvm: Match fexp2 for SI.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-07 12:16:32 +02:00
Brian Paul
043f66204b glapi/glx: rename 'table' variable to 'disp_table'
This fixes an issue where the local 'table' variable was hiding the
function parameter name in glGetColorTable(..., void *table).

This should be OK as long as there's never a GL entrypoint that uses
'disp_table' as a parameter name.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-06 18:58:49 -06:00
Brian Paul
14f55869a4 glx: move 'prime' var into #ifdef'd code block
To silence unused var warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-06 18:58:49 -06:00
Kenneth Graunke
815d9d405c i965: Fix primitive restart on Haswell.
Haswell moved the "Cut Index Enable" bit from the INDEX_BUFFER packet to
a new 3DSTATE_VF packet, so we need to emit that.  Also, it requires us
to specify the cut index rather than assuming it's 0xffffffff.

This adds a new Haswell-specific tracked state atom to gen7_atoms.
Normally, we would create a new generation-specific atom list, but since
there's only one difference over Ivybridge so far, I chose to simply
make it return without doing any work on non-Haswell systems.

Fixes five piglit tests:
- general/primitive-restart-DISABLE_VBO
- general/primitive-restart-VBO_COMBINED_VERTEX_AND_INDEX
- general/primitive-restart-VBO_INDEX_ONLY
- general/primitive-restart-VBO_SEPARATE_VERTEX_AND_INDEX
- general/primitive-restart-VBO_VERTEX_ONLY

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-09-06 16:39:48 -07:00
Matt Turner
058fb00716 build: Disable building of d3d1x
It's broken and unmaintained, and I'm tired of seeing bug reports about
it.
2012-09-06 16:20:18 -07:00
Paul Berry
78a34d868d intel: avoid undefined variable warnings in intel_screen.c
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-06 14:49:25 -07:00
Jerome Glisse
5ceb87286f r600g: order atom emission v3
To avoid GPU lockup registers must be emited in a specific order
(no kidding ...). This patch rework atom emission so order in which
atom are emited in respect to each other is always the same. We
don't have any informations on what is the correct order so order
will need to be infered from fglrx command stream.

v2: add comment warning that atom order should not be taken lightly
v3: rebase on top of alphatest atom fix

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-06 15:09:17 -04:00
Jerome Glisse
935a729447 r600g: fix num of dwords needed for alphatest_state atom
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-09-06 15:09:14 -04:00
Chad Versace
f29a4b0157 mesa: Don't advertise GLES extensions in GL contexts
glGetStringi(GL_EXTENSIONS) failed to respect the context's API, and so
returned all internally enabled GLES extensions from a GL context.
Likewise, glGetIntegerv(GL_NUM_EXTENSIONS) also failed to repsect the
context's API.

Note: This is a candidate for the 8.0 and 9.0 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-09-06 11:46:04 -07:00
José Fonseca
edc0a00377 llvmpipe: Make driver name more informative.
Such as

  "llvmpipe (LLVM 3.1, 128 bits)"

or

  "llvmpipe (LLVM 3.1, 256 bits)"

when leveraging AVX 8-wide registers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-09-06 16:35:25 +01:00
Michel Dänzer
694617a5b4 radeonsi: Handle more L/I/A format cases.
Fixes piglit fbo-generatemipmap-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-06 16:48:16 +02:00
Michel Dänzer
cfebaf9dbd radeonsi: Enable whole quad mode for pixel shaders.
Fixes wrong mipmap level being sampled at some triangle edges.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:46:55 +02:00
Michel Dänzer
5edb80cee0 radeon/llvm: Add intrinsic for enabling whole quad mode in SI pixel shaders.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:46:42 +02:00
Michel Dänzer
e7383b74ef radeon/llvm: SI shader vector instructions implicitly use the EXEC register.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:46:27 +02:00
Michel Dänzer
ab162f80c3 radeon/llvm: Extend SI EXEC register support.
Add 32 bit lo and hi variants, and binary encodings.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-06 16:15:44 +02:00
Tom Stellard
2baaa5c7eb radeon/llvm: Remove R600InstrInfo.td from TD_FILES
Fixes build bug introduced by
cebbdd4ac2
2012-09-06 14:16:59 +00:00
Michel Dänzer
d0f51fe567 radeonsi: Enable NPOT textures again.
Should be at least mostly working now (with the corresponding fixes in
libdrm_radeon).

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:39:20 +02:00
Michel Dänzer
cf697e875c radeonsi: Mipmaps require memory footprint to be padded to powers of two.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:39:13 +02:00
Michel Dänzer
b7d96ca35e radeonsi: Sampler view state simplification.
We can always use the offset and tiling mode from level 0 and restrict the
first and last mipmap level to be used in the sampler resource.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:39:01 +02:00
Michel Dänzer
396af00ffe radeonsi: Untiled textures are linear aligned, not linear general.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-09-06 15:38:45 +02:00
Tom Stellard
cebbdd4ac2 radeon/llvm: Cleanup makefile
Hopefully, this will fix all the parallel make problems people have
been having.
2012-09-06 13:30:42 +00:00
Matt Turner
b6109de34f Remove useless checks for NULL before freeing
Same as earlier commit, except for "FREE"

This patch has been generated by the following Coccinelle semantic
patch:

// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ FREE (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   FREE(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
type T;
@@
+ FREE ((T) E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   FREE((T) E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ FREE (E);
- if (unlikely (E != NULL)) {
-   FREE (E);
- }

@@
expression E;
type T;
@@
+ FREE ((T) E);
- if (unlikely (E != NULL)) {
-   FREE ((T) E);
- }

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
da3282b6e2 Replace another malloc/memset-0 combination with calloc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
52789496a7 Remove useless memset after calloc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
6bda027e01 Use calloc instead of malloc/memset-0
This patch has been generated by the following Coccinelle semantic
patch:

@@
expression E;
identifier I;
@@
- I = malloc(E);
+ I = calloc(1, E);
...
- memset(I, 0, sizeof *I);

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
5067506ea6 Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic
patch:

// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
type T;
@@
+ free ((T) E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free((T) E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
-   free (E);
- }

@@
expression E;
type T;
@@
+ free ((T) E);
- if (unlikely (E != NULL)) {
-   free ((T) E);
- }

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:50 -07:00
Matt Turner
a9e8054fff glX_proto_send.py: Don't cast the return value of malloc 2012-09-05 22:28:50 -07:00
Matt Turner
2b7a972e3f Don't cast the return value of malloc/realloc
This patch has been generated by the following Coccinelle semantic
patch:

// Don't cast the return value of malloc/realloc.
//
// Casting the return value of malloc/realloc only stands to hide
// errors.

@@
type T;
expression E1, E2;
@@
- (T)
(
_mesa_align_calloc(E1, E2)
|
_mesa_align_malloc(E1, E2)
|
calloc(E1, E2)
|
malloc(E1)
|
realloc(E1, E2)
)
2012-09-05 22:28:50 -07:00
Matt Turner
812931f602 glX_proto_send.py: Remove deprecated Xmalloc/Xfree calls
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:49 -07:00
Matt Turner
7c7b7b068b Remove Xcalloc/Xmalloc/Xfree calls
These calls allowed Xlib to use a custom memory allocator, but Xlib has
used the standard C library functions since at least its initial import
into git in 2003. It seems unlikely that it will grow a custom memory
allocator. The functions now just add extra overhead. Replacing them
will make future Coccinelle patches simpler.

This patch has been generated by the following Coccinelle semantic
patch:

// Remove Xcalloc/Xmalloc/Xfree calls

@@ expression E1, E2; @@
- Xcalloc (E1, E2)
+ calloc (E1, E2)

@@ expression E; @@
- Xmalloc (E)
+ malloc (E)

@@ expression E; @@
- Xfree (E)
+ free (E)

@@ expression E; @@
- XFree (E)
+ free (E)

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:28:49 -07:00
Vinson Lee
17a574d7cd Use the correct macro _WIN32 for Windows.
The correct predefined macro for Windows is _WIN32, not WIN32 or
__WIN32__.  _WIN32 is defined for 32-bit and 64-bit version of Windows
by both MSVC and MinGW compilers.

http://sourceforge.net/p/predef/wiki/OperatingSystems
http://msdn.microsoft.com/en-us/library/b0084kay.aspx

This patch also fixes a MinGW automake build error.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-05 22:14:32 -07:00
Brian Paul
df5eb0c9bc mesa: remove #undef CONST in get.c
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:31 -06:00
Brian Paul
97992b05fb mesa: remove now unused CONST macro
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:27 -06:00
Brian Paul
2e23a76eb9 mesa: s/CONST/const/ in a comment
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:21 -06:00
Brian Paul
9f2a7a38e8 mesa: s/CONST/const/ in math/ files
The CONST macro hack will go away soon.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 21:20:03 -06:00
Tom Stellard
d220e2de7f radeon/llvm: Fix operand ordering for V_CNDMASK_B32
This fixes several hundred piglit tests.
2012-09-05 13:17:49 -04:00
Tom Stellard
12d3d6f6ab radeon/llvm: Use correct float->int conversion opcode on SI.
V_CVT_I32_F32 converts floats to signed integers, but we were using
V_CVT_F32_I32 which convertes signed integers to float.
2012-09-05 13:17:17 -04:00
Tom Stellard
d68e337c60 configure.ac: Don't link gallium drivers with libdricore
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-05 14:01:56 -04:00
Paul Berry
e42f16c192 i965/blorp: Fix incorrect indentation. 2012-09-05 10:42:06 -07:00
Paul Berry
772ea84b35 mapi: Add shared-glapi-test to .gitignore 2012-09-05 10:41:42 -07:00
Brian Paul
771e7b6d88 mesa: fix per-level max texture size error checking
This is a long-standing omission in Mesa's texture image size checking.
We need to take the mipmap level into consideration when checking if the
width, height and depth are too large.

Fixes the new piglit max-texture-size-level test.
Thanks to Stéphane Marchesin for finding this problem.

Note: This is a candidate for the stable branches.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-05 08:44:26 -06:00
Kenneth Graunke
456c7355e0 i965: Don't use brw->fragment_program in the old brw_wm_pass2.c.
According to Eric, this shouldn't matter since we don't do precompiles
using the old backend.  In other words, brw->fragment_program (the
currently active program) should equal c->fp (the program currently
being compiled).

However, it's just not a good idea to access brw->fragment_program
directly in compiler code.  It's totally illegal in the new backend, so
let's just not do it here either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Paul Berry <stereotype441@gmail.com>
2012-09-05 06:50:10 -07:00
Tom Stellard
446d19c12a radeon/llvm: Fix lowering of SI_V_CNDLT
SREG_LIT_0 is a scalar register, so it can only be used in the
first argument of vector instructoins.
2012-09-04 14:21:10 -04:00
Tom Stellard
f9fede884b radeon/llvm: Fix encoding of V_CNDMASK_B32
The CodeEmitter was not setting the VGPR bit for src0, because the
instruction definition had the VCC register in the src0 slot, instead of
the actual src0 register.  This has been fixed by moving the VCC
register to the end of the operand list.
2012-09-04 14:21:10 -04:00
Brian Paul
f73ffacbf0 mesa: fix DIFFERENT_SIGNS() function
Looks like converting this to a macro, returning bool, caused us to
lose the high (31st) bit result.  Fixes piglit fbo-1d test.  Strange
that none of the other tests I ran caught this.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54365

Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-09-04 11:36:58 -06:00
Vincent Lejeune
8eaa36317a radeon/llvm: do not convert f32 operand of select_cc node
v2:-use camel coding style

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:54:37 +02:00
Vincent Lejeune
a4325b3229 radeon/llvm: custom lowering for FP_TO_UINT when dst is i1 (bool)
v2:-wrap line at 80 characters

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:54:01 +02:00
Vincent Lejeune
d9e135e18c radeon/llvm: support setcc on f32
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:52:53 +02:00
Vincent Lejeune
a383142436 radon/llvm: br_cc f32 now lowered without cast
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:50:44 +02:00
Vincent Lejeune
6a85725f13 radeon/llvm: swap wrong OPCODE_IS_*_ZERO_* opcode and use
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-09-04 17:44:48 +02:00
Christian König
73dd82061e winsys/radeon: create only one winsys for each fd
Fixing problems with GLAMOR.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:38 +02:00
Christian König
88a4fd8fe6 radeonsi: stop big offsets from hanging the GPU v2
v2: rebased of radeon/llvm fix.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:32 +02:00
Christian König
de7d3825a0 radeonsi: adjust PIPE_SHADER_CAP_MAX_CONSTS
So it matches what we really can do.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:26 +02:00
Christian König
8758183f0a radeon/llvm: fix SelectADDR8BitOffset
The offset is unsigned, not signed.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-09-04 10:51:11 +02:00
José Fonseca
7eb5040197 gallivm,llvmpipe: Use 4-wide vectors on AMD Bulldozer.
8-wide vectors is slower.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-09-04 08:49:00 +01:00
Brian Paul
9a31e090ef mesa: add missing return statements after recording errors
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-03 18:07:41 -06:00
Brian Paul
2ffc7fd2d2 mesa: remove more null pointer checks before free() calls
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-03 18:07:41 -06:00
Brian Paul
2276bb991a mesa: remove null pointer checks before free() calls
Since free(NULL) is fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-09-03 18:07:41 -06:00
Brian Paul
56ccdf7e30 mesa: remove SQRTF, use sqrtf. Convert INV_SQRT() to inline function.
We were already defining sqrtf where we don't have the C99 version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-09-03 18:07:41 -06:00
Vadim Girlin
f44bda17f5 r600g: adjust QUANT_MODE for higher precision
Use 1/256 for R6xx/7xx, 1/4096 for evergreen, instead of default 1/16.

Helps to pass some piglit tests (fbo, multisample).

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-04 00:18:13 +04:00
Vinson Lee
19b3910bd5 util: Add cpuid for Solaris Studio.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-09-03 12:28:07 -07:00
Ian Romanick
51b069e7aa meta: Don't save and restore fog state when there is no fog state
I wonder if the better solution is to have _mesa_meta_GenerateMipmap not
use MESA_META_ALL for the GLSL path.  Even on compatibility profiles
there is no reason to save and restore fog on this path.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54295
2012-09-03 10:33:54 -07:00
Brian Paul
0b90da3252 mesa: remove accidentally committed __SUNPRO_C sqrtf() code 2012-09-03 08:03:07 -06:00
Christian König
e1673d2001 radeonsi: disable array-textures for now
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-09-03 11:23:25 +02:00
Christian König
aa5daa61a1 radeonsi: disable Z16 for now
It's causing crashes.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-03 11:23:20 +02:00
Christian König
74a55392b6 radeonsi: disable NPOT textures for now
Looks like we have an alignment issue with NPOT textures
and mipmaps. So disable NPOT textures until we figure out
what is going wrong here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-03 11:23:14 +02:00
Christian König
e7723b5bdf radeonsi: handle indirect constants gracefully
It's not supported yet, so at least don't try to crash the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-09-03 11:23:08 +02:00
Brian Paul
a96119cc8c radeon: fix free/FREE mistake 2012-09-01 09:47:29 -06:00
Brian Paul
12bf268aab vega: include u_debug.h for assert() 2012-09-01 09:03:24 -06:00
Brian Paul
fe72a069d1 mesa: s/FREE/free/
v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-01 07:47:24 -06:00
Brian Paul
4fdac659f8 mesa: s/CALLOC/calloc/
v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-01 07:47:24 -06:00
Brian Paul
33bb8c051d mesa: s/MALLOC/malloc/
v2: replace instances in dri/common/ dirs

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-09-01 07:47:24 -06:00
Brian Paul
66d6ba2d83 util: remove u_debug.h from u_math.h
No debug code is used in u_math.h
2012-09-01 07:41:26 -06:00
Brian Paul
a7663729d2 util: include u_debug.h 2012-09-01 07:41:26 -06:00
Brian Paul
b114e37179 tgsi: include u_debug.h 2012-09-01 07:41:26 -06:00
Brian Paul
36f3f7ebfa mesa: clean-up LOG2() function 2012-09-01 07:41:26 -06:00
Brian Paul
c8a86f717f mesa: move IS_NEGATIVE() and DIFFERENT_SIGNS() to macros.h 2012-09-01 07:41:26 -06:00
Brian Paul
a2cf265c8d mesa: clean up F_TO_I, IFLOOR, ICEIL functions
Put all the #ifdef stuff inside the function bodies instead of outside.
2012-09-01 07:41:26 -06:00
Kenneth Graunke
4d9abd96cc i965/fs: Don't use brw->fragment_program in calculate_urb_setup().
Reading brw->fragment_program is nonsensical in compiler code: it
contains the currently active program (if any), not the one currently
being compiled.  Attempting to access it may either lead to crashes
(null pointer dereference if no program is active) or wrong results.

Fixes piglit regressions since 9ef710575b
on pre-Sandybridge hardware.  The actual bug was created in commit
7b1fbc6889.

NOTE: This is a candidate for the 9.0 and 8.0 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54183
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-31 16:36:09 -07:00
Matt Turner
e0f510b1c9 build: Remove left over echo from GLU removal 2012-08-31 15:12:21 -07:00
Vadim Girlin
b05a1fc156 mesa: don't wait in _mesa_ClientWaitSync if timeout is 0
From ARB_sync spec:

    If the value of <timeout> is zero, then ClientWaitSync does not
    block, but simply tests the current state of <sync>. TIMEOUT_EXPIRED
    will be returned in this case if <sync> is not signaled, even though
    no actual wait was performed.

Fixes random fails of the arb_sync-timeout-zero piglit test on r600g.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-09-01 01:02:24 +04:00
Matt Turner
b95d598323 Remove libGLU
It's been moved to its own repository, found at
	http://cgit.freedesktop.org/mesa/glu/

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-31 10:58:15 -07:00
Jakob Bornecrantz
6a7dea93fa dri: Rework planar image interface
As discussed with Kristian on #wayland. Pushes the decision of components into
the dri driver giving it greater freedom to allow t to implement YUV samplers
in hardware, and which mode to use.

This interface will also allow drivers like SVGA to implement YUV surfaces
without the need to sub-allocate and instead send 3 seperate buffers for each
channel, currently not implemented.

I have tested these changes on Gallium Svga. Scott tested them on both intel
and Gallium Radeon. Kristan and Pekka tested them on intel.

v2: Fix typo in dri2_from_planar.
v3: Merge in intel changes.

Tested-by: Scott Moreau <oreaus@gmail.com>
Tested-by: Pekka Paalanen <ppaalanen@gmail.com>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-31 19:51:02 +02:00
Tom Stellard
022f6d8861 radeon/llvm: Rework how immediate operands are handled with SI
Immediate operands were previously handled in the CodeEmitter, but that
code was buggy and very confusing.  This commit adds a pass that simplifies
the handling of immediate operands by spliting the loading of the
immediate into a sperate insruction that is bundled with the original.
2012-08-31 12:54:58 -04:00
Tom Stellard
1cee70c5d8 radeon/llvm: Fix typo in assert 2012-08-31 12:54:58 -04:00
Tom Stellard
1247549734 radeon/llvm: Fix isEG tablegen predicate
This predicate incorrectly included SI GPUs, so some Evergreen
instructions were being emmitted on SI.
2012-08-31 12:54:58 -04:00
Tom Stellard
ee45dec7c4 radeon/llvm: Add support for RCP instruction on SI 2012-08-31 12:54:58 -04:00
Tom Stellard
fc8b4765d0 radeon/llvm: Support AMDGPUfmin DAG node on SI 2012-08-31 12:54:57 -04:00
Tom Stellard
c3c323a164 radeonsi: Handle TGSI_SEMANTIC_PSIZE
The relevant POINT_SIZE registers are being set using the
pipe_rasterizer_state, so we just need to tell the shader compiler which
export type to use.

This fixes several of the glean glsl tests.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-31 12:53:51 -04:00
Tapani Pälli
d58ca43b80 android: do not expose single buffered eglconfigs
On Android we want to add only double buffered configs for visuals.
Earlier implementation set the SurfaceType as 0 for single buffered
configs but driver still exposed these configs that were not compatible
with any egl surface type.  This caused Khronos conformance test runs to
fail on Android. This patch fixes the issue by skipping single buffered
configs earlier and not exposing them.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-31 09:47:02 -07:00
Tapani Pälli
29d394b9ba android: fix liblog API changes
android logging macros changed their name in JellyBean.

Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-31 09:45:56 -07:00
Tapani Pälli
4d02b018f4 xmlconfig: use __progname when building for Android
__progname symbol and strrchr are available with bionic.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-31 09:45:49 -07:00
Vinson Lee
f3bb6bd9b3 scons: Remove leftover print statement.
Remove print statement left over from commit
c57fb034b1.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-08-31 08:26:29 -07:00
Andreas Boll
0dcf555104 docs: update relnotes-9.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 09:22:18 -06:00
Andreas Boll
3678f8904c mesa: also bump version in Makefile.am and configure.ac to 9.0
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 09:22:16 -06:00
Vinson Lee
c57fb034b1 scons: Add default libraries to Solaris build.
Fixes SCons build on Solaris.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54293
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-31 08:24:38 -06:00
Brian Paul
43ed822a50 st/mesa: s/CALLOC/calloc/ to fix allocation bug
The CALLOC() macro only takes one argument so this was being treated
as a comma expression.  Simply use calloc() instead.

A follow-on patch will replace all CALLOC() calls with calloc().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
2012-08-31 08:05:38 -06:00
Brian Paul
c5f9cf8232 util: add casts to silence signed/unsigned comparison warnings 2012-08-31 08:04:40 -06:00
Brian Paul
8472bb4508 mesa: fix-up and use _mesa_delete_renderbuffer()
_mesa_delete_renderbuffer() should free the mutex (though that may be a
no-op) and then free the renderbuffer object itself.  Subclasses of
gl_renderbuffer can use this function too.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-31 08:04:40 -06:00
Ian Romanick
2d2f1fd164 docs: Add some missing features to 9.0 release notes and GL3.txt
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-30 18:23:29 -07:00
Ian Romanick
0791484c42 mesa: Bump version to 9.0
Now that OpenGL 3.1 is supported by at least one driver, follow
tradition and bump the major version number.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-30 18:23:28 -07:00
Marek Olšák
0e470533ad r600g: enable transform feedback on Cayman
There doesn't seem to be anything wrong with it.
2012-08-31 01:19:03 +02:00
Marek Olšák
64db3cc6ad r600g: implement MSAA for Cayman
Everything works except for blitting MSAA colorbuffers, which isn't
so trivial on Cayman. It's a rarely-used feature anyway.
2012-08-31 01:19:03 +02:00
Anuj Phogat
f8a8f069ee i965/msaa: flag _NEW_MULTISAMPLE in the brw_tracked_state
This is required to get the program recompiled when SampleAlphaToCoverage
is enabled.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-30 11:10:50 -07:00
Marek Olšák
c2e9dd0276 r600g: enable MSAA on r6xx by default
DRM 2.22.0 is required though. Also require the new DRM for r700, as
there are some important fixes for that generation too.
2012-08-30 19:43:56 +02:00
Marek Olšák
2f6eb3afb7 r600g: disable MSAA depth decompression on r6xx 2012-08-30 19:43:56 +02:00
Marek Olšák
78354011f9 r600g: implement color resolve for r600
The blend state is different and the resolve single-sample buffer must have
FMASK and CMASK enabled. I decided to have one CMASK and one FMASK
per context instead of per resource.

There are new FMASK and CMASK allocation helpers and a new buffer_create
helper for that.
2012-08-30 19:43:56 +02:00
Marek Olšák
863e2c85b9 r600g: fix CB_SHADER_MASK and CB_TARGET_MASK for r6xx 2012-08-30 19:43:56 +02:00
Marek Olšák
187d7fb2fe r600g: implement draw_rectangle callback
The color resolve on r6xx needs PT_RECTLIST. Using conventional primitive
types (triangles and quads) produces an ugly line between two diagonally
opposite corners. I guess a rectangular point sprite would work too.
2012-08-30 19:43:55 +02:00
Marek Olšák
8698a3b85d r600g: implement MSAA for r700
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-30 19:43:55 +02:00
Marek Olšák
edf22a5c6d r600g: change programming of CB_SHADER_MASK on r600-r700
This one actually makes more sense and gives the expected value
for MSAA resolve.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-30 19:43:55 +02:00
Marek Olšák
1ff5f08823 configure.ac: require libdrm_radeon 2.6.39 for MSAA 2012-08-30 19:43:55 +02:00
Brian Paul
055093e33f meta: remove call to _meta_in_progress(), fix multisample enable/disable
This partially reverts d638da23d2.

With gallium the meta code is not always built so the call to
_meta_in_progress() was unresolved.  Simply special-case the
GL_MULTISAMPLE case in the meta code.  There might be other special
cases in the future given all the differences between legacy GL,
core GL, GLES, etc.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54234
and https://bugs.freedesktop.org/show_bug.cgi?id=54239

v2 (Paul Berry <stereotype441@gmail.com>): keep _meta_in_progress
function, since it's needed by the i965 driver, but don't call it from
core mesa.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-30 08:28:19 -07:00
Brian Paul
aad7ccd261 meta: add parenthesis to silence compiler warnings
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-30 09:26:51 -06:00
Tapani Pälli
9121460f13 scons : add HAVE_DLOPEN to build environment
fixes dlopen issue caused by 57c57df7b4

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54140

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-08-30 12:02:03 +01:00
Christian König
f1fd94f355 radeonsi: fix stupid bug added in commit 07838603b9
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-30 10:23:32 +02:00
Eric Anholt
8393360659 i965/fs: Remove a dead member from live variables analysis.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 20:46:51 -07:00
Kenneth Graunke
6928bea7ca i965/fs: Initialize output_components[] by filling it with zeros.
Prior to commit 2f1869822, emit_fb_writes() looped from 0 to 3, writing
all four components of a vec4 color output.  However, that broke for
smaller output types (float, vec2, or vec3).  To fix that, I introduced
a new variable (output_components[]) containing the size of the output
type for each render target.

Unfortunately, I forgot to actually initialize it in the constructor,
which meant that unless a shader wrote to gl_FragColor, or the specific
output for each render target, output_components would contain a garbage
value, and we'd loop for a completely non-deterministic amount of time.

Not actually emitting any color writes seems like the right approach.
We may still need to emit a render target write (to terminate the
thread), but don't have to put in any sensible values (the shader didn't
write anything, after all).

Fixes a regression since 2f18698220.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54193
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Ian Romanick <idr@freedesktop.org>
2012-08-29 15:10:57 -07:00
Ian Romanick
42723d88d3 mesa: Do something sensible when on-line compression is requested but not possible
It is possible to force S3TC extensions to be enabled.  This is
generally done to support applications that will only supply
pre-compressed textures.  This accounts for the vast majority of
applications.

However, there is still the possibility of an application asking for
on-line compression.  In that case, generate a warning and substitute a
generic compressed format.  The driver will either pick an uncompressed
format or a compressed format that Mesa can handle on-line (e.g., FXT1).

This should only cause problems for applications that request on-line
compression and read the compressed texture back.  This is likely an
infinitesimal subset of an already infinitesimal subset.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 15:09:38 -07:00
Ian Romanick
0e0d664461 i965: Allow creation of OpenGL 3.1 contexts
v2: Fix API_OPENGL_CORE handling when TEXTURE_FLOAT_ENABLED is not
defined.  Based on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:38 -07:00
Ian Romanick
2a33a99737 i965: Advertise GLSL 1.40 and TexBOs in core contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:38 -07:00
Ian Romanick
91473485fc intel: Clean up bits of cruft in intelCreateContext
This and the previous three commits should probably be squashed together...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
bf8644e64d i965: Set context flags
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
ca2b1fcb30 mesa/dri: Allow creation of forward-compatible contexts
This is done by changing the API to API_OPENGL_CORE.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
36ceabfb74 mesa/es: Enable GL_OES_vertex_array_object
Functionally the same as GL_ARB_vertex_array_object.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:37 -07:00
Ian Romanick
35cf6aeb8c mesa: Enable GL_{ARB,APPLE}_vertex_array_object in all drivers
This is a purely software extension.  The drivers don't need to do any
work to support it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:37 -07:00
Ian Romanick
d1cf5c77b7 meta: Don't use deprecated keyword in 1.30 shader
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
ae88281b7b mesa: Disallow alpha, luminance, and LA textures in core context
Also disallow the 1, 2, 3, and 4 formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
04d6ffa06d mesa: Disallow more deprecated functions in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
91107b4ccf mesa: Require names from Gen in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
843b876ba3 mesa: Allow NULL vertex pointer without a VBO
There is text in the OpenGL 3.x specs to explicitly allow this case.
Weird.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
792214e8d4 mesa: Disallow VertexAttribPointer without a VAO in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
29512df635 mesa: Disallow wide lines in forward compatible context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:37 -07:00
Ian Romanick
7e1cab09a1 mesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context
Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says (in the list
of deprecated functionality):

    "Separate polygon draw mode - PolygonMode face values of FRONT and
    BACK; polygons are always drawn in the same mode, no matter which
    face is being rasterized."

Also modify meta to not use FRONT or BACK in a core context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Paul Berry
d638da23d2 meta: Don't stray outside the confines of the API specified in the context
Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
8e7b6a69e9 mesa: Don't allow display lists or evaluators in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
2bcf555490 mesa: Don't allow GL_EXTENSIONS query in core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
c85a9a9996 mesa: Non-sprite points are deprecated
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Eric Anholt
7d8d1c7819 mesa: Fix VAO deletion on GL 3.1 core.
We were calling through a dispatch table entry that was NULL, since the apple
variant is only on legacy desktop.  Just call the function we mean instead of
indirecting through the dispatch.
2012-08-29 15:09:36 -07:00
Eric Anholt
8a4d560796 mesa: Enable a bunch of missing getters on 3.1 core.
NOTE: maybe I enabled too many?
2012-08-29 15:09:36 -07:00
Eric Anholt
bb4a39ec95 mesa: Expose texture buffer objects when the context is GL 3.1 core.
v2: Use API_OPENGL_CORE.

v3: Only require desktop GL.  If a driver can't support TexBOs in a non-core
context, it should not enable them.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 15:09:36 -07:00
Ian Romanick
1b86a91c64 mesa: Allow PACK / UNPACK queries for ES2
These are part of the GL_EXT_unpack_subimage extension and ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
a010215463 mesa: Kill ES2 wrapper functions
v2: Fix completely broken condition around ClearColorIiEXT and
ClearColorIuiEXT.

v3: Add special VertexAttrib handling for ES2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
fc2219e448 mesa: glGetVertexAttribPointerv is part of core profile and ES2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:36 -07:00
Ian Romanick
917f68071b mesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:36 -07:00
Ian Romanick
f778174ea1 mesa: Require OpenGL 2.0 for GL_POINT_SPRITE_COORD_ORIGIN
The comment in the code even says this is the right thing to do.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:36 -07:00
Ian Romanick
25ffb86893 mesa: Require that drivers supporting point sprites support point parameters
All drivers in Mesa do.  This allows a lot of extension checking code to be
gutted from the function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:35 -07:00
Ian Romanick
33e01d93ca mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
8a263b6efd mesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
d2b03f6e99 mesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
f329adfa49 mesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
0fa4ed05cf mesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
fb4f2d3425 mesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
8df3f9bd5f mesa/es: Validate glGetMaterial pname in Mesa code rather than the ES wrapper
Fixes a bug that glGetMaterial[fx]v in ES1 contexts would (try to) allow
queries of GL_AMBIENT_AND_DIFFUSE.  This enum can only be used in glMaterial,
not in the get.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
9555d7bdc1 mesa/es: Validate glGetPointerv pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile, GLES1, and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
d6c8913bc6 mesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
10e7db1ccf mesa/es: Validate glFog pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
b7c7e5e45a mesa/es: Validate glReadPixels format and type in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
4114dee99e mesa/es: Validate glPixelStore pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:35 -07:00
Ian Romanick
08be1d288f mesa/es: Validate glEnable cap in Mesa code rather than the ES wrapper
Also handle glDisable, glIsEnabled, glEnableClientState, and
glDisableClientState.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
bca2cece02 mesa/es: Validate glHint target in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
2c87030a00 mesa/es: Validate glGetVertexAttribf pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Allow glGetVertexAttribfv(0, GL_CURRENT_VERTEX_ATTRIB_ARB, param) in
OpenGL 3.1, just like OpenGL ES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
c13f36ce4e mesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
6a9b8f897a mesa/es: Validate primitive modes in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
72e076cb17 mesa: Refactor _mesa_valid_prim_mode to use a switch-statement
This makes the next change a bit easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
01497a3560 mesa/es: Validate blend function enums in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

v3: Allow GL_SRC_ALPHA_SATURATE as a destination factor in GLES3.  Based
on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
e58c19a204 mesa/es: Validate glClear mask in Mesa code rather than the ES wrapper 2012-08-29 15:09:34 -07:00
Ian Romanick
f0c99d0a6a mesa/es: Validate glRenderbufferStorage internalFormat in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Allow GL_RGB10_A2UI in GLES3 based on review feedback from Eric
Anholt.

v4: Arg.  Reject unsized RED and RG enums on GLES.  More feedback from
Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
ae86ebfcc9 mesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-29 15:09:34 -07:00
Ian Romanick
0cdaa471ec mesa/es: Validate glGetFramebufferAttachmentParameter pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile, GLES1, and GLES3 filtering.

v3: Fix the GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query when the
attachment type is GL_NONE on GLES3.  Other cleanups.  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
5b44a77428 mesa/es: Validate glGenerateMipmap target in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Fix a typo in GL_TEXTURE_2D_ARRAY checking.

v4: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Ian Romanick
7f991d26ad mesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test.  The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2).  Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-29 15:09:34 -07:00
Tom Stellard
2809ae3d44 radeon/llvm: Fix encoding of FP immediates on SI 2012-08-29 15:52:10 -04:00
Tom Stellard
05113fd266 radeon/llvm: Create a register class for the M0 register
The Common Subexpression Elimination pass will not operate on
instructions with physical register defs, so we end up with
several redundant copies to M0 when using interpolation.

Adding a register class that only contains the M0 register allows
use to use a virtual register to represent M0, and makes it possible
for the Common Subexpression Elimination pass to remove the extra
copies.
2012-08-29 15:52:10 -04:00
Tom Stellard
733c28a0d9 radeon/llvm: Set the neverHasSideEffects bit on more instructions
This flag makes these instructions candidates for the dead code
elimination and common subexpression elimination.
2012-08-29 15:52:10 -04:00
Tom Stellard
cf4ac69928 radeon/llvm: Declare the interpolation intrinsics as ReadOnly
This signals to the Dead Code Elimination pass that it is safe to
remove these instructions when they are dead.
2012-08-29 15:52:10 -04:00
Tom Stellard
73a2c4b9db radeon/llvm: Mark M0 as a def when lowering interpolation instructions 2012-08-29 15:52:10 -04:00
Anuj Phogat
0fc11a24c8 meta: Add GLSL variant of _mesa_meta_GenerateMipmap() function
This reduces the overhead of using the fixed function internally
in the driver.

V2: Use setup_glsl_generate_mipmap() and setup_ff_generate_mipmap()
    functions to avoid code duplication.
    Use glsl version when ARB_{vertex, fragmet}_shader are present.
    Remove redundant code.

V3: Remove redundant border related code leaving the assertion.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-29 11:43:52 -07:00
Brian Paul
c824804c6f glsl: s/class/struct/ for ast_type_qualifier
To silence an MSVC compiler warning about class vs. struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-29 12:08:46 -06:00
Brian Paul
ec6478fd32 mesa: convert a few more macros to inline functions 2012-08-29 08:20:58 -06:00
Brian Paul
cf41d7c63a mesa: remove COPY_4V_CAST() macro
Only used in one place, and not really needed.
2012-08-29 08:20:58 -06:00
Brian Paul
fd9afb87d8 mesa: convert a bunch of math macros to inline functions 2012-08-29 08:20:58 -06:00
Brian Paul
454e23776d tnl: use INTERP_4F() instead of four INTERP_F() calls 2012-08-29 08:20:58 -06:00
Brian Paul
ba6f47132d swrast: fix wrong assignments in _swrast_add_spec_terms_line() 2012-08-29 08:20:58 -06:00
Brian Paul
1aee8803f8 mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()
To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.
2012-08-29 08:20:57 -06:00
Martin Pieuchot
c4c4d4ad1e mesa: Define CPU_TO_LE32 to work on OpenBSD
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-29 08:05:17 -06:00
Brian Paul
4aede0018a docs: remove mention of old driver maintenance
People who need old drivers can use older versions of Mesa.
2012-08-28 13:09:02 -06:00
Andreas Boll
6eaccbfeeb docs/utilities: add/update some useful utilities
the progs/util directory is now in mesa demos
replace glean with piglit
add ApiTrace

markup: replace the unordered list <ul> with a definition list <dl>

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-28 13:08:56 -06:00
Eric Anholt
67e9ae8563 i965: Disable the swrast context setup on GL 3.1 core.
I've reviewed the code, and the swrast callsites remaining are all in
drawpixels/copypixels/bitmap/accum, or _swrast_BlitFramebuffer that shouldn't
be hit.  A piglit run with the context setup disabled on legacy GL and GLES2
showed regressions only in the copypixels and drawpixels tests.

If the context type is forced, this reduces the shader_runner maximum heap
size for glsl-algebraic-add-add-1.shader_test from 15,137,496b to 4,165,376b.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
993c52d0be i965: Replace general sw fallback support with a manual check for rendermode.
There were no other cases that set it any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
b0d23b66cf intel: Move RenderMode fallback func to i915 driver.
The Fallback field of the context struct doesn't work that way on i965, and
it's the only caller of FALLBACK() in the driver.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
628dfe9511 i965: Drop the old sw fallback for position array being disabled.
This code has been in the driver since the first commit.  I think it was
trying to stop rendering from happening with a disabled position array.  Core
mesa has since had changes to deal with disabled position arrays correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
5e3c093ff8 i965: Drop support for forcing drawing through sw fallbacks.
It turns out it hasn't worked since at least 8.0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
bfae8650ec i965: Move depth resolve for span fallbacks to a simpler place.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Eric Anholt
707f242c4b i965: Drop manual hiz resolves in span rendering.
swrast uses MapRenderbuffer, which leads to intel_miptree_map, which does the
depth resolve.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-28 11:43:04 -07:00
Michel Dänzer
70f9dbe298 radeon/llvm: Handle TGSI KIL opcode for SI.
Fixes piglit fp-kil and glBitmap() with radeonsi.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-28 20:27:23 +02:00
Michel Dänzer
16e42a5dd0 radeon/llvm: Basic support for SI EXEC register.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-28 20:26:50 +02:00
Michel Dänzer
6ca64393c9 radeonsi: Don't write to the PA_SC_RASTER_CONFIG register.
It should be initialized by the kernel as necessary.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-08-28 20:24:52 +02:00
Marek Olšák
999b7f6665 r600g: fix relative addressing on RS780 and RS880
They should be treated like RV670.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 18:27:03 +02:00
Andreas Boll
3e20605c16 docs/helpwanted: add radeonsi todo list
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 17:36:07 +02:00
Andreas Boll
17f09b664b configure.ac: add radeonsi to --with-gallium-drivers help string
the help string is used by ./configure --help

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 17:35:36 +02:00
José Fonseca
bc8509b43b llvmpipe: Bump the maximum texture size (in pixels).
But cap the size in bytes, to avoid depleting the whole system memory,
with humongus textures.

Tested with max-texture-size piglit test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-28 15:18:43 +01:00
Vadim Girlin
6463eb013f u_vbuf: avoid unnecessary update of the vertex elements
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-28 18:01:13 +04:00
Matt Turner
971750e1cd egl: fix invalid flag detection for EGL_KHR_create_context
We want to check whether there are bits set outside of the valid flags.

Fixes piglit test egl-create-context-invalid-flag-gl

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-27 15:11:11 -07:00
Kenneth Graunke
77d675926a i965: Make VS programs obey the shader_precompile driconf option.
Now that it's on by default, we may as well make it obey the flag,
for consistency's sake if nothing else.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
9ef710575b i965: Reenable the fragment shader precompile.
Precompiling the shader at link time often allows us to avoid compiling
it at the first use.  This moves the expensive compilation and
optimization process to game or level load time, rather than at draw
time, where we really can't avoid any cycles and don't want to risk
stalling the GPU.

The downside is that we have to guess the non-orthagonal state the
program will have set when it draws with the shader.  Previously, we
guessed wrong for nearly every shader, so it wasn't useful.  With the
recent SamplerUnits rework and this series, we've either eliminated
state or made smarter guesses, and usually get it right now.

In the L4D2 time demo, I now have 39 fragment shader recompiles and no
vertex shader recompiles.  Before this series and the SamplerUnits
rework, I had 206 fragment shader recompiles and 192 vertex shader
recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
88b3850c27 i965: Set swizzle fields in the VS precompile program key.
This fixes a regression since 76d1301e8e:
I began setting SWIZZLE_XYZW for unused sampler units in the actual
program keys, since this matched the FS precompile behavior.  However,
the VS precompile was expecting zero, so that commit made essentially
every vertex shader (even those not using texturing) mismatch and need
to be recompiled.

Setting them in the VS precompile key solves the issue.  It also is an
improvement over our old behavior: previously we guessed that vertex
shaders didn't use any textures at all.  Now we actually look to see if
the VS had any sampler uniforms and guess based on that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
c20cb8d1f6 i965/vs: Add VS program key dumping to INTEL_DEBUG=perf.
Eric added support for WM key debugging.  This adds it for the VS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
85b24b0751 i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.
Our previous assumption, SWIZZLE_XYZW, was completely bogus for depth
textures.  There are no Y, Z, or W components.

DEPTH_TEXTURE_MODE has three options:
- GL_LUMINANCE: <X, X, X, 1>
- GL_INTENSITY: <X, X, X, X>
- GL_ALPHA:     <0, 0, 0, X>

The default value is GL_LUMINANCE, and most applications don't seem to
alter DEPTH_TEXTURE_MODE.  Make that our precompile guess.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
f3d0daf7ea i965: Index sampler program key data by linker-assigned index.
Now that most things are based on the linker-assigned index, it makes
sense to convert the arrays in the VS/WM program key as well.  It seems
silly to leave them indexed by texture unit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
ab17762c70 i965: Only set proj_attrib_mask for fixed function.
brw_wm_prog_key's proj_attrib_mask field is designed to enable an
optimization for fixed-function programs, letting us avoid projecting
attributes where the divisor is 1.0.

However, for shaders, this is not useful, and is pretty much impossible
to guess when building the FS precompile key.  Turning it off for
shaders should allow the precompile to work and not lose much.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
6cc14c2493 i965: Don't set stats_wm in the WM program key on Gen6+.
It's only needed for Gen4/5 IZ lookup workarounds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:40 -07:00
Kenneth Graunke
b6b1fc1261 i965: Don't set vp_outputs_written in the WM program key on Gen6+.
It's only used by on pre-Sandybridge hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:39 -07:00
Kenneth Graunke
87cdefed40 i965: Double the size of the state cache.
We probably want to do something more sophisticated here, but this at
least makes it through L4D2 without dumping the program cache.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-27 14:23:39 -07:00
Julien Cristau
ac889b2410 glapi/glx: call __glEmptyImage if USE_XCB, not memcpy directly
We were stomping on the caller's buffer by ignoring their alignment
requests and other pixel store modes.  This patch makes the USE_XCB path match
the older one more closely.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52059

Signed-off-by: Julien Cristau <julien.cristau@logilab.fr>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-27 13:32:53 -06:00
Brian Paul
f308c80490 gallium/util: implement tile code for PIPE_FORMAT_Z32_FLOAT
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-27 13:32:53 -06:00
Brian Paul
a971476cc7 st/mesa: use fallback path for glCopyTexSubImage(GL_TEXTURE_1D_ARRAY)
Fixes many failing cases in piglit copyteximage test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-27 13:32:53 -06:00
Chad Versace
88edbdf9f0 i965: Move hiz resolve to after renderbuffer resizing (v2)
Do all pre-draw hiz resolves *after* the renderbuffers are resized by
intel_prepare_render. Otherwise, we may resolve buffers that are
immediately discarded afterwards.

Fixes the assertion failure below when resizing windows in KDE and under
some unknown circumstance in Chrome OS:
    intel_resolve_map.c:46: intel_resolve_map_set: Assertion
    `(*tail)->need == need' failed.

Also, remove the comment that "resolves must occur [...] before setting up
any hardware state". That was true when resolves were implemented with
meta-ops, but no longer with blorp.

v2:
  - Keep brw_predraw_resolve_buffers in its current position, which is
    before any brw_context bits are modified. Instead, move the call to
    intel_prepare_render.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252
Reported-by: Lu Hua <huax.lu@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-27 07:48:28 -07:00
Chad Versace
a2a7e640a4 i965: Remove redundant null check
intel_renderbuffer_resolve_hiz checks if rb->mt is null, so there is no
need for the caller to do so.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-27 07:47:09 -07:00
Marek Olšák
7f0fcf17c3 r300g: implement TRUNC correctly
This fixes some integer division tests.
2012-08-27 14:35:18 +02:00
Michel Dänzer
f402acdbe2 radeonsi: Use FP16 shader export format when necessary / possible.
Fixes piglit fbo-blending-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:56 +02:00
Michel Dänzer
26c7139d2c radeonsi: Refactor initialization of shader export intrinsic arguments.
In preparation for extending this code, which would make it rather unwieldy in
its current place.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:49 +02:00
Michel Dänzer
d1e40b3d40 radeonsi: Maintain cache of pixel shader variants according to contxt state.
Mostly inspired by r600g commit 4acf71f01e
('r600g: cache shader variants instead of rebuilding v3').

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:51:41 +02:00
Michel Dänzer
84fdda280f radeonsi: Drop extraneous semicolons from pm4 state macro definitions.
Could cause build failures if trying to use the macros in certain constructs.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-27 11:50:38 +02:00
Marek Olšák
a3d9d7ec79 r600g: implement compression for MSAA colorbuffers for evergreen
This adds the FMASK and CMASK buffers. They share the same resource
with color data.

COMPRESSION and FAST_CLEAR are always enabled if both FMASK and CMASK are
allocated. We initialize the CMASK to a "compressed" state (not "fast cleared"),
so that we can keep FAST_CLEAR enabled all the time.

Both FMASK and CMASK must be present at the moment. If either one is missing,
the other one is not used.

v2: add cayman regs in the list

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
48edfe0505 r600g: cleanup names around depth decompression
for consistency with the upcoming color decompression naming

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
3ac54ac2c8 r600g: fix evergreen 8x MSAA sample positions
The original samples positions took samples outside of the pixel boundary,
leading to dark pixels on the edge of the colorbuffer, among other things.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:31:00 +02:00
Marek Olšák
1cfec6e2c8 r600g: set CB_TARGET_MASK to 0xf and not 0xff for resolve on evergreen
independent_blend_enable must be true, so that the colormask isn't replicated
in all colorbuffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:30:59 +02:00
Marek Olšák
1516a4f353 gallium/u_blitter: initialize sample mask in resolve
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-08-27 04:30:59 +02:00
Tom Stellard
07c71d6ede r300/compiler: Use variable lists in the rename_regs pass 2012-08-26 20:39:49 -04:00
Eric Anholt
7540f25a34 i965: Rewrite the comment describing the query object support.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
f0159018d7 i965/gen6+: Add support for GL_ARB_timer_query.
Needs updated libdrm.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
9a2943ddf2 i965: Add support for GL_ARB_occlusion_query2.
This extension is just a bit of core code on top of the GL_ARB_occlusion_query
support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-26 10:40:33 -07:00
Eric Anholt
b765119c5d mesa: Add constants for the GL_QUERY_COUNTER_BITS per target.
Drivers need to be able to communicate their actual number of bits populated
in the field in order for applications to be able to properly handle rollover.

There's a small behavior change here: Instead of reporting the
GL_SAMPLES_PASSED bits for GL_ANY_SAMPLES_PASSED (which would also be valid),
just return 1, because more bits don't make any sense.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-26 10:40:28 -07:00
Eric Anholt
6754ec831e i965: Fix accumulator_contains() test to also reject swizzles of the dst.
When faced with this sequence:

	MOV	R1, c[1];
	MAD	R0, R2, R1.x, R1.y;

we were concluding that the MOV of R1 set up our accumulator and so we could
just use the previous result.  Only, it's got R1.xyzw in it instead of the
r1.y we're looking for.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46784
NOTE: This is a candidate for the 8.0 branch.
2012-08-26 09:58:40 -07:00
Jakob Bornecrantz
33ee019422 st/dri: Support width and height getters
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:40:18 +02:00
Jakob Bornecrantz
15effe1fab st/dri: Claim to support validate_usage
Support version 3 as well as 2, since that is only the new format query,
which Jesse added support for to st/dri when he added it to dri_inteface.h.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:40:10 +02:00
Jakob Bornecrantz
93ebec87ed dri: Make query image WIDTH and HEIGHT be version 4
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:50 +02:00
Jakob Bornecrantz
6bb71b8cbe dri: Remove image write function
Since its not used by anything anymore and no release has gone out
where it was being used.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:41 +02:00
Jakob Bornecrantz
a669a5055e gbm: Use libkms to replace DRI cursor images
Uses libkms instead of dri image cursor. Since this is the only user of the
DRI cursor and write interface we can remove cursor surfaces entirely from
the DRI interface and as a consequence also from the Gallium interface as
well. Tho to make everybody happy with this it would probably should add a
kms_bo_write function, but that is probably wise in anyways.

The only downside is that it adds a dependancy on libkms, this could how ever
be replaced with the dumb_bo drm ioctl interface.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:23 +02:00
Kenneth Graunke
a3685544e1 i965: Don't set iz_lookup the FS precompile's program key on Gen6+.
We already changed the actual program key builder to only set these bits
on gen < 6; this patch just brings the precompile state back in line so
it doesn't mismatch every time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 23:05:35 -07:00
Kenneth Graunke
98211d5af7 i965/fs: Fix INTEL_DEBUG=perf program key printing.
When dumping differences in program keys, it printed messages of the
format:

   [Name of thing that changed]  [new]->[old]

This was terribly confusing: the right arrow implies "the value changed
from this to that", when in fact the message conveyed the opposite.

Except that some of the time, it didn't, since we accidentally swapped
the arguments to brw_debug_recompile_sampler_key.  With two swaps, it
would often come out in the expected format.

This patch fixes it to properly print:

   [Name of thing that changed]  [old]->[new]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-25 23:01:50 -07:00
Kenneth Graunke
174d44a9c4 mesa: Use a new, more specific hook for shader uniform changes.
Gallium drivers and i965 don't require special notification when
sampler uniforms change.  They simply see the _NEW_TEXTURE and adjust
their indirection tables.  These drivers don't want ProgramStringNotify:
it simply causes pointless recompiles.

Unfortunately, i915 still requires shader recompiles and needs
ProgramStringNotify.  Rather than trying to fix that, simply change the
hook to a new, more specific one: ShaderUniformChange.  On i915, this
translates to ProgramStringNotify; others simply ignore it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
85e8e9e000 i965: Use linker-assigned sampler IDs in instruction encoding.
When assigning uniform locations, the linker assigns each sampler
uniform a sequential numerical ID.  gl_shader_program::SamplerUnits maps
these sampler variable IDs to the actual texture units they reference
(specified via glUniform1i).

Previously, we encoded this mapping in the SEND instruction encoding:
the "sampler" was the texture unit number, and the binding table index
was SURF_INDEX_TEXTURE(the texture unit number).  This unfortunately
meant that whenever the application changed the value of a sampler
uniform, we had to recompile the shader to change the SEND instructions.

This was horrible for the game Cogs, which repeatedly switches between
using texture unit 0 and 1.  It also made fragment shader precompiles
useless: we'd do the precompile at glLinkShader() time, before the
application called glUniform1i to set the sampler values.  As soon as
it did that, we'd have to recompile, wasting time and space in the
program cache.

This patch encodes the SamplerUnits indirection in the binding table,
sampler state, and sampler default color tables.  Instead of baking the
texture unit number into the shader, we bake in the sampler variable ID
assigned by the linker.  Since those never change, we don't need to
recompile programs on uniform changes.

This does mean that the tables now depend on the linked shader program
being used for rendering, rather than simply representing all available
texture units.  This could cause an increase in state emission.

Another plus is that the sampler state and sampler default color tables
are now compact: we only emit as many entries as there are sampler
uniforms, with no holes in the table since the new sampler IDs are
sequential.  Previously we had to emit a full 16 entries every time,
since the tables tracked the state of all active texture units.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
2faa592e7f i965: Add a "sampler state index" parameter to update_sampler_state().
This represents the index into the sampler state table or sampler
default color table (the two are identical).

Right now, this is still the texture unit, but that will change shortly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
28fab4295e i965: Un-hardcode WM binding table from update_texture_surface.
Currently, we mirror the VS and WM binding tables' texture entries.
That may not continue to be true, so in preparation, pass in the binding
table and surface index as arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke
96a22f3583 i965/vs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
0ad2dce24a i965/fs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Don't bother renaming fs_instruction::sampler.  Although it's currently
the texture unit, this series will change that.  No need for the churn.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
bf0308d8d6 i965/fs: Remove unused 'sampler' parameter in emit_texture_genX().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
76d1301e8e i965: Set SWIZZLE_NOOP for unused texture units in the program keys.
Previously, we left the swizzle key field as zero for unused texture
units.  The precompile sets all of them to SWIZZLE_NOOP, which meant
that we mismatched almost every time.

Since either works equally well, change it to SWIZZLE_NOOP to match
the precompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
f510dd5d60 i965: Remove four and a half year old TODO comments about samplers.
I can't actually understand what these mean, and they seem to
essentially say "we should simplify things", which is a nice goal but
not very specific.

Presumably things got cleaned up at some point.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke
d1447f5bc9 i965: Fix brw_link_shader to return false rather than NULL.
Fixes brw_shader.cpp:101:9: warning: converting to non-pointer type
'GLboolean {aka unsigned char}' from NULL [-Wconversion-null]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-with-great-enthusiasm-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Ian Romanick
f9767dac9a mesa/es: Validate glGetBufferParameteriv pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:15:20 -07:00
Ian Romanick
93d109645a mesa/es: Validate glMapBuffer access in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: *Really* add proper core-profile and GLES3 filtering based on review
feedback from Eric Anholt.  It looks like previously there was some
rebase / merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
bd4e5dd355 mesa/es: Validate glBufferData usage in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering based on review feedback
from Eric Anholt.  It looks like previously there was some rebase /
merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
b0b6b76d52 mesa/es: Validate buffer object targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick
e2cf14d7b2 mesa/es: Validate VertexPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
ef723ecce4 mesa/es: Remove redundant vertex pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
a8f475d8f6 mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
c3e9a207d0 mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
e5ef0cbe0e mesa/es: Validate NormalPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick
fb8218508a mesa/es: Validate ColorPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
07ccfef8d1 mesa/es: Validate ColorPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
28ee443d7b mesa/es: Remove redundant vertex attrib pointer type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
ae633d0b2e mesa/es: Remove redundant vertex attrib pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
946ddec163 mesa/es: Disallow BGRA vertex arrays in ES or ES2 contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
bbceed268e mesa: Rearrange array type checking, filter more types in ES
v2: Fix handling of GL_INT and GL_UNSIGNED_INT types pre-ES3.0, and fix
handling of GL_INT_2_10_10_10_REV and GL_UNSIGNED_INT_2_10_10_10_REV in
ES3.0.  Based on review comments by Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-24 19:13:17 -07:00
Ian Romanick
a33f360e8f mesa: Refactor element type checking into its own function
This consolidates the tests and makes the emitted error message
consistent.

v2: Rename _mesa_valid_element_type to valid_elements_type.  Log the
enum string instead of the hex value in error messages.  Based on review
comments from Brian Paul and Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 19:13:12 -07:00
Brian Paul
229868edf7 wgl: update some comments 2012-08-24 14:09:03 -06:00
Brian Paul
4b7c0938e4 st/mesa: don't do (generic) compression of 1D or 1D_ARRAY textures
As with the previous commit for core Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
a3af27e993 mesa: add generic compressed -> uncompressed format helper
_mesa_generic_compressed_format_to_uncompressed_format() probably wins the
prize for longest function name in Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
13d0bb21a9 mesa: don't try (generic) compression of 1D and 1D_ARRAY textures
See comments in the code for details.

Note: we only need to special-case the generic compressed formats since
specific texture formats are error-checked earlier to see if the compression
format is compatible with the texture type.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul
d47a6ada9c mesa: add texture target field to ChooseTextureFormat() driver hook
This will let us choose the actual hardware format depending on the
type of texture.

v2: fixup radeon, nouveau, intel and swrast drivers too

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 14:08:57 -06:00
Brian Paul
ba7218061b xlib: remove texture compression hackery
I think this was left-over debug code from long ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 13:15:27 -06:00
Brian Paul
09fafd3b85 st/mesa: clean up use of 'target' variable in st_context_teximage()
'target' was used both as a parameter of type st_texture_type and then
re-used for GL_TEXTURE_x targets.  Rename the function parameter and
add a new local 'GLenum target'.

And remove an extraneous break statement.
2012-08-24 13:15:27 -06:00
Matt Turner
261719b21c automake: convert vgapi 2012-08-24 11:08:19 -07:00
Matt Turner
ba4a36d8cd build: Check for bison-generated file before bailing because of no bison
.y/.c was a typo.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner
179d8aa331 Move _mesa_dl* functions into dlopen.h and inline them
No point in having an extra function call for inlinable functions.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Tapani Pälli
57c57df7b4 mesa/dlopen: use HAVE_DLOPEN instead of _GNU_SOURCE
Patches changes mesa to use 'HAVE_DLOPEN' defined by configure and Android.mk
instead of _GNU_SOURCE for detecting dlopen capability. This makes dlopen to
work also on Android where _GNU_SOURCE is not defined.

[mattst88] v2: HAVE_DLOPEN is sufficient for including dlfcn.h, remove
	       mingw/blrts checks around dlfcn.h inclusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner
df4dccc7a9 build: Only add links to .so files if we're building them
Xlib-GLX and OSMesa support static building.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53962
2012-08-24 11:08:19 -07:00
Matt Turner
c56b57f4a1 build: Add libOSMesa.so.$(VERSION) link to libdir 2012-08-24 11:08:19 -07:00
Matt Turner
a8fd8cb9e7 build: Replace OSMESA_VERSION with generic VERSION_NUMBER
Can be used by other modules.
2012-08-24 11:08:19 -07:00
Matt Turner
383a70bf9a build: Order AC_CONFIG_FILES list
Makefiles before .pc files before directories. Alphabetize files of the
same type.
2012-08-24 11:08:19 -07:00
Matt Turner
8cdce6c136 build: Only build libmesa.la when needed
Namely, for Xlib-GLX, OSMesa, or test programs.
2012-08-24 11:08:19 -07:00
Matt Turner
00f3d9b11a build: Remove duplicate DRI automake conditionals 2012-08-24 11:08:19 -07:00
Matt Turner
d23b1b7977 build: Remove GLU_DIRS 2012-08-24 11:08:19 -07:00
Matt Turner
0abb26ebff build: Only generate dispatch assembly code that will be built 2012-08-24 11:08:19 -07:00
Paul Berry
5133bd6585 i965: don't clear resolve map when doing fast depth clears.
Previously, when performing a fast depth clear, we would also clear
the miptree's resolve map.  This destroyed important information,
since the resolve map contains information about needed resolves for
all levels and layers of the miptree, whereas a depth clear only
applies to a single level/layer combination at a time.  As a result,
resolves would sometimes fail to occur, leading to incorrect
rendering.

Fixes rendering artifacts with shadow maps in Unigine Heaven and
Unigine Sanctuary.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50270

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-24 09:59:27 -07:00
Paul Berry
4b8b6f385e i965/HiZ: remove assertion from intel_resolve_map_set().
There are three possible resolve map states for each (level, layer) of
a depth miptree: "needs HiZ resolve", "needs depth resolve", and
"needs neither".  When HiZ was first implemented on i965, any attempt
to directly transition between "needs HiZ resolve" and "needs depth
resolve" without passing through the "needs neither" state would have
been a bug indicating that a necessary resolve hadn't been performed.
Accordingly, intel_resolve_map_set() contained an assertion to verify
that no such direct transition happened.

However, now that we support fast depth clears, there is a valid
transition from the "needs HiZ resolve" to the "needs depth resolve"
state.  When doing a fast depth clear, the old state of the buffer is
irrelevant, since we are completely replacing it with the clear value,
so it is not necessary to do any resolves before clearing--we can
transition, if necessary, directly from the "needs HiZ resolve" state
to the "needs depth resolve" state.

To avoid spurious assertions in this valid case, this patch just
removes the assertion.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-24 09:59:27 -07:00
Christian König
9aacd5cc67 radeonsi: remove old tilling handling
Just use the functionality provided by the surface manager instead.

This fixes just another bunch of piglit tests.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-24 18:11:31 +02:00
Ian Romanick
86f29cf7d0 mesa/es: Validate glCreateShader targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Ian Romanick
b042f7a1ff mesa/es: Validate glGetProgramiv pnames in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Ian Romanick
1a200b68cd mesa: Filter glGetProgramiv pnames based on available extensions
Previously you could always glGetProgramiv one of the transform feedback
or geometry shader enums even if the extension wasn't supported.

In addtion, this reverts part of bda6ad27.  I think the hunks involving
GL_PROGRAM_BINARY_LENGTH_OES were spurious.  Mesa has no support for any
other part of GL_OES_get_program_binary.

v2: Remove redundant return in get_programiv based on review feedback
from Matt Turner.

v3: Correctly handle UBO related enums.

v4: Emit the bad enum in the _mesa_error call based on review feedback
from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 09:06:31 -07:00
Brian Paul
9282ebbaa5 swrast: implement cubical depth texture sampling
Fixes a few more failures in the piglit copyteximage test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 09:38:44 -06:00
Blaž Tomažič
87280d56a3 clover: Accept CL_MEM_READ_WRITE flag
Fix API functions for memory objects to accept CL_MEM_READ_WRITE flag.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
[ Francisco Jerez: Drop incorrect change in clCreateSubBuffer. ]
2012-08-24 17:10:14 +02:00
Tom Stellard
167ecf5ba3 radeon/llvm: Cleanup R600Instructions.td 2012-08-24 14:14:55 +00:00
Brian Paul
388af5b6f4 main: fix ES compile breakage 2012-08-24 06:40:06 -06:00
Brian Paul
4fec5e9154 mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for dxt formats
As with the previous commit.

This fixes the last crash in the piglit copyteximage test but there's
still some failures.
2012-08-24 06:18:42 -06:00
Brian Paul
d78b44c265 mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for latc/rgtc formats
Fix-up the texel fetch functions so that they handle 3D coords (as used for
array textures) and remove the "f_2d" part from their names.

Helps fix swrast crashes in piglit's copyteximage test.  More to come.
2012-08-24 06:18:41 -06:00
Brian Paul
fe2cc65fbb mesa: code movement in teximage.c
To get rid of a forward declaration.
2012-08-24 06:18:41 -06:00
Brian Paul
bdff1dfb39 mesa: consolidate glTexImage and glCompressedTexImage code
There was a lot of similar or duplicated code before.
To minimize this patch's size, use a forward declaration for
compressed_texture_error_check().  Move the function in the next patch.
2012-08-24 06:18:41 -06:00
Brian Paul
e93cb4b34f mesa: make glTexImage, glCompressedTexImage proxy code more alike
Next up, we can combine the teximage() and compressed_teximage() functions.
2012-08-24 06:18:41 -06:00
Brian Paul
c1a9e6010b mesa: rename texpal.[ch] to texcompress_cpal.[ch]
To be consistent with other files related to texture compression.
2012-08-24 06:18:41 -06:00
Brian Paul
aab06dc0f0 mesa: s/GLuint/gl_format/ in _mesa_compressed_format_to_glenum()
No real change here, just use the right type.
2012-08-24 06:18:41 -06:00
Brian Paul
46751edca9 mesa: new _mesa_num_tex_faces() helper
Not a real big help now, but will be useful for the
GL_ARB_texture_cube_map_array extension in the future.
2012-08-24 06:18:41 -06:00
Brian Paul
8a935d71ff mesa: make _mesa_get_proxy_tex_image() static
It's not used by any other file.
2012-08-24 06:18:41 -06:00
Brian Paul
637a79aa23 mesa: don't clear proxy image fields when regular GL error is generated
If a proxy texture call generates a regular GL error, we should not
clear the proxy image's width/height/depth/format fields.  Use a new
PROXY_ERROR token to distinguish proxy errors from regular GL errors.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 06:18:41 -06:00
Brian Paul
1f5b1f9846 mesa: fix glTexImage proxy texture error generation
When calling glTexImage() with a proxy target most error conditions should
generate a GL error.  We were erroneously doing the proxy-error behaviour
(where we zeroed-out the image's width/height/depth/format fields) in too
many places.

There's another issue with proxy textures, but that'll be fixed in the
next patch.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 06:18:41 -06:00
José Fonseca
3e3f99277d draw: Fix regression in draw_set_sampler(_views).
draw->samplers(_views) now has PIPE_SHADER_TYPES elements, instead of
PIPE_MAX_SAMPLERS as before.

Also, shader_stage must be less than PIPE_SHADER_TYPES to prevent buffer
overflow.

Trivial.
2012-08-24 11:28:00 +01:00
Vadim Girlin
e84d45fdb7 build: don't leave git_sha1.h.tmp after build/install
Fixes "`main/git_sha1.h.tmp': Permission denied" build error.
See https://bugs.freedesktop.org/show_bug.cgi?id=52064

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 11:16:14 +04:00
Tom Stellard
1434a86f50 radeon/llvm: Set End of Program bit on RAT instructions
This code was accidently dropped during the MCCodeEmitter conversion.
2012-08-23 21:54:32 +00:00
Tom Stellard
1bd7b29a66 radeon/llvm: Use correct instruction for moving immediates
This should fix an assertion failure that was happening in some compute
shaders.
2012-08-23 21:54:32 +00:00
Tom Stellard
2ad8608cb3 radeon/llvm: Fix some coding style issues 2012-08-23 21:54:32 +00:00
Tom Stellard
228a6641cc radeon/llvm: Pull changes from external version of the backend 2012-08-23 21:54:32 +00:00
Tom Stellard
5a1edb8655 radeon/llvm: Simplify the convert to ISA pass 2012-08-23 21:54:32 +00:00
Tom Stellard
cb5227b403 radeon/llvm: Make sure to use the Text section in the AsmPrinter 2012-08-23 21:54:31 +00:00
Matt Turner
68a2c510a6 build: Fix installation of GLES2 headers
Reported-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Tested-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-08-23 14:07:35 -07:00
Matt Turner
fc9ea7c74d build: Fix GLES linkage with libglapi
Reported-by: Ian Romanick <idr@freedesktop.org>
2012-08-23 14:07:35 -07:00
Anuj Phogat
e592f7df03 i965/msaa: Add sample-alpha-to-coverage support for multiple render targets
Render Target Write message should include source zero alpha value when
sample-alpha-to-coverage is enabled for an FBO with  multiple render targets.
Source zero alpha value is used as fragment coverage for all the render
targets.

This patch makes piglit tests draw-buffers-alpha-to-coverage and
alpha-to-coverage-no-draw-buffer-zero to pass on Sandybridge. No
regressions are observed with piglit all.tests.

V2: Revert all the changes made in emit_color_write() function to
include src0 alpha for targets > 0. Now handling this case in a if
block.

V3: Correctly calculate the instruction length for buffer zero.
Properly handle the case of dual_src_blend when alpha-to-coverage
is enabled.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-08-23 13:30:54 -07:00
Stéphane Marchesin
ff996cafce glsl/linker: Avoid buffer over-run in parcel_out_uniform_storage::visit_field
When too may uniforms are used, the error will be caught in
check_resources (src/glsl/linker.cpp).

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Benoit Jacob <bjacob@mozilla.com>
2012-08-23 11:42:19 -07:00
Ian Romanick
9b028faeaa mesa/es: Validate glCompressedTexSubImage internalFormat in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
dd0eb00487 mesa/es: Validate glCompressedTexImage internalFormat in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
c11096e94a mesa/es: Validate glCopyTexImage internalFormat in Mesa code rather than the ES wrapper
v2: Add GLES3 filtering.  I'm not 100% sure this is correct.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
9848e86af0 mesa/es: Validate glTexSubImage format and type in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
409620e477 mesa/es: Validate glTexImage format, type, and internalFormat in Mesa code rather than the ES wrapper
v2: Add proper GLES3 filtering.

v3: Collapse ALPHA, LUMINANCE, and LUMINANCE_ALPHA cases per review
comment from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
0686ccac95 mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper
Also validate glCopyTexImage border.  This fixes a bug in the APIspec.
Previously glTexImage3DOES could be passed a non-zero border without error.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:31 -07:00
Ian Romanick
59d965333c mesa: Generate an error when glCopyTexImage border is invalid
NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
2dcb40bb44 mesa/es: Add support for GL_APPLE_texture_max_level
This is desktop OpenGL functionality that has always existed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
c9689e3e55 mesa/es: Validate glGetTexParameter pnames in Mesa code rather than the ES wrapper
This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile and GLES3 filtering.  GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts.  A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
b3dd524a10 mesa/es: Validate glTexParameter pnames in Mesa code rather than the ES wrapper
This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile, GLES1, and GLES3 filtering.  GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts.  A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
4269cace79 mesa/es: Remove redundant glBindTexture target validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
3f7c8364cf mesa: Filter glBindTexture targets based on supported features.
Fixed the piglit test arb_texture_buffer_object-negative-unsupported.

NOTE: This is a candidate for stable release branches.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
530c9d764b mesa/es: Validate tex image targets in Mesa code rather than the ES wrapper
This should take care of all the TexImage, TexSubImage, CopyTexImage,
CompressedTexImage3DOES, and CopyTexSubImage type paths.

v2: Add proper core-profile and GLES3 filtering.

v3: Squash the CompressedTexImage3DOES patch per review comment from
Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
ea9b212fca mesa/es: Validate EGLImageTargetTexture2DOES target in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
a0595cb450 mesa/es: Validate glTexParameter targets in Mesa code rather than the ES wrapper
Ditto for glGetTexParameter targets.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:30 -07:00
Ian Romanick
842efb9447 mesa/es: Validate GL_TEXTURE_WRAP param in Mesa code rather than the ES wrapper
v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:29 -07:00
Ian Romanick
d53101a9f3 mesa: Refactor validate_texture_wrap_mode to use a switch-statement
This makes the next couple changes a little easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-23 10:15:29 -07:00
Ian Romanick
2abf555496 meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't exist
This is a bit of a hack.  _mesa_meta_GenerateMipmap shouldn't even be
used in contexts where GL_GENERATE_MIPMAP doesn't exist (i.e., core
profile and ES2) because it uses fixed-function, and fixed-function
doesn't exist there either!

A GLSL-based _mesa_meta_GenerateMipmap should be available soon.  When
that is available, this patch will be irrelevant and should be reverted.

v2: Change (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) to
(ctx->API == API_OPENGL || ctx->API == API_OPENGLES) based on review
comment from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-23 10:15:29 -07:00
Tapani Pälli
2ddfca9837 build/glsl: fix android build v2
Commit 77a3efc6b9 broke android build that
sets its own value for GLSL_SRCDIR before including Makefile.sources.
Patch moves overriding the value after include, this works as GLSL_SRCDIR
variable gets expanded only later.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-23 10:13:38 -07:00
Matt Turner
a6b8b709cd automake: convert es1api 2012-08-23 09:40:06 -07:00
Matt Turner
0f8110cb0c automake: convert es2api 2012-08-23 09:38:32 -07:00
Vadim Girlin
68d6441930 st/dri: pass config options to the state tracker
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
a6457c0692 st/mesa: accept and handle configuration options from st/dri
Currently there is a single option - force_glsl_extensions_warn.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
44f69fc825 st/dri: add force_glsl_extensions_warn option to dri options
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
e7c177ec9e st/dri: use driver name for driconf section lookup
The name is taken from the driver_descriptor, so it will be the same as
expected by driconf utility.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-23 19:57:51 +04:00
Vadim Girlin
6547733593 swrast: add DRM_DRIVER_DESCRIPTOR to store driver name 2012-08-23 19:57:50 +04:00
Paulo Alcantara
b41f36bde7 egl_dri2: Fix segmentation fault
The segmentation fault occurs when DRI2 is not loaded up and
dri2_setup_screen() function deferences dri2_dpy->dri2 (since it's NULL
at this point).

This patch fixes the segmentation fault by checking if dri2 pointer is
not NULL before deferencing it.

Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-23 09:17:23 -06:00
Tom Stellard
90bd1d52bb radeon/llvm: Use the MCCodeEmitter for R600 2012-08-23 15:00:48 +00:00
Tom Stellard
235318a578 radeon/llvm: Use the MCCodeEmitter for SI 2012-08-23 15:00:48 +00:00
Tom Stellard
2de24024c1 radeon/llvm: Set 64BitPtr feature bit for SI 2012-08-23 15:00:48 +00:00
Tom Stellard
3f9b6aa0f4 radeon/llvm: Lower RETFLAG DAG Node to S_ENDPGM on SI 2012-08-23 15:00:48 +00:00
Tom Stellard
e30b4644b6 radeon/llvm: Add AsmPrinter 2012-08-23 15:00:48 +00:00
Tom Stellard
e61c54cb6b radeon/llvm: Mark JUMP as a pseudo instruction 2012-08-23 15:00:48 +00:00
Tom Stellard
ead72204f1 radeon/llvm: Remove the last uses of MachineOperand flags 2012-08-23 15:00:47 +00:00
Tom Stellard
67a47a445b radeon/llvm: Add flag operand to some instructions
This new operand replaces the MachineOperand flags in LLVM, which
will be deprecated soon.  Eventually all instructions should have a flag
operand, but for now this operand has only been added to instructions
that need it.
2012-08-23 15:00:47 +00:00
Tom Stellard
3a7a56e7aa radeon/llvm: Encapsulate setting of MachineOperand flags
MachineOperand flags will be removed soon, so it is convienent to
have only one function that modifies them.
2012-08-23 15:00:47 +00:00
Matt Turner
bee2edbf3d build: Link DRI drivers with dricore in case of no direct rendering
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
bfd7d6f58b build: Only build libmesagallium.la if building Gallium
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
f9786394e5 build: Clean glx Makefile.am
mapi/glapi is already built when make is run in src/glx.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
d9b109892d build: Put mapi/shared-glapi in CORE_DIRS
SRC_DIRS was overwritten (visible in the second hunk).

Also don't require mapi/shared-glapi to be built for GLES.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
8c9b78aad1 build: Only allow shared-glapi with DRI
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
32e8ce6d24 build: Set sensible DRI/X11/OSMesa defaults
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
53248e5f95 build: Print whether shared-glapi is enabled
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
625651cf81 build/x11: Force usage of C++ linker
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
9049b7f0fa build/x11: Don't link against shared-glapi
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Matt Turner
be5fe7b320 build: Remove deprecated --with-driver= flag
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-22 11:08:06 -07:00
Christian König
302c66ff81 radeonsi: rework vertex format handling
Preventing piglit's draw-vertices test from hanging the GPU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-22 15:33:54 +02:00
Christian König
07838603b9 radeonsi: fix SPI_PS_INPUT_ENA handling
We need to enable at least one interpolation mode,
otherwise the GPU will hang.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-22 15:33:49 +02:00
Vadim Girlin
8d1a9a984f r600g: fix lockups with dual_src_blend v2
Disable blending when dual_src_blend is enabled and number of color exports
in the current fragment shader is less than 2.

Fixes lockups with ext_framebuffer_multisample-
alpha-to-coverage-dual-src-blend piglit test.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-08-22 12:12:22 +04:00
Jakob Bornecrantz
c4610e9f92 st/dri: Add shared usage on buffers created
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-22 00:01:28 +02:00
Jakob Bornecrantz
61e95b8a5f gbm: Add shared usage on images created
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-22 00:01:28 +02:00
Anuj Phogat
df2c4cbced mesa: Fix generic compressed texture formats' handling in glTexImage/glCopyTexImage
The generic texture formats should be accepted by the <internalformat>
parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and
CopyTexImage2D functions. When the application specifies a generic
format, the driver is free to pick an uncompressed format.

This patch reverts the changes due to following commit:
commit a36581ccc0
mesa: do more teximage error checking for generic compressed formats

This patch fixes compressed texture format failures in intel oglconform
pxconv-gettex test case:
https://bugs.freedesktop.org/show_bug.cgi?id=47220

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-21 15:00:06 -07:00
Tom Stellard
1cb07bd3b8 radeon/llvm: ExpandSpecialInstrs - Add support for cube instructions 2012-08-21 15:42:44 +00:00
Tom Stellard
6c99f2101f radeon/llvm: ExpandSpecialInstrs - Add support for vector instructions 2012-08-21 15:42:44 +00:00
Tom Stellard
82a5d0c641 radeon/llvm: Add R600ExpandSpecialInstrs pass
This pass expends reduction instructions into a MachineInstrBundle that
contains 4 instruction, one for each instruction slot.
2012-08-21 15:42:44 +00:00
Tom Stellard
0588298575 radeon/llvm: Add helper function for getting sub reg indices 2012-08-21 15:42:44 +00:00
Michel Dänzer
1a25ebe3ce radeonsi: Handle NULL sampler views getting passed in by the state tracker.
Don't dereference NULL pointers, and if all views are NULL, don't generate an
invalid PM4 packet which locks up the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-08-21 15:42:25 +02:00
Ian Romanick
c1114c619a APIspec: Remove cruft about AMD_compressed_???_texture
Mesa doesn't support these extensions, and it seems unlikely that it
ever will

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
4c32ee5bca mesa/es: Remove redundant glFramebufferTexture3D textarget validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
7c9afe50fd mesa/es: Remove redundant glGetShaderiv pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:34 -07:00
Ian Romanick
aaef441638 mesa/es: Remove redundant glCompressedTexImage border validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
d39cb8e9ef mesa/es: Remove redundant glPointSizePointer type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
d54004c352 mesa/es: Remove redundant glGetBufferPointer pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
68d7ce3e9e mesa/es: Remove redundant glGetVertexAttribPointer pname validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
5be5cf6934 mesa/es: Remove redundant element type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
b99a8caff1 mesa/es: Remove redundant glGetShaderPrecisionFormat shader type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
c914ac239e mesa/es: Remove redundant depth func validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
af276d9d4b mesa/es: Remove redundant stencil op fail/zfail/zpass validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
f3f993153c mesa/es: Remove redundant shade model mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:33 -07:00
Ian Romanick
5a193557d1 mesa/es: Remove redundant light pname and light validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
0234410791 mesa/es: Remove redundant hint mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
a4251da3b2 mesa/es: Remove redundant separate stencil face validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
9113d0e686 mesa/es: Remove redundant stencil function validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
1087745afe mesa/es: Remove redundant logic op operand validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
bf03589882 mesa/es: Remove redundant alpha function validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
8f55d83569 mesa/es: Remove redundant separate stencil mask face validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
52d57985c6 mesa/es: Remove redundant front-face mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
e1dbf56a10 mesa/es: Remove redundant face culling mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:32 -07:00
Ian Romanick
66404557db mesa/es: Remove redundant blend equation mode validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:06:31 -07:00
Ian Romanick
e39ea674d0 mesa/es: Remove redundant texture target validation
Mesa doesn't check the parameter passed to glMultiTexCoord*.  It does,
however, mask the texture value to prevent out-of-bounds writes.  This
patch will promote this non-conformant behavior to OpenGL ES 1.  I don't
think anyone will care, and the gets some silly code out of a hot path.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 16:05:11 -07:00
Ian Romanick
386e2f3289 mesa/es: Rearrange placement of GL_TEXTURE_MAX_ANISOTROPY_EXT in APIspec
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 09:52:45 -07:00
Ian Romanick
27e55805fb mesa/es: Remove redundant min/mag filter validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-20 09:52:27 -07:00
Mathias Fröhlich
926a4a922f radeon-llvm: Start multithreaded before using llvm.
This is required to make some of llvm's api calls
thread save. In particular the PassRegistry, which is
implicitly accessed while compiling shader programs.
The PassRegistry uses a mutex that is only active if
the llvm_is_multithreaded() returns true.
Calling llvm_start_multithreading() makes this happen
and by calling this function we try to make sure that
we can savely compile shaders in paralell.
Since there is also a call llvm_stop_multithreading()
in the llvm api, we cannot guarantee that this does
not get switched off while we are relying on this being
set, but for the easier use cases this fixes a race with
the radeon llvm compiler we have as of today.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-20 16:27:23 +00:00
archibald
59361d76a5 r600g: Move common compute/3D register init to its own function
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-20 15:35:09 +00:00
Christoph Bumiller
c51f8e2790 nv50/ir/tgsi: handle DP2 in tgsi Instruction srcMask
Solved by Tiziano Bacocco on IRC.
2012-08-18 17:38:56 +02:00
Christoph Bumiller
f3a7be740d nv50/ir/emit: don't forget saturation bit on f32 add immediate
Solved by Maxim Levitsky on IRC.
2012-08-18 17:38:45 +02:00
Tilman Sauerbeck
d0ace4e949 mesa: use #if over #ifdef in the FEATURE_ES1 check to fix a build failure.
mfeatures.h will define FEATURE_ES1 to 0 if it's not defined yet.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53664

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-18 07:53:54 -06:00
Brian Paul
5b542681dc st/mesa: fix sampler view counting
In the past, when we called pipe::set_sampler_views(n) the drivers set
samplers [n..MAX] to NULL.  We no longer do that.  The state tracker
code was already trying to set unused sampler views to NULL to cover
that case, but the logic was broken and unnoticed until now.  This patch
fixes it.

Strictly speaking, this patch shouldn't be necessary.  Drivers should simply
ignore unused samplers and sampler views.  But some drivers like llvmpipe (and
others?) count those things and they figure into state validation.  That could
be fixed in the future.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53617

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-18 07:40:10 -06:00
Brian Paul
d65eb02537 util: update and fix u_upload_mgr.h comments 2012-08-18 07:39:52 -06:00
Brian Paul
84e5cb37d3 st/mesa: use Elements() instead of hard-coded number
And add a comment about the velems_util_draw[] array.
2012-08-18 07:39:52 -06:00
Brian Paul
1a9e4d5113 mesa: remove unused params, add const qualifiers
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-18 07:39:52 -06:00
Brian Paul
a6af24ee14 mesa: querying GL_TEXTURE_COMPRESSED_IMAGE_SIZE for a buffer obj is illegal
GL_INVALID_OPERATION is to be raised when querying a non-compressed
image/buffer.  Since a buffer object can't have a compressed format this
query always generates an error.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-18 07:39:51 -06:00
Ian Romanick
34472a0d87 mesa/es: Don't generate ES1 type conversion wrappers
These are gradually going to get whittled away and eventually folded into the
source files with the native type functions.

v2: Add (speculative) SConscript changes.  These may be broken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-17 18:12:20 -07:00
Eric Anholt
d707e337f5 i965: Fix bug in the old FS backend's projtex() calculation.
In the old backend, we looked at any FS attribute's proj_attrib_mask bits, not
just texcoords.  Now that we have _mesa_vert_result_to_frag_attrib(), we can
fill in the other FS inputs with correct proj_attrib_mask info.

NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46644
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-17 10:05:34 -07:00
Kenneth Graunke
3df13b32e5 mesa: Support GL_TEXTURE_BUFFER in GetTexLevelParameter[if]v in GL 3.1+.
The OpenGL 3.1 specification explicitly allows this.  Oddly, the
ARB_texture_buffer_object spec's issues section claims this isn't
allowed, but proceeds to explain that the extension simply doesn't edit
the underlying spec to allow it, and thus it didn't appear in the list
of legal texture targets.

Thus, this patch legalizes it only in 3.1+ contexts, but still returns
INVALID_ENUM in earlier contexts that expose ARB_texture_buffer_object.

Unfortunately, the behavior of the call is horrendously undefined.

Fixes oglconform's tbo/negative.textureParams test.

v2: Require desktop OpenGL.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
8c37fc1e92 mesa: Split out part of glGetTexLevelParameter into a helper function.
Move the _mesa_GetTexLevelParameter[iv] functions below the helper
function so the prototype is available.

This will be useful in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
58d11524da mesa: Add GL_TEXTURE_CUBE_MAP to _mesa_max_texture_levels(). [v2]
For cube maps, _mesa_generate_mipmap() calls this with
GL_TEXTURE_CUBE_MAP (the gl_texture_object's Target) rather than one
of the faces.  This caused _mesa_max_texture_levels() to return 0, which
resulted in maxLevels == -1 and the next line's assertion to fail.

This function is called from seven places:
- fbobject.c: framebuffer_texture()
- mipmap.c: _mesa_generate_mipmap()
- texgetimage.c:
  - getteximage_error_check()
  - getcompressedteximage_error_check()
- texparam.c: _mesa_GetTexLevelParameteriv()
- texstorage.c: tex_storage_error_check()

All of these (or their callers) now explicitly check for invalid targets
already, so this shouldn't cause invalid targets to slip through.
(Technically _mesa_generate_mipmap() doesn't check for invalid targets,
but the API-facing _mesa_GenerateMipmapEXT() function does.)

+2 oglconforms (float-texture/mipmap.automatic and mipmap.manual)

In addition to fixing the mipmap bug, it should also cause glTexStorage
to accept GL_TEXTURE_CUBE_MAP, which is explicitly allowed by the spec.

v2: Drop alterations to callers; this is now in a patch series that adds
    explicit checking to API functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
9e4fde85e4 mesa: Add explicit target checking to GetTexLevelParameter[if]v().
Previously, it relied on _mesa_max_texture_levels() for texture target
error checking.  This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels(), so
this patch should not introduce any change in behavior.  Future patches
will cause the two to diverge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Kenneth Graunke
63396ce4c0 mesa: Add explicit target checking to Get[Compressed]TexImage().
Previously, they relied on _mesa_max_texture_levels() for texture target
error checking.  This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels() but
removed the proxy targets, as both functions explicitly rejected those
targets.  This changes the order in which we check errors, which could
change whether we return INVALID_VALUE or INVALID_ENUM.  However, it
shouldn't change the list of accepted targets.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-17 09:14:36 -07:00
Brian Paul
f69273f952 llvmpipe: remove polygon stipple assertion
It's possible for us to have an unused sampler bound when the fragment
shader itself doesn't use any samplers.  So the assertion isn't valid.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53616
2012-08-17 09:07:49 -06:00
Brian Paul
553a08d314 svga: minor code reformatting
To be consistent with other functions.
2012-08-16 17:03:43 -06:00
Matt Turner
81ba2c53b6 build: Remove -shared from OSMesa's LDFLAGS
Would break the static build.
2012-08-16 15:04:54 -07:00
Matt Turner
d12b07eb1a build: Remove EXTRA_LIB_PATH
You can add extra library paths to LDFLAGS directly.
2012-08-16 15:04:54 -07:00
Matt Turner
e273ed37ea build: Require X11 pkg-config files 2012-08-16 15:04:53 -07:00
Marek Olšák
f36c404f90 r600g: disable tiling for 422 formats again 2012-08-16 20:44:54 +02:00
Marek Olšák
795834432b r600g: fix blits of subsampled formats 2012-08-16 20:44:54 +02:00
Marek Olšák
6fd9218bb4 r600g: fix copying between NPOT mipmapped compressed textures
We aligned the dimensions to the blocksize, then divided by it
(in r600_blit.c), then minified, which was wrong.

The minification must be done first, not last.
This fixes piglit/fbo-generatemipmap-formats with S3TC and maybe
a bunch of other tests too. Tested on RV730.
2012-08-16 20:44:54 +02:00
Marek Olšák
b8e9cf5d96 r600g: make F2U trans-only on r600-r700
This fixes a failing assertion in r600_asm.c.
2012-08-16 20:44:53 +02:00
Marek Olšák
0d7e002815 r600g: set CB_COLOR_INFO to INVALID for disabled colorbuffers on r600-r700
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-16 20:44:53 +02:00
Marek Olšák
951ac46a6a r600g: rename r600_resource_texture to r600_texture 2012-08-16 20:44:53 +02:00
Marek Olšák
952c905767 r600g: always put tiled textures in VRAM 2012-08-16 20:44:53 +02:00
Marek Olšák
773ff5705f r600g: cleanup r600_resource_texture in favor of radeon_surface 2012-08-16 20:44:53 +02:00
Marek Olšák
362a25aac5 r600g: remove unused parameter in r600_texture_create_object 2012-08-16 20:44:53 +02:00
Marek Olšák
c4993d15eb r600g: fixup the usage flag for the flushed depth texture 2012-08-16 20:44:53 +02:00
Philipp Brüschweiler
0efd564a09 wayland-drm: close fd after the display is uninitialized
This fixes a "kernel rejected pushbuf: Bad file descriptor" error on
wl_drm display destruction.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-08-16 13:17:06 -04:00
José Fonseca
50dec63790 scons: Fix MinGW cross compilation.
Compensate for the recent changes and assumptions added to
Makefiles.sources
2012-08-16 17:21:52 +01:00
Tom Stellard
5f82d19248 radeon/llvm: Lower implicit parameters before ISel 2012-08-16 16:04:51 +00:00
Brian Paul
0d308ef8fe gallium/draw: move misplaced brace 2012-08-16 09:16:42 -06:00
Brian Paul
f6b7157550 mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image
This seems to be expected by the WebGL texture-mips test.  The error makes
sense, but I haven't found (yet) any OpenGL documentation specifying this
error condition.

See http://bugs.freedesktop.org/show_bug.cgi?id=44912

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-16 09:11:14 -06:00
Brian Paul
d663a557fd r600: update sampler, sampler_view code for the future
For when we have pipe->set_sampler_states(pipe, shader, start, num, samplers),
etc.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-16 09:01:31 -06:00
Brian Paul
10e552d056 rbug: update data structures, functions for future changes
To support geom/compute/etc shaders, samplers, sampler views, etc.
To support pipe->bind_sampler_states() w/ start_slot.
2012-08-16 09:01:31 -06:00
Brian Paul
109e87dc6a gallium/trace: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
d4ab8bd095 gallium/identity: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
f3cc4990a0 galahad: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
bd3733c0be svga: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
c969cb1447 llvmpipe: add 'start' parameter to bind_sampler_states/views() 2012-08-16 09:01:31 -06:00
Brian Paul
25a42f39e3 softpipe: add 'start' parameter to bind_sampler_states/views()
To support updating a sub-range of sampler states/views in the future.
Note that we always pass start=0 at this time.
2012-08-16 09:01:31 -06:00
Brian Paul
348ac08bfd gallium/trace: consolidate sampler, sampler_view code 2012-08-16 09:01:31 -06:00
Brian Paul
0ad95b923a gallium/identity: consolidate sampler, sampler_view code
This will simplify things when the pipe_context functions are consolidated.
2012-08-16 09:01:31 -06:00
Brian Paul
f3c3aff6ef st/mesa: add support for GS textures and samplers 2012-08-16 09:01:31 -06:00
Brian Paul
6c8a132158 st/mesa: combine vertex/fragment sampler state in arrays
As with other recent changes, put the vertex and fragment sampler state
into arrays indexed by the shader type.  This will let us easily add
support for other types of shaders in the future.
2012-08-16 09:01:31 -06:00
Brian Paul
cab2fed135 gallium: remove PIPE_MAX_VERTEX/GEOMETRY_SAMPLERS #define
PIPE_MAX_SAMPLERS, PIPE_MAX_VERTEX_SAMPLERS and PIPE_MAX_GEOMETRY_SAMPLERS
were all defined to the same value (16).

In various places we're creating arrays such as
sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] so we were assuming
the same number of max samplers for all shader stages anyway.

Of course, drivers are still free to advertise different numbers of max
samplers for different shaders.
2012-08-16 09:01:31 -06:00
Brian Paul
a2c1df4c9a draw: index samplers and sampler_view state by shader type
So that we can handle GS state and other types of shaders in the future.
2012-08-16 09:01:31 -06:00
Brian Paul
bef196c792 draw: move tgsi-related state into a tgsi sub-struct
To better organize things a bit.
2012-08-16 09:01:31 -06:00
Brian Paul
df87fb5913 gallium: add a shader stage/type param to some draw functions
To prepare for geometry shader texture support in the draw module.
Note: we still only handle the vertex shader case.
2012-08-16 09:01:31 -06:00
Brian Paul
a8ed00d5f1 st/mesa: silence signed/unsigned comparison warning 2012-08-16 09:00:08 -06:00
Brian Paul
d733e5da9c svga: move result->key expression after result != NULL check 2012-08-16 08:58:55 -06:00
Brian Paul
50188adf7d svga: fix result==NULL logic in emit_fs_consts()
The previous test for result != NULL was kind of bogus since we dereferenced
the pointer earlier in the code.  Now, check for result != NULL first, then
get the result->key info.

Also, remove the useless "offset +=" code at the end.
2012-08-16 08:58:55 -06:00
Brian Paul
d55e0f1ba0 svga: update comment (s/SVGA_NEW_VS_RESULT/SVGA_NEW_VS_PRESCALE/) 2012-08-16 08:58:55 -06:00
Brian Paul
2a5eeeaebe svga: rename svga_hw_vs_parameters -> svga_hw_vs_constants
and similarly for svga_hw_fs_parameters
2012-08-16 08:58:55 -06:00
Niels Ole Salscheider
8cc1860d4a st/mesa: index can be negative in the PROGRAM_CONSTANT case
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-16 08:56:09 -06:00
Brian Paul
fd41cbc557 mesa: add cast to silence warning in _mesa_pack_rgba_span_from_ints() 2012-08-16 08:55:48 -06:00
Brian Paul
658044cde1 meta: remove unused variable 2012-08-16 08:53:55 -06:00
Michel Dänzer
1b11395a36 radeonsi: Fix symbol conflicts with r600g.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50389

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 12:01:16 +02:00
Michel Dänzer
51d9f37a72 radeonsi: Fix memory leaks if returning early from some state functions.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
4b64fa2ff1 radeonsi: Fix LLVM context leak.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
18abc270c5 gallium/radeon: Don't assign virtual address space for BO that already has one.
We'd end up re-using the old one and throwing away the new one anyway, but only
after a roundtrip to the kernel.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
a60be05284 gallium/radeon: Create hole for waste when allocating from va_offset.
Otherwise, the wasted area could never be used for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:24 +02:00
Michel Dänzer
1f455ef5bc gallium/radeon: Fix potential address space loss in radeon_bomgr_force_va().
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
6d59b7f6dc gallium/radeon: Delete uppermost virtual address space hole if it's at the top.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
f5fe81daea gallium/radeon: Fix losing holes when allocating virtual address space.
If a hole exactly matches the allocated size plus alignment, we would fail to
preserve the alignment as a hole. This would result in never being able to use
the alignment area for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 11:58:23 +02:00
Michel Dänzer
206d07625c gallium/radeon: Merge holes when freeing virtual address space.
Otherwise we'll likely end up with an ever increasing amount of ever smaller
holes.

Requires keeping the list ordered wrt offsets.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 09:39:36 +02:00
Michel Dänzer
c25968f3e2 gallium/radeon: Make va_offset 64 bits wide.
Otherwise we'd wrap around after 32 bits. The kernel currently limits GPU
virtual address space to 4GB anyway, but that will probably change sooner or
later, and this would result in confusing error messages when running out of
virtual address space even now.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-16 09:37:33 +02:00
Vinson Lee
1597176f70 llvmpipe: Silence Coverity incorrect sizeof expression defect.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-15 22:15:49 -07:00
Vinson Lee
3d6892c479 scons: Add option to enable floating-point textures.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-15 22:04:24 -07:00
Dave Airlie
6a3ac03f2b glx/dri2: add dri2 prime support.
This adds support for having libGL pick a different driver for prime support.

DRI_PRIME env var is set to the value retrieved from the server randr
provider calls, by the calling process. (generally DRI_PRIME=1 will be
the right answer).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-08-16 10:02:10 +10:00
Vincent Lejeune
565a4e2a86 radeon/llvm: Enable if-cvt
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
a614979286 radeon/llvm: Add callbacks needed by if-cvt
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
0eca5fd919 radeon/llvm: Lower branch/branch_cond into predicated jump
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:14 +00:00
Vincent Lejeune
6db2e9fdb0 radeon/llvm: Add a predicated JUMP instruction
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
8263408a91 radeon/llvm: Support for predicate bit
Tom Stellard:
  - A few changes to predicate register defs

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
8f597d57e9 r600g: Glue to handle predicate aware output from llvm
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
72f7632c6b r600g: Fix instruction group merge when there are predicated insts.
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
56227f875b radeon/llvm: Do not use PV/PS if PRED_SEL does not match
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune
da676eab93 r600g: Add support for predicates
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Christian König
cf76edd300 radeonsi: move ps sampler state into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
ec5b698525 radeonsi: move ps sampler views into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
54de6f452c radeonsi: move vertex state descriptors into PM4 stream
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
f2c95d93db radeonsi: add shader data infrastructure
With this we can embed data for the shaders (like resource
descriptors) into the PM4 stream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Christian König
4444b9d1ec radeon/llvm: add support to fetch temps as vectors
Necessary for texture fetches with temp regs as source on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 22:13:19 +02:00
Tom Stellard
b6051bc785 radeon/llvm: Remove AMDGPUUtil.cpp 2012-08-15 18:35:26 +00:00
Apostolos Bartziokas
040c2e0456 radeon/llvm: Cleanup AMDGPUUtil.cpp 2012-08-15 18:35:25 +00:00
Tom Stellard
3aaa209293 radeon/llvm: Lower loads from USE_SGPR adddress space during DAG lowering 2012-08-15 18:35:25 +00:00
Tom Stellard
40c41fe890 radeon/llvm: Add live-in registers during DAG lowering
Psuedo instructions emulating live-in registers have been removed
and their corresponding intrinsics are now being lowered during DAG
lowering.
2012-08-15 18:35:25 +00:00
Tom Stellard
f3480f9234 radeon/llvm: Lower store_output intrinsic during DAG lowering 2012-08-15 18:35:25 +00:00
Tom Stellard
a76a0f7422 radeon/llvm: Force VTX_READ instructions to use same reg for src and dst
I was seeing some GPU hangs that seemed to be cause by ALU instructions
writing to the same register used as the source for VTX_READ.  Adding
this constraint to the VTX_READ instructions avoids this situation.
2012-08-15 18:35:25 +00:00
Marek Olšák
97b4b97b2f radeonsi: fix build breakage after u_blitter changes 2012-08-15 20:03:37 +02:00
Marek Olšák
e0cc61bd91 gallium/u_blitter: document custom meta helpers 2012-08-15 19:20:58 +02:00
Marek Olšák
b3b5bb9ddb r600g: disable handling of DISCARD_RANGE
https://bugs.freedesktop.org/show_bug.cgi?id=53130
2012-08-15 19:20:58 +02:00
Marek Olšák
44f14ebd7b r600g: implement timestamp query and get_timestamp hook
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-15 19:20:58 +02:00
Marek Olšák
1932bc8aae r600g: enable MSAA on evergreen by default
v2: add the DRM version check
2012-08-15 19:20:58 +02:00
Marek Olšák
870af19d70 r600g: implement copying between MSAA textures 2012-08-15 19:20:58 +02:00
Marek Olšák
0f86915c53 r600g: implement MSAA color resolve 2012-08-15 19:20:58 +02:00
Marek Olšák
94b634eca0 r600g: implement MSAA depth-stencil decompression and resolve
and integer textures, which are resolved the same as depth, I think.
2012-08-15 19:20:58 +02:00
Marek Olšák
6d3ad2dd2b r600g: implement TXQ_LZ opcode 2012-08-15 19:20:57 +02:00
Marek Olšák
4b78df9c81 r600g: implement MSAA rendering and texturing for evergreen and cayman 2012-08-15 19:20:57 +02:00
Marek Olšák
a01791add0 r600g: implement set_sample_mask 2012-08-15 19:20:57 +02:00
Marek Olšák
6517225078 r600g: implement alpha-to-coverage 2012-08-15 19:20:57 +02:00
Marek Olšák
26cb887ea2 r600g: implement alpha-to-one 2012-08-15 19:20:57 +02:00
Marek Olšák
4f21595276 r600g: remove support for 3-channel colorbuffers
We have no sampler support for them.
2012-08-15 19:20:57 +02:00
Marek Olšák
2f14202f52 configure.ac: bump libdrm_radeon requirement to 2.6.38 2012-08-15 19:20:57 +02:00
Marek Olšák
a7f4d3b740 winsys/radeon: print error if CS is overflowed
and don't submit the CS to the kernel.
2012-08-15 19:20:57 +02:00
Marek Olšák
dc5e61d884 gallium/u_blitter: implement X and Y texture flipping 2012-08-15 19:20:57 +02:00
Marek Olšák
825b45366d gallium/u_blitter: implement blitting multisample resources
It can blit only one sample at a time (it should be called in a loop).
2012-08-15 19:20:57 +02:00
Marek Olšák
dacf5dc9ac gallium: add TGSI support for multisample textures
The only allowed instructions are TXQ_LZ and TXF.

TXQ_LZ is like TXQ, but without the LOD parameter (which is always zero
with MSAA textures)

The 3rd or the 4th texcoord component in TXF should contain the sample index
for a 2D_MSAA or 2D_ARRAY_MSAA texture, respectively.
2012-08-15 19:20:57 +02:00
Marek Olšák
ba53573a8b gallium/tgsi: fix TGSI text parser
The problem was that the string matching succeeded e.g. for "2D" when there
was actually "2D_MSAA" and then failed parsing "_MSAA".

To prevent similar failures in the future, let's fix this kind of error
everywhere.
2012-08-15 19:20:57 +02:00
Marek Olšák
b7c4ee21c5 gallium/u_blit: set dst format from pipe_resource, not pipe_surface
We use it to decide whether we can use resource_copy_region.

NOTE: This is a candidate for the 8.0 branch.
2012-08-15 19:20:57 +02:00
Marek Olšák
1a17c42344 gallium: make pipe_box signed in order to represent flipped blits
This will be used by u_blitter.
2012-08-15 19:20:57 +02:00
Marek Olšák
03b78ceb50 st/mesa: don't clamp fragment color with integer colorbuffer 2012-08-15 19:20:57 +02:00
Marek Olšák
e06d6168cb mesa: flush vertices in test_framebuffer_completeness 2012-08-15 19:20:57 +02:00
Michel Dänzer
538085c5d4 st/egl: Fix up for ClientVersion -> ClientMajorVersion rename.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53513

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-15 10:49:39 +02:00
Jordan Justen
b3900ed5ad i965: add ARB_texture_rgb10_a2ui support
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
091eb15b69 meta: allow CopyTexSubImage on integer formats
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
6671d0dad3 mesa ReadPixels: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
f7333b6345 mesa pack: handle packed integer formats with clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
1a814217c3 mesa unpack: call _mesa_problem when unpack function is not available
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
b3dd048cbb mesa texstore: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
7208505d30 mesa GetTexImage: handle signed/unsigned integer clamping
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Jordan Justen
7ef270867c mesa pack: handle uint and int clamping properly
Rename _mesa_pack_rgba_span_int to _mesa_pack_rgba_span_from_uints.
Add _mesa_pack_rgba_span_from_ints.

These separate routines allow the integer clamping to be handled
properly for signed versus unsigned integers.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 17:07:42 -07:00
Chad Versace
1938501fbf intel: Fix rendering to a multisample front buffer
We need to downsample before flushing BUFFER_FAKE_FRONT_LEFT to
BUFFER_FRONT_LEFT in intel_flush_front.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Chad Versace
a43599d1d1 intel: Clean up intel_flush_front
Stop repeating ourselves. Replace the 4 instances of
`driContext->driDrawablePriv` with `driDrawable`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Chad Versace
38b748ce29 intel: Refactor intel_downsample_for_dri2_flush
Move it from intel_screen.c to intel_context.c. Redeclare as non-static.
A future commit will use it in multiple files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-14 16:19:25 -07:00
Ian Romanick
cde2b7e55d docs: Add EGL extensions to release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-14 15:45:17 -07:00
Ian Romanick
dbecb41300 egl: Allow OpenGL ES 3.0 as a version
In the DRI2 back-end this will get the same API as GLES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
a2ce2eba26 dri2: Note that __DRI_API_GLES2 is also used for OpenGL ES 3.0
Unlike 1.x to 2.0, OpenGL ES 3.0 is backwards compatible with 2.0.  Use the
same API flag for both.  Applications that specifically want 3.0 will specify
this using the major / minor version attributes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
7b4b4f8e68 egl_dri2: Add support for EGL_KHR_create_context and EGL_EXT_create_context_robustness
Just like in GLX, EGL_KHR_create_context requires DRI2 version >= 3, and
EGL_EXT_create_context_robustness requires both DRI2 version >= 3 and the
__DRI2_ROBUSTNESS extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
f171571bfc egl: Implement front-end support for EGL_EXT_create_context_robustness
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
63beb3df98 egl: Implement front-end support for EGL_KHR_create_context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
9d76ad2fac egl_dri2: Silence warnings about missing initializers
egl_dri2.c: At top level:
egl_dri2.c:325:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:325:4: warning: (near initialization for 'swrast_driver_extensions[2].version') [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: (near initialization for 'swrast_core_extensions[1].version') [-Wmissing-field-initializers]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
3fd79dd988 egl: Rename ClientVersion to ClientMajorVersion, add ClientMinorVersion
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:03 -07:00
Ian Romanick
ce55741cbc egl_dri2: Use createContextAttribs if DRI2 version >= 3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
38f91f2b08 egl_dri2: Require DRI2 version 2
The extra block in dri2_create_context is to prevent extra white space noise
in the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
0c445bb618 dri_util: Compare against the correct API enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 15:41:02 -07:00
Ian Romanick
258771882d mesa: Enable GL_ARB_invalidate_subdata
v2: Add GL_ARB_invalidate_subdata to release notes at Brian's
suggestion.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 14:39:33 -07:00
Ian Romanick
07e12c4917 mesa: Add skeleton implementations of glInvalidateTex{Sub,}Image
These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Add comment explaining why minimum dimensions are set to 1 for some
texture targets.  Add default case to switch statement to silence
compiler warnings and detect new texture targets.  Both changes
suggested by Brian.  Also use _mesa_is_desktop_gl as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
f241ffd48c mesa: Add skeleton implementations of glInvalidateBuffer{Sub,}Data
These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Use _mesa_bufferobj_mapped instead of testing
gl_buffer_object::Pointer as suggested by Brian.  Also use
_mesa_is_desktop_gl as suggested by Ken.

v3: Add a comment by the map subrange / discard range overlap test and
fix an off-by-one error noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
e2370bcc1d mesa/es: Pass context to _mesa_init_bufferobj_dispatch
With this change _mesa_init_bufferobj_dispatch won't set function
pointers that don't exist in OpenGL ES.

v2: Use _mesa_is_desktop_gl and _mesa_is_gles3 as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
342be8aa88 mesa: Add skeleton implementations of glInvalidate{Sub,}Framebuffer
These are part of GL_ARB_invalidate_subdata and OpenGL ES 3.0.

v2: Reject aux buffers in core context, and use _mesa_is_desktop_gl and
_mesa_is_gles3.  Both suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:33 -07:00
Ian Romanick
12249b9c96 glapi: Add GL_ARB_invalidate_subdata
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 14:39:33 -07:00
Ian Romanick
2a1ca4ff73 mesa/es3: Add _mesa_is_gles3 predicate
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:29 -07:00
Ian Romanick
9bcb9fad65 intel: Implement ARB_texture_storage
This is basically cut-and-paste from the swrast implementation, and it
could probably be (slightly) more optimal.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 14:39:19 -07:00
Ian Romanick
92b614172f mesa: update glext.h to version 83
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-14 12:19:24 -07:00
Matt Turner
79e9e1b32f build: Use MKDIR_P in src/mesa/Makefile.am
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
02f52e8df5 build: Use AM_V_GEN in src/mesa/Makefile.am
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
1b200d9001 build: Fix autogen.sh to allow out-of-tree builds
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
85d355f122 build: Fix out-of-tree generation of builtin_function.cpp
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
2191a79b4e build: Fix gtest out-of-tree build
Introduced by 3d000e7dd.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
e939250b63 build: Fix out-of-tree generation of api_exec_es{1,2}.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:39 -07:00
Matt Turner
5c2a6b74ed build/sources.mak: Add src/glsl/glcpp to INCLUDE_DIRS
Fixes problem where libdricore's of-out-tree build couldn't find
glcpp.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:38 -07:00
Matt Turner
fa74175210 build/sources.mak: Remove unused GLSL_LIBS
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-14 10:54:38 -07:00
Ian Romanick
707f067915 mesa: Kill GL_ARB_shadow_ambient with fire
No driver supports this extension, and it seems unlikely than any driver
ever will.  I think r300c may have supported it at one time, but that
driver has already been removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-14 10:40:04 -07:00
Tom Stellard
b49771970b radeon/llvm: Inline immediate offset when lowering implicit parameters 2012-08-14 14:06:20 +00:00
Tom Stellard
2fae8227ad radeon/llvm: Use correct opcocde for BREAK_LOGICALNZ_i32 2012-08-14 13:26:30 +00:00
José Fonseca
ea8dcfc90d scons: Populate top_srcdir and top_builddir variables when reading Makefiles.sources.
This is not entirely correct, as scons doesn't put binaries in a
"src" subdirectory, but doesn't seem to be a problem for now.
2012-08-14 12:19:56 +01:00
Kenneth Graunke
605f964d5c mesa: Use GLdouble for depthMax in final unpack conversions.
The final step of _mesa_unpack_depth_span is to take the temporary
GLfloat depth values and convert them to the desired format.  When
converting to GL_UNSIGNED_INTEGER with depthMax > 0xffffff, we use
double-precision math to avoid overflow and precision problems.

Or at least that's the idea.  Unfortunately

   GLdouble z = depthValues[i] * (GLfloat) depthMax;

actually causes single-precision multiplication, since both operands are
GLfloats.  Casting depthMax to GLdouble causes the scaling to be done
with double-precision math.

Fixes a regression in oglconform's depth-stencil basic.read.ds test
since c60ac7b179, where the expected and
actual values differed slightly.  For example, 0xcfa7a6 vs. 0xcfa7a4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49772
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 19:16:38 -07:00
Eric Anholt
43e3a7533d i965: Fix the scaling of seconds to ms in perf debug.
*headdesk*
2012-08-13 17:50:25 -07:00
Ian Romanick
d606926013 i965: Validate API and version in brwCreateContext
v2: Use base-10 for versions like gl_context::Version.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:38:55 -07:00
Ian Romanick
db273724c9 i915: Validate API and version in i915CreateContext
v2: Use base-10 for versions like gl_context::Version.  Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:36:50 -07:00
Ian Romanick
a81e4b3e92 i830: Validate API and version before calling i830CreateContext
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-13 17:23:48 -07:00
Ian Romanick
2b63624326 intel: In the i915 driver, the chipset cannot be i965
In the i965 dirver, the chipset must be i965.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-13 17:23:24 -07:00
Ian Romanick
70f47505a2 dri: Pass API_OPENGL_CORE through to the drivers
This forces the drivers to do at least some validation of context API
and version before creating the context.  In r100 and r200 drivers, this
means that they don't do any post-hoc validation.

v2: Actually reject compatibility profile 3.2+ contexts.  Thanks Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:17:12 -07:00
Ian Romanick
7e81f553bc mesa: Filter a bunch more functions based on API
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 17:17:00 -07:00
Ian Romanick
0fef911ce4 mesa: Don't advertise extensions that are part of GL 1.5 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
aa0b1e902b mesa: Don't advertise extensions that are part of GL 1.4 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
213945385a mesa: Don't advertise extensions that are part of GL 1.3 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
7ef1869d69 mesa: Don't advertise extensions that are part of GL 1.2 in a core context
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Ian Romanick
4d39b86315 mesa: Don't advertise deprecated extensions in a core context
It may be possible to trim the list of extensions futher.  These are
just the obvious extensions that add functionality that the core context
explicitly forbids.  Apple's core-context extension list is *just* the
extensions on top of the core GL version.  I'm not sure we want to go
that far, but removing some things that have been in core since 2.1 may
be okay.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-13 16:19:36 -07:00
Christopher James Halse Rogers
cd4a61100d build: Fix libdricore out-of-tree builds (v2)
v2: Add both top_srcdir and top_builddir to mesa asm include dirs.
    These require both in-tree and build-time-generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:54 -07:00
Christopher James Halse Rogers
73fef0178a build/mapi: More killing of TOP in favour of top_srcdir
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:47 -07:00
Christopher James Halse Rogers
77a3efc6b9 build/glsl: fix location of generated files.
Like in src/mesa, use GLSL_BUILDDIR/GLSL_SRCDIR to unambiguously
distinguish between in-tree and generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:39 -07:00
Christopher James Halse Rogers
37a1b8083e build/glapi: fix includes for generated files
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:31 -07:00
Christopher James Halse Rogers
3fe69bac49 build: fix out of tree generation of glapi_mapi_tmp.h
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:25 -07:00
Christopher James Halse Rogers
726f534bbb build/glx: fix include paths for out-of-tree builds
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-08-13 12:24:17 -07:00
Christopher James Halse Rogers
b2ecaab7ad build: fix location of generated files in src/mesa (v4)
Also fix include paths for the generated headers.

v2: Switch to using self-explanatory BUILDDIR/SRCDIR defined from
    top_builddir/top_srcdir rather than the ambiguous TOP.
v3: Add both top_builddir and top_srcdir to include flags for mesa asm.
    These rely on both in-tree and build-time-generated includes.
v4: Rebased on top of 948c8f502a.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-08-13 12:24:04 -07:00
Kenneth Graunke
4e087de51a intel: Reserve enough space to finish occlusion queries on Gen6.
After realizing that brw_finish_batch emitted some final PIPE_CONTROLs
to record occlusion queries, Chris noted that we probably hadn't
reserved enough space to actually emit them.

Reserving a full 60 bytes seems a bit harsh, since we only need that
much if occlusion queries are actually active.  Plus, 28 bytes would be
sufficient for Gen7, and 24 for Gen4-5.

We could optimize this in the future, but it doesn't seem too critical.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-12 20:12:28 -07:00
Kenneth Graunke
9da50667f4 intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.
On Gen4+, brw_finish_batch() calls brw_emit_query_end(), which emits
some extra PIPE_CONTROLs to capture the current occlusion query data.
Unfortunately, it was being called *after* _intel_batchbuffer_flush
added the MI_BATCH_BUFFER_END, meaning those PIPE_CONTROLs didn't get
inside the batch.

Not only does this likely cause bogus occlusion query values, it can
also cause crashes: with the recent change to use 64-bit depth count
writes on Gen6+, we started emitting an odd-length PIPE_CONTROL, which
happened after the MI_NOOP padding.  This resulted in an odd-length
batch buffer, which resulted in execbuf2 returning -EINVAL and the
application dying with an intel_do_flush_locked failure.

On older generations, finish_batch() doesn't emit any state, so this
change shouldn't have any effect.

Huge thanks to Chris Wilson for helping me figure this out.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-12 20:12:13 -07:00
Eric Anholt
006c1a3c65 i965: Add perf debug for stalls during shader compiles.
v2: fix bad comment from before I gave up and decided to just use doubles.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
97a5f0ff2e i965: Add performance debug for when the state cache gets nuked.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
fc3b7c9b56 i965: Add performance debug for shader recompiles.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
b4da272a6e i965: Add performance debug for fast clear fallbacks.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
0e723b135b intel: Add performance debug for some common GPU stalls.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
4cfb9e3000 i965: Add performance debug for register spilling.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
d72ff03e69 i965: Add INTEL_DEBUG=perf for failure to compile 16-wide shaders.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:25 -07:00
Eric Anholt
79198063b8 intel: Rename INTEL_DEBUG=fall to INTEL_DEBUG=perf.
I want to introduce some more debug output for performance surprises that
includes fallbacks, but aren't necessarily software rasterization.  Leave
INTEL_DEBUG=fall in place for those that have used that flag before.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 19:08:24 -07:00
Pauli Nieminen
bf6c1b7470 meta: texture rectangle textures may not have mipmaps
Avoid INVALID_OPERATION error if decompressing rectangle texture.
Setting mipmap level limits for those textures is error that must not be
hit by meta code to mislead user.

[v3/Kayden]: Resolve conflicts due to Eric picking a subset of Pauli's
original changes.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:46 -07:00
Pauli Nieminen
b9daa83463 meta: Use sampler object for mipmap generation
Sampler objects are perfect for meta operations.Sampler object
is separate state object that shadows the sampling state in texture
object. With sampler object mipmap can maintain same sampling state for
all subsequent generation requests.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:43 -07:00
Pauli Nieminen
ac4dc5e931 mesa/samplerobj: Avoid crash in sampler query if texture unit is disabled
Sampler queries are so far made only for enabled texture unit. But if
any code would query sampler before checking texture unit state that
would result to NULL deference.

Making the inline helper easier to use with NULL check makes a lot sense
because compiler is likely to combine the checks for the current texture.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 16:18:41 -07:00
Pauli Nieminen
5606bd574e mesa: Remove unnecessary parameters CompressedTexImage
In tune with previous patches. Again there is duplication of information
in function parameters that is good to remove.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:30 -07:00
Pauli Nieminen
c9a7dfcf92 mesa: Remove unnecessary parameters from AllocTextureImageBuffer
Size and format information is always stored in gl_texture_image
structure. That makes it preferable to remove duplicate information from
parameters to make interface easier to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:28 -07:00
Pauli Nieminen
c5af889180 mesa: Remove unnecessary parameters from TexImage
gl_texture_image structure always holds size and internal format before
TexImage driver hook is called. Those passing same information in
function parameters only duplicates information making the interface
harder to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:49:13 -07:00
Tom Stellard
e98ace934e configure: Check xcb version when X11 pkgconfig exists
Commit 6882381a2e added a dependency on a
newer version of xcb, but the version check wasn't added in all the
necessary places.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-12 15:42:43 -07:00
Chí-Thanh Christopher Nguyễn
4c73282d2b gbm: Fix build without gallium_drm_loader
pipe_loader_drm_probe_fd only exists if HAVE_PIPE_LOADER_DRM is defined.
Patch improved as suggested by Vadim A. Misbakh-Soloviov.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52962
2012-08-12 14:38:32 -07:00
Christian König
9f5ff5981c radeonsi: move drawing into new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
583c212115 radeonsi: move sync handling into new state handler
So we can remove all the old atom handling.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
303f4b7dcd radeonsi: separate and disable streamout for now
I have my doubts that this code still works on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
696b6cf466 radeonsi: remove ps_partial_flush
Not needed any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:26 +02:00
Christian König
7acb194a7b radeonsi: remove r6xx_flush_and_inv atom
It is not used any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
708337e62e radeonsi: move init state to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
862df0885a radeonsi: add support for PKT3 cmds to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Christian König
ce40e4726c radeonsi: cleanup shader headers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-08-11 09:58:25 +02:00
Chad Versace
996ff1c9bf Revert "mesa: Remove C++11 narrowing warnings"
This reverts commit 9f5a5d541d.

Fixes the following build error on GCC 4.2.3:
  cc1plus: error: unrecognized command line option "-Wno-narrowing"
The GCC Manual incorrectly stated that commit 9f5a5d54 woulde be safe for
old versions of GCC.

Reported-by: Andy Furniss <andyqos@ukfsn.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-10 14:05:14 -07:00
Brian Paul
16c702ef3b softpipe: fix softpipe_delete_fs_state() failed assertion
The var!=softpipe->fs_variant assertion was failing because we weren't
nulling the softpipe->fs_variant pointer when binding a new shader.
Since softpipe->fs_variant depends on the current fs, it's of no use
when a new FS is bound.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53318

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-10 13:27:04 -06:00
Brian Paul
3487b93cc4 cso: rearrange some structure fields for consistency 2012-08-10 12:14:17 -06:00
Brian Paul
cf77c29e60 st/mesa: fix renderbuffer validation bug
After we attach a new renderbuffer in this function we need to make
sure Mesa's update_framebuffer() gets called.

Fixes crash in WebGL conformance/textures/texture-attachment-formats.html,
but the test still fails for other reasons.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53316

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-10 11:49:36 -06:00
Chad Versace
9f5a5d541d mesa: Remove C++11 narrowing warnings
Add -Wno-narrowing to CXXFLAGS for gcc.

It is safe to add this flag even for versions of gcc that don't recognize
it.  From the GCC Manual [1]: "[GCC] allows the use of new -Wno- options
with old compilers".

This removes warnings of the form
    warning: narrowing conversion of X from 'int' to 'float' inside { } is
    ill-formed in C++11 [-Wnarrowing]
in ff_fragment_shader.cpp and gen6_blorp.cpp of the form.  When building
i965, I observed no other difference in the build output.

[1] http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-10 09:59:41 -07:00
Brian Paul
f7af4beae5 gallivm: fix crash in lp_sampler_static_state()
Fixes WebGL conformance/uniforms/uniform-default-values.html crash.

We need to check for the null view pointer before accessing view->texture.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53317

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-08-10 09:45:25 -06:00
Brian Paul
9b04abe368 st/mesa: fix glCopyTexSubImage crash
Fixes a WebGL crash.  The dest texture image is at level 2 and is of
size 1x1 texel.  The st texture image is a stand-alone resource, not
a pointer into a complete mipmap.  So the resource has one level and
trying to write to level 2 blows up.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53314
and http://bugs.freedesktop.org/show_bug.cgi?id=53319

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-08-10 09:45:17 -06:00
Chad Versace
6cb9e99a75 intel: Always downsample in intel_miptree_map_multisample
Always downsample before mapping, even if the map mode contains
GL_MAP_INVALIDATE_RANGE_BIT. If we neglect to downsample when only
a subrect is mapped then the upsample in intel_miptree_unmap_multisample
may write garbage to the region outside the subrect.

(Eric gave my patch e88cfbb a conditional reviewed-by with the condition
that it always downsample before mapping. I forgot to make that change
before pushing the patch.)

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-09 15:21:02 -07:00
Eric Anholt
04a11b5f5e i965/gen6+: Add support for edge flags.
Fixes the 3 new piglit edgeflag tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40707
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:50 -07:00
Eric Anholt
b3367f56d8 i965/vs: Convert EdgeFlagPointer values appropriately for the VS on gen4.
Fixes piglit gl-2.0/edgeflag.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Eric Anholt
3eb8d71225 i965/vs: Add comment noting copy_edgeflag state dependency.
It's already in the state struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Eric Anholt
e119f98472 i965/vs: Add support for copying user edge flags.
Fixes the glsl skinning demo regression since changing to the new GLSL
compiler, and is part of fixing piglit gl-2.0-edgeflag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50079
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-09 09:07:49 -07:00
Olivier Galibert
7426d9d769 i965/fs: Fix the FS inputs setup when some SF outputs aren't used in the FS.
If there was an edge flag or a two-side-color pair present, we'd end up
mismatched and read values from earlier in the VUE for later FS inputs.

v2: Fix regression in gles2conform shaders generating point size. (change by
    anholt)

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 branch.
2012-08-09 09:07:49 -07:00
Vinson Lee
3466538171 st/mesa: Initialize tgsi_texture_offset Padding field.
Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 22:36:27 -07:00
Kenneth Graunke
68bccc40f5 glx/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.
If the application has requested reset notification, then
dri2_convert_glx_attribs will initialize this to the correct value.

Otherwise, it's supposed to initialize this to NO_NOTIFICATION, but
doesn't when num_attribs == 0.  (The consensus seems to be that we
should make it do so, but that's more invasive, so I'm pushing this for
now.)

Fixes a regression since a8724d85f8
where trying to run OilRush_x86 or apitrace heaven_x64 would result in:

dri_util.c:221: dri2CreateContextAttribs: Assertion `!"Should not get
here."' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53076
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2012-08-08 17:15:21 -07:00
Tapani Pälli
94f22fbe78 intel: use _mesa_meta_Clear with OpenGL ES 1.1 v2
Patch changes i915 and i965 drivers to use fixed function version of
meta clear when running on ES 1.1. This fixes rendering errors seen with
Google Maps, Angry Birds and Gallery3D on Android platform.

Change 88128516d4 exposes all extensions
internally to be available independent of GL flavour, therefore check
against ARB_fragment_shader does not work.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50333
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 17:15:21 -07:00
Kenneth Graunke
5deb1d1a1f i965: Rework the extra flushes surrounding occlusion queries.
This removes the CS stall on Ivybridge.

On Sandybridge, the depth stall needs to be preceded by a non-zero
post-sync op, which requires a CS stall, which needs a stall at
scoreboard.  Emit the full workaround.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 17:15:21 -07:00
Eric Anholt
b0adbda75a i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.
I don't know if it was possible to trigger this bug -- we don't merge
saturates into the math instruction because we're bad at coalescing currently,
and there's nothing generating these with predicates.  Still, let's avoid
future bugs when we do smarter codegen.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:31 -07:00
Eric Anholt
9b4053cabd i965: Drop the confusing saturate argument to math instruction setup.
This was ridiculous.  We were ignoring the inst->header.saturate flag in the
case of math and only math.  On gen4, we would leave inst->header.saturate in
place if it happened to be set, which would end up being applied to the
implicit mov and thus trash the first argument.  On gen6, we would overwrite
inst->header.saturate with the saturate flag from the argument, which was not
set appropriately in brw_vec4_emit.cpp, and was only not a bug due to our
incompetence at coalescing saturate moves.

By ripping the argument out and making saturate work just like all the other
brw_eu_emit.c code generation, we can avoid both these classes of bugs.

Fixes piglit fog-modes, and the new specific fs-saturate-exp2 case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48628
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-08 16:21:30 -07:00
Eric Anholt
33dfdc735e i965: Make brw_set_saturate() use stdbool.
There was a chance for brw_wm_emit.c to screw up and pass (1 << 4) instead of
1, which would get converted to 0 when stored.  Instead, use stdbool which
converts nonzero to true/1 like we want.
2012-08-08 16:21:30 -07:00
Eric Anholt
1b148e660e mesa: In conditional rendering fallback, check the query status.
Otherwise, conditional rendering always takes the fallthrough "render it
anyway" case unless the application had itself done a check or wait on the
query.

Fixes intel oglconform's conditional_render advanced.nofbo.readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Eric Anholt
4bbd120368 mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.
I happened to notice this while looking at a blit pass in l4d2, which had an
optional push/pop around framebuffer srgb setting.  It didn't matter in the
end, but the fix is sitting in my tree now.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-08-08 16:21:30 -07:00
Ian Romanick
9f7b3d1713 Make shared-glapi the default
You can't practically have desktop OpenGL and OpenGL ES on the same system
without this.  The benefits of not having it (e.g., a more compact dispatch
table) are irrelevant.

v2: Don't mark shared-glapi as experimental.  Review suggestion by Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
5602f0f955 mesa/tests: Fix trivial typos in src/mapi/glapi tests
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
45d3d0ad21 mesa/tests: Add tests for the generated shared-glapi dispatch table
These are largely based on the src/mapi/glapi/tests.  However,
shared-glapi provides less external visibility into the dispatch table,
so there is less to test.  Also, shared-glapi does not implement
_glapi_get_proc_name, so that test was removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
d9f899bb93 glapi: Prevent accidental use of lies w/shared-glapi
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
99fee476a1 glx: Don't use glapitable.h at all
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  Avoiding the use of glapitable.h avoids the lies.  The only
entries used in this code are entries that are ABI.  For these, the ABI
offset can be used directly.

Since this code is in src/glx, it can't use src/mesa/main/dispatch.h to
get the pretty names for these offsets.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
f5dffb7e36 glx: Don't rely on struct _glapi_table
When --enable-shared-glapi is used, all non-ABI entries in the table are
lies.  There are two completely separate code generation paths used to
assign dispatch offset.  Neither has any clue about the other.
Unsurprisingly, the can't agree on what offsets to assign.

This adds a bunch of overhead to __glXNewIndirectAPI, but this function
is called at most once.

The test ExtensionNopDispatch was removed.  There was just no way to
make this test work with the information provided in shared-glapi.
Since indirect_glx.c uses _glapi_get_proc_offset now, it was also
impossible to make the tests work without shared-glapi.  So much pain.

This fixes indirect rendering with shared-glapi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:26 -07:00
Ian Romanick
52d6df8aa7 mesa/tests: Don't build glapi tests with shared-glapi
This fixes 'make check' on with --enable-shared-glapi.  This test cannot work
in that environment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-08 10:06:25 -07:00
Kenneth Graunke
e45a9ce474 i965: Use 64-bit writes for occlusion queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:23 -07:00
Kenneth Graunke
20c09b82d0 i965: Refactor depth count write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:21 -07:00
Kenneth Graunke
a2cdd5ada8 i965: Emit a CS stall before timestamp writes.
This implements one of the Sandybridge PIPE_CONTROL workarounds.  It
doesn't appear to be required for Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:19 -07:00
Kenneth Graunke
c4c78c275a i965: Use 64-bit writes for timestamp queries.
The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits.  Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:16 -07:00
Kenneth Graunke
03f14664b6 i965: Refactor timestamp write PIPE_CONTROLs into a helper function.
This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:24:14 -07:00
Kenneth Graunke
61d0b9f52c intel: Make the length for PIPE_CONTROL explicit.
PIPE_CONTROL has variable length, depending upon generation and whether
we want to do 32-bit or 64-bit data writes.  Make it explicit, rather
than hiding a length of 4 in the #define for _3DSTATE_PIPE_CONTROL.

Generated by s/3DSTATE_PIPE_CONTROL/3DSTATE_PIPE_CONTROL | (4 - 2)/g.
This is equivalent since the #define used to have | 2 in it.  A grep
through the sources shows that all instances have been converted, so
it's safe to remove the | 2 from the #define.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-08 09:23:57 -07:00
Brian Paul
ecac178aa2 swrast: add missing switch case for API_OPENGL_CORE
To silence compiler warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
b4d6502fcd gallivm: remove unused src_elem_type variable
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
f21669e9a2 svga: remove unused svga_shader::use_sm30 field, add comments
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Brian Paul
16a289195e svga: remove unused svga_winsys_handle type
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-08 09:39:36 -06:00
Michel Dänzer
82cd9c0fc2 radeonsi: If pixel shader compilation fails, use a dummy shader.
Otherwise we're likely to hang the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 15:33:38 +02:00
Christian König
be42a45e02 radeonsi: fix memory leak and/or segfaults
Fix a stupid typo that could lead to memory
leaks and/or segfaults.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:36:49 +02:00
Christian König
8c44e5a144 radeon/winsys: fix winsys VM handling
Move releasing the VM area after closing the bo handle.

This partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45018

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-08 12:35:10 +02:00
Vinson Lee
7528e2104f translate: Fix typo in is_legal_int_format_combo.
Fixes same on both sides defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-07 22:34:28 -07:00
Marek Olšák
1ea263fccb r600g: remove unused parameters in texture functions 2012-08-07 23:39:52 +02:00
Eric Anholt
4a078516b6 i965: Enable uniform buffer objects on gen6+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt
04871058eb i965/vs: Add support for loading uniform buffer variables as pull constants.
Unlike the FS side in the previous commit, this does variable indexing just
fine, using the same code as we used for other variable-indexed pull
constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:52 -07:00
Eric Anholt
90de96ff0d i965/fs: Add support for loading uniform buffer variables as pull constants.
Variable array indexing isn't finished, because the lowering pass
turns it all into conditional moves of constant index accesses so I
can't test it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
bb020d09c3 i965/vs: Add a surface index to VS_OPCODE_PULL_CONSTANT instructions.
Similar to the previous commit for the fragment shader, now we have a buffer
index and an offset.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
454dc83f66 i965/fs: Communicate the pull constant block read parameters through fs_regs.
I wanted to add the surface index as a variable value for UBO support,
and a reg seemed like the obvious way to go.  This exposes more of the
information to CSE, which we'll probably want to apply to pull
constant loads for UBOs eventually (you might access 4 floats in a
row, each of which would produce an oword block read of the same
block).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
25d2bf3845 i965: Bind UBOs as surfaces like we do for pull constants.
v2: Comment fix, drop extraneous parens (review by Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
5bffbd7ba2 i965: Add an offset argument to constant buffer setup.
We'll use this for UBO surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
5fc5b29a54 mesa: Add support for glUniformBlockBinding() in display lists.
Fixes piglit GL_ARB_uniform_buffer_object/dlist.

v2: Use the .ui fields instead of .i for type consistency (review by Brian
    Paul)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
bfa046b5f2 mesa: Unbind uniform buffer bindings on glDeleteBuffers().
Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
1eb3c06ae8 mesa: Default to GL 3.1's limits on uniform blocks.
The ARB spec lets you get away with the default block counting against the
blocks for combined size limits.  The core spec says you need to be able to
support the maximum size of default block *and* the maximum size of each
uniform block.  I see no reason that any driver would have a problem with
that.

Fixes gl 3.1/minmax (with an associated fix to the test)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
803262a5f5 glsl: Refuse to parse uniform block declarations when UBOs aren't available.
Fixes piglit
GL_ARB_uniform_buffer_object/compiler/extension-disabled-block.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
e45f1b11c0 glsl: Align GL_UNIFORM_BLOCK_DATA_SIZE according to std140 rules.
Fixes piglit GL_ARB_uniform_buffer_object/data-size test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:51 -07:00
Eric Anholt
86e0045578 glsl: Only flag RowMajor on matrix-type variables.
We were only propagating it to the API when the variable was a matrix type,
but we were still tripping over it in lower_ubo_reference when it was set on a
vector.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
ffb2d43059 glsl: Fix calculation of std140 offset alignment for mat2s.
We were getting the base offset of a vec2, not of a vec2[2] like the quoted
spec text says we should.

v2: Fix swapped then/else cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
300315fe69 glsl: Fix glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX).
Previously, we were returning the index into the UniformBlocks of one of the
linked shaders, when it's supposed to be the program global index.

Fixes piglit getactiveuniformsiv-uniform_block_index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
af3fc6bb28 ir_to_mesa: Don't whack the ->location field of uniform block variables.
Fixes some failures in GL_ARB_uniform_buffer_object/maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
56e82e30cb mesa: Make glBindBufferBase/glBindBufferRange() work on just-genned names.
In between glGenBuffers() and glBindBuffer(), the buffer object points to this
dummy buffer with a name of 0, and a glBindBufferBase() would point to that.
It seems pretty clear, given that glBindBufferBase() only cares about the
current size of the buffer at render time, that it should bind up the buffer
that you passed in instead of pointing it at this useless dummy buffer.

However, what should glBindBufferRange() do?  As of this patch, it will
promote the genned buffer to a proper buffer like it had been
glBindBuffer()ed, and then detect that the size is greater than the buffer's
current size of 0 and throw INVALID_VALUE.  It seems like the most reasonable
answer here.

Note that this also changes the behavior of these two on non-glGenBuffers() bo
names.  We haven't yet set up the error throwing for glBindBuffers() on gl
3.1+, and my assumption is that these two functions should inherit their
behavior on un-genned names from glBindBuffers().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 13:54:50 -07:00
Eric Anholt
a75f2681d2 glsl: Add a lowering pass to turn complicated UBO references to vector loads.
v2: Reduce the impenetrable code in emit_ubo_loads() by 23 lines by keeping
    the ir_variable as the variable part of the offset from handle_rvalue(),
    and track the constant offsets from that with a plain old integer value,
    avoiding a bunch of temporary variables in the array and struct handling.
    Also, fix file description doxygen.
v3: Fix a row vs col typo, and fix spelling in a comment.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-07 13:54:47 -07:00
Eric Anholt
8c2a983835 glsl: Add a variant of the rvalue visitor for handle_rvalue() on the way down.
For the UBO lowering pass, I want to see the whole dereference chain for
replacing, not the innermost ir_dereference_variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
2ea3ab14f2 glsl: Add a "ubo_load" expression type for fetches from UBOs.
Drivers will probably want to be able to take UBO references in a
shader like:

        uniform ubo1 {
                float a;
                float b;
                float c;
                float d;
        }

        void main() {
             gl_FragColor = vec4(a, b, c, d);
        }

and generate a single aligned vec4 load out of the UBO.  For intel,
this involves recognizing the shared offset of the aligned loads and
CSEing them out.  Obviously that involves breaking things down to
loads from an offset from a particular UBO first.  Thus, the driver
doesn't want to see

	variable_ref(ir_variable("a")),

and even more so does it not want to see

	array_ref(record_ref(variable_ref(ir_variable("a")),
          "field1"), variable_ref(ir_variable("i"))).

where a.field1[i] is a row_major matrix.

Instead, we're going to make a lowering pass to break UBO references
down to expressions that are obvious to codegen, and amenable to
merging through CSE.

v2: Fix some partial thoughts in the ir_binop comment (review by Kenneth)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
71ba6de342 glsl: Fix a reference to UniformBlocks during uniform linking.
When converting var->location from pointing at the program's UniformBlocks to
pointing at the linked shader's UniformBlocks, I missed this change.  It
usually worked out in the end because the two lists happen to be the same in
many testcases.

Fixes a valgrind complaint on
oglconform ubo-compile.cpp advanced.std140.2stage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
7e42302e71 glsl: Update the notes on adding a new expression type.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:49 -07:00
Eric Anholt
9c1b41879a mesa: Replace VersionMajor/VersionMinor with a Version field.
As we get into supporting GL 3.x core, we come across more and more features
of the API that depend on the version number as opposed to just the extension
list.  This will let us more sanely do version checks than "(VersionMajor == 3
&& VersionMinor >= 2) || VersionMajor >= 4".

v2: Fix a bad <= 30 check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:47:19 -07:00
Eric Anholt
3aaeb3e5e7 intel: Fix compiler warnings from winsys msaa. 2012-08-07 11:47:11 -07:00
Chad Versace
e943e5c291 intel: Advertise multisample DRI2 configs on gen >= 6
This turns on window system MSAA.

This patch changes the id of many GLX visuals and configs, but that
couldn't be prevented. I attempted to preserve the id's of extant configs
by appending the multisample configs to the end of the extant ones. But
somewhere, perhaps in the X server, the configs are reordered with
multisample configs interspersed among the singlesample ones.

Test results:
  Tested with xonotic and `glxgears -samples 1` on Ivybridge.

  No piglit regressions on Ivybridge.

  On Sandybridge, passes 68/70 of oglconform's
  winsys multisample tests.  The two failing tests are:
      multisample(advanced.pixelmap.depth)
      multisample(advanced.pixelmap.depthCopyPixels)
  These tests hang the gpu (on kernel 3.4.6) due to
  a glDrawPixels/glReadPixels pair on an MSAA depth buffer.  I don't expect
  realworld apps to do that, so I'm not too concerned about the hang.

  On Ivybridge, passes 69/70. The failing case is
  multisample(advanced.line.changeWidth).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:34 -07:00
Chad Versace
8b5d68dd28 intel: Clarify intel_screen_make_configs
This function felt sloppy, so this patch cleans it up a little bit.

- Rename `color` to `i`. It is not a color value, only an iterator int.
- Move `depth_bits[0] = 0` into the non-accum loop because that is where
  it used. The accum loop later overwrites depth_bits[0].
- Rename `depth_factor` to `num_depth_stencil_bits`.
- Redefine `msaa_samples_array` as static const because it is never
  modified. Rename to `singlesample_samples`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
a4bf68ca50 dri: Simplify use of driConcatConfigs
If either argument to driConcatConfigs(a, b) is null or the empty list,
then simply return the other argument as the resultant list.

All callers were accomplishing that same behavior anyway. And each caller
accopmplished it with the same pattern. So this patch moves that external
pattern into the function.

Reviewed-by: <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
b2d428cb8d intel: Refactor creation of DRI2 configs
DRI2 configs were constructed in intelInitScreen2. That function already
does too much, so move verbatim the code for creating configs to a new
function, intel_screen_make_configs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
61fd684782 intel: Downsample on DRI2 flush
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
e88cfbb95f intel: Support mapping multisample miptrees
Add two new functions: intel_miptree_{map,unmap}_multisample, to which
intel_miptree_{map,unmap} dispatch. Only mapping flat, renderbuffer-like
miptrees are supported.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
4c0ccc13bd intel: Refactor use of intel_miptree_map
Move the opencoded construction and destruction of intel_miptree_map into
new functions, intel_miptree_attach_map and intel_miptree_release_map.
This patch prevents code duplication in a future commit that adds support
for mapping multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
81980958d0 intel: Refactor intel_miptree_map/unmap
Move the body of intel_miptree_map into a new function,
intel_miptree_map_singlesample. Now intel_miptree_map dispatches to the
new function. A future commit adds a multisample variant.

Ditto for intel_miptree_unmap.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
6b56140b4b i965: Mark needed downsamples for msaa winsys buffers
Add function intel_renderbuffer_set_needs_downsample. It is a no-op
except on multisample winsys buffers shared with DRI2.

Mark the needed downsamples with the new function at two locations:
    - Immediately after drawing is complete.
    - After blitting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
d3746354fb intel: Define functions for up/downsampling on miptrees
Flesh out the stub functions intel_miptree_{up,down}sample.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
6cc9df331b i965: Add function brw_blorp_blit_miptrees
Define a function, brw_blorp_blit_miptrees, that simply wraps
brw_blorp_blit_params + brw_blorp_exec with C calling conventions. This
enables intel_miptree.c, in a following commit, to perform blits with
blorp for the purpose of downsampling multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
f4873babdc intel: Allocate miptree for multisample DRI2 buffers
Immediately after obtaining, with DRI2GetBuffersWithFormat, the DRM buffer
handle for a DRI2 buffer, we wrap that DRM buffer handle with a region and
a miptree. This patch additionally allocates an accompanying multisample
miptree if the DRI2 buffer is multisampled.

Since we do not yet advertise multisample GL configs, the code for
allocating the multisample miptree is currently inactive.

This patch adds the following fields to intel_mipmap_tree:
    singlesample_mt
    needs_downsample
and the following function stubs:
    intel_miptree_downsample
    intel_miptree_upsample

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
4eba67285f intel: Refactor creation of hiz and mcs miptrees
Move the logic for creating the ancillary hiz and mcs miptress for winsys
and non-texture renderbuffers from intel_alloc_renderbuffer_storage to
intel_miptree_create_for_renderbuffer. Let's try to isolate complex
miptree logic to intel_mipmap_tree.c.

Without this refactor, code duplication would be required along the
intel_process_dri2_buffer codepath in order to create the mcs miptree.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
e2f2376e88 intel: Set num samples for winsys renderbuffers
Add a new param, num_samples, to intel_create_renderbuffer and
intel_create_private_renderbuffer.

No multisample GL config is yet advertised, so the value of num_samples is
currently 0.  For server-owned winsys buffers, gl_renderbuffer::NumSamples
is not yet used.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
53fa28f7b1 intel: Refactor quantize_num_samples
Rename quantize_num_samples to intel_quantize_num_samples and change the
first param from struct intel_context* to struct intel_screen*. The
function will later be used by intelCreateBuffer, which is not bound to
any context but is bound to a screen.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Chad Versace
7a2e40ed28 intel: Update stale comment for intel_miptree_slice::map
The comment referred to intel_tex_image_map/unmap, but should more
accurately refer to intel_miptree_map/unmap.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-07 09:30:33 -07:00
Paulo Zanoni
4b40375c43 i965: add more Haswell PCI IDs
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07 11:13:47 -03:00
Brian Paul
8433f80add egl: remove redundant PFNEGLQUERYSTREAMTIMEKHRPROC typedef
This typedef is present earlier in the header and isn't part of the
EGL_KHR_stream_cross_process_fd extension.  Looks like a Khronos glitch.
2012-08-07 07:31:05 -06:00
Brian Paul
99695f58fd softpipe: fix loop limit for tex_cache[] array
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=53199
2012-08-07 08:00:46 -06:00
Vinson Lee
7d65356d8a st/mesa: Fix a potential memory leak in get_mesa_program.
Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 22:08:56 -07:00
Vinson Lee
c3894bc2d5 gallivm: Add constructor for raw_debug_ostream.
Fixes uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 22:07:31 -07:00
Brian Paul
e622723918 docs: update ARB_debug_output status to DONE 2012-08-06 16:48:00 -06:00
Jason Wood
56c1f55c51 docs: Add OpenGL 4.3 requirements
v2: Note that GLSL 4.3 has not been started, and that
ARB_compute_shader has been started in Gallium drivers.

Signed-off-by: Jason Wood <sandain@hotmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:41:24 -06:00
Ian Romanick
45e592c3dd egl: Import eglext.h version 14
This is necessary for EGL_KHR_create_context work (including writing
piglit tests).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
b50703aea5 egl: Replace KHR_surfaceless_* extensions with KHR_surfaceless_context
KHR extension name is reserved for Khronos ratified extensions, and there is
no such thing as EGL_KHR_surfaceless_{gles1,gles2,opengl}.  Replace these
three extensions with EGL_KHR_surfaceless_context since that extension
actually exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
cb77f5dd1f egl_dri2: Refactor dereference of dri2_ctx_shared
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
05413ddb1d egl_dri2: Remove swrast version >= 2 checks
Since support for swrast version 2 was added (f55d027a), it has also been
required.  In swrast_driver_extensions, version 2 is set for __DRI_SWRAST
extension.  Remove the spurious version checks sprinked through the code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Ian Romanick
63adb6b9ea dri2: Fix bug in attribute handling for non-desktop OpenGL contexts
Previously an error would be generated if any attributes were specified when
creating a non-desktop OpenGL context.  This was a mistake, and it will
prevent old drivers from working with new EGL libraries that add support for
the createContextAttribs interface.  Instead, match the behavior of
EGL_KHR_create_context: allow versions that make sense, reject non-zero flags.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-06 15:37:04 -07:00
Andreas Boll
102617bc52 docs: update piglit url
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:23:43 -06:00
Andreas Boll
933e13e2af docs/helpwanted: add r600g and i915g todo lists
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-06 16:23:43 -06:00
Kenneth Graunke
caa4ae5d7d i965: Allocate dummy slots for point sprites before computing VUE map.
Commit f0cecd43d6 moved the VUE map computation to be only once, at
VS compile time.  However, it did so in slightly the wrong place: it
made the one call to brw_vue_compute_map happen right before the
allocation of dummy slots for replaced point sprite coordinates, causing
a different VUE map to be generated (at least on Ironlake).

Fixes a regression in Piglit's point-sprite test on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46489
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:40 -07:00
Kenneth Graunke
54c045b93c i965/vs: Don't clobber sampler message MRFs with subexpressions.
See the preceding commit for a description of the problem.

NOTE: This is a candidate for stable release branches.

v2: Use a separate dPdx variable rather than reusing the lod src_reg.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:15 -07:00
Kenneth Graunke
c0f60106df i965/fs: Don't clobber sampler message MRFs with subexpressions.
Consider a texture call such as:

   textureLod(s, coordinate, log2(...))

First, we begin setting up the sampler message by loading the texture
coordinates into MRFs, starting with m2.  Then, we realize we need the
LOD, and go to compute it with:

   ir->lod_info.lod->accept(this);

On Gen4-5, this will generate a SEND instruction to compute log2(),
loading the operand into m2, and clobbering our texcoord.

Similar issues exist on Gen6+.  For example, nested texture calls:

  textureLod(s1, c1, texture(s2, c2).x)

Any texturing call where evaluating the subexpression trees for LOD or
shadow comparitor would generate SEND instructions could potentially
break.  In some cases (like register spilling), we get lucky and avoid
the issue by using non-overlapping MRF regions.  But we shouldn't count
on that.

Fixes four Piglit test regressions on Gen4-5:
- glsl-fs-shadow2DGradARB-{01,04,07,cumulative}

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:11 -07:00
Kenneth Graunke
27bf9c1997 i965/fs: Factor out texcoord setup into a helper function.
With the textureRect support and GL_CLAMP workarounds, it's grown
sufficiently that it deserves its own function.  Separating it out
makes the original function much more readable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:09 -07:00
Kenneth Graunke
82bfb4b41a i965/fs: Move message header and texture offset setup to generate_tex().
Setting the texture offset bits in the message header involves very
specific hardware register descriptions.  As such, I feel it's better
suited for the lower level "generate" layer that has direct access to
the weird register layouts, rather than at the fs_inst abstraction layer.

This also parallels the approach I took in the VS backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-06 11:16:00 -07:00
Jerome Glisse
2df399c34b r600g: atomize sampler state v2
Use atom for sampler state. Does not provide new functionality
or fix any bug. Just a step toward full atom base r600g.

v2: Split seamless on r6xx/r7xx into it's own atom. Make sure it's
    emited after sampler and with a pipeline flush before otherwise
    it does not take effect.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-08-06 12:04:55 -04:00
Alex Deucher
d3f8000bfc radeonsi: add some new pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-06 10:55:41 -04:00
Alex Deucher
a6146d2566 r600g: add additional evergreen pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-08-06 10:55:41 -04:00
Brian Paul
8eeeef3705 st/mesa: merge fragment/vertex sampler update code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:20 -06:00
Brian Paul
819e786339 st/mesa: massage update_vertex_samplers() code
...to look like update_fragment_samplers() code, as with the previous
commit.  The next step would be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:19 -06:00
Brian Paul
2aac0d145a st/mesa: merge fragment/vertex texture update code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:50:11 -06:00
Brian Paul
dd6aafcf72 st/mesa: massage the update_vertex_textures() code
...to look like update_fragment_textures() code.  The next step would
be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:41:07 -06:00
Brian Paul
5749ae919e st/mesa: rename some vertex/fragment state fields for better consistency
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:41:07 -06:00
Brian Paul
29604441de llvmpipe: consolidate the sampler and sampler view setting code
Less code.  And as with softpipe, if/when we consolidate the pipe_context
functions for binding sampler state, this will make the llvmpipe changes
trivial.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
b3538d3563 llvmpipe: combine vertex/fragment sampler state into an array
This will allow code consolidation in the next patch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
1f34e1a6cb softpipe: consolidate vert/frag/geom sampler setting functions
The functions for setting samplers and sampler views for vertex,
fragment and geometry shaders were nearly identical.  Now they
use shared code.

In the future, if the pipe_context functions for setting samplers
and sampler views for vert/frag/geom/compute are combined, this
will make updating the softpipe driver a snap.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
d6c3e6d8f3 softpipe: consolidate sampler-related arrays
Combine separate arrays for vertex/fragment/geometry samplers, etc into
one array indexed by PIPE_SHADER_x.

This allows us to collapse separate code for vertex/fragment/geometry
state into loops over the shader stage.  More to come.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Brian Paul
0a14e9f09f softpipe: combine vert/frag/geom texture caches in an array
This lets us consolidate some code now, and more in subsequent patches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-08-06 08:33:17 -06:00
Vinson Lee
61b62c007a mesa: Fix off-by-one error in Parse_TextureImageId.
Fixes out-of-bounds write defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 21:42:23 -07:00
Vinson Lee
3e7b3a04bf util: Move dereference after null check in util_resource_copy_region.
Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 21:41:27 -07:00
Brian Paul
a5ca29100b i915g: silence a const pointer warning 2012-08-04 08:38:11 -06:00
Marek Olšák
f9a498d1bc radeonsi: fix build failure after blitter changes 2012-08-04 16:34:24 +02:00
Marek Olšák
cb922b63eb r600g: precompute color buffer state in pipe_surface and reuse it 2012-08-04 14:05:52 +02:00
Marek Olšák
cdc681c3ad r600g: precompute depth buffer state in pipe_surface and reuse it
This is done on-demand, because we don't know in advance if a zbuffer
will be bound as depth or color.
2012-08-04 14:05:51 +02:00
Marek Olšák
e6dfc8c77b r600g: simplify create_surface 2012-08-04 14:05:51 +02:00
Marek Olšák
581f7e3101 r600g: drop the old texture allocation code
Made obsolete by the libdrm surface allocator.
2012-08-04 14:05:51 +02:00
Marek Olšák
7c371f4695 r600g: make sure copying of all texture formats is accelerated 2012-08-04 14:05:51 +02:00
Marek Olšák
84645fa613 gallium/u_blitter: add a query for checking whether copying is supported
v2: add comments
2012-08-04 14:05:37 +02:00
Marek Olšák
e2f623f1d6 r600g: don't decompress depth or stencil if there isn't any 2012-08-04 13:53:07 +02:00
Marek Olšák
ea72351a91 r600g: correct texture memory size for Z32F_S8X24 on evergreen 2012-08-04 13:53:07 +02:00
Marek Olšák
c8ff737a18 gallium/u_blitter: remove fallback for stencil copy that all drivers skipped
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
ef1bf6d69e gallium/u_blitter: add ability to blit only depth or only stencil
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
8842678047 gallium: define PIPE_MASK_RGBAZS
I need this and it seems like it could be useful.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
8aaf6972d1 gallium/u_blitter: minor cleanup
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
67a3e5bc32 gallium/tgsi: fixup texture name strings
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
6c420b1668 gallium/u_blitter: set sample mask to ~0
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
9d1ef354f9 gallium/u_blit: bail out if src is a multisample texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
6b3f1ae12b gallium/u_blit: check nr_samples before using resource_copy_region
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:07 +02:00
Marek Olšák
e7689303a8 gallium: set sample mask to ~0 for clear, blit and gen_mipmap
The sample mask affects single-sampled rendering too (it's orthogonal
to the color mask).

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-04 13:53:06 +02:00
Dave Airlie
cd97a5f660 r600g: fix F2U opcode translation
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-08-04 13:45:27 +02:00
Vinson Lee
5bce0b5175 draw: Ensure channel in convert_to_soa is initialized.
Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-03 22:28:31 -07:00
Vinson Lee
9d36b3abfd u_blitter: Move a pointer dereference after null check.
Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-03 22:27:13 -07:00
Matt Turner
fb85558ab1 Use C99 NAN and INFINITY macros 2012-08-03 15:02:09 -07:00
Brian Paul
65da837fcf gallium/tests/trivial: updates for CSO interface changes 2012-08-03 11:58:43 -06:00
Brian Paul
c61d3fe8bd st/xorg: updates for CSO interface changes 2012-08-03 11:56:36 -06:00
Brian Paul
459dd56897 st/xa: updates for CSO interface changes 2012-08-03 11:56:28 -06:00
Brian Paul
3d1bec5d9a vega: fix build breakage from cso sampler/view changes 2012-08-03 08:33:23 -06:00
Brian Paul
832706a80b cso: remove unreachable break statements 2012-08-03 07:16:35 -06:00
Brian Paul
076e5eacf1 cso: 80-column wrapping, remove trailing whitespace, etc 2012-08-03 07:16:35 -06:00
Brian Paul
ea6f035ae9 gallium: consolidate CSO sampler and sampler_view functions
Merge the vertex/fragment versions of the cso_set/save/restore_samplers()
functions.  Now we pass the shader stage (PIPE_SHADER_x) to the function
to indicate vertex/fragment/geometry samplers.  For example:

cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler);

This results in quite a bit of code reduction, fewer CSO functions and
support for geometry shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-08-03 07:16:35 -06:00
Vinson Lee
350f12fb65 st/mesa: Ensure dst in compile_instruction is initialized.
Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-02 21:10:49 -07:00
Tom Stellard
f6ad8b45c2 radeon/llvm: Add $(LLVM_LDFLAGS) to the loader linker flags 2012-08-02 20:12:11 +00:00
Tom Stellard
4a89a20717 radeon/llvm: Add support for more f32 CMP instructions on SI 2012-08-02 20:12:11 +00:00
Tom Stellard
a35eea7868 radeon/llvm: Add support for fneg on SI 2012-08-02 20:12:10 +00:00
Tom Stellard
4104bae063 radeon/llvm: Add support for fp_to_sint on SI 2012-08-02 20:12:10 +00:00
Tom Stellard
f7fcaa07df radeon/llvm: Remove CMOVLOG DAG node 2012-08-02 20:12:06 +00:00
Tom Stellard
a5ac8ee2c5 radeonsi: Properly initialize si_shader_ctx.radeon_bld 2012-08-02 13:21:30 -04:00
Michel Dänzer
c2bae6b91d radeonsi: Handle TGSI TXP opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 18:38:47 +02:00
Michel Dänzer
93b4f1f97e radeonsi: Handle TGSI DIV opcode.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 18:38:16 +02:00
Brian Paul
daf4254d07 svga: remove questionable INLINE qualifiers 2012-08-02 09:40:41 -06:00
Brian Paul
421f134028 svga: sort #includes 2012-08-02 09:40:40 -06:00
Brian Paul
81f2f3f65c svga: add some comments in svga_screen_cache.c 2012-08-02 09:40:40 -06:00
Brian Paul
4b5a5898b1 svga: whitespace, formatting fixes 2012-08-02 09:40:40 -06:00
Brian Paul
bcd8d9713d svga: remove unneeded 'struct svga_screen' declarations 2012-08-02 09:40:40 -06:00
Brian Paul
8551635242 mesa: fix default_access_mode() result for ES2
The GL_OES_mapbuffer extension is supported by OpenGL ES 1 and ES 2 so return
GL_MAP_WRITE_BIT for both ES versions, not just ES 1.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-02 09:40:40 -06:00
Brian Paul
3eb2b5c5e4 mesa: default_access_mode() returns a GLbitfield, not GLenum 2012-08-02 09:40:40 -06:00
José Fonseca
4bd36956f8 scons: set YACCHXXFILESUFFIX to stop needless rebuilding of the parser
Before, the GLSL parser was getting rebuilt every time that scons was
run.  The problem was scons was expecting a glsl_parser.hpp file but
we were generating a glsl_parser.h file.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-08-02 09:40:40 -06:00
Christian König
41625afa2f radeonsi: initial VDPAU target
Windowed speed is of course way to slow, but fullscreen
works like a charm now.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 15:15:23 +02:00
Christian König
a3c6607be1 radeon/llvm: fix fp immediates on SI
I don't know if this is a good idea, but it
fixes the problem at hand.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-02 15:15:00 +02:00
Christian König
250b7fdd26 radeonsi: fix TEX writemask
Using the writemask in the sampler results in packet
VGPRS. For now just sample all components and let
llvm chose the right one.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 12:05:33 +02:00
Christian König
3508815d17 radeonsi: fix shader param and color count
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:57 +02:00
Christian König
92b96a883f radeonsi: fix texture loads from sampler > 0
The backend is multiplying the offset by the numbers of
elements anyway, so doing it twice just makes everything
crash.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:52 +02:00
Christian König
9b7dc5e81c radeonsi: disable tiling until we fixed all bugs
Currently there are more important things to worry about.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-02 11:22:40 +02:00
Vinson Lee
8734584952 scons: Add support for Intel Compiler.
The patch makes the SCons build with Intel Compiler successful.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 21:28:47 -07:00
Pauli Nieminen
204bfb904b meta: Use sampler object in framebuffer blit
Framebuffer blit needs to setup texture sampling with no reference to the
user's texturing state, and a sampler object lets us avoid a bunch of changes
to the user's state setup.

We don't bother caching the sampler object since we're changing parameters in
it based on the filtering option to glBlitFramebuffer().

Fixes piglit GL_ARB_sampler_objects/framebufferblit and rendering in l4d2 (our
setting of srgb decode wasn't being respected due to the user's sampler object
being active).

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
676a563d5b meta: Add sampler object to texture decompression
Sampler objects can be used to shadow texture object state without
modifying original application state. Decompression path feels a bit
like path where caching shouldn't happen. But as everything else is
cached already I decided to cache sampler state too.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
5a320d5bcf mesa: Allow meta module to call sampler functions
To allow meta module to use sample objects mesa GL functions need to be
visible and linkable for meta module.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:57:12 -07:00
Pauli Nieminen
cbdc1d5354 swrast: Support sampler object for texture fetching state
swrast needs to pass sampler object into all texture fetching functions
to use correct sampling state when sampler object is bound to the unit.
The changes were made using half manual regular expression replace.

v2: Fix NULL deref in _swrast_choose_triangle(), because the _Current
    values aren't set yet, so we need to look at our texObj2D. (anholt)

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:55:51 -07:00
Pauli Nieminen
8129dabb5f mesa: Make ARB_sampler_objects mandatory
To allow meta acceleration operations to use sampler objects the
ARB_sampler_objects extension needs to be mandatory for all drivers.
Because the extension doesn't have any hardware dependencies it is
trivial to implement.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
ae58f9696c mesa/program: Use sampler object state if present
CompareFailValue is part of Sampler state that needs to be read from
bound sampler object if present.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
cae7636852 mesa/ff_shader: Fix sampler state reading
Fixed function fragment shader generator was incorrectly read texture
sampling state directly from texture object. To make sure that
ARB_sampler_object works correctly shader generator has to use the
bound sampler if one exist.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:17 -07:00
Pauli Nieminen
6f6bd8aedc radeon&r200: Add support for ARB_sampler_objects
Preparation for the mandatory support of ARB_sampler_objects. I have tested
this patch with rv280 only.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
10169e7adc radeon: Fix printf format not to warn in 64bit
When I build tested radeon changes I noticed two warnings about format
size missmatch in 64bit. I decided to clean them to make relevant
compiler warnings easier to spot.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
54808e560f nouveau: Add support for ARB_sampler_objects
ARB_sampler_objects is very simple software only extension to support.  I want
to make it a mandatory extension for Mesa drivers to allow the meta module to
use it.

This patch add support for the extension to nouveau. It is completely untested
search and replace patch, except for flagging the texture state as needing to
be recomputed when a sampler object is present.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
765509903b mesa/samplerobj: Support EXT_texture_sRGB_decode
sRGBDecode state is part of sampler object state but mesa was missing
handlers to access the state. This patch adds the support for required
state changes and queries.

GL_EXT_texture_sRGB_decode issue 4:
"4) Should we add forward-looking support for ARB_sampler_objects?

        RESOLVED: YES

        If ARB_sampler_objects exists in the implementation, the sampler
        objects should also include this parameter per sampler."

Fixes piglit GL_ARB_sampler_objects/GL_EXT_texture_sRGB_decode.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:31:16 -07:00
Pauli Nieminen
c37efbfe4c mesa: Move DepthMode to texture object
GL_DEPTH_TEXTURE_MODE isn't meant to be part of sampler state based on
compatibility profile specifications.

OpenGL specification 4.1 compatibility 20100725 3.9.2:
"... The values accepted in the pname parameter
are TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_WRAP_R, TEXTURE_MIN_-
FILTER, TEXTURE_MAG_FILTER, TEXTURE_BORDER_COLOR, TEXTURE_MIN_-
LOD, TEXTURE_MAX_LOD, TEXTURE_LOD_BIAS, TEXTURE_COMPARE_MODE, and
TEXTURE_COMPARE_FUNC. Texture state listed in table 6.25 but not listed here and
in the sampler state in table 6.26 is not part of the sampler state, and remains in the
texture object."

The list of states is in Table 6.24 "Textures (state per texture
object)" instead of 6.25 mentioned in the specification text.

Same can be found from 3.3 compatibility specification.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-01 15:30:13 -07:00
Paul Berry
c18806cebf i965/msaa: Allow GL_SAMPLES to be set to 1 prior to Gen6.
This patch allows GL_SAMPLES to be set to either 0 or 1 on i965
platforms that don't support MSAA (those prior to Gen6).  Setting
GL_SAMPLES=1 has the same effect as setting it to 0 on these platforms
(because MSAA is unsupported), but is distinguishable via the GL API.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50165

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-01 12:45:20 -07:00
Paul Berry
97fc89c6cb i965/msaa: Treat GL_SAMPLES=1 as equivalent to GL_SAMPLES=0.
EXT_framebuffer_multisample is a required subpart of
ARB_framebuffer_object, which means that we must support it even on
platforms that don't support MSAA.  Fortunately
EXT_framebuffer_multisample allows for this by allowing GL_MAX_SAMPLES
to be set to 1.

This leads to a tricky quirk in the GL spec: since
GlRenderbufferStorageMultisamples() accepts any value for its
"samples" parameter up to and including GL_MAX_SAMPLES, that means
that on platforms that don't support MSAA, GL_SAMPLES is allowed to be
set to either 0 or 1.  On platforms that do support MSAA, GL_SAMPLES=1
is not used; 0 means no MSAA, and 2 or higher means MSAA.

In other words, GL_SAMPLES needs to be interpreted as follows:
  =0  no MSAA (possible on all platforms)
  =1  no MSAA (only possible on platforms where MSAA unsupported)
  >1  MSAA (only possible on platforms where MSAA supported)

This patch modifies all MSAA-related code to choose between
multisampling and single-sampling based on the condition (GL_SAMPLES >
1) instead of (GL_SAMPLES > 0) so that GL_SAMPLES=1 will be treated as
"no MSAA".

Note that since GL_SAMPLES=1 implies GL_SAMPLE_BUFFERS=1, we can no
longer use GL_SAMPLE_BUFFERS to distinguish between MSAA and non-MSAA
rendering.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-01 12:45:15 -07:00
Tomeu Vizoso
d5c918f6ad glsl: Add support for OES_standard_derivatives in GLSL ES.
Previously, we advertised the extension but the builtin functions
were enabled only for GLSL and not for ES.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52003

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-01 10:44:44 -07:00
Chad Versace
8c94f6bbd8 intel: Use consistent pattern in intelCreateBuffer
The 16-bit depth case did not follow the function's prevalent pattern.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:40 -07:00
Chad Versace
2b4fbc4d7d intel: Decrease nesting level in intelCreateBuffer
Nearly the whole function body was contained in the 'else' branch. The
'if' branch did one thing: return early with an error. Clean things up by
moving all the code out of the 'else' branch. Decreases max nesting level
from 4 to 3.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:38 -07:00
Chad Versace
83fa0842ca intel: Remove dead code in intelAllocateBuffer
After commit "intel: Convert to using private depth/stencil buffers", we
request from DRI2GetBuffersWithFormat only the front left and back left
buffers. We no longer request depth and stencil buffers.

Assert that in intelAllocateBuffer and remove the related dead code.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-01 10:33:36 -07:00
Matt Turner
84ead7b4e8 configure.ac: Remove extra ;;
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53053
2012-08-01 10:12:50 -07:00
Matt Turner
33ae29c93b configure.ac: Don't duplicate CFLAGS
These assignments caused CFLAGS specified on the configure line to
appear twice in the final CFLAGS. Removing them makes the behavior
reasonable -- USER_CFLAGS are appended at the end of CFLAGS, allowing
the builder to override flags added by configure.ac like
-fno-strict-aliasing.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:50 -07:00
Matt Turner
14819eb588 configure.ac: Remove contractions to stop breaking syntax highlighting
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:50 -07:00
Matt Turner
0e38a3ca52 configure.ac: remove remnants of ppc asm support
Missed by d387899388.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-08-01 10:12:22 -07:00
Adam Jackson
33ef67ab20 linux: Default to dri not xlib on all arches
Even on s390{,x} where there's no video card, you still want this so GLX
protocol works.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-08-01 12:37:25 -04:00
Christoph Bumiller
8592933de8 nv50,nvc0: make resolve sampler objects allow sRGB conversion
Just figured out what that bit does.

Note: It's converted back to sRGB on write, so no effective
conversion occurs.
2012-08-01 15:39:46 +02:00
Christoph Bumiller
6286d9810b Revert "gallium: specify resource_resolve destination via a pipe_surface"
This reverts commit 5d5af7d359.

It turns out the issue this was supposed to fix merely counter-acted
a bug in the hardware driver that I wasn't aware of.

The resource_resolve is not supposed to do sRGB conversion, period.
(This would violate the requirement that source and destination must
be of the same format).
2012-08-01 15:39:46 +02:00
Roland Scheidegger
be2dcc5e9f r200: get rid of dubious aux scissor bits
no point in emitting aux scissor values if we
a) never enable them
b) never set the actual values

plus it is enough to have that aux scissor enable reg (which we never set to
enable) in one place not two.
2012-08-01 14:58:47 +02:00
Roland Scheidegger
c0c216c469 radeon/r200: get rid of some unneeded cliprect/scissor code
Noone was interested in the number of cliprects, and noone cared
about the intersect result neither. So just nuke this.
2012-08-01 14:58:38 +02:00
Roland Scheidegger
549470aa1a r200: get rid of old gart memory functions from old dri1
Those functions are SO dead.
2012-08-01 14:58:29 +02:00
Roland Scheidegger
de694b6b10 radeon/r200: fix bogus clears
There were several problems with these functions (which are a remnant
of dri1 hyperz mostly - should bring it back somehow someday).
First, it would always do a swrast clear if the buffer to clear was a fbo.
Second, for buffers we wouldn't handle the clear (I guess aux/accum?) we
would actually still have tried to clear that later even when we already
cleared it with swrast.
2012-08-01 14:58:23 +02:00
Roland Scheidegger
5b88a2a22d radeon/r200: fix bogus assert/scissor wrt width/height 2048
This addresses one issue raised in bug #51658 discovered by Eugene St Leger.
The assert is bogus since there's no problem with texture width/height being
2048 (the width/height programmed is width/height minus one).
OTOH though the programmed size for scissor rect should be width/height
minus one too otherwise bad things may happen (as it is inclusive, and there's
not enough bits for more than a value of 2047).
2012-08-01 14:58:15 +02:00
Christian König
6574fe3c4a radeon/llvm: fix calculation of max register number
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-01 11:15:06 +02:00
Tom Stellard
a488fdd3d9 radeon/llvm: Add pseudo-support for 64-bit immediate types on SI
SI does not support 64-bit immediates natively, but llvm will generate
i64 immediates when indexing loads and stores (since SI has 64-bit
pointers).  The i64 indices will always be small enough to fit into
32-bits (i.e. the high 32 bits will always be all zeros), so we can
treat these index values as 32-bits.
2012-07-31 20:19:21 +00:00
Tom Stellard
be46874281 radeon/llvm: Fix incorrect return value in SelectADDRReg()
We need to return true when we match the pattern.
2012-07-31 20:19:20 +00:00
Tom Stellard
056b77ca22 radeon/llvm: Move SMRD IMM pattern before SMRD SGPR pattern
In tablegen, if two patterns match, the one that comes first in the file
is given preference.  We want the SMRD IMM pattern to be given
preference, because it encodes the pointer offset in its immediate
field, which saves us an add instruction.
2012-07-31 20:19:20 +00:00
Eric Anholt
877a897adc glsl: Reject linking shaders with too many uniform blocks.
Part of fixing piglit maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
fa08b8ad54 mesa: Return -1 for glGetUniformLocation on UBOs.
Fixes piglit ARB_uniform_buffer_object/getuniformlocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
bbd1d6124d glsl: Assign array and matrix stride values according to std140 layout.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
551bdf25bc glsl: Add support for default layout qualifiers for uniforms.
I ended up having to add rallocing of the ast_type_qualifier in order
to avoid pulling in ast.h for glsl_parser_extras.h, because I wanted
to track an ast_type_qualifier in the state.

Fixes piglit ARB_uniform_buffer_object/row-major.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
7b77c64254 glsl: Merge UBO layout qualifiers in a qualifier list.
Yes, you get to say things like "layout(row_major, column_major)" and
get column major.

Part of fixing piglit ARB_uniform_buffer_object/row_major.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:20 -07:00
Eric Anholt
eed967bc9c mesa: Add support for GL_ARB_ubo's glGetActiveUniformName().
This is like a stripped-down version of glGetActiveUniform that just
returns the name, since the other return values (type and size) of
that function are now meant to be handled with
glGetActiveUniformsiv().

Fixes piglit ARB_uniform_buffer_object/getactiveuniformname

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
dc654370c3 mesa: Add support for most of the other pnames of glGetActiveUniformBlockiv().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
5a165d1f3a mesa: Add support for getting active uniform block names.
Fixes piglit ARB_uniform_buffer_object/getactiveuniformblockname.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
467304dfe5 mesa: Add support for glUniformBlockBinding() and the API to get it back.
Fixes piglit ARB_uniform_buffer_object/uniformbufferbinding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
fafa394c15 glsl: Incorporate all UBO language changes into GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Eric Anholt
4070036259 mesa: Add support for glGetProgramiv pnames for UBOs.
Fixes piglit ARB_uniform_buffer_object/getprogramiv.

v2: Add extension checks.
v3: Appease MSVC.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-31 12:06:19 -07:00
Kenneth Graunke
3a90dc22d1 glsl: Refactor #version validation to be more future-proof.
The previous implementation required a flag in _mesa_glsl_parse_state
and line of code to initialize it for every version of the shading
language we intend to support.  As we look to add 150, 330, 400, 410,
420, and beyond, this gets rather unwieldy.

This patch retains the switch statement (to reject, say, #version 111),
but removes all the bits.  Code to check for ctx->API == API_OPENGL_CORE
could easily be added to the 110 and 120 cases to reject those.

v2: Use _mesa_is_desktop_gl to preserve the existing behavior in the
    presence of the new API_OPENGL_CORE enumeration.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-07-31 11:20:49 -07:00
Eric Anholt
19bd5936af i965: Add support for GL_SKIP_DECODE_EXT on other SRGB formats.
Fixes some failures in getteximage-formats.

v2: Remove stray include, and drop extra test for encoding == GL_SRGB --
    _mesa_get_srgb_format_linear() returns the same format if it wasn't SRGB.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48120
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
NOTE: This is a candidate for the 8.0 branch.
2012-07-31 11:14:23 -07:00
Kenneth Graunke
03ac5c54b5 glsl: Fix #pragma invariant(all) language version check.
It was using state->Const.GLSL_100ES, which is set if the driver
supports ARB_ES2_compatibility or we're in ES2 mode.  Instead, it should
use state->language_version, as that represents the actual GLSL version
of the shader being compiled.

Since the correct logic is < 120 && !100, just make it == 110.

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-07-31 10:52:54 -07:00
Kenneth Graunke
d84b3a5a3c mesa: Support glGetString(GL_SHADING_LANGUAGE_VERSION) for >= 1.40.
This will need to get refactored when we add support for core profiles
or forward-compatible contexts, but we may as well have it in the
meantime.  This allows us to override the GLSL version and experiment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-31 10:52:54 -07:00
Brian Paul
591594ea1e ir_to_mesa: make size_swizzles[] array static const 2012-07-31 09:00:41 -06:00
Jon TURNEY
27013e5164 Move installing osmesa.pc to drivers/osmesa
Move installing osmesa.pc to drivers/osmesa, where it belongs better

This also restores the installation of gl.pc if we are building osmesa at the
same time as libGL, which was broken in commit 39785488 when the .pc
installation was converted to automake

v2:
Remove HAVE_OSMESA_DRIVER automake conditional, it's now pointless as we
will only be building in the drivers/osmesa directory if the condition it
checked was true.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-31 12:48:33 +01:00
Vinson Lee
2faa2b4f7e gallium/util: Use GCC built-in functions for NaN and infinity.
This patch fixes this build failure with Intel Compiler.

src/gallium/auxiliary/util/u_format_tests.c(903): error: floating-point operation result is out of range
     {PIPE_FORMAT_R16_FLOAT, PACKED_1x16(0xffff), PACKED_1x16(0x7c01), UNPACKED_1x1(        NAN, 0.0, 0.0, 1.0)},

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-30 23:27:19 -07:00
Jordan Justen
3d0b54c7c6 mesa: don't enable legacy GL functions when using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
1fea3df6f4 intel: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
0f099df567 meta: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
4aecd8f031 glsl: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:25:56 -07:00
Jordan Justen
09714c09a4 mesa: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Jordan Justen
3d284dcba6 mesa: add api check functions
These functions make it easier to check for multiple API types.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Jordan Justen
1c29b73f4d mesa: add API_OPENGL_CORE api
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-30 16:18:57 -07:00
Ian Romanick
d3de40742f glsl: Fix ir_last_opcode value.
Now that ir_quadop_vector exists, ir_last_binop and ir_last_opcode are
no longer the same.  Only one place currently uses this enumeration, and
already handles ir_quadop_vector correctly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:15:48 -07:00
Ian Romanick
9d998a2a59 glsl: Request an Nx1 type instance in ir_quadop_vector lowering pass.
No types have 0 columns.  The glsl_type::get_instance method contains

   if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
      return error_type;

To get a vector, use columns = 1.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:14:34 -07:00
Kenneth Graunke
13cb99dc73 glsl: Make bvec and ivec types accessible without using get_instance.
It's more convenient to use shortcuts like glsl_type::bvec2_type than
the longwinded glsl_type::get_instance(GLSL_TYPE_BOOL, 2, 1).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
2012-07-30 15:14:09 -07:00
Tom Stellard
cd0949eb28 radeon/llvm: Cleanup AMDIL.h 2012-07-30 21:10:14 +00:00
Tom Stellard
2f921101c0 radeon/llvm: Rename all AMDIL* classes to AMDGPU* 2012-07-30 21:10:14 +00:00
Tom Stellard
b72ab79d73 radeon/llvm: Merge AMDILSubtarget into AMDGPUSubtarget 2012-07-30 21:10:13 +00:00
Tom Stellard
27ae41c83d radeon/llvm: Merge AMDILTargetLowering class into AMDGPUTargetLowering 2012-07-30 21:10:13 +00:00
Tom Stellard
c96490e3b5 radeon/llvm: Remove IL_cmp DAG node 2012-07-30 21:10:13 +00:00
Tom Stellard
aece7970eb radeon/llvm: Cleanup and reorganize AMDIL .td files 2012-07-30 21:10:13 +00:00
Tom Stellard
0ce6e50601 radeon/llvm: Remove lowering code for unsupported features
e.g. function calls, load/store from stack
2012-07-30 21:10:08 +00:00
Tom Stellard
caeaf43dad radeon/llvm: Remove AMDILVersion.td 2012-07-30 20:31:57 +00:00
Tom Stellard
c3111eb639 radeon/llvm: Remove AMDILAlgorithms.tpp 2012-07-30 20:31:57 +00:00
Tom Stellard
ac669c32c6 radeon/llvm: Merge AMDILInstrInfo.cpp into AMDGPUInstrInfo.cpp 2012-07-30 20:31:57 +00:00
Tom Stellard
3a0187b1b5 radeon/llvm: Merge AMDILRegisterInfo into AMDGPURegisterInfo 2012-07-30 20:31:57 +00:00
Tom Stellard
9c42fb6f26 radeon/llvm: Change the tablegen target from AMDIL to AMDGPU 2012-07-30 20:31:56 +00:00
Kenneth Graunke
f56dfc3213 i965: Support MESA_FORMAT_SIGNED_RGBA_16.
The hardware supports this format with no known quirks, so we may as
well enable it.

Alpha blending is not supported until Sandybridge, but as far as I can
tell, OpenGL doesn't require alpha blending on SNORM formats.  Plus, we
already expose R8G8B8A8_SNORM which has a similar restriction.

Fixes 6 piglit texwrap-2D-*SNORM* cases,
gl-3.1/required-sized-texture-formats, and 10 oglconform snorm-textures
subcases

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-30 09:35:58 -07:00
Elvis Lee
e7a4a2b18b gbm: Fix build for wayland include
backends/gbm_dri.c fails to find wayland-server.h.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-30 11:58:02 -04:00
Brian Paul
b51be8786f mesa: fix _math_matrix_copy(), again
The matrix is 16 GLfloats in size.  Since from->inv is just a pointer (not
an array), sizeof(*from->inv) wasn't right.
2012-07-30 08:30:15 -06:00
Vinson Lee
502c10839e mesa: Fix wrong sizeof argument in _math_matrix_copy.
Fixes Coverity wrong sizeof argument defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-07-30 08:13:55 -06:00
Christian König
86490bc150 radeonsi: fix db and stencil setup v2
v2: fix tiling for small pitches, that finally makes
    glxgears and readPixSanity work

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:02:04 +02:00
Christian König
7dace3a3cf radeonsi: fix stencil op mapping
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:02:00 +02:00
Christian König
ad15c8c0f1 radeonsi: fix assertion in si_bind_vs_sampler
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:55 +02:00
Christian König
1fb8ee62fa radeonsi: fix shader binding
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:51 +02:00
Christian König
f18fd255cf radeonsi: fix dummy export in shaders v2
v2: add assertion for vertex shader

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 15:01:34 +02:00
Christian König
b15e3ae5b4 radeonsi: fix vertex buffer and elements
Let's just use the T# descriptors until we get a fetch shader.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:45:32 +02:00
Christian König
d51b9b70d5 radeonsi: fix shader size and handling
We should always upload the shader here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:45:08 +02:00
Christian König
fe41287ffa radeonsi: rename r600_resource to si_resource
Also split it into seperate header and add
some helper functions.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-30 14:44:38 +02:00
Kenneth Graunke
dcf8754cce glcpp: Add a newline to expanded #line directives.
Otherwise, the preprocessor happily outputs

    #line 2 4 <your next line of code>

and the main compiler gets horribly confused and fails to compile.

This is not the right solution (line numbers in error messages will
likely be off-by-one in certain circumstances), but until Carl comes
up with a proper fix, this gets programs running again.

Fixes regressions in Regnum Online, Overgrowth, Piglit, and others since
commit aac78ce823.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51802
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51506
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-28 13:33:50 -07:00
Christoph Bumiller
5d5af7d359 gallium: specify resource_resolve destination via a pipe_surface
The format member of pipe_surface may differ from that of the
pipe_resource, which is used to communicate, for instance, whether
sRGB encode should be enabled in the resolve operation or not.

Fixes resolve to sRGB surfaces in mesa/st when GL_FRAMEBUFFER_SRGB
is disabled.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-28 14:58:18 +02:00
Christoph Bumiller
51e41a0d89 st/mesa: call update_renderbuffer_surface for sRGB renderbuffers, too
sRGBEnabled should affect both textures and renderbuffers, so we need
to check/update the pipe_surface format for both.

Fixes, for instance, rendering appearing too bright in wine applications
using sRGB multisample renderbuffers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-28 13:14:30 +02:00
Christoph Bumiller
acd66ec033 nv50: fix depth/stencil multisample memory storage types
Leftover from libdrm_nouveau v2 interface change.
2012-07-28 13:14:03 +02:00
Christoph Bumiller
cd3d85b63d nv50: fix resource_resolve shader start offsets 2012-07-28 13:11:56 +02:00
Brian Paul
f612e55e45 st/mesa: undo a couple static asserts
Hmm, gcc didn't catch these mistakes, but MSVC did.
2012-07-27 16:10:58 -06:00
Brian Paul
322a2938f3 st/mesa: use STATIC_ASSERT in a few places 2012-07-27 15:47:38 -06:00
Brian Paul
59c67f8116 mesa: whitespace, etc. fixes in program.h 2012-07-27 15:43:53 -06:00
Brian Paul
906febaf8b meta: fix glDrawPixels fallback test, stencil drawing
Remove the check for pixel transfer ops.  If any RGB/depth scale/bias
is in effect, it'll be applied in the glTexImage step.

If drawing stencil pixels we need to disable pixel transfer so that
alpha scale/bias are not applied to the stencil data.

These issues were spotted by Roland.

Fixes Blender performance issues reported in
http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-27 14:53:16 -06:00
Brian Paul
a80b7407f3 radeon: fix 'sowftware' typo 2012-07-27 14:53:16 -06:00
Eric Anholt
fbf86c7f0f i965/gen7: Reduce GT1 WM thread count according to updated BSpec.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>

https://bugs.freedesktop.org/show_bug.cgi?id=52382
2012-07-27 11:42:19 -07:00
Kenneth Graunke
cbcf750d5f i965: Fix typo in shader channel select field name.
"chanel" isn't very searchable.  I can type, honest!

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-27 11:31:07 -07:00
Paul Berry
ee9f6a34cc i965/msaa: Use MESA_FORMAT_R8 for MCS buffer.
No functional change.  This patch modifies intel_miptree_alloc_mcs to
allocate the 4x MCS buffer using MESA_FORMAT_R8 instead of
MESA_FORMAT_A8.  In principle it doesn't matter, since we only access
the buffer using MCS-specific hardware mechanisms, so all that's
important is to use a format with the correct size.  However,
MESA_FORMAT_A8 has enough unusual behaviours that it seems prudent to
avoid it.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-27 10:42:19 -07:00
Zou Nan hai
588881430a intel: increase wm thread number to 80 on gen6 GT2
It seems reset is not required for setting the max_wm_threads to 80
on gen6 GT2.

Increases performance in the Counter-Strike: Source video stress test
by 7.18% (n=5).

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Matt Turner <mattst88@gmail.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-07-27 10:32:17 -07:00
Tom Stellard
fdd8df20e4 r600g: Emit dispatch state for compute directly to the cs
We no longer rely on an evergreen_compute_resource for emitting dispatch
state.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
dc0b8a4628 r600g: Initialize VGT_PRIMITIVE_TYPE in the start_cs_cmd atom
The value of this register will always be DI_PT_POINTLIST for compute
shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
d3b0130491 r600g: Atomize compute shader state
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
5497391067 r600g: Add helper functions for emitting compute SET_CONTEXT packets
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-27 17:08:09 +00:00
Tom Stellard
c9ef27276f radeon/llvm: Add instruction defs for branches on SI 2012-07-27 17:08:09 +00:00
Tom Stellard
ee0f0f03c6 radeon/llvm: Fix VOPC and V_CNDMASK encoding 2012-07-27 17:08:09 +00:00
Tom Stellard
d4bdd09d47 radeon/llvm: Assert if we try to copy SCC reg 2012-07-27 17:08:09 +00:00
Tom Stellard
fd1f19a191 radeon/llvm: Add SI DAG optimizations for setcc, select_cc
These are needed for correctly lowering branch instructions in some
cases.
2012-07-27 17:08:08 +00:00
Tom Stellard
cd5d4c5073 radeon/llvm: Add support for encoding SI branch instructions 2012-07-27 17:08:08 +00:00
Tom Stellard
50ff2dc0a4 radeon/llvm: Add special nodes for SALU operations on VCC
The VCC register is tricky because the SALU views it as 64-bit, but the
VALU views it as 1-bit.  In order to deal with this we've added some
special bitcast and binary operations to help convert from the 64-bit
SALU view to the 1-bit VALU view and vice versa.
2012-07-27 17:08:08 +00:00
Tom Stellard
c424975572 radeon/llvm: Add i1 registers for SI. 2012-07-27 17:08:08 +00:00
Tom Stellard
bdda1cb914 radeon/llvm: Fix CCReg definitions on SI 2012-07-27 17:08:08 +00:00
Tom Stellard
ae9be358f2 radeonsi: Enable PIPE_SHADER_CAP_INTEGERS 2012-07-27 17:08:08 +00:00
Tom Stellard
022b54359a radeonsi: Add support for loading integers from constant memory 2012-07-27 17:08:07 +00:00
Tom Stellard
ad95bcb31f radeon/llvm: Add bitconvert patterns for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
4cab682184 radeon/llvm: Add custom lowering for SELECT_CC nodes on SI 2012-07-27 17:08:07 +00:00
Tom Stellard
ba76684292 radeon/llvm: Move conditional pattern leafs to common tablegen file 2012-07-27 17:08:07 +00:00
Tom Stellard
d36455ba2c radeon/llvm: Implement getSetCCResultType for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
e8825ce6e1 radeon/llvm: Custom lower BR_CC for SI 2012-07-27 17:08:07 +00:00
Tom Stellard
87272e9e25 radeon/llvm: Move lowering of BR_CC node to R600ISelLowering
SI will handle BR_CC different from R600, so we need to move it
out of the shared instruction selector.
2012-07-27 17:08:07 +00:00
Tom Stellard
92823fb72a radeon/llvm: Move lowering of SETCC node to R600ISelLowering
SI will handle SETCC different from R600, so we need to move it
out of the shared instruction selector.
2012-07-27 17:08:06 +00:00
Tom Stellard
46d12c99a2 radeon/llvm: Use correct node type when lowering SETCC 2012-07-27 17:08:06 +00:00
Tom Stellard
47d1b0a809 radeon/llvm: Move LowerSELECT_CC into R600ISelLowering
SI will handle SELECT_CC different from R600, so we need to move it out
of the shared instruction selector.
2012-07-27 17:08:06 +00:00
Eric Anholt
11ff18fcf5 automake: Remove OPT_FLAGS.
If you want to change your compiler arguments, just set CFLAGS/CXXFLAGS.
Having Mesa have this separate variable is a great way to have your arguments
not thoroughly propagated to all compiler invocations.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 17:30:06 -07:00
Eric Anholt
87a1c4f233 automake: Remove ARCH_FLAGS.
In all current uses, it was appended to CFLAGS, which already had -m32.  If
you want to do some other flag supplied to compiler invocations, there's
CFLAGS/CXXFLAGS.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 17:30:06 -07:00
Paul Berry
4df2848786 i965/msaa: use ROUND_DOWN_TO macro.
No functional change.  This patch modifies brw_blorp_blit.cpp to use
the ROUND_DOWN_TO macro instead of open-coded bit manipulations, for
clarity.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 15:02:10 -07:00
Brian Paul
f37f1a7209 svga: initialize svga_compile_key to zeros to be safe 2012-07-26 16:00:31 -06:00
Brian Paul
dafa77201f svga: fix invalid memory reference in needs_to_create_zero()
The emit->key.fkey info is only valid if we're generating a fragment shader.
We should not look at it if we're generating a vertex shader.

When generating a vertex shader, the value of emit->key.fkey.num_textures was
garbage and the loop over num_textures would read invalid data.  At best
this would cause us to emit an unused constant.  At worse, we could segfault.
Just by dumb luck, fkey.num_textures was usually a smallish integer.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-26 16:00:31 -06:00
Brian Paul
38184dcd54 radeon: fix Base/base typo
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=52563
2012-07-26 15:57:20 -06:00
Daniel Charles
948c8f502a android-build: fix dricore build for autogenerated files (v3)
Recently more files were removed from control to be auto-generated
in the dricore library. Android build was not able to locate the
new files if they were not created beforehand.

LOCAL_SRC_FILES includes some of those files and Android.gen.mk
re-defines this variable by filtering out the auto-generated files.
Unfortunately for this variable it is not the same to have the SRCDIR
variable defined as the current directory.

By re-defining SRCDIR for the autotools build the Android build system
is happy again and the new files were actually removed from the sources
to use the auto generated versions.

Also patch d5c1801a01 was partially reverted as the files
can not be compiled to the LOCAL_PATH, instead they should live on the
intermediates folder so that a clean can wipe them out.

v3: [chad] Fix the definition of SRCDIR in libdricore/Makefile.am.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Signed-off-by: Daniel Charles <daniel.charles@intel.com>
2012-07-26 14:51:20 -07:00
Brian Paul
0e893b4261 radeon: set swrast_renderbuffer::ColorType field when mapping renderbuffers
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=47375

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Barto <mister.freeman@laposte.net>
2012-07-26 13:59:44 -06:00
Brian Paul
a73e9207da xlib: add X error handler around XGetImage() call
XGetImage() will generate a BadMatch error if the source window isn't
visible.  When that happens, create a new XImage.  Fixes piglit 'select'
test failures with swrast/xlib driver.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-26 13:59:44 -06:00
Brian Paul
66adc807c4 mesa: remove obsolete matrix comment 2012-07-26 13:59:44 -06:00
Brian Paul
1e37d54d9d mesa: fix comment typo: s/pointer/point/ 2012-07-26 13:59:44 -06:00
Brian Paul
66d9ac5ac7 mesa: remove _math_matrix_alloc_inv()
Always allocate space for the inverse matrix in _math_matrix_ctr()
since we were always calling _math_matrix_alloc_inv() anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 13:59:44 -06:00
Brian Paul
50db812915 mesa: loosen small matrix determinant check
When computing a matrix inverse, if the determinant is too small we could hit
a divide by zero.  There's a check to prevent this (we basically give up on
computing the inverse and return the identity matrix.)  This patch loosens
this test to fix a lighting bug reported by Lars Henning Wendt.

v2: use abs(det) to handle negative values

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Lars Henning Wendt <lars.henning.wendt@gris.tu-darmstadt.de>
2012-07-26 13:59:43 -06:00
Paul Berry
148c8e639d i965: Use sendc for all render target writes on Gen6+.
The sendc instruction causes the fragment shader thread to wait for
any dependent threads (i.e. threads rendering to overlapping pixels)
to complete before sending the message.  We need to use sendc on the
first render target write in order to guarantee that fragment shader
outputs are written to the render target in the correct order.

Previously, we only used the "sendc" instruction when writing to
binding table index 0.  This did the right thing for fragment shaders,
because our fragment shader back-ends always issue their first render
target write to binding table index 0.  However, it did the wrong
thing for blorp, which performs its render target writes to binding
table index 1.

A more robust solution is to use sendc for all render target writes.
This should not produce any performance penalty, since after the first
sendc, all of the dependent threads will have completed.

For more information about sendc, see the Ivy Bridge PRM, Vol4 Part3
p218 (sendc - Conditional Send Message), and p54 (TDR Registers).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-26 10:49:38 -07:00
Paul Berry
8f37ea414f i965/msaa: Remove TODO comments that are no longer relevant.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:49:38 -07:00
Paul Berry
c738ea1191 intel: Make more consistent use of _mesa_is_{user,winsys}_fbo()
A lot of code was still differentiating between between winsys and
user fbos by testing the fbo's name against zero.  This converts
everything in the i915 and 965 drivers over to use _mesa_is_user_fbo()
and _mesa_is_winsys_fbo().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:48:36 -07:00
Paul Berry
284ad9c3b2 mesa: Make more consistent use of _mesa_is_{user,winsys}_fbo()
A lot of code was still differentiating between between winsys and
user fbos by testing the fbo's name against zero.  This converts
everything in core mesa, the state tracker, and src/mesa/program over
to use _mesa_is_user_fbo() and _mesa_is_winsys_fbo().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-26 10:38:05 -07:00
Oliver McFadden
e72f20641a glsl: warning: pragma `invariant(all)' not supported in GLSL ES 1.00
The OpenGL(R) ES Shading Language
Version 1.00 Revision 17 (12 May, 2009)

> 4.6.1 The Invariant Qualifier
> ... To force all output variables to be invariant, use the pragma
> #pragma STDGL invariant(all)

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-26 13:09:15 +03:00
Kenneth Graunke
16cba717c2 shared-glapi: Install libglapi.so.0.0.0 and .0 links in lib/.
We already provided these files on 'make install', but only created a
'libglapi.so' in the top-level lib/ convenience folder.  We used to
create all three, but at some point in the build system churn, it broke.

Various applications (like the ES2 conformance suite) seem to link
against libglapi.so.0, so without these links, setting LD_LIBRARY_PATH
and LIBGL_DRIVERS_PATH can lead to using /usr/lib/libglapi.so.0 with
/home/whatever/libGL.so, which leads to API calls getting routed
incorrectly (i.e. glCompileShader -> _mesa_LinkProgramARB), which leads
to rage problems.

Preserve developer sanity...install links.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-25 22:37:24 -07:00
Vinson Lee
4f109ca4e8 scons: Fix build with clang.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-25 17:04:30 -07:00
Eric Anholt
cc44aa7749 i965: Remove unused param conversion code.
Ever since ctx->NativeIntegers was set, the conversion flag has been
PARAM_NO_CONVERT.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-25 10:29:56 -07:00
Olivier Galibert
fa76d04aea softpipe: fix copy/paste error in tex sample code
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=52369

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-25 07:47:19 -06:00
Jon TURNEY
f9089f4022 Remove redundant osmesa shared library install from Makefile.old
Since osmesa now has been converted to Makefile.am, an appropriate install: rule
is generated to install the shared libary, so we no longer need to do that in
src/mesa/Makefile.old

This leaves nothing in src/mesa/Makefile.old but the tags: rule, so move that to
Makefile.am and remove Makefile.old

Also, nothing now uses OSMESA_LIB_GLOB anymore, so remove it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:41:07 +01:00
Jon TURNEY
bd4a3cce96 Update mesa/drivers/x11/Makefile.am for xm_image.h removal
Commit 6c6803f28d removed xm_image.[ch], and removed
xm_image.c, but not xm_image.h from the Makefile, this was subsequently carried over
into Makefile.am

Remove xm_image.h from Makfile.am.  This allows 'make dist' to succeed, even if it
doesn't do anything useful

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:40:10 +01:00
Jon TURNEY
9f84d645a4 drivers/osmesa: Link OSMesa using -no-undefined libtool flag
"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 require that all symbols are resolved when the
library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:39:42 +01:00
Jon TURNEY
50b13217ba drivers/X11: Link X11 libGL with -no-undefined libtool flag
"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 require that all symbols are resolved when the
library is linked."

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-25 12:38:38 +01:00
Vinson Lee
491d82e9df Revert "scons: Add instrumentation component libraries to linking on llvm-3.2."
This reverts commit e2e7b467d8.

No longer needed after llvm-3.2svn r160611.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-07-24 22:49:49 -07:00
Paul Berry
497bf5dd2b i965/msaa: Switch on 8x MSAA for Gen7.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:59 -07:00
Paul Berry
7285612713 i965/msaa: Adjust MCS buffer allocation for 8x MSAA.
MCS buffers use 32 bits per pixel in 8x MSAA, and 8 bits per pixel in
4x MSAA.  This patch adjusts the format we use to allocate the buffer
so that enough memory is set aside for 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
304be9db14 i965/msaa: Remove assertion in 3DSTATE_SAMPLE_MASK to allow 8x MSAA.
The code to emit 3DSTATE_SAMPLE_MASK was already correct for 8x
MSAA--this patch just removes an assertion that would have prevented
it from being used for 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
2a9ab29ed9 i965/msaa: Adjust 3DSTATE_MULTISAMPLE packet for 8x MSAA.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
7fae97c98b i965/blorp: Encode and decode IMS format for 8x MSAA correctly.
This patch updates the blorp functions encode_msaa() and decode_msaa()
to properly handle the encoding of IMS MSAA buffers when
num_samples=8.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
619471dc32 i965/blorp: Compute sample number correctly for 8x MSAA.
When operating in persample dispatch mode, the blorp engine would
previously assume that subspan N always represented sample N (this is
correct assuming 4x MSAA and a 16-wide dispatch).  In order to support
8x MSAA, we must compute which sample is associated with each subspan,
using the "Starting Sample Pair Index" field in the thread payload.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
082874e389 i965/blorp: Properly adjust primitive size for 8x MSAA.
When rendering to an IMS MSAA surface on Gen7, blorp sets up the
rendering pipeline as though it were rendering to a single-sampled
surface; accordingly it must adjust the size of the primitive it sends
down the pipeline to account for the interleaving of samples in an IMS
surface.

This patch modifies the size adjustment code to properly handle 8x
MSAA, which makes room for the extra samples by using an interleaving
pattern that is twice as wide as 4x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
17eae9762c i965/blorp: Parameterize manual_blend() by num_samples.
This patch adds a num_samples argument to the blorp function
manual_blend(), allowing it to be told how many samples need to be
blended together.  Previously it assumed 4x MSAA, since that was all
we supported.

We also bump up LOG2_MAX_BLEND_SAMPLES from 2 to 3, so that
manual_blend() will be able to handle 8x MSAA.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-24 14:52:58 -07:00
Paul Berry
4afee38a2f i965/msaa: Remove comment about falsely claiming to support MSAA.
Gen6+ hardware now supports MSAA properly.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:58 -07:00
Paul Berry
ff9313fac7 i965/blorp: Handle DrawBuffers properly.
When the client program uses glDrawBuffer() or glDrawBuffers() to
select more than one color buffer for drawing into, and then performs
a blit, we need to blit into every single enabled draw buffer.

+2 oglconforms.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50407

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
fa1d267beb i965/blorp: Rearrange order of blit validation and preparation steps.
This patch rearranges the order of steps performed by a blorp blit
from this:

- Sync up state of window system buffers.
- Find buffers.
- Find miptrees.
- Make sure buffer formats match.
- Handle mirroring.
- Make sure width and height match.
- Handle clipping/scissoring.
- Account for window system origin conventions.
- Do depth resolves, if applicable.
- Do the blit.
- Record the need for a future HiZ resolve, if applicable.

To this:

- Sync up state of window system buffers.
- Handle mirroring.
- Make sure width and height match.
- Handle clipping/scissoring.
- Account for window system origin conventions.
- Find buffers.
- Make sure buffer formats match.
- Find miptrees.
- Do depth resolves, if applicable.
- Do the blit.
- Record the need for a future HiZ resolve, if applicable.

The steps are the same, but they are now performed in an order that
will make it possible to implement correct DrawBuffers support.  Note
that the last four steps are now in a separate function
(do_blorp_blit), since they will need to be executed repeatedly when
DrawBuffers support is added.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
eac4f1a707 i965/blorp: Don't fall back to swrast when miptrees absent.
Previously, the blorp engine would fall back to swrast if the source
or destination of a blit had no associated miptree.  This was
unnecessary, since _mesa_BlitFramebufferEXT() already takes care of
making the blit silently succeed if there are no buffers bound, so the
fallback paths could never actually happen in practice.

Removing these fallback paths will simplify the implementation of
correct DrawBuffers support in blorp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
0dbec6ae07 i965/blorp: Fixup scissoring of blits to window system buffers.
This patch modifies the order of operations in the blorp engine so
that clipping and scissoring are performed before adjusting the
coordinates to account for the difference in origin convention between
window system buffers and framebuffer objects.  Previously, we would
do clipping and scissoring after adjusting for origin conventions, so
we would get scissoring wrong in window system buffers.

Fixes Piglit test "fbo-scissor-blit window".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
da54d2e576 i965/blorp: Simplify check that src/dst width/height match.
When checking that the source and destination dimensions match, we
don't need to store the width and height in variables; doing so just
risks confusion since right after the check, we do clipping and
scissoring, which may alter the width and height.

No functional change.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
bac43b8bb7 i965/msaa: Work around problems with null render targets on Gen6.
On Gen6, multisampled null render targets don't seem to work
properly--they cause the GPU to hang.  So, as a workaround, we render
into a dummy color buffer.

Fortunately this situation (multisampled rendering without a color
buffer) is rare, and we don't have to waste too much memory, because
we can give the workaround buffer a very small pitch.

Fixes piglit test "EXT_framebuffer_multisample/no-color {2,4}
depth-computed *" on Gen6.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
0aeb87023e i965: Set width, height, and tiling properly for null render targets.
The HW docs say that the width and height of null render targets need
to match the width and height of the corresponding depth and/or
stencil buffers, and that they need to be marked as Y-tiled.  Although
leaving these values at 0 doesn't seem to cause any ill effects, it
seems wise to follow the documented requirements.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
691c55f356 i965/msaa: Control multisampling behaviour via the visual.
Previously, we used the number of samples in draw buffer 0 to
determine whether to set up the 3D pipeline for multisampling.  Using
the visual is cleaner, and has the benefit of working properly when
there is no color buffer.

Fixes all piglit tests "EXT_framebuffer_multisample/no-color" on Gen7.
On Gen6, the "depth-computed" variants of these tests still fail; this
will be addresed in a later patch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:57 -07:00
Paul Berry
48fdfbcb58 msaa: Compute visual samples/sampleBuffers from all buffers.
This patch ensures that Visual.samples and Visual.sampleBuffers are
set correctly even in the case where there is no color buffer.
Previously, these values would retain their default value of 0 in this
circumstance, even if the depth or stencil buffer was multisampled.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-24 14:52:56 -07:00
Anthony G. Basile
f35e380dd2 Fix compile time errors when building against uclibc
Mesa misses a few checks when compiling on a uclibc system
which cause it to fall back on glibc-ism.  This patch
addresses those issues.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2012-07-24 13:00:47 -07:00
Jerome Glisse
1ffac44e83 r600g: enable streamout only on 2.14 or latter kernel
The kernel streamout support was supposed to get into 3.3 along
the tiling change and thus use the same kernel version bump of
2.13 to report userspace that streamout register were supported.

This is not what happen. So as streamout kernel support did not
bump the kernel driver version, rely on kernel 2.14 version bump
to know if streamout is enabled or not. Which means you need at
least 3.4 kernel.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-24 15:08:31 -04:00
Jordan Justen
881bb4ac72 intel: move error on create context to proper path
The error was being set on the non-error path, rather
than the error path.

NOTE: This is a candidate for the 8.0 branch.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-24 11:59:19 -07:00
Jordan Justen
01168df4d9 mesa context: generate an error for uninstalled context functions
For 'non-legacy' contexts we will want to generate an error
if an uninstalled function is called.

The effect of this change will be that we can avoid installing
legacy functions, and they will then generate an error as
needed for deprecated functions in GL >= 3.1.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-24 11:50:35 -07:00
Brian Paul
1f9239ec8d nouveau: include glformats.h to get missing prototype
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=52449
2012-07-24 10:33:20 -06:00
Brian Paul
a271a0c9f6 mesa: improve comment in build_tnl_program() 2012-07-24 09:54:50 -06:00
Brian Paul
8f2a13c5e3 docs: the legacy makefile system is removed in Mesa 8.1 2012-07-24 08:49:02 -06:00
Brian Paul
7e18a039ee mesa: move _mesa_error_check_format_and_type() to glformats.c
Now all the format/type-related helper functions are in glformats.c
and image.c is just image-related functions.
2012-07-24 08:37:29 -06:00
Brian Paul
a1287f549a mesa: move more format helper functions to glformats.c 2012-07-24 08:37:29 -06:00
Brian Paul
8b762ebd72 mesa: move some format helper functions to glformats.c 2012-07-24 08:37:29 -06:00
Christian König
de3335dba8 radeonsi: remove old state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
9b213c871a radeonsi: move everything else into the new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
53d47889e6 radeonsi: move format handling into si_state.c
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
73dd906ba0 radeonsi: move remaining sampler state into si_state.c
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
ca9cf611b6 radeonsi: move draw state into new handling
Split it out into si_state_draw.c

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
0d6b0b512a radeonsi: move constants to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
baf2039756 radeonsi: move sampler states into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
3c09f11e5c radeonsi: move shaders to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
bd2a5cf328 radeonsi: move spi into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
840f05da6b radeonsi: move init state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
e4e6f954ae radeonsi: move draw_info to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
76660dfcce radeonsi: move CB_TARGET_MASK into fb/blend state
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
e6937211da radeonsi: move stencil_ref to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:30 +02:00
Christian König
b41b3eb989 radeonsi: move dsa state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
bd18a316e1 radeonsi: move infeered fb/rs state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
f67fae0e43 radeonsi: move rasterizer state into new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
835098a529 radeonsi: move framebuffer to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
7e011d92c9 radeonsi: move viewport to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
43f414f7b7 radeonsi: move scissor state to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
9cbbe0d4e6 radeonsi: move clip state to new handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
0a091a4824 radeonsi: move blend color to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
63636ae52a radeonsi: move blender to new state handling
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Christian König
bf7302a6e1 radeonsi: rework state handling v2
Add a complete new state handling for SI.

v2: fix spelling error

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-07-24 12:29:29 +02:00
Brad King
27382c0f7b automake: Honor GL_LIB for mangled/custom lib names
Commit 2d4b77c7 (automake: Convert src/mesa/drivers/x11/Makefile to
automake, 2012-06-12) dropped the old Makefile, which used GL_LIB, and
replaced it with a Makefile.am hard-coding the name "GL".  This broke
handling of --enable-mangling and --with-gl-lib-name options which
depend on GL_LIB to specify the GL library name.

Use "@GL_LIB@" in src/mesa/drivers/x11/Makefile.am to configure the
library name.  Also use this approach to simplify src/glx/Makefile.am
and drop the HAVE_MANGLED_GL conditional.  While at it, fix the
compatibility link we create in "lib" for the software-only driver to
use version GL_MAJOR instead of hard-coding "1".

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-07-23 22:34:13 -07:00
Marek Olšák
82fc813ca8 st/mesa: fix DDY opcode for FBOs
This fixes piglit/fbo-deriv.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
f40b5723f0 st/mesa: set the centroid qualifier in fragment shader inputs
This fixes some centroid tests in the EXT_framebuffer_multisample piglit group.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
162b3ad94d st/mesa: flush the glBitmap cache before changing framebuffer state
This fixes the piglit EXT_framebuffer_multisample/bitmap tests.

Note that we must not rely on ctx->DrawBuffer when flushing the cache, because
that's already updated with a new framebuffer. We want to draw into the old
framebuffer where glBitmap was called.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:53 +02:00
Marek Olšák
07b9b3c37b st/mesa: set the correct window renderbuffer internal format
The multisample-resolve blit relies on this being correct.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:52 +02:00
Marek Olšák
5927227576 mesa: fix format checking when doing a multisample resolve
v2: make it more bullet-proof

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-23 19:23:52 +02:00
José Fonseca
c30bf68946 gallivm: Prefer the standard JIT engine whenever possible.
Testing shows that the standard JIT engine retrofited with AVX support is quite
stable and as capable to handle AVX instructions as MC-JIT is.

And the old JIT is much more memory efficient, as we don't need to
allocate one engine instance per shader, as we do for MC-JIT due to its
incompleteness.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-23 17:46:38 +01:00
Jerome Glisse
cb149bf9e1 r600g: don't emit forbidden reg with old kernel on evergreen
Fix https://bugs.freedesktop.org/show_bug.cgi?id=52313

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-23 11:42:36 -04:00
Jerome Glisse
b7b5a77ec0 r600g: don't emit forbidden register on old kernel
Fix https://bugs.freedesktop.org/show_bug.cgi?id=52313

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-07-23 11:28:25 -04:00
Vincent Lejeune
bc4b4c605c radeon/llvm: Fix a bug with IF LOGICALNZ with int operand
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-23 15:04:36 +00:00
Tom Stellard
044de40cb0 pipe_loader: Try to connect with the X server before probing pciids v2
When X is running it is neccesary for pipe_loader to authenticate with
DRM, in order to be able to use the device.

This makes it possible to run OpenCL programs while X is running.

v2:
  - Fix C++ style comments
  - Drop Xlib-xcb dependency
  - Close the X connection when done
  - Split auth code into separate function

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-07-23 13:25:36 +00:00
Tom Stellard
17f6c9195f configure.ac: Add --with-llvm-prefix option
This option allows you to specify the llvm install prefix.  It is
useful for switching between different versions of LLVM.
2012-07-23 13:25:36 +00:00
Kenneth Graunke
c3bc41011f mesa: Prevent repeated glDeleteShader() from blowing away our refcounts.
Calling glDeleteShader() should mark shaders as pending for deletion,
but shouldn't decrement the refcount every time.  Otherwise, repeated
glDeleteShader() is not safe.

This is particularly bad since glDeleteProgram() frees shaders: if you
first call glDeleteShader() on the shaders attached to the program (thus
decrementing the refcount), then called glDeleteProgram(), it would try
to free them again (decrementing the refcount another time), causing
a refcount > 0 assertion to fail.

Similar to commit d950a778.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-22 14:34:44 -07:00
Matt Turner
cfdf60f236 imports.h: Correct ceilf typo.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-22 14:06:08 -07:00
Marek Olšák
f96405f254 st/mesa: remove st_flush_bitmap wrapper
just a cleanup
2012-07-22 03:32:55 +02:00
Jordan Justen
749c9060ac mesa formats: add MESA_FORMAT_ABGR2101010_UINT
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
1c8812c244 mesa formats: unpack ARGB8888/XRGB8888
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
8c265cf5ef mesa pack: use _mesa_problem instead of assert
If the pack type is not supported, use _mesa_problem
rather than asserting.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Jordan Justen
9ad8f431b2 mesa: add glformats integer type/format detection routines
_mesa_is_integer_format is moved to formats.c and renamed
as _mesa_is_enum_format_integer.

_mesa_is_format_unsigned, _mesa_is_type_integer,
_mesa_is_type_unsigned, and _mesa_is_enum_format_or_type_integer
are added.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-21 16:49:42 -07:00
Vinson Lee
e2e7b467d8 scons: Add instrumentation component libraries to linking on llvm-3.2.
llvm-3.2svn r160587 moved createBoundsCheckingPass from
lib/Transforms/Scalar to lib/Transforms/Instrumentation.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-21 10:38:25 -07:00
Matt Turner
d24cf88a1a Remove unused _mesa_memset16
Unused since commit fd104a845.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
f58ba6ca91 Remove _mesa_inv_sqrtf in favor of 1/SQRTF
Except for a couple of explicit uses, _mesa_inv_sqrtf was disabled since
its addition in 2003 (see f9b1e524).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
948b1c541f Remove _mesa_sqrt* in favor of plain sqrt
Temporarily disabled since 2003 (see 386578c5b).

This saves us from calling sqrt() 128 times to generate the sqrttab in
one_time_init().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
Matt Turner
ec79138138 Use INV_SQRT instead of 1/SQRTF
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-21 08:23:38 -07:00
José Fonseca
bd9bf7a424 autoconf: Only kink mcjit component when available.
Should fix build failures with older LLVM version, but only tested on
LLVM 3.1.
2012-07-21 11:43:35 +01:00
Chad Versace
735070c45b i830: Fix stack corruption
Found by compiler warning:
    i830_texstate.c:131:28: warning: argument to 'sizeof' in 'memset' call
          is the same expression as the destination; did you mean to
          dereference it?  [-Wsizeof-pointer-memaccess]
       memset(state, 0, sizeof(state));
              ~~~~~            ^~~~~

On 64-bit systems, memset here would write an extra 4 bytes.

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-20 16:01:57 -07:00
José Fonseca
1a8f6ac5a4 mesa: disable MSVC global optimization in pack.c
To reduce excessive compilation time in release mode.

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Brian Paul <brianp@vmware.com>
2012-07-20 16:23:22 -06:00
Brian Paul
9fd4e9e9e6 mesa: whitespace fixes in pbo.c 2012-07-20 16:22:59 -06:00
Brian Paul
ac14f569fe mesa: update texstore.c comment 2012-07-20 15:13:19 -06:00
Roland Scheidegger
70a969f123 llvmpipe: use runtime loop instead of static loop for looping over quads
This can potentially cut shader program size by a factor of 4 for 4-wide
execution respectively 2 for 8-wide execution and while this ratios aren't
quite reached for more complex shaders it can be close.
Could not really measure a performance difference so far except for trivial
shaders (glxgears).
There seems to be a fair amount of unnecessary move's generated especially
at the beginning it might be possible to optimize those away somehow.
Things aren't quite as clean, some additional stuff needs to be done for
keeping both paths working (though llvm might be able to optimize this away).
glxgears seems to lose about 5-10% of performance, looking at the generated
shaders this is actually less than I'd think it would be - both 4 and 8-wide
shaders, despite containing a loop actually have about 10% more instructions
in total, and will have roughly 50% more executed instructions (though mostly
cheap ones). Need to figure out how to reduce overhead...

v2: keep complex interpolation for 4-wide mode, adapt to interface changes.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-20 20:17:15 +01:00
Roy Spliet
542bd6941f nv30: Support negative offsets in indirect constant access.
Fixes piglit vp-address-01 amongst several others.

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Reviewed-by: Lucas Stach <dev@lynxeye.de>
Tested-by: Lucas Stach <dev@lynxeye.de>
2012-07-20 20:31:40 +02:00
Bryan Cain
248e6f0331 nv50/ir: set position before i instead of i->next in NV50LoweringPreSSA::visit
Fixes rendering glitches in Psychonauts such as Raz's eyes flickering white.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=51962.
2012-07-20 20:30:07 +02:00
Eric Anholt
b2a44cde64 i965/gen7: Increase the WM threads to hardware limits.
This thread count is only supposed to be enabled when "WIZ Hashing Disable in
GT_MODE register enabled."  I've always been confused whether that means the
bit in the register should be 1 or 0.  For my IVB GT2's register 0x7008 value
of 0x0, this appears to work fine.

Improves l4d2 performance at 640x480 by 0.88 +/- 0.11% (n=88).  Improves
performance with rasterization at 1280x1024 by 1.45% +/- 0.36% (n=6).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-20 11:05:39 -07:00
Eric Anholt
8ab5842a6d glsl: Assign locations for uniforms in UBOs using the std140 rules.
Fixes piglit layout-std140.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:44:04 -07:00
Eric Anholt
9feb403b0e glsl: Don't resize arrays in uniform blocks.
This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:59 -07:00
Eric Anholt
0cea8a56b6 glsl: Don't dead-code eliminiate uniforms declared in uniform blocks.
This is a requirement for std140 uniform blocks, and optional for
packed/shared blocks.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:52 -07:00
Eric Anholt
548bce4733 mesa: Implement the UBO-specific pnames of glGetActiveUniformsiv.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:50 -07:00
Eric Anholt
a74507dc94 glsl: Propagate uniform block information into gl_uniform_storage.
Now we can actually return information on uniforms in uniform blocks
in the new queries.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:47 -07:00
Eric Anholt
ddc88fbf51 mesa: Add implementation of glGetUniformBlockIndex().
Now that we finally have a list of uniform blocks in the linked shader
program, we can tell what their indices are.

Fixes piglit GL_ARB_uniform_buffer_object/getuniformblockindex.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:44 -07:00
Eric Anholt
093b20666d glsl: Set the uniform_block index for the linked shader variables.
At this point in the linking, we've totally lost track of the struct
gl_uniform_buffer that this pointed to in the original unlinked
shader, so we do a nasty n^2 walk to find it the new one based on the
variable name.

Note that these point into the shader's list of gl_uniform_buffers,
not the linked program's.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:42 -07:00
Eric Anholt
9f1a4a6340 mesa: Add support for glGetActiveUniformsiv on non-UBO pnames.
We'll need to propagate the UBO fields to the uniform storage records
before we can handle the other pnames.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:40 -07:00
Eric Anholt
acfbdfcbc8 mesa: Add support for glGetUniformIndices().
This is a single entrypoint that maps from a series of names to the
indices of those names within the active uniforms list.  Each index is
like glGetUniformLocation()'s return value, except that it doesn't
encode an array offset.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:35 -07:00
Eric Anholt
abcdbdf9cc mesa: Move the _mesa_uniform_merge_location_offset to glGetUniformLocation().
With the upcoming GL_ARB_uniform_buffer_object changes, the only
other caller that will want the cooked value is state_tracker.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:33 -07:00
Eric Anholt
f609cf782a glsl: Merge the lists of uniform blocks into the linked shader program.
This attempts error-checking, but the layout isn't done yet.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:28 -07:00
Eric Anholt
b3c093c79c glsl: Translate the AST for uniform blocks into some IR structures.
We're going to need this structure to cross-validate the uniform
blocks between shader stages, since unused ir_variables might get
dropped.  It's also the place we store the RowMajor qualifier, which
is not part of the GLSL type (since that would cause a bunch of type
equality checks to fail).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:19 -07:00
Eric Anholt
f7561e8ecd glsl: Turn UBO variable declarations into ir_variables and check qualifiers.
Fixes piglit layout-*-non-uniform and layout-*-within-block.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-20 10:43:12 -07:00
Lucas Stach
cdad337fec st/xorg: fix masked transformations
Someone tried to be clever and "optimized" add_vertex_data2() to just use
two points for the texture coordinates and then reuse individual
components. Sadly this is not how matrix multiplication works.

Fixes rendercheck -t tmcoords

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-20 18:47:54 +02:00
Paul Berry
60c3e69dbf i965/blorp: Use IMS layout when texturing from depth/stencil surfaces.
Previously, on Gen7, when texturing from a depth or stencil surface,
the blorp engine would configure the 3D pipeline as though the input
surface was non-multisampled, and perform the necessary coordinate
transformations in the fragment shader to account for the IMS layout.
This meant outputting a lot of extra fragment shader code, and it
raised some uncertainty about how to deal with very large surfaces.

This patch modifies blorp to configure the 3D pipeline properly for
IMS layout when reading from depth and stencil surfaces.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
0dd5e98aa5 i965/blorp: Loosen assertions in compute_msaa_layout_for_pipeline.
Previously, on Gen7, compute_msaa_layout_for_pipeline() would verify
that IMS layout is not used.  However, now that we configure
SURFACE_STATE correctly for IMS surfaces, IMS layout is available.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
989218b980 i965/blorp: Configure SURFACE_STATE correctly for IMS surfaces.
This patch modifies gen7_set_surface_num_multisamples() to set up the
SURFACE_STATE appropriately for texturing from IMS format MSAA
surfaces (which are only used on Gen7 for depth and stencil buffers).
Since the function now sets more than just the number of multisamples,
it's been renamed to gen7_set_surface_msaa().

This will make it possible to remove some kludginess from the blorp
engine.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:38 -07:00
Paul Berry
f91b4d92b9 i965/blorp: Optimize manual_blend() for compressed multisampled surfaces.
When downsampling a compressed multisampled surface, we can take a
shortcut to downsample any pixels that were completely covered by a
single primitive.  In this case, the first color value we fetch is the
correct final color for the downsampled pixel, so we can skip the rest
of the blending operation.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
e5d983267a i965/blorp: Fix integer downsampling on Gen7.
When downsampling an integer-format buffer on Gen7, we need to use the
"avg" instruction rather than the "add" instruction, to ensure that we
don't overflow the range of 32-bit integers.  Also, we need to use the
proper register type (BRW_REGISTER_TYPE_D or BRW_REGISTER_TYPE_UD) for
intermediate color data and for writing to the render target.

Note: this patch causes blorp to use the proper register type for all
operations (downsampling, upsampling, and ordinary blits).  Strictly
speaking, this is only necessary for downsampling, because the other
operations exclusively use MOV instructions on the color data.  But
it's simpler to use the proper register type in all cases.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
b961d37e61 i965/blorp: Modify manual_blend() to avoid unnecessary loss of precision.
When downsampling from an MSAA image to a single-sampled image, it is
inevitable that some loss of numerical precision will occur, since we
have to use 32-bit floating point registers to hold the intermediate
results while blending.  However, it seems reasonable to expect that
when all samples corresponding to a given pixel have the exact same
color value, there will be no loss of precision.

Previously, we averaged samples as follows:

    blend = (((sample[0] + sample[1]) + sample[2]) + sample[3]) / 4

This had the potential to lose numerical precision when all samples
have the same color value, since ((sample[0] + sample[1]) + sample[2])
may not be precisely representable as a 32-bit float, even if the
individual samples are.

This patch changes the formula to:

    blend = ((sample[0] + sample[1]) + (sample[2] + sample[3])) / 4

This avoids any loss of precision in the event that all samples are
the same, by ensuring that each addition operation adds two equal
values.

As a side benefit, this puts the formula in the form we will need in
order to implement correct blending of integer formats.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
6a27506181 i965: Add support for AVG instruction.
From the Ivy Bridge PRM, Vol4 Part3 p152:

    "The avg instruction performs component-wise integer average of
    src0 and src1 and stores the results in dst. An integer average
    uses integer upward rounding. It is equivalent to increment one to
    the addition of src0 and src1 and then apply an arithmetic right
    shift to this intermediate value."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-20 09:35:37 -07:00
Paul Berry
9544e44262 i965: Replace fs_visitor::kill_emitted with gl_fragment_program::UsesKill.
The kill_emitted variable was duplicating the functionality of
gl_fragment_program::UsesKill.  There's no need for both.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-20 09:33:07 -07:00
Paul Berry
0f1f2ff8db mesa: Set gl_fragment_program::UsesKill in do_set_program_inouts.
Previously, the code for setting this flag for GLSL programs was
duplicated in three places: brw_link_shader(), glsl_to_tgsi_visitor,
and ir_to_mesa_visitor.  In addition to the unnecessary duplication,
there was a performance problem on i965: brw_link_shader() set the
flag before doing its final round of optimizations, which meant that
if the optimizations managed to eliminate all the discard operations,
the flag would still be set, resulting (at least in theory) in slower
performance.

This patch consolidates all of the code that sets UsesKill for GLSL
programs into do_set_program_inouts(), which already is doing a
similar job for UsesDFdy, and which occurs after i965's final round of
optimizations.

Non-GLSL programs (ARB programs and the state tracker's glBitmap
program) are unaffected.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-20 09:33:07 -07:00
Kristian Høgsberg
a8c092266e gallium-egl: Move wayland query_buffer implementation
Move it to native_wayland_drm_bufmgr_helper.c which only gets compiled when
wayland is enabled and which already includes the right headers.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 16:11:06 -04:00
Olivier Galibert
fbe3fa74e5 softpipe: Fix segfault with fbo-cubemap.
The cube sampler generates two-dimensional texture coordinates and
hence passes NULL for the array for the third one.  The actual 2D
sampler, lower in the pipe, knew not to used that array since it
didn't need it.  But the samplers have become single-texel and the
coordinate array dereference has been moved up one step, to a level
where the code does not know only two coordinates are used.  Hence the
segfault.

The simplest fix by far is to add a third dummy coordinate array in
the call to the next pipe step, which will be dereferenced to an
harmless 0 which then will be happily ignored by the sampler.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=52250

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-19 13:19:14 -06:00
Kristian Høgsberg
d7522ed130 wayland: Support EGL_WIDTH and EGL_HEIGHT queries for wl_buffer
We're going to make the public wl_buffer struct as small as possible.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kristian Høgsberg
e23bfdb329 wayland: Use existing EGL_TEXTURE_FORMAT for querying wl_buffer texture format
We also reuse EGL_TEXTURE_RGBA and EGL_TEXTURE_RGB, adding only the new
planar YUV texture formats: EGL_TEXTURE_Y_U_V_WL, EGL_TEXTURE_Y_UV_WL and
EGL_TEXTURE_Y_XUXV_WL.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kristian Høgsberg
e1b45a3c06 gallium-egl: Implement eglQueryWaylandBufferWL
Support this query for gallium EGL too.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-19 14:03:17 -04:00
Kenneth Graunke
d43f4181e1 glsl: Remove open coded version of ir_variable::interpolation_string().
Presumably the function didn't exist when we wrote this code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 11:00:00 -07:00
Paul Berry
d08fdacd58 i965: Avoid unnecessary recompiles for shaders that don't use dFdy().
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This patch avoids unnecessarily recompiling shaders that don't use
dFdy(), by only setting render_to_fbo in the wm program key if the
shader actually uses dFdy().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:25 -07:00
Paul Berry
ce1d2f08f9 glsl: Set UsesDFdy appropriately for GLSL shaders.
This patch updates the ir_set_program_inouts_visitor so that it also
sets gl_fragment_program::UsesDFdy.

This is a bit of a hack (since dFdy() isn't an input or an output),
but there's no other obvious visitor to squeeze this functionality
into, and it would be silly to create a brand new visitor just for
this purpose.

v2: use local 'fprog' var to avoid repeated casting.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:21 -07:00
Paul Berry
a0f7b86959 mesa: Set UsesDFdy appropriately for assembly programs.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:19 -07:00
Paul Berry
5e310e9f83 mesa: Add UsesDFdy to struct gl_fragment_program.
The i965 back-end needs to compile dFdy() differently for FBOs and
window system framebuffers, because Y coordinates are flipped between
the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs).
This boolean will allow it to avoid unnecessarily recompiling shaders
that don't use dFdy().

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-19 10:02:01 -07:00
Kenneth Graunke
658a63e5d9 drirc: Add disable_blend_func_extended workaround for Unigine OilRush.
The previous commit implemented the workaround, cited a bug report
about OilRush, but actually only enabled the workaround for the demos.

Turn it on for OilRush too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-19 01:40:24 -07:00
Kenneth Graunke
040894391a i965: Add a driconf option to disable GL_ARB_blend_func_extended.
Unigine Heaven (at least) has a bug where it incorrectly uses the
GL_ARB_blend_func_extended extension.

Dual source blending allows two color outputs per render target;
individual shader outputs can be assigned to be either the first or
second blending input by setting the 'index' via one of two methods:

- An API call: glBindFragDataLocationIndexed()
- The GLSL 'layout' qualifier provided by GL_ARB_explicit_attrib_location

Both of these only work on user defined fragment shader outputs; it's an
error to use either on built-in outputs like gl_FragData.

Unigine uses gl_FragData and gl_FragColor exclusively, and doesn't even
attempt to use either method to set index == 1.  However, it does set
the blending function to SRC1 enums, which requires a fragment shader
output with index == 1 or else rendering is undefined.

In other words, enabling ARB_blend_func_extended causes Unigine to
render incorrectly, resulting in an apparent regression, even though our
driver code (as far as I can tell) is perfectly fine.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50291
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-19 01:22:34 -07:00
Brian Paul
768be75c44 mesa: remove stale comment 2012-07-18 16:51:47 -06:00
Brian Paul
e4f8d33aea mesa: use gl_program cast wrappers
In a few cases, remove unneeded casts.
And fix a few other const-correctness issues.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 16:51:47 -06:00
Brian Paul
1170b5aa9f mesa: add some gl_program cast wrappers
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 16:51:47 -06:00
Marek Olšák
c3c83af380 r600g: setup streamout before calling last r600_need_cs_space before drawing
This fixes CS checker errors due to registers not being initialized, because
the flush occured after dirty state was emitted but before drawing.
2012-07-18 22:42:58 +02:00
Eric Anholt
a40c1f9522 i965/fs: Make register spill/unspill only do the regs for that instruction.
Previously, if we were spilling the result of a texture call, we would store
all 4 regs, then for each use of one of those regs as the source of an
instruction, we would unspill all 4 regs even though only one was needed.

In both lightsmark and l4d2 with my current graphics config, the shaders that
produce spilling do so on split GRFs, so this doesn't help them out.  However,
in a capture of the l4d2 shaders with a different snapshot and playing the
game instead of using a demo, it reduced one shader from 2817 instructions to
2179, due to choosing a now-cheaper texture result to spill instead of piles
of texcoords.

v2: Fix comment noted by Ken, and fix the if condition associated with it for
    the current state of what constitutes a partial write of the destination.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-07-18 12:30:06 -07:00
Eric Anholt
a454f8ec6d i965/fs.h: Refactor tests for instructions modifying a register.
There's one instance of a potential behavior change: propagate_constants may
now propagate into a part of a vgrf after a different part of it was
overwritten by a send that returns multiple registers.  I don't think we ever
generate IR that meets that condition, but it's something to note if we bisect
behavior change to this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
fc01376c50 i965/fs: Replace usage is_tex() with regs_written() checks.
In these places, we care about any sort of send that hits more than one reg,
not just textures.  We don't yet have anything else returning more than one
reg, so there's no change.

v2: Use mlen instead of is_tex() for the is-it-a-send check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
a6411520b4 i965/fs: Rename virtual_grf_next to virtual_grf_count.
"count" is a more useful name, since most of the time we're using it for
looping over the variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Eric Anholt
40cd60a315 i965/fs: Move a block out of a loop in live variables setup.
This was accidentally copy-and-pasted inside.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-18 12:30:06 -07:00
Anuj Phogat
cd5cd85a43 i965/msaa: Disable alpha-to-{coverage, one} when drawbuffer zero is in integer format
OpenGL specification 3.3 (page 196), section 4.1.3 says:
If drawbuffer zero is not NONE and the buffer it references has an
integer format, the SAMPLE_ALPHA_TO_COVERAGE and SAMPLE_ALPHA_TO_ONE
operations are skipped."
This should work properly even if there are other draw buffers that
are not in integer format.

This patch makes following piglit tests pass on mesa:
int-draw-buffers-alpha-to-coverage
int-draw-buffers-alpha-to-one

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-07-18 11:54:12 -07:00
Lucas Stach
fb18ec4f27 st/xorg: attach EDID to outputs
Allows tools like GNOME's monitor configuration to show meaningful names.

v2: fix resource leak

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:19:16 +02:00
Lucas Stach
9de16ac0a8 st/xorg: remove superfluous memset
exaDriverAlloc() uses calloc, which already initialises pExa to zero.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:19:07 +02:00
Lucas Stach
70f0eda127 st/xorg: reorder exa context creation and use screen param queries
Gives the x-server a more accurate description of the exa hardware
capabilities.

v2: drop NPOT check

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-07-18 17:18:55 +02:00
Olivier Galibert
229a1a7e4d softpipe: Take all lods into account when texture sampling.
This patch churns a lot because it needs to change 4-wide filters into
single pixel filters, since each fragment may use a different filter.

The only case not entirely supported is the anisotropic filtering.
Not sure what we want to do there, since a full quad is required by
that filter.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-18 08:02:39 -06:00
Marek Olšák
99c65bac34 r600g: implement wait-free buffer transfer for DISCARD_RANGE
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-07-18 07:16:30 +02:00
Marek Olšák
8ac9801669 r600g: accelerate buffer copying
This will be useful for efficient handling of the DISCARD transfer flags.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-07-18 06:32:57 +02:00
Marek Olšák
f237fd431b r600g: update R600_MAX_DRAW_CS_DWORDS to take draw-opaque into account 2012-07-18 06:25:37 +02:00
Marek Olšák
30257c3291 r600g: move VGT_STRMOUT_DRAW_OPAQUE_OFFSET initialization into invariant state 2012-07-18 06:25:37 +02:00
Marek Olšák
d9ba1b0beb r600g: only set the index type if drawing is indexed 2012-07-18 06:25:37 +02:00
Marek Olšák
1cfb55c509 r600g: remove debug code for streamout 2012-07-18 06:25:37 +02:00
Marek Olšák
ff9a49328e r600g: inline r600_context_draw_opaque_count 2012-07-18 06:25:37 +02:00
Marek Olšák
1b699a4832 r600g: fix alphatest without a colorbuffer on evergreen 2012-07-18 06:25:36 +02:00
Marek Olšák
82a1d24175 r600g: fix alphatest without a colorbuffer on r6xx-r7xx 2012-07-18 04:35:38 +02:00
Marek Olšák
de4fd087cb r600g: always derive alphatest state from the first colorbuffer 2012-07-18 04:17:11 +02:00
Marek Olšák
bc2f5fc01e r600g: atomize alphatest state 2012-07-18 03:45:25 +02:00
Marek Olšák
5130196c0b r600g: try to fix line stippling with lineloops
The piglit test is failing, but visually it looks almost correct.
2012-07-18 02:17:10 +02:00
Marek Olšák
43e226b6ef r600g: optimize uploading depth textures
Make it only copy the portion of a depth texture being uploaded and
not the whole 2D layer.

There is also a little code cleanup.
2012-07-18 00:32:50 +02:00
Marek Olšák
b242adbe5c r600g: remove needless wrapper r600_texture_depth_flush 2012-07-18 00:21:53 +02:00
Marek Olšák
611dd52942 r600g: init_flushed_depth_texture should be able to report errors 2012-07-18 00:21:53 +02:00
Paul Berry
e9b908b014 msaa: Generate proper error for operations prohibited on MSAA buffers.
From the GL 3.0 spec, section 4.3.3, in the documentation for
CopyPixels():

    "An INVALID_OPERATION error will be generated if the object bound
    to READ_FRAMEBUFFER_BINDING is framebuffer complete and the value
    of SAMPLE_BUFFERS is greater than zero."

The same applies to CopyTexImage...() and CopyTexSubImage...()
functions, since they are defined in terms of CopyPixels().

Previously we were generating an INVALID_FRAMEBUFFER_OPERATION error
in these cases.

Fixes piglit tests
"EXT_framebuffer_multisample/negative-{copypixels,copyteximage}".

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 14:40:01 -07:00
Brian Paul
c4d2a14d6e gallivm: silence uninitialized variable warnings 2012-07-17 14:41:29 -06:00
Marek Olšák
9d699cd845 r600g: fix lockups with and enable dual source blending on evergreen
GL_ARB_blend_func_extended is now enabled on all chipsets.
2012-07-17 21:22:15 +02:00
Marek Olšák
c26fadf195 r600g: remove unused code after conversion of sampler views 2012-07-17 21:22:15 +02:00
Marek Olšák
5d8d4252f2 r600g: convert sampler view emission into atoms
Vertex and constant buffers are emitted in the same way.
This is mainly a simplification of the code. The cleanup is in another patch.
2012-07-17 21:22:15 +02:00
Marek Olšák
7022f49b52 r600g: only make constant buffers dirty if there's something to update 2012-07-17 21:22:15 +02:00
Marek Olšák
80755ff563 r600g: properly track which textures are depth
This fixes the issue with have_depth_texture never being set to false.
2012-07-17 21:22:15 +02:00
Marek Olšák
e5de73cafd r600g: consolidate and optimize sampler states changes for evergreen
Only set sampler states which changed.
2012-07-17 21:22:14 +02:00
Marek Olšák
883c43cdd4 r600g: don't invalidate texture caches when setting sampler states
Changing sampler states doesn't change resource bindings.
2012-07-17 21:22:14 +02:00
Marek Olšák
ba48f47ebf r600g: consolidate code for setting sampler views and fix bugs in the process
Issues fixed:

- set_vs_sampler_views for evergreen is now properly implemented.

- Added the missing inval_texture_cache call for evergreen.

- have_depth_texture was sometimes incorrectly set to false on evergreen even
  if there were depth textures in other shader stages. To fix this, set it
  to true once and never set it to false again. It's stupid, but it matches
  the r600 code. The proper fix is left to another patch.

- Optimizaton: The sampler views which aren't changed aren't updated.
2012-07-17 21:22:14 +02:00
Marek Olšák
d1ca16b273 r600g: remove unused flag have_depth_fb
This is a leftover from:

commit fe1fd67556
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Jul 8 03:10:37 2012 +0200

    r600g: don't flush depth textures set as colorbuffers
2012-07-17 21:22:14 +02:00
Marek Olšák
585baac652 r600g: do fine-grained vertex buffer updates
If only some buffers are changed, the other ones don't have to re-emitted.
This uses bitmasks of enabled and dirty buffers just like
emit_constant_buffers does.
2012-07-17 21:22:14 +02:00
Marek Olšák
f4f2e8ebe1 r600g: don't call inval_shader_cache in r600_context_flush twice
It's already called in r600_constant_buffers_dirty.
2012-07-17 21:22:14 +02:00
Marek Olšák
6694a68d89 gallium/util: add util_bit_last - finds the last bit set in a word 2012-07-17 21:22:14 +02:00
Marek Olšák
018e3f75d6 r600g: fix all failing depth-stencil tests for evergreen 2012-07-17 21:22:14 +02:00
Michel Dänzer
761131ce45 configure.ac: Further LLVM fixups.
* Also add mcjit in the non-OpenCL case.
* Replace hardcoded llvm-config with $LLVM_CONFIG everywhere.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellad <thomas.stellard@amd.com>
2012-07-17 19:12:01 +02:00
Michel Dänzer
39c4bc7fdf glsl: Drop obsolete .gitignore entries.
Helps spotting and removing the obsolete generated files, which otherwise break
the build.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-07-17 18:30:32 +02:00
Tom Stellard
ed41a559dc configure.ac: Add libLLVMMCJIT to the LLVM_LDFLAGS
This is neccessary for linking the llvmpipe tests.  It appears this
dependency was introduced by the "wider native register" changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-07-17 12:08:24 -04:00
Eric Anholt
fadc9eaf97 intel: Add a comment explaining why we early return on matching BO names.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:08 -07:00
Eric Anholt
2b311fd802 intel: Drop other checks for old loader version.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:06 -07:00
Eric Anholt
1b4374d364 intel: Replace the non-getBuffersWithFormat compat path with an error message.
It's been broken (using NULL getBuffersWithFormat() instead of
getBuffers()) due to a copy and paste error for a year now.
GetBuffersWithFormat has been around since 2009, so I don't feel any
guilt in not supporting it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:04 -07:00
Eric Anholt
9bbf7c139b intel: Remove dead intel_framebuffer_has_hiz().
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:18:02 -07:00
Eric Anholt
bce58e155d intel: Convert to using private depth/stencil buffers (v2)
This means that GLX buffer sharing of these no longer works.  On the
other hand, just *look* at this code reduction.

v2:
  - [chad] Fix intelCreateBuffer for gen < 6. When the branch for
    !screen->hw_has_separate_stencil was taken,
    intel_create_private_renderbuffer was incorrectly not used.

  - [chad] Remove all code in intel_process_dri2_buffer for processing
    depth, stencil, and hiz buffers. That code is now dead.

CC: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:17:56 -07:00
Eric Anholt
433ff3e16e intel: Add a function for creating a private window system buffer.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-17 08:17:38 -07:00
Roland Scheidegger
bf484024b9 gallivm: (trivial) remove unnecessary bogus include 2012-07-17 17:11:18 +02:00
Kristian Høgsberg
2023bf996e gbm: Add gbm_bo_import for gallium gbm backend 2012-07-17 10:54:00 -04:00
Elvis Lee
1f2c87cc8f st/egl: Fix build for wayland includes
common/native_wayland_drm_bufmgr_helper.c fails to find wayland-server.h

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-17 10:54:00 -04:00
Elvis Lee
23f1e551cc st/gbm: renaming pitch to stride on gallium
commit '7250cd506baa0bd4649b30d87509cdd0cbc06a57'
changes struct gbm_bo, renaming it's 'pitch' to 'stride'.
This applies to Gallium.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-17 10:54:00 -04:00
Matt Turner
f42e601ce0 glx: build tests after libglx.la
Previously, if you ran make followed by make check it would work, but
if you just ran make check the test program would fail to compile.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-17 06:59:00 -07:00
José Fonseca
3469715a8a gallivm,draw,llvmpipe: Support wider native registers.
Squashed commit of the following:

commit 7acb7b4f60dc505af3dd00dcff744f80315d5b0e
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:46:31 2012 +0100

    draw: Don't use dynamically sized arrays.

    Not supported by MSVC.

commit 5810c28c83647612cb372d1e763fd9d7780df3cb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:44:16 2012 +0100

    gallivm,llvmpipe: Don't use expressions with PIPE_ALIGN_VAR().

    MSVC doesn't accept exceptions in _declspec(align(...)). Use a
    define instead.

commit 8aafd1457ba572a02b289b3f3411e99a3c056072
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 9 17:41:56 2012 +0100

    gallium/util: Make u_cpu_detect.h header C++ safe.

commit 5795248350771f899cfbfc1a3a58f1835eb2671d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Jul 2 12:08:01 2012 +0100

    gallium/util: Add ULL suffix to large constants.

    As suggested by Andy Furniss: it looks like some old gcc versions
    require it.

commit 4c66c22727eff92226544c7d43c4eb94de359e10
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 13:39:07 2012 +0100

    gallium/util: Truly disable INF/NAN tests on MSVC.

    Thanks to Brian for spotting this.

commit 8bce274c7fad578d7eb656d9a1413f5c0844c94e
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 13:39:07 2012 +0100

    gallium/util: Disable INF/NAN tests on MSVC.

    Somehow they are not recognized as constants.

commit 6868649cff8d7fd2e2579c28d0b74ef6dd4f9716
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 5 15:05:24 2012 +0200

    gallivm: Cleanup the 2 x 8 float -> 16 ub special path in lp_build_conv.

    No behaviour change intended, like 7b98455fb40c2df84cfd3cdb1eb7650f67c8a751.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 5147a0949c4407e8bce9e41d9859314b4a9ccf77
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jul 5 14:28:19 2012 +0200

    gallivm: (trivial) fix issues with multiple-of-4 texture fetch

    Some formats can't handle non-multiple of 4 fetches I believe, but
    everything must support length 1 and multiples of 4.
    So avoid going to scalar fetch (which is very costly) just because length
    isn't 4.
    Also extend the hack to not use shift with variable count for yuv formats to
    arbitrary length (larger than 1) - doesn't matter how many elements we
    have we always want to avoid it unless we have variable shift count
    instruction (which we should get with avx2).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 87ebcb1bd71fa4c739451ec8ca89a7f29b168c08
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jul 4 02:09:55 2012 +0200

    gallivm: (trivial) fix typo for wrap repeat mode in linear filtering aos code

    This would lead to bogus coordinates at the edges.
    (undetected by piglit because this path is only taken for block-based
    formats).

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 3a42717101b1619874c8932a580c0b9e6896b557
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue Jul 3 19:42:49 2012 +0100

    gallivm: Fix TGSI integer translation with AVX.

commit d71ff104085c196b16426081098fb0bde128ce4f
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Jun 29 15:17:41 2012 +0100

    llvmpipe: Fix LLVM JIT linear path.

    It was not working properly because it was looking at the JIT function
    before it was actually compiled.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit a94df0386213e1f5f9a6ed470c535f9688ec0a1b
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Jun 28 18:07:10 2012 +0100

    gallivm: Refactor lp_build_broadcast(_scalar) to share code.

    Doesn't really change the generated assembly, but produces more compact IR,
    and of course, makes code more consistent.

    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 66712ba2731fc029fa246d4fc477d61ab785edb5
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 27 17:30:13 2012 +0100

    gallivm: Make LLVMContextRef a singleton.

    There are any places inside LLVM that depend on it.  Too many to attempt
    to fix.

    Reviewed-by: Brian Paul <brianp@vmware.com>

commit ff5fb7897495ac263f0b069370fab701b70dccef
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 28 18:15:27 2012 +0200

    gallivm: don't use 8-wide texture fetch in aos path

    This appears to be a slight loss usually.
    There are probably several reasons for that:
    - fetching itself is scalar
    - filtering is pure int code hence needs splitting anyway, same
      for the final texel offset calculations
    - texture wrap related code, which can be done 8-wide, is slightly more
      complex with floats (with clamp_to_edge) and float operations generally
      more costly hence probably not much faster overall
    - the code needed to split when encountering different mip levels for the
      quads, adding complexity
    So, just split always for aos path (but leave it 8-wide for soa, since we
    do 8-wide filtering there when possible).
    This should certainly be revisited if we'd have avx2 support.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit ce8032b43dcd8e8d816cbab6428f54b0798f945d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 18:41:19 2012 +0200

    gallivm: (trivial) don't extract fparts variable if not needed

    Did not have any consequences but unnecessary.

commit aaa9aaed8f80dc282492f62aa583a7ee23a4c6d5
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 18:09:06 2012 +0200

    gallivm: fix precision issue in aos linear int wrap code

    now not just passes at a quick glance but also with piglit...
    If we do the wrapping with floats, we also need to set the
    weights accordingly. We can potentially end up with different
    (integer) coordinates than what the integer calculations would
    have chosen, which means the integer weights calculated previously
    in this case are completely wrong. Well at least that's what I think
    happens, at least recalculating the weights helps.
    (Some day really should refactor all the wrapping, so we do whatever is
    fastest independent of 16bit int aos or 32bit float soa filtering.)

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit fd6f18588ced7ac8e081892f3bab2916623ad7a2
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 27 11:15:53 2012 +0100

    gallium/util: Fix parsing of options with underscore.

    For example

      GALLIVM_DEBUG=no_brilinear

    which was being parsed as two options, "no" and "brilinear".

commit 09a8f809088178a03e49e409fa18f1ac89561837
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 26 15:00:14 2012 +0100

    gallivm: Added a generic lp_build_print_value which prints a LLVMValueRef.

    Updated lp_build_printf to share common code.
    Removed specific lp_build_print_vecX.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit e59bdcc2c075931bfba2a84967a5ecd1dedd6eb0
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed May 16 15:00:23 2012 +0100

    draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.

    Starting with LLVM 3.0, named structures are meant not for debugging, but
    for recursive data types, previously also known as opaque types.

    The recursive nature of these types leads to several memory management
    difficulties.  Given that we don't actually need recursive types, avoid
    them altogether.

    This is an attempt to address fdo bugs 41791 and 44466. The issue is
    somewhat random so there's no easy way to check how effective this is.

    Cherry-picked from 9af1ba565d

commit df6070f618a203c7a876d984c847cde4cbc26bdb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 27 14:42:53 2012 +0200

    gallivm: (trivial) fix typo in faster aos linear int wrap code

    no longer crashes, now REALLY tested.

commit d8f98dce452c867214e6782e86dc08562643c862
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 18:20:58 2012 +0200

    llvmpipe: (trivial) remove bogus optimization for float aos repeat wrap

    This optimization for nearest filtering on the linear path generated
    likely bogus results, and the int path didn't have any optimizations
    there since the only shader using force_nearest apparently uses
    clamp_to_edge not repeat wrap anyway.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit c4e271a0631087c795e756a5bb6b046043b5099d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 23:01:52 2012 +0200

    gallivm: faster repeat wrap for linear aos path too

    Even if we already have scaled integer coords, it's way faster to use
    the original float coord (plus some conversions) rather than use URem.
    The choice of what to do for texture wrapping is not really tied to int
    aos or float soa filtering though for some modes there can be some gains
    (because of easier weight calculations).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 1174a75b1806e92aee4264ffe0ffe7e70abbbfa3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 14:39:22 2012 +0200

    gallivm: improve npot tex wrap repeat in linear soa path

    URem gets translated into series of scalar divisions so
    just about anything else is faster.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit f849ffaa499ed96fa0efd3594fce255c7f22891b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 26 00:40:35 2012 +0100

    gallivm: (trivial) fix near-invisible shift-space typo

    I blame the keyboard.

commit 5298a0b19fe672aebeb70964c0797d5921b51cf0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 16:24:28 2012 +0200

    gallivm: add new intrinsic helper to deal with arbitrary vector length

    This helper will split vectors which are too large for the hw, or expand
    them if they are too small, so a caller of a function using intrinsics which
    uses such sizes need not split (or expand) the vectors manually and the
    function will still use the intrinsic instead of dropping back to generic
    llvm code. It can also accept scalars for use with pseudo-vector intrinsics
    (only useful for float arguments, all x86 scalar simd float intrinsics use
    4vf32).
    Only used for lp_build_min/max() for now (also added the scalar float case
    for these while there). (Other basic binary functions could use it easily,
    whereas functions with a different interface would need different helpers.)
    Expanding vectors isn't widely used, because we always try to use
    build contexts with native hw vector sizes. But it might (or not) be nicer
    if this wouldn't need to be done, the generated code should in theory stay
    the same (it does get hit by lp_build_rho though already since we
    didn't have a intrinsic for the scalar lp_build_max case before).

    v2: incorporated Brian's feedback, and also made the scalar min/max case work
        instead of crash (all scalar simd float intrinsics take 4vf32 as argument,
        probably the reason why it wasn't used before).
        Moved to lp_bld_intr based on José's request, and passing intrinsic size
        instead of length.
        Ideally we'd derive the source type info from the passed in llvm value refs
        and process some llvmtype return type so we could handle intrinsics where
        the source and destination type isn't the same (like float/int conversions,
        packing instructions) but that's a bit too complicated for now.

    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 01aa760b99ec0b2dc8ce57a43650e83f8c1becdf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 16:19:18 2012 +0200

    gallivm: (trivial) increase max code size for shader disassembly

    64kB was just short of what I needed (which caused a crash) hence
    increase to 96kB (should probably be smarter about that).

commit 74aa739138d981311ce13076388382b5e89c6562
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:53:29 2012 +0100

    gallivm: simplify aos float tex wrap repeat nearest

    just handle pot and npot the same. The previous pot handling
    ended up with exactly the same instructions plus 2 more (leave it
    in the soa path though since it is probably still cheaper there).
    While here also fix a issue which would cause a crash after an assert.

commit 0e1e755645e9e49cfaa2025191e3245ccd723564
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:29:24 2012 +0100

    gallivm: (trivial) skip floor rounding in ifloor when not signed

    This was only done for the non-sse41 case before, but even with
    sse41 this is obviously unnecessary (some callers already call
    itrunc in this case anyway but some might not).

commit 7f01a62f27dcb1d52597b24825931e88bae76f33
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 25 11:23:12 2012 +0100

    gallivm: (trivial) fix bogus comments

commit 5c85be25fd82e28490274c468ce7f3e6e8c1d416
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Jun 20 11:51:57 2012 +0100

    translate: Free elt8_func/elt16_func too.

    These were leaking.

    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit 0ad498f36fb6f7458c7cffa73b6598adceee0a6c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 19 15:55:34 2012 +0200

    gallivm: fix bug for tex wrap repeat with linear sampling in aos float path

    The comparison needs to be against length not length_minus_one, otherwise
    the max texel is never chosen (for the second coordinate).

    Fixes piglit texwrap-1D-npot-proj (and 2D/3D versions).

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit d1ad65937c5b76407dc2499b7b774ab59341209e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Jun 19 16:13:43 2012 +0200

    gallivm: simplify soa tex wrap repeat with npot textures and no mip filtering

    Similar to what is already done in aos sampling for the float path (but not
    the int path since we don't get normalized float coordinates there).
    URem is expensive and the calculation is done trivially with
    normalized floats instead (at least with sse41-capable cpus).
    (Some day should probably do the same for the mip filter path but it's much
    more complicated there hence the gain is smaller.)

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit e1e23f57ba9b910295c306d148f15643acc3fc83
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 20:38:56 2012 +0200

    llvmpipe: (trivial) remove duplicated function declaration

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 07ca57eb09e04c48a157733255427ef5de620861
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 20:37:34 2012 +0200

    llvmpipe: destroy setup variants on context destruction

    lp_delete_setup_variants() used to be called in garbage collection,
    but this no longer exists hence the setup shaders never got freed.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit ed0003c633859a45f9963a479f4c15ae0ef1dca3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 18 16:25:29 2012 +0100

    gallivm: handle different ilod parts for multiple quad sampling

    This fixes filtering when the integer part of the lod is not the same
    for all quads. I'm not fully convinced of that solution yet as it just
    splits the vector if the levels to be sampled from are different.
    But otherwise we'd need to do things like some minify steps, and getting
    mip level base address separately anyway hence it wouldn't really look
    like much of a win (and making the code even more complex).
    This should now give identical results to single quad sampling.

commit 8580ac4cfc43a64df55e84ac71ce1a774d33c0d2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 14 18:14:47 2012 +0200

    gallivm: de-duplicate sample code common to soa and aos sampling

    There doesn't seem to be any reason why this code dealing with cube face
    selection, lod and mip level calculation is separate in aos and
    soa sampling, and I am sick of having it to change in both places.

commit fb541e5f957408ce305b272100196f1e12e5b1e8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Jun 14 18:15:41 2012 +0200

    gallivm: do mip filtering with per quad lod_fpart

    This gives better results for mip filtering, though the generated code might
    not be optimal. For now it also creates some artifacts if the lod_ipart isn't
    the same for all quads, since instead of using the same mip weight for all
    quads as previously (which just caused non-smooth gradients) this now will
    use the right weights but with the wrong mip level in this case (can easily
    be seen with things like texfilt, mipmap_tunnel).
    v2: use logic helper suggested by José, and fix issue with negative lod_fpart
        values

commit f1cc84eef7d826a20fab6cd8ccef9a275ff78967
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Jun 13 18:35:25 2012 +0200

    gallivm: (trivial) fix bogus assert in lp_build_unpack_broadcast_aos_scalars

commit 7c17dbae8ae290df9ce0f50781a09e8ed640c044
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 12 12:11:14 2012 +0100

    util: Reimplement half <-> float conversions.

    Removed u_half.py used to generate the table for previous method.

    Previous implementation of float to half conversion was faulty for
    denormalised and NaNs and would require extra logic to fix,
    thus making the speedup of using tables irrelevant.

commit 7762f59274070e1dd4b546f5cb431c2eb71ae5c3
Author: James Benton <jbenton@vmware.com>
Date:   Tue Jun 12 12:12:16 2012 +0100

    tests: Updated tests to properly handle NaN for half floats.

commit fa94c135aea5911fd93d5dfb6e6f157fb40dce5e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 11 18:33:10 2012 +0200

    gallivm: do mip level calculations per quad

    This is the final piece which shouldn't change the rendering output yet.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 23cbeaddfe03c09ca18c45d28955515317ffcf4c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Jun 9 00:54:21 2012 +0200

    gallivm: do per-quad cube face selection

    Doesn't quite fix the piglit cubemap test (not sure why actually)
    but doing per-quad face selection is doing the right thing and
    definitely an improvement.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit abfb372b3702ac97ac8b5aa80ad1b94a2cc39d33
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Jun 11 18:22:59 2012 +0200

    gallivm: do all lod calculations per quad

    Still no functional change but lod is now converted to scalar after
    lod calculations.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit 519368632747ae03feb5bca9c655eccbc5b751b4
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 16:46:10 2012 +0100

    gallivm: Added support for half-float to float conversion in lp_build_conv.

    Updated various utility functions to support this change.

commit 135b4d683a4c95f7577ba27b9bffa4a6fbd2c2e7
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 16:02:46 2012 +0100

    gallivm: Added function for half-float to float conversion.

    Updated lp_build_format_aos_array to support half-float source.

commit 37d648827406a20c5007abeb177698723ed86673
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:55:18 2012 +0100

    util: Updated u_format_tests to rigidly test half-float boundary values.

commit 2ad18165d96e578aa9046df7c93cb1c3284d8c6b
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:54:16 2012 +0100

    llvmpipe: Updated lp_test_format to properly handle Inf/NaN results.

commit 78740acf25aeba8a7d146493dd5c966e22c27b73
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 14:53:30 2012 +0100

    util: Added functions for checking NaN / Inf for double and half-floats.

commit 35e9f640ae01241f9e0d67fe893bbbf564c05809
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 24 21:05:13 2012 +0200

    gallivm: Fix calculating rho for 3d textures for the single-quad case

    Discovered by accident, this looks like a very old typo bug.

commit fc1220c636326536fd0541913154e62afa7cd1d8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 24 21:04:59 2012 +0200

    gallivm: do calcs per-quad in lp_build_rho

    Still convert to scalar at the end of the function.

commit 50a887ffc550bf310a6988fa2cea5c24d38c1a41
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon May 21 23:21:50 2012 +0200

    gallivm: (trivial) return scalar in lp_build_extract_range for length 1 vectors

    Our type system on top of llvm's one doesn't generally support vectors of
    length 1, instead using scalars. So we should return a scalar from this
    function instead of having to bitcast the vector with length 1 later elsewhere.

commit 80c71c621f9391f0f9230460198d861643324876
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 17:49:15 2012 +0100

    draw: Fixed bad merge error

commit c47401cfad0c9167de20ff560654f533579f452c
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:29:30 2012 +0100

    draw: Updated store_clip to store whole vectors instead of individual elements.

commit 2d9c1ad74b0b0b41861fffcecde39f09cc27f1cf
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:28:32 2012 +0100

    gallivm: Added lp_build_fetch_rgba_aos_array.

    A version of lp_build_fetch_rgba_aos which is targeted at simple array formats.

    Reads the whole vector from memory in one, instead of reading each element
    individually.

    Tested with mesa tests and demos.

commit ff7805dc2b6ef6d8b11ec4e54aab1633aef29ac8
Author: James Benton <jbenton@vmware.com>
Date:   Tue May 22 15:27:40 2012 +0100

    gallivm: Added lp_build_pad_vector.

    This function pads a vector with undef to a desired length.

commit 701f50acef24a2791dabf4730e5b5687d6eb875d
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 17:27:19 2012 +0100

    util: Added util_format_is_array.

    This function checks whether a format description is in a simple array format.

commit 5e0a7fa543dcd009de26f34a7926674190fa6246
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 19:13:47 2012 +0100

    draw: Removed draw_llvm_translate_from and draw/draw_llvm_translate.c.

    This is "replaced" by adding an optimised path in lp_build_fetch_rgba_aos
    in an upcoming patch.

commit 8c886d6a7dd3fb464ecf031de6f747cb33e5361d
Author: James Benton <jbenton@vmware.com>
Date:   Wed May 16 15:02:31 2012 +0100

    draw: Modified store_aos to write the vector as one, not individual elements.

commit 37337f3d657e21dfd662c7b26d61cb0f8cfa6f17
Author: James Benton <jbenton@vmware.com>
Date:   Wed May 16 14:16:23 2012 +0100

    draw: Changed aos_to_soa to use lp_build_transpose_aos.

commit bd2b69ce5d5c94b067944d1dcd5df9f8e84548f1
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 19:14:27 2012 +0100

    draw: Changed soa_to_aos to use lp_build_transpose_aos.

commit 0b98a950d29a116e82ce31dfe7b82cdadb632f2b
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 18:57:45 2012 +0100

    gallivm: Added lp_build_transpose_aos which converts between aos and soa.

commit 69ea84531ad46fd145eb619ed1cedbe97dde7cb5
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 18:57:01 2012 +0100

    gallivm: Added lp_build_interleave2_half aimed at AVX unpack instructions.

commit 7a4cb1349dd35c18144ad5934525cfb9436792f9
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue May 22 11:54:14 2012 +0100

    gallivm: Fix build on Windows.

    MC-JIT not yet supported there.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit afd105fc16bb75d874e418046b80d9cc578818a1
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:17:26 2012 +0100

    llvmpipe: Added a error counter to lp_test_conv.

    Useful for keeping track of progress when fixing errors!

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit b644907d08c10a805657841330fc23db3963d59c
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:16:46 2012 +0100

    llvmpipe: Changed known failures in lp_test_conv.

    To comply with the recent fixes to lp_bld_conv.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit d7061507bd94f6468581e218e61261b79c760d4f
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:14:38 2012 +0100

    llvmpipe: Added fixed point types tests to lp_test_conv.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 146b3ea39b4726dbe125ac666bd8902ea3d6ca8c
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:26:35 2012 +0100

    llvmpipe: Changed lp_test_conv src/dst alignment to be correct.

    Now based on the define rather than a fixed number.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit f3b57441f834833a4b142a951eb98df0aa874536
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:06:44 2012 +0100

    gallivm: Fixed erroneous optimisation in lp_build_min/max.

    Previously assumed normalised was 0 to 1, but it can be -1 to 1
    if type is signed.
    Tested with lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit a0613382e5a215cd146bb277646a6b394d376ae4
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:04:49 2012 +0100

    gallivm: Compensate for lp_const_offset in lp_build_conv.

    Fixing a /*FIXME*/ to remove errors in integer conversion in lp_build_conv.
    Tested using lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit a3d2bf15ea345bc8a0664f8f441276fd566566f3
Author: James Benton <jbenton@vmware.com>
Date:   Fri May 18 16:01:25 2012 +0100

    gallivm: Fixed overflow in lp_build_clamped_float_to_unsigned_norm.

    Tested with lp_test_conv and lp_test_format, reduced errors.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit e7b1e76fe237613731fa6003b5e1601a2e506207
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 21 20:07:51 2012 +0100

    gallivm: Fix build with LLVM 2.6

    Trivial, and useful.

commit d3c6bbe5c7f5ba1976710831281ab1b6a631082d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Tue May 15 17:15:59 2012 +0100

    gallivm: Enable MCJIT/AVX with vanilla LLVM 3.1.

    Add the necessary C++ glue, so that we don't need any modifications
    to the soon to be released LLVM 3.1.

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>

commit 724a019a14d40fdbed21759a204a2bec8a315636
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 14 22:04:06 2012 +0100

    gallivm: Use HAVE_LLVM 0x0301 consistently.

commit af6991e2a3868e40ad599b46278551b794839748
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon May 14 21:49:06 2012 +0100

    gallivm: Add MCRegisterInfo.h to silence benign warnings about missing implementation.

    Trivial.

commit 6f8a1d75458daae2503a86c6b030ecc4bb494e23
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Apr 2 22:14:15 2012 -0700

    gallivm: Pass in a MCInstrInfo to createMCInstPrinter on llvm-3.1.

    llvm-3.1svn r153860 makes MCInstrInfo available to the MCInstPrinter.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 62555b6ed8760545794f83064e27cddcb3ce5284
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Tue Mar 27 21:51:17 2012 -0700

    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>

commit 6a9bd784f4ac68ad0a731dcd39e5a3c39989f2be
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Tue Mar 13 22:40:52 2012 -0700

    gallivm: Fix createOProfileJITEventListener namespace with llvm-3.1.

    llvm-3.1svn r152620 refactored the OProfile profiling code.
    createOProfileJITEventListener was moved from the llvm namespace to the
    llvm::JITEventListener namespace.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit b674955d39adae272a779be85aa1bd665de24e3e
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Mar 5 22:00:40 2012 -0800

    gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.

    llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
    MCRegisterInfo argument.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 11ab69971a8a31c62f6de74905dbf8c02884599f
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Wed Feb 29 21:20:53 2012 -0800

    Revert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."

    This reverts commit d5a6c17254.

    llvm-3.1svn r151687 makes MemoryObject accessor members const again.

    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 339960c82d2a9f5c928ee9035ed31dadb7f45537
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon May 14 16:19:56 2012 +0200

    gallivm: (trivial) fix assertion failure for mipmapped 1d textures

    In lp_build_rho, we may end up with a 1-element vector (for mipmapped 1d
    textures), but in this case we require the type to be a non-vector type,
    so need a cast.

commit 9d73edb727bd6d196030dc3026b7bf0c574b3e19
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 10 18:12:07 2012 +0200

    gallivm: prepare for per-quad lod calculations for large vectors

    to be able to handle multiple quads at once in texture sampling and still
    do lod calculations per quad, it is necessary to get the per-quad derivatives
    into the lp_build_rho function.
    Until now these derivative values were just scalars, which isn't going to work.
    So we now use vectors, and since the interface needs to change we also do some
    different (slightly more efficient) packing of the values.
    For 8-wide vectors the packed derivative values for 3 coords would look like
    this, this scales to a arbitrary (multiple of 4) vector size:
    ds1dx ds1dy dt1dx dt1dy ds2dx ds2dy dt2dx dt2dy
    dr1dx dr1dy _____ _____ dr2dx dr2dy _____ _____
    The second vector will be unused for 1d and 2d textures.
    To facilitate future changes the derivative values are put into a struct, since
    quite some functions just pass these values through.
    The generated code seems to be very slightly better for 2d textures (with
    4-wide vectors) than before with sse2 (if you have a cpu with physical 128bit
    simd units - otherwise it's probably not a win).
    v2: suggestions from José, rename variables, add comments, use swizzle helper

commit 0aa21de0d31466dac77b05c97005722e902517b8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu May 10 18:10:31 2012 +0200

    gallivm: add undefined swizzle handling to lp_build_swizzle_aos

    This is useful for vectors with "holes", it lets llvm choose the most
    efficient shuffle instructions if some elements aren't needed without having to
    worry what elements to manually pick otherwise.

commit 00faf3f370e7ce92f5ef51002b0ea42ef856e181
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri May 4 17:25:16 2012 +0100

    gallivm: Get the LLVM IR optimization passes before JIT compilation.

    MC-JIT engine compiles the module immediately on creation, so the optimization
    passes were being run too late.

    So now we create a target data layout from a string, that matches the
    ABI parameters reported by the compiler.

    The backend optimization passes were always been run, so the performance
    improvement is modest (3% on multiarb mesa demo).

    Reviewed-by: Roland Scheidegger <sroland@vmware.com>
    Reviewed-by: Brian Paul <brianp@vmware.com>

commit 40a43f4e2ce3074b5ce9027179d657ebba68800a
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed May 2 16:03:54 2012 +0200

    gallivm: (trivial) fix wrong define used in lp_build_pack2

    should fix stack-smashing crashes.

commit e6371d0f4dffad4eb3b7a9d906c23f1c88a2ab9e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Apr 30 21:25:29 2012 +0200

    gallivm: add perf warnings when not using intrinsics with 256bit vectors

    Helper functions using integer sse2 intrinsics could split the vectors with AVX
    instead of using generic fallback (which should be faster).
    We don't actually expect to hit these paths (hence don't fix them up to actually
    do the vector splitting) so just emit warnings (for those functions where it's
    obvious doing split/intrinsic is faster than using generic path).
    Only emit warnings for 256bit vectors since we _really_ don't expect to hit
    arbitrary large vectors which would affect a lot more functions.
    The warnings do not actually depend on avx since the same logic applies to
    plain sse2 too (but of course again there's _really_ no reason we should hit
    these functions with 256bit vectors without avx).

commit 8a9ea701ea7295181e846c6383bf66a5f5e47637
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:37:07 2012 +0200

    gallivm: split vectors manually for avx in lp_build_pack2 (v2)

    There's 2 reasons for this:
    First, there's a llvm bug (fixed in 3.1) which generates tons of byte
    inserts/extracts otherwise, and second, more importantly, we want to use
    pack intrinsics instead of shuffles.
    We do this in lp_build_pack2 and not the calling code (aos sample path)
    because potentially other callers might find that useful too, even if
    for larger sequences of code using non-native vector sizes it might be
    better to manually split vectors.
    This should boost texture performance in the aos path considerably.
    v2: fix issues with intrinsics types with old llvm

commit 27ac5b48fa1f2ea3efeb5248e2ce32264aba466e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:26:22 2012 +0200

    llvmpipe: refactor lp_build_pack2 (v2)

    prettify, and it's unnecessary to assert when there's no intrinsic due to
    unsupported bit width - the shuffle path will work regardless.
    In contrast lp_build_packs2, should only rely on lp_build_pack2 doing the
    clamping for element sizes for which there is a sse2 intrinsic.
    v2: fix bug spotted by Jose regarding the intrinsic type for packusdw
    on old llvm versions.

commit ddf279031f0111de4b18eaf783bdc0a1e47813c8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue May 1 20:13:59 2012 +0200

    gallivm: add src width check in lp_build_packs2()

    not doing so would skip clamping even if no sse2 pack instruction is
    available, which is incorrect (in theory only, such widths would also always
    hit a (unnecessary) assertion in lp_build_pack2().

commit e7f0ad7fe079975eae7712a6e0c54be4fae0114b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Apr 27 15:57:00 2012 +0200

    gallivm: (trivial) fix crash-causing typo for npot textures with avx

commit 28a9d7f6f655b6ec508c8a3aa6ffefc1e79793a0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Apr 25 19:38:45 2012 +0200

    gallivm: (trivial) remove code mistakenly added twice.

commit d5926537316f8ff67ad0a52e7242f7c5478d919b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Apr 24 21:16:15 2012 +0200

    gallivm: add a new avx aos sample path (v2)

    Try to avoid mixing float and int address calculations. This does texture wrap
    modes with floats, and then the offset calculations still with ints (because
    of lack of precision with floats, though we could do some effort to make it work
    with not too large (16MB) textures).
    This also handles wrap repeat mode with npot-sized textures differently than
    either the old soa or aos int path (likely way faster but untested).
    Otherwise the actual address wrap code is largely similar to the soa path (not
    quite the same as this one also has some int code), it should get used by avx
    soa sampling later as well but doesn't handle more complex address modes yet
    (this will also have the benefit that we can use aos sampling path for all
    texture address modes).
    Generated code for that looks reasonable, but still does not split vectors
    explicitly for fetch/filter which means still get hit by llvm (fixed upstream)
    which generates hundreds of pinsrb/pextrb instead of two shuffles.
    It is not obvious though if it's much of a win over just doing address calcs
    4-wide but with ints, even if it is definitely much less instructions on avx.
    piglit's texwrap seems to look exactly the same but doesn't test
    neither the non-normalized nor the npot cases.
    v2: fix comments, prettify based on Brian's and Jose's feedback.

commit bffecd22dea66fb416ecff8cffd10dd4bdb73fce
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Apr 19 01:58:29 2012 +0200

    gallivm: refactor aos lp_build_sample_image_nearest/linear

    split them up to separate address calculations and fetching/filtering.
    Need this for being able to do 8-wide float address calcs and 4-wide
    fetch/filter later (for avx). Plus the functions were very big scary monsters
    anyway (in particular lp_build_sample_image_linear).

commit a80b325c57529adddcfa367f96f03557725c4773
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Apr 16 17:17:18 2012 +0200

    gallivm: fix lp_build_resize when truncating width but expanding vector size

    Missed this case which I thought was impossible - the assertion for it was
    right after the division by zero...
    (AoS) texture sampling may ask us to do this, for things like 8 4x32int
    vectors to 1 32x8int vector conversion (eventually, we probably don't want
    this to happen).

commit f9c8337caa3eb185830d18bce8b95676a065b1d7
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sat Apr 14 18:00:59 2012 +0200

    gallivm: fix cube maps with larger vectors

    This makes the branchless cube face selection code work with larger vectors.
    Because the complexity is quite high (cannot really be improved it seems,
    per-face selection would reduce complexity a lot but this leads to errors
    unless the derivatives are calculated all from the same face which almost
    doubles the work to be done) it is still slower than the branching version,
    hence only enable this with large vectors.
    It doesn't actually do per-quad face selection yet (only makes sense with
    matching lod selection, in fact it will select the same face for all pixels
    based on the average of the first four pixels for now) but only different
    shuffles are required to make it work (the branching version actually should
    work with larger vectors too now thanks to the improved horizontal add but of
    course it cannot be extended to really select the face per-quad unless doing
    branching per quad).

commit 7780c58869fc9a00af4f23209902db7e058e8a66
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 30 21:11:12 2012 +0100

    llvmpipe: (trivial) fix compiler warning

    and also clarify comment regarding availability of popcnt instruction.

commit a266dccf477df6d29a611154e988e8895892277e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 30 14:21:07 2012 +0100

    gallivm: remove unneeded members in lp_build_sample_context

    Minor cleanup, the texture width, height, depth aren't accessed in their
    scalar form anywhere. Makes it more obvious those values should probably be
    fetched already vectorized (but this requires more invasive changes)...

commit b678c57fb474e14f05e25658c829fc04d2792fff
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 29 15:53:55 2012 +0100

    gallivm: add a helper for concatenating vectors

    Similar to the extract_range helper intended to get around slow code generated
    by llvm for 128bit insertelements.
    Concatenating two 128bit vectors this way will result in a single vinsertf128
    operation rather than two 64bit stores plus one 128bit load, though it might be
    mildly useful for other purposes as well.

commit 415ff228bcd0cf5e44a4c15350a661f0f5520029
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 19:41:15 2012 +0100

    gallivm: add a custom 2x8f->1x16ub avx conversion path

    Similar to the existing 4x4f->1x16ub sse2 path, shaves off a couple
    instructions (min/max mostly) because it relies on pack intrinsics clamping.

commit 78c08fc89f8fbcc6dba09779981b1e873e2a0299
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 18:44:07 2012 +0100

    gallivm: add avx arithmetic intrinsics

    Add all avx intrinsics for arithmetic functions (with the exception
    of the horizontal add function which needs another look).
    Seems to pass basic tests.

    Reviewed-by: José Fonseca <jfonseca@vmware.com>

commit a586caa2800aa5ce54c173f7c0d4fc48153dbc4e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 15:31:35 2012 +0100

    gallivm: add avx logic intrinsics

    Add the blend intrinsics for 8-wide float and 4-wide double vectors.
    Since we lack 256bit int instructions these are used for int vectors as well,
    though obviously not for byte or word element values.
    The comparison intrinsics aren't extended for avx since these are only used
    for pre-2.7 llvm versions.

commit 70275e4c13c89315fc2560a4c488c0e6935d5caf
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 28 00:40:53 2012 +0100

    gallivm: new helper function for extract shuffles.

    Based on José's idea as we can need that in a couple places.
    Note that such shuffles should not be used lightly, since data layout
    of <4 x i8> is different to <16 x i8> for instance, hence might cause
    data rearrangement.

commit 4d586dbae1b0c55915dda1759d2faea631c0a1c2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 27 18:27:25 2012 +0100

    gallivm: (trivial) don't overallocate shuffle variable

    using wrong define meant huge array...

commit 06b0ec1f6d665d98c135f9573ddf4ba04b2121ad
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 27 17:54:20 2012 +0100

    gallivm: don't do per-element extract/insert for vector element resize

    Instead of doing per-element extract/insert if the src vectors
    and dst vector differ in total size (which generates atrocious code)
    first change the src vectors size by using shuffles to destination
    vector size.
    We can still do better than that on AVX for packing to color buffer
    (by exploiting pack intrinsics characteristics hence eleminating the
    need for some clamps) but this already generates much better code.

    v2: incorporate feedback from José, Keith and use shuffle instead of
    bitcasts/extracts. Due to llvm deficiencies the latter cause all data
    to get moved to GPRs and back in pieces (even though the data in the
    regs actually stays the same...).

commit c9970d70e05f95d3f52fe7d2cd794176a52693aa
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 23 19:33:19 2012 +0000

    gallivm: fix bug in simple position interpolation

    Accidental use of position attribute instead of just pixel coordinates.
    Caused failures in piglit glsl-fs-ceil and glsl-fs-floor.

commit d0b6fcdb008d04d7f73d3d725615321544da5a7e
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 23 15:31:14 2012 +0000

    gallivm: fix emission of ceil opcode

    lp_build_ceil seems more appropriate than lp_build_trunc.
    This seems to be never hit though someone performs some ceil
    to floor magic.

commit d97fafed7e62ffa6bf76560a92ea246a1a26d256
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 22 11:46:52 2012 +0000

    gallivm: new vectorized path for cubemap calculations

    should be faster when adapted to multiple quads as only selection masks need to be different.
    The code is more or less a per-pixel version adapted to only do it per quad.
    A per pixel version would be much simpler (could drop 2 selects, 6 broadcasts and the messy
    horizontal add of 3 vectors at the expense of only 2 more absolute value instructions -
    would also just work for arbitary large vectors).
    This version doesn't yet work with larger vectors because the horizontal add isn't adjusted
    to be able to work with 2x4 vectors (and also because face selection wouldn't be done per
    quad just per block though that would be only a correctness issue just as with lod selection).
    The downside is this code is quite a bit slower. On a Core2 it can be sped up by disabling the
    hw blend instructions for selection and using logicop fallbacks instead, but it is still slower
    than the old code, hence leave that in for now. Probably will chose one or the other version
    based on vector length in the end.

commit b375fbb18a3fd46859b7fdd42f3e9908ea4ff9a3
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 21 14:42:29 2012 +0000

    gallivm: fix optimized occlusion query intrinsic name

commit a9ba0a3b611e48efbb0e79eb09caa85033dbe9a2
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Mar 21 16:19:43 2012 +0000

    draw,gallivm,llvmpipe: Call gallivm_verify_function everywhere.

commit f94c2238d2bc7383e088b8845b7410439a602071
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 18:54:10 2012 +0000

    gallivm: optimize calculations for cube maps a bit

    this does some more vectorized calculations and uses horizontal adds if possible.
    A definite win with sse3 otherwise it doesn't seem to make much of a difference.
    In any case this is arithmetically identical, cannot handle larger vectors.
    Should be useful as a reference point against larger vector version later...

commit 21a2c1cf3c8e1ac648ff49e59fdc0e3be77e2ebb
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 15:16:27 2012 +0000

    llvmpipe: slight optimization of occlusion queries

    using movmskps when available.
    While this is slightly better for cpus without popcnt we should
    really sum the vectors ourselves (it is also possible to cast to i4 before
    doing the popcnt but that doesn't help that much neither since llvm
    is using some optimized popcnt version for i32)

commit 5ab5a35f216619bcdf55eed52b0db275c4a06c1b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 20 13:32:11 2012 +0000

    llvmpipe: fix occlusion queries with larger vectors

    need to adjust casts etc.

commit ff95e6fdf5f16d4ef999ffcf05ea6e8c7160b0d5
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Mar 19 20:15:25 2012 +0000

    gallivm: Restore optimization passes.

commit 57b05b4b36451e351659e98946dae27be0959832
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 19:34:22 2012 +0000

    llvmpipe: use existing min2 macro

commit bc9a20e19b4f600a439f45679451f2e87cd4b299
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 19:07:27 2012 +0000

    llvmpipe: add some safeguards against really large vectors

    As per José's suggestion, prevent things from blowing up if some cpu
    would have 1024bit or larger vectors.

commit 0e2b525e5ca1c5bbaa63158bde52ad1c1564a3a9
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 18:31:08 2012 +0000

    llvmpipe: fix mask generation for uberwide vectors

    this was the only piece preventing 16-wide vectors from working
    (apart from the LP_MAX_VECTOR_WIDTH define that is), which is the maximum
    as we don't get more pixels in the fragment shader at once.
    Hence adjust that so things could be tested properly with that size
    even though there seems to be no practical value.

commit 3c8334162211c97f3a11c7f64e9e5a2a91ad9656
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 18:19:41 2012 +0000

    llvmpipe: fix the simple interpolation method with larger vectors

    so both methods actually _really_ work now. Makes textures look
    nice with larger vectors...

commit 1cb0464ef8871be1778d43b0c56adf9c06843e2d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 17:26:35 2012 +0000

    llvmpipe: fix mask generation and position interpolation with 8-wide vectors

    trivial bugs, with these things start to look somewhat reasonable.
    Textures though have some swizzling issues it seems.

commit 168277a63ef5b72542cf063c337f2d701053ff4b
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 16:04:03 2012 +0000

    llvmpipe: don't overallocate variables

    we never have more than 16 (stamp size) / 4 (minimum possible vector size).
    (With larger vectors those variables are still overallocated a bit.)

commit 409b54b30f81ed0aa9ed0b01affe15c72de9abd2
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 15:56:48 2012 +0000

    llvmpipe: add some 32f8 formats to lp_test_conv

    Also add the ability to handle different sized vectors.

commit 55dcd3af8366ebdac0af3cdb22c2588f24aa18ce
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Mon Mar 19 15:47:27 2012 +0000

    gallivm: handle different sized vectors in conversion / pack

    only fully generic path for now (extract/insert per element).

commit 9c040f78c54575fcd94a8808216cf415fe8868f6
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Sun Mar 18 00:58:28 2012 +0100

    llvmpipe: fix harmless use of unitialized values

commit 551e9d5468b92fc7d5aa2265db9a52bb1e368a36
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 16 23:31:21 2012 +0100

    gallivm: drop special path in extract_broadcast with different sized vectors

    Not needed, llvm can handle shuffles with different sized result vector just
    fine. Should hopefully generate the same code in the end, but simpler IR.

commit 44da531119ffa07a421eaa041f63607cec88f6f8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 16 23:28:49 2012 +0100

    llvmpipe: adapt interpolation for handling multiple quads at once

    this is still WIP there are actually two methods possible not quite
    sure what makes the most sense, so there's code for both for now:
    1) the iterative method as used before (compute attrib values at upper left
    corner of stamp and upper left corner of each quad initially).
    It is improved to handle more than one quad at once, and also do some more vectorized
    calculations initially for slightly better code - newer cpus have full throughput with
    4 wide float vectors, hence don't try to code up a path which might be faster if there's
    just one channel active per attribute.
    2) just do straight interpolation for each pixel.
    Method 2) is more work per quad, but less initially - if all quads are executed
    significantly more overall though. But this might change with larger vector lengths.
    This method would also be needed if we'd do some kind of active quad merging when
    operating on multiple quads at once.
    This path contains some hack to force llvm to generate better code, it is still far
    from ideal though, still generates far too many unnecessary register spills/reloads.
    Both methods should work with different sized vectors.
    Not very well tested yet, still seems to work with four-wide vectors, need changes
    elsewhere to be able to test with wider vectors.

commit be5d3e82e2fe14ad0a46529ab79f65bf2276cd28
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 16 20:59:37 2012 +0000

    draw: Cleanup.

commit f85bc12c7fbacb3de2a94e88c6cd2d5ee0ec0e8d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 16 20:43:30 2012 +0000

    gallivm: More module compilation refactoring.

commit d76f093198f2a06a93b2204857e6fea5fd0b3ece
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Mar 15 21:29:11 2012 +0000

    llvmpipe: Use gallivm_compile/free_function() in linear code.

    Should had been done before.

commit 122e1adb613ce083ad739b153ced1cde61dfc8c0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 13 14:47:10 2012 +0100

    llvmpipe: generate partial pixel mask for multiple quads

    still works with one quad, cannot be tested yet with more
    At least for now always fixed order with multiple quads.

commit 4c4f15081d75ed585a01392cd2dcce0ad10e0ea8
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 22:09:24 2012 +0100

    llvmpipe: refactor state setup a bit

    Refactor to make it easier to emit (and potentially later fetch in fs)
    coefficients for multiple attributes at once.
    Need to think more about how to make this actually happen however, the
    problem is different attributes can have different interpolation modes,
    requiring different handling in both setup and fs (though linear and
    perspective handling is close).

commit 9363e49722ff47094d688a4be6f015a03fba9c79
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 19:23:23 2012 +0100

    llvmpipe: vectorize tri offset calc

    cuts number of instructions in quad-offset-factor from 107 to 75.
    This code actually duplicated the (scalar) code calculating the determinant
    except it used different vertex order (leading to different sign but it doesn't
    matter) hence llvm could not have figured out it's the same (of course with
    determinant vectorized in the other place that wouldn't have worked any longer
    neither).
    Note this particular piece doesn't actually vectorize well, not many arithmetic
    instructions left but tons of shuffle instructions...
    Probably would need to work on n tris at a time for better vectorization.

commit 63169dcb9dd445c94605625bf86d85306e2b4297
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Mar 8 03:11:37 2012 +0100

    llvmpipe: vectorize some scalar code in setup

    reduces number of arithmetic instructions, and avoids loading
    vector x,y values twice (once as scalars once as vectors).
    Results in a reduction of instructions from 76 to 64 in fs setup for glxgears
    (16%) on a cpu with sse41.
    Since this code uses vec2 disguised as vec4, on old cpus which had physical
    64bit sse units (pre-Core2) it probably is less of a win in practice (and if
    you have no vectors you can only hope llvm eliminates the arithmetic for
    unneeded elements).

commit 732ecb877f951ab89bf503ac5e35ab8d838b58a1
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Mar 7 00:32:24 2012 +0100

    draw: fix clipping

    bug introduced by 4822fea3f0440b5205e957cd303838c3b128419c broke
    clipping pretty badly (verified with lineclip test)

commit ef5d90b86d624c152d200c7c4056f47c3c6d2688
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 6 23:38:59 2012 +0100

    draw: don't store vertex header per attribute

    storing the vertex header once per attribute is totally unnecessary.
    Some quick look at the generated assembly says llvm in fact cannot optimize
    away the additional stores (maybe due to potentially aliasing pointers
    somewhere).
    Plus, this makes the code cleaner and also allows using a vector "or"
    instead of scalar ones.

commit 6b3a5a57b0b9850854cfbd7b586e4e50102dda71
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Mar 6 19:11:01 2012 +0100

    draw: do the per-vertex "boolean" clipmask "or" with vectors

    no point extracting the values and doing it per component.
    Doesn't help that much since we still extract the values elsewhere anyway.

commit 36519caf1af40e4480251cc79a2d527350b7c61f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Fri Mar 2 22:27:01 2012 +0100

    gallivm: fix lp_build_extract_broadcast with different sized vectors

    Fix the obviously wrong argument, so it doesn't blow up.

commit 76d0ac3ad85066d6058486638013afd02b069c58
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Mar 2 12:16:23 2012 +0000

    draw: Compile per module and not per function (WIP).

    Enough to get gears w/ LLVM draw + softpipe to work on AVX doing:

      GALLIUM_DRIVER=softpipe SOFTPIPE_USE_LLVM=yes glxgears

    But still hackish -- will need to rethink and refactor this.

commit 78e32b247d2a7a771be9a1a07eb000d1e54ea8bd
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 12:01:05 2012 +0000

    llvmpipe: Remove lp_state_setup_fallback.

    Never used.

commit 6895d5e40d19b4972c361e8b83fdb7eecda3c225
Author: José Fonseca <jfonseca@vmware.com>
Date:   Mon Feb 27 19:14:27 2012 +0000

    llvmpipe: Don't emit EMMS on x86

    We already take precautions to ensure that LLVM never emits MMX code.

commit 4822fea3f0440b5205e957cd303838c3b128419c
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Feb 29 15:58:19 2012 +0100

    draw: modifications for larger vector sizes

    We want to be able to use larger vectors especially for running the vertex
    shader. With this patch we build soa vectors which might have a different
    length than 4.
    Note that aos structures really remain the same, only when aos structures
    are converted to soa potentially different sized vectors are used.
    Samplers probably don't work yet, didn't look at them.
    Testing done:
    glxgears works with both 128bit and 256bit vectors.

commit f4950fc1ea784680ab767d3dd0dce589f4e70603
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 15:51:57 2012 +0100

    gallivm: override native vector width with LP_NATIVE_VECTOR_WIDTH env var for debug

commit 6ad6dbf0c92f3bf68ae54e5f2aca035d19b76e53
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 29 15:51:24 2012 +0100

    draw: allocate storage with alignment according to native vector width

commit 7bf0e3e7c9bd2469ae7279cabf4c5229ae9880c1
Author: José Fonseca <jfonseca@vmware.com>
Date:   Fri Feb 24 19:06:08 2012 +0000

    gallivm: Fix comment grammar.

    Was missing several words. Spotted by Roland.

commit b20f1b28eb890b2fa2de44a0399b9b6a0d453c52
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 19:22:09 2012 +0000

    gallivm: Use MC-JIT on LLVM 3.1 + (i.e, SVN)

    MC-JIT

    Note: MC-JIT is still WIP. For this to work correctly it requires
    LLVM changes which are not yet upstream.

commit b1af4dfcadfc241fd4023f4c3f823a1286d452c0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 20:03:15 2012 +0100

    llvmpipe: use new lp_type_width() helper in lp_test_blend

commit 04e0a37e888237d4db2298f31973af459ef9c95f
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 19:50:34 2012 +0100

    llvmpipe: clean up lp_test_blend a little

    Using variables just sized and aligned right makes it a bit more obvious
    what's going on.
    The test still only tests vector length 4.
    For AoS anything else probably isn't going to work.
    For SoA other lengths should work (at least with floats).

commit e61c393d3ec392ddee0a3da170e985fda885a823
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:48:30 2012 +0000

    gallivm: Ensure vector width consistency.

    Instead of assuming that everything is the max native size.

commit 330081ac7bc41c5754a92825e51456d231bf84dd
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:44:14 2012 +0000

    draw: More simd vector width consistency fixes.

commit d90ca002753596269e37297e2e6c139b19f29f03
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 17:43:00 2012 +0000

    gallivm: Remove unused lp_build_int32_vec4_type() helper.

commit cae23417824d75869c202aaf897808d73a2c1db0
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Thu Feb 23 17:32:16 2012 +0100

    gallivm: use global variable for native vector width instead of define

    We do not know the simd extensions (and hence the simd width we should use)
    available at compile time.
    At least for now keep a define for maximum vector width, since a global
    variable obviously can't be used to adjust alignment of automatic stack
    variables.
    Leave the runtime-determined value at 128 for now in all cases.

commit 51270ace6349acc2c294fc6f34c025c707be538a
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 15:41:02 2012 +0000

    gallivm: Add a hunk inadvertedly lost when rebasing.

commit bf256df9cfdd0236637a455cbaece949b1253e98
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 14:24:23 2012 +0000

    llvmpipe: Use consistent vector width in depth/stencil test.

commit 5543b0901677146662c44be2cfba655fd55da94b
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 14:19:59 2012 +0000

    draw: Use a consistent the vector register width.

    Instead of 4x32 sometimes, LP_NATIVE_VECTOR_WIDTH other times.

commit eada8bbd22a3a61f549f32fe2a7e408222e5c824
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 12:08:04 2012 +0000

    gallivm: Remove garbagge collection.

    MC-JIT will require one compilation per module (as opposed to one
    compilation per function), therefore no state will be shared,
    eliminating the need to do garbagge collection.

commit 556697ea0ed72e0641851e4fbbbb862c470fd7eb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 10:33:41 2012 +0000

    gallivm: Move all native target initialization to lp_set_target_options().

commit c518e8f3f2649d5dc265403511fab4bcbe2cc5c8
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:52:32 2012 +0000

    llvmpipe: Create one gallivm instance for each test.

commit 90f10af8920ec6be6f2b1e7365cfc477a0cb111d
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:48:08 2012 +0000

    gallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().

    Brittle, complex, and unecesary. Just use function pointer constant.

commit 98fde550b33401e3fe006af59db4db628bcbf476
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:21:26 2012 +0000

    gallivm: Add a lp_build_const_func_pointer() helper.

    To be reused in all places where we want to call C code.

commit 6cfedadb62c2ce5af8d75969bc95a607f3ece118
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 09:44:41 2012 +0000

    gallivm: Cleanup/simplify lp_build_const_string_variable.

    - Move to lp_bld_const where it belongs
    - Rename to lp_build_const_string
    - take the length from the argument (and don't count the zero terminator twice)
    - bitcast the constant to generic i8 *

commit db1d4018c0f1fa682a9da93c032977659adfb68c
Author: José Fonseca <jfonseca@vmware.com>
Date:   Thu Feb 23 11:52:17 2012 +0000

    gallivm: Set NoFramePointerElimNonLeaf to true where supported.

commit 088614164aa915baaa5044fede728aa898483183
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Wed Feb 22 19:38:47 2012 +0100

    llvmpipe: pass in/out pointers rather scalar floats in lp_bld_arit

    we don't want llvm to potentially optimize away the vectors (though it doesn't
    seem to currently), plus we want to be able to handle in/out vectors of arbitrary
    length.

commit 3f5c4e04af8a7592fdffa54938a277c34ae76b51
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Feb 21 23:22:55 2012 +0100

    gallivm: fix lp_build_sqrt() for vector length 1

    since we optimize away vectors with length 1 need to emit intrinsic
    without vector type.

commit 79d94e5f93ed8ba6757b97e2026722ea31d32c06
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 22 17:00:46 2012 +0000

    llvmpipe: Remove lp_test_round.

commit 81f41b5aeb3f4126e06453cfc78990086b85b78d
Author: Roland Scheidegger <sroland@vmware.com>
Date:   Tue Feb 21 23:56:24 2012 +0100

    llvmpipe: subsume lp_test_round into lp_test_arit

    Much simpler, and since the arguments aren't passed as 128bit values can run
    on any arch.
    This also uses the float instead of the double versions of the c functions
    (which probably was the intention anyway).
    In contrast to lp_test_round the output is much less verbose however.
    Tested vector width of 32 to 512 bits - all pass except 32 (length 1) which
    crashes in lp_build_sqrt() due to wrong type.

    Signed-off-by: José Fonseca <jfonseca@vmware.com>

commit 945b338b421defbd274481d8c4f7e0910fd0e7eb
Author: José Fonseca <jfonseca@vmware.com>
Date:   Wed Feb 22 09:55:03 2012 +0000

    gallivm: Centralize the function compilation logic.

    This simplifies a lot of code.

    Also doing this in a central place will make it easier to carry out the
    changes necessary to use MC-JIT in the future.

gallivm: Fix typo in explicit derivative shuffle.

Trivial.

draw: make DEBUG_STORE work again

adapt to lp_build_printf() interface changes

Reviewed-by: José Fonseca <jfonseca@vmware.com>

draw: get rid of vecnf_from_scalar()

just use lp_build_broadcast directly (cannot assign a name but don't really
need it, vecnf_from_scalar() was producing much uglier IR due to using
repeated insertelement instead of insertelement+shuffle).

Reviewed-by: José Fonseca <jfonseca@vmware.com>

llvmpipe: fix typo in complex interpolation code

Fixes position interpolation when using complex mode
(piglit fp-fragment-position and similar)

Reviewed-by: José Fonseca <jfonseca@vmware.com>

draw: fix clipvertex/position storing again

This appears to be the result of a bad merge.
Fixes piglit tests relying on clipping, like a lot of the interpolation tests.

Reviewed-by: José Fonseca <jfonseca@vmware.com>

gallivm: Fix explicit derivative manipulation.

Same counter variable was being used in two nested loops. Use more
meanigful variable names for the counter to fix and avoid this.

gallivm: Prevent buffer overflow in repeat wrap mode for NPOT.

Based on Roland's patch, discussion, and review .

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: Fix dims for TGSI_TEXTURE_1D in emit_tex.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: Fix explicit volume texture derivatives.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

gallivm: fix 1d shadow texture sampling

Always r coordinate is used, hence need 3 coords not two
(the second one is unused).

Reviewed-by: José Fonseca <jfonseca@vmware.com>

gallivm: Enable AVX support without MCJIT, where available.

For now, this just enables AVX on Windows for testing.  If the code is
stable then we might consider prefering the old JIT wherever possible.

No change elsewhere.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-17 13:42:39 +01:00
José Fonseca
ba9c1773d7 gallivm: Allow to force nearest filtering on a per-axis basis.
Experimental code, not really used yet.
2012-07-17 13:42:39 +01:00
Kristian Høgsberg
b262f56738 wayland: Include wl_drm format enum in wayland-drm.h
This gets referenced before we get to generate the header files, so just include the
enum that we need and don't include the generated header.
2012-07-17 08:30:39 -04:00
James Benton
e253175c9c llvmpipe: Fix bug with blend factor in complementary optimisations.
Fixes fdo 52168.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-17 13:16:38 +01:00
Christian König
89e755d762 radeonsi: fix vertex element state
The vertex element state isn't in registers any more, so
remove that old code. That fixes a memory corruption with
the blend state and gets eglgears partially working.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2012-07-17 10:44:12 +02:00
Christian König
4247fd9928 radeon/llvm: fix compiling when llvm is active, but opencl isn't
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-17 10:43:53 +02:00
Brian Paul
aa0becdbb6 mesa: include inttypes.h to get uint8_t type
To fix MSVC build.
2012-07-16 16:12:02 -06:00
Brian Paul
fe2a7b7e7f st/egl: fix uninitialized pointer bug
If no format is matched in the loop the value of xconf was undefined.

NOTE: This is a candidate for the 8.0 branch.
2012-07-16 16:03:31 -06:00
Brian Paul
2f92a9f721 r300g: silence uninitialized var warning 2012-07-16 16:03:31 -06:00
Elvis Lee
cf775c9cbf egl_dri2: NULL check for EGLNativeWindowType
Some application calls eglCreateWindowSurface with
EGLNativeWindowType parameter having zero value. It causes SEGV
and disturbs error handling like EGL_NO_SURFACE.

Signed-off-by: Elvis Lee <kwangwoong.lee@lge.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-07-16 16:03:31 -06:00
Jon TURNEY
d80fd04639 Fix building mesa with assembly enabled since a112ca5d
a112ca5d rather crassly smashed all the compiler flags together into AM_CFLAGS.
Separate them out the way they were before, putting pre-processor flags into
AM_CPPFLAGS, so assembly source gets preprocessed with the correct pre-processor
flags as well.

Also, remove unneeded CFLAGS from AM_CFLAGS, and CXXFLAGS from AM_CXXFLAGS

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tested-by: Brian Paul <brianp@vmware.com>
2012-07-16 22:54:36 +01:00
Chad Versace
8dc074cd92 intel: Fix build broken by ETC1 patch
I suck at resolving merge conflicts and broke the build in a5a34b1.
This patch adds the missing field intel_mipmap_tree::wraps_etc1.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:29:24 -07:00
Chad Versace
a5a34b153d intel: Enable GL_OES_compressed_ETC1_RGB8_texture
Enable it for all hardware.

No current hardware supports ETC1, so this patch implements it by
translating the ETC1 data to RGBX data during the call to
glCompressedTexImage2D(). For details, see the doxygen for
intel_mipmap_tree::wraps_etc1.

Passes the Piglit test spec/OES_compressed_ETC1_RGB8_texture/miptree and
the ETC1 test in the GLES2 conformance suite.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:11:12 -07:00
Chad Versace
8ec721264c mesa: Add function for decoding ETC1 textures
Add function _mesa_etc1_unpack_rgba8888. It is intended to be used by
glCompressedTexSubImage2D to decode ETC1 textures into RGBA.

CC: Chia-I <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:07:57 -07:00
Chad Versace
d7458e401e gallium/util, mesa: Refactor etc1 unpack function
Move the body of util_etc1_rgb8_unpack_rgba_unorm8 into a new function
that can be shared between gallium and dri drivers,
texcompress_etc_tmp.h:etc1_unpack_rgba8888.

CC: Chia-I <olv@lunarg.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-16 14:07:57 -07:00
Kristian Høgsberg
7250cd506b gbm: Rename gbm_bo_get_pitch to gbm_bo_get_stride
We use pitch for 'pixels per row' and stride for 'bytes per row' pretty
consistently in mesa and most other places, so rename the gbm API.
2012-07-16 16:29:16 -04:00
Kristian Høgsberg
44f066b9ff gbm: Add new gbm_bo_import entry point
This generalizes and replaces gbm_bo_create_for_egl_image.  gbm_bo_import
will create a gbm_bo from either an EGLImage or a struct wl_buffer.
2012-07-16 16:29:15 -04:00
Roland Scheidegger
43ccded1e1 llvmpipe: destroy setup variants on context destruction
lp_delete_setup_variants() used to be called in garbage collection,
but this no longer exists hence the setup shaders never got freed.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-16 19:00:54 +01:00
James Benton
8684ffc141 llvmpipe: Unified common code between AoS and SoA blending.
Added a new file lp_bld_blend.c for the common code.
Merged and added some simple optimisations.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-07-16 19:00:54 +01:00
Kristian Høgsberg
636646a481 intel: Don't call _mesa_get_format_bytes for MESA_FORMAT_NONE
When we don't intend to texture from or render to a __DRIimage we
use __DRI_IMAGE_FORMAT_NONE.  In that case, we just create the __DRIimage
to reference the underlying buffer, and will create usable __DRIimages
from it using createSubImage later.

If we try to use _mesa_get_format_bytes() on MESA_FORMAT_NONE in
a debug build, we hit an assertion, so let's not do that.
2012-07-16 11:00:16 -04:00
Jon TURNEY
81de0431d6 Fix building glsl when using automake-1.12 after 68e04cc6
Commit 68e04cc6 was tested using automake-1.11.  Unfortunately, automake-1.12
made a "slightly backward-incompatible change" in the use of yacc with C++, and
for a .yy file, the generated header file is now named .hh, not .h

To work with both, write our own rule for running yacc, which generates a
header file named .h, rather than using automake's rule.

Also, remove things from BUILD_SOURCES which don't need to be there

Also, update EXCLUDE rules in doxygen/glsl.doxy, for change of generated files
from .cpp -> .cc, and glsl_lexer.h has never existed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-15 15:27:26 +01:00
Marek Olšák
bc6bff7947 r600g: compute needed CS space for vertex buffers correctly 2012-07-15 15:26:14 +02:00
Marek Olšák
15ca9d159e r600g: don't check the R600_GLSL130 env var
GLSL 1.3 has been enabled by default for quite a while.
2012-07-15 02:16:46 +02:00
Jerome Glisse
e634651024 r600g: fix DB decompression on evergreen
Separated out of the hyperz patch by Marek with minor modifications.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:06:44 +02:00
Tom Stellard
c2f444c54d r600g: Emit vertex buffers using the same method as constant buffers
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:00:27 +02:00
Tom Stellard
9b76ee70b2 r600g: Unify 3D and compute vertex buffer emission
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-15 02:00:21 +02:00
Marek Olšák
0b4c5dbb8c r600g: fix grammar constant_buffer -> constant_buffers 2012-07-15 01:41:11 +02:00
Andreas Boll
e3ff4d4c10 radeon/llvm: Fix CR/LF in AMDILSIDevice.h 2012-07-13 16:35:22 +00:00
Tom Stellard
cc3907856e radeon/llvm: Clean up AMDILIntrinsicInfo.cpp 2012-07-13 16:29:46 +00:00
Tom Stellard
f323c6260d radeon/llvm: Coding style fixes 2012-07-13 16:29:46 +00:00
Jon TURNEY
39d82a1b20 Fix linking gallium drivers and with dricore after defadf2b1
Commit defadf2b1 erroneously tries to make gallium drivers link with libdricore
as a static library, not a shared library

Also, change uses of DRI_LIB_DEPS in gallium driver Makefiles to
GALLIUM_DRI_LIB_DEPS, so the libraries added are used in the linking the gallium
driver

Also, fix the path to the libdricore.so symlink, it's made in LIB_DIR, not in
the libdricore directory

Also repair quoting of dricore settings of DRI_LIB_DEPS and GALLIUM_DRI_LIB_DEPS
variables so VERSION is interpolated in configure but TOP and LIB_DIR are
interpolated later (where they are known, but VERSION isn't)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-13 17:20:39 +01:00
Christoph Bumiller
9ed65301e0 nouveau: implement missing timer query functionality 2012-07-13 17:28:00 +02:00
Kristian Høgsberg
426a23af14 wayland: Stop trying to use make rules from aclocal, just copy and paste
Defeated by autotool, copy and paste to the rescue.

https://bugs.freedesktop.org/show_bug.cgi?id=51997
https://bugs.freedesktop.org/show_bug.cgi?id=51531

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-13 11:20:17 -04:00
José Fonseca
b3ba0a7afa mesa/st: Generates TGSI that always recognizes INSTANCEID/VERTEXID as integers.
Tested by running piglit draw-instanced, and by forcing llvmpipe advertise no native
integer support, which now produces:

VERT
DCL IN[0]
DCL SV[0], INSTANCEID
DCL OUT[0], POSITION
DCL OUT[1], COLOR
DCL CONST[0..19]
DCL TEMP[0], LOCAL
DCL TEMP[1], LOCAL
DCL TEMP[2], LOCAL
DCL ADDR[0]
  0: U2F TEMP[0].x, SV[0]
  1: ARL ADDR[0].x, TEMP[0].xxxx
  2: MOV TEMP[1].xy, CONST[ADDR[0].x+8].xyxx
  3: ADD TEMP[2].x, IN[0].xxxx, TEMP[1].xxxx
  4: ADD TEMP[1].x, IN[0].yyyy, TEMP[1].yyyy
  5: MUL TEMP[2], CONST[16], TEMP[2].xxxx
  6: MAD TEMP[2], CONST[17], TEMP[1].xxxx, TEMP[2]
  7: MAD TEMP[2], CONST[18], IN[0].zzzz, TEMP[2]
  8: MAD TEMP[2], CONST[19], IN[0].wwww, TEMP[2]
  9: ARL ADDR[0].x, TEMP[0].xxxx
 10: MOV TEMP[1], CONST[ADDR[0].x]
 11: MOV OUT[0], TEMP[2]
 12: MOV OUT[1], TEMP[1]
 13: END
2012-07-13 13:01:52 +01:00
José Fonseca
6dddd18480 draw,gallivm: Fix draw_get_shader_param.
- Use LLVM limits when LLVM is being used, instead of TGSI limits
- Provide draw_get_shader_param_no_llvm for when llvm is never used (softpipe)
- Eliminate several of the hacks around draw shader caps in several drivers

Unfortunately the hack for PIPE_MAX_VERTEX_SAMPLERS is still necessary.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-13 13:01:51 +01:00
Jon TURNEY
99728076ec Don't explicitly link libOsmesa with libmesa's dependency libglsl
The libmesa convenience library is linked with the libglsl convenience
library.  libOsmesa is linked with libmesa, and also directly with libglsl.
When using libtool, this gives rise to duplicate symbol errors.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:44 +01:00
Jon TURNEY
b2a37e242e automake: convert libglapi
* "configure substitutions are not allowed in _SOURCES variables" in automake,
so remove the AC_SUBST'ed GLAPI_ASM_SOURCES and instead use some AM_CONDITIONALS
to choose which asm sources are used

* Change GLAPI_LIB to point to the .la file in other Makefile.am files, and make a link
to the .a file for the convenience of other Makefiles which have not yet been converted
to automake

v2:
- Use AM_CPPFLAGS for cleaner build output
- EXTRA_SOURCES is not needed
- Remove libglapi.a compatibility link on clean

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:07 +01:00
Jon TURNEY
1e48dfeee6 Rename X86-64_API -> X86_64_API
automake doesn't allow hyphens in variable names

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:05 +01:00
Jon TURNEY
defadf2b15 Link dri drivers with mesa or dricore libtool library
Now mesa/drivers/dri is converted to automake, we want to update DRI_LIB_DEPS
so that we link with the libmesa or libdricore libtool library, as appropriate.

However, this is complicated by the fact that gallium/targets is not (yet)
converted, so we can't share the DRI_LIB_DEPS autoconf variable with that anymore.

Add an additional autoconf variable GALLIUM_DRI_LIB_DEPS, which is now used in
gallium/targets/Makefile.dri, to link with the libdircore or libmesa native library.

v2: libdricore$VERSION.a needs to be libdricore$(VERSION).a

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:03 +01:00
Jon TURNEY
cf362d00b9 Remove unused MESA_MODULES autoconf variable
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:44:01 +01:00
Jon TURNEY
a112ca5d5f automake: convert libmesa and libmesagallium
* "configure substitutions are not allowed in _SOURCES variables" in automake, so instead of
MESA_ASM_FILES, use some AM_CONDITIONALS to choose which architecture's asm sources are used
in libmesa_la_SOURCES. (Can't remove MESA_ASM_FILES autoconf variable as it's still used in
sources.mak)

* Update to link with the .la file in other Makefile.am files, and make a link to the
.a file for the convenience of other Makefiles which have not yet been converted to automake

v2: Remove stray -static from LDFLAGS
v3: Remove .a compatibility link on clean

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:58 +01:00
Jon TURNEY
8676890018 Rename sparc/clip.S -> sparc/sparc_clip.S
Automake can't handle having both clip.S and clip.c, even though they have different paths

"src/mesa/Makefile.am: object `clip.lo' created by `$(SRCDIR)/sparc/clip.S' and `$(SRCDIR)/main/clip.c'"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:56 +01:00
Jon TURNEY
68e04cc601 automake: convert libglsl
v2: Use AM_V_GEN to silence generated code rules. Add BUILT_SOURCES to CLEANFILES
v3:
- Fix an accidental // in a path
- Use automake make rules for lex/yacc rather than writing our own
- Update .gitignore appropriately
- Build a libglcpp convenience library rather than awkwardly including
the files in libglsl and delegating the generation
- Remove libglsl.a compatibility link on clean
v4:
- Automake's rules for lex/yacc make .cc if source is .ll or .yy, and apparently we
must use those extensions "because of scons", so update everywhere glsl_parser.cpp
-> glsl_parser.cc and glsl_lexer.cpp -> glsl_lexer.cc. This fixes 'make tarballs'
and building with dricore enabled.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:41 +01:00
Laurent Carlier
284325d97b automake: convert libOSmesa
This also currently fix the installation of libOSmesa.

v2: Remove old Makefile, libOSmesa is now versioned, fix typos
v3: Keep config substitution alphabetized
v4: Update .gitignore
v5: Libraries will be in the builddir, not the srcdir.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Matt Turner <mattst88@gmail.com>
2012-07-13 12:43:39 +01:00
Marek Olšák
1a06e8454e mesa,st/mesa: implement GL_RGB565 from ARB_ES2_compatibility
This was not implemented, because the spec was changed just recently.

Everything has been in place already.

Gallium has PIPE_FORMAT_B5G6R5_UNORM, while Mesa has MESA_FORMAT_RGB565.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-13 01:36:07 +02:00
Kenneth Graunke
fe911c1d43 i965: Move loop over texture units into brw_populate_sampler_prog_key.
The whole reason I avoided this was because it might operate on a
brw_vertex_program or a brw_fragment_program.  However, that isn't a
problem: all we need is the gl_program base type.

This avoids awkwardly passing the loop counter 'i' as a parameter,
simplifies both callers, and also plumbs prog in place for future use.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 14:17:44 -07:00
Kenneth Graunke
86e401b771 i965: Always emit alpha when nr_color_buffers == 0.
If alpha-testing is enabled, we need to send alpha down the pipeline
even if nr_color_buffers == 0.  However, tracking whether alpha-testing
is enabled in the WM program key is expensive: it causes us to compile
multiple specializations of the same shader, using program cache space.

This patch removes the check for alpha-testing, and simply emits alpha
whenever nr_color_buffers == 0.  We believe this will also be necessary
for alpha-to-coverage, and it should add minimal overhead to an uncommon
case.  Saving the recompiles should more than make up the difference.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 13:35:46 -07:00
Kenneth Graunke
16060531ba i965: Use the blitter in intel_bufferobj_subdata for busy BOs on Gen6+.
Previously we only did this pre-Gen6, and used pwrite on Gen6+.
In one workload, this cuts significant amount of overhead.

v2: Simplify the function based on Eric's suggestions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-12 13:35:46 -07:00
José Fonseca
978807ef01 gallivm: Use %.9g to print floats.
So that we can see them in their full denormalized glory.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-12 21:14:35 +01:00
José Fonseca
5b8d80a783 scons: Remove -ffast-math.
We rely on proper IEEE 754 behavior in too many places for this.

See also commit 2fdbbeca43 with equivalent
change for autoconf.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-12 21:14:29 +01:00
José Fonseca
bd3aab8d79 scons: Also require recent XCB.
And don't trip when it's not found -- simply skip building src/glx.
2012-07-12 21:13:10 +01:00
Eric Anholt
6882381a2e mesa: Require current libxcb.
Without that, people with buggy apps that looked at just the server
string for GLX_ARB_create_context would call this function that just
threw an error when you tried to make a context.  Google shows plenty
of complaints about this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 12:29:12 -07:00
Tom Stellard
f92873be2c radeon/llvm: Don't use lp_build_swizzle_aos() for swizzles
This function assumes that lp_build_context::type is a vector type,
which is not true for r600 or radeonsi.

This fixes an assertion failure using glamor 2D accel.
2012-07-12 13:53:22 -04:00
Tom Stellard
185fc9a5ef radeonsi: Dump TGSI code prior to doing TGSI->LLVM conversion.
This way if the conversion fails, we know what the TGSI shader looks
like.
2012-07-12 13:53:22 -04:00
Kenneth Graunke
b546aebae9 i965: Delete previous workaround for textureGrad with shadow samplers.
It had many problems:
- The shadow comparison was done post-filtering.
- It required state-dependent recompiles whenever the comparison
  function changed.
- It didn't even work: many cases hit assertion failures.
- I never implemented it for the VS.

The new lowering pass which converts textureGrad to textureLod by
computing the LOD value works much better.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:26 -07:00
Kenneth Graunke
b0c8d3be73 i965: Add a lowering pass to convert TXD to TXL by computing the LOD.
Intel hardware doesn't natively support textureGrad with shadow
comparisons.  So we need to generate code to handle it somehow.

Based on the equations of page 205 of the OpenGL 3.0 specification,
it's possible to compute the LOD value that would be selected given the
gradient values.  Then, we can simply convert the TXD to a TXL.

Currently, this passes 34/46 of oglconform's shadow-grad subtests;
four cubemap tests are regressed.  We should investigate this in the
future.

v2: Apply abs() to the scalar case (thanks to Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:23 -07:00
Kenneth Graunke
d9da350a83 glsl/ir_builder: Add a new swizzle_for_size() function.
This swizzles away unwanted components, while preserving the order of
the ones that remain.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:20 -07:00
Kenneth Graunke
0bb3d4ba54 glsl/ir_builder: Add a generic constructor for unary expressions.
I needed to compute logs and square roots in a patch I was working on,
and wanted to use the convenient interface.  We already have a similar
constructor for binops; adding one for unops seems reasonable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:20:18 -07:00
Kenneth Graunke
b656df990f glsl: Initialize coordinate to NULL in ir_texture constructor.
I ran into this while trying to create a TXS query, which doesn't have a
coordinate.  Since it didn't get initialized to NULL, a bunch of
visitors tried to access it and crashed.

Most of the time, this won't be a problem, but it's just a good idea.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-12 10:19:38 -07:00
José Fonseca
d9a8cd76e5 st/xorg: Fix build failure due to symbol clash. 2012-07-12 16:02:49 +01:00
Marek Olšák
0f3659bb56 docs: update relnotes-8.1 and GL3 status 2012-07-12 13:05:59 +02:00
Marek Olšák
63d8c8baa9 st/mesa: expose new transform feedback extensions 2012-07-12 13:05:59 +02:00
Marek Olšák
d24ece97e5 mesa: add ARB_transform_feedback_instanced extension enable flag
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
db7404defd mesa: implement new DrawTransformFeedback functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
7e0cb473b0 mesa: implement display list support for new DrawTransformFeedback functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
ce16ca4635 mesa: implement display list support for indexed query functions
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:59 +02:00
Marek Olšák
553e13dbc2 mesa: implement indexed query functions from ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
375e73d859 mesa: implement glGet queries and error handling for ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
21cb5ed20d glsl: implement ARB_transform_feedback3 in the linker
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
9576d555e0 glapi: add ARB_transform_feedback_instanced
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
6d13d91f4e glapi: add ARB_transform_feedback3
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-12 13:05:58 +02:00
Marek Olšák
e773a48a3b r600g: fix uploading non-zero mipmap levels of depth textures
This fixes piglit/depth-level-clamp.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
fe1fd67556 r600g: don't flush depth textures set as colorbuffers
The only case a depth buffer can be set as a color buffer is when flushing.

That wasn't always the case, but now this code isn't required anymore.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
6842d5fced r600g: don't set dirty_db_mask for a flushed depth texture
A flush depth texture is never set as a depth buffer and never flushed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
5a17d8318e r600g: flush depth textures bound to vertex shaders
This was missing/broken. There are also minor code cleanups.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:31 +02:00
Marek Olšák
dee58f94af r600g: do fine-grained depth texture flushing
- maintain a mask of which mipmap levels are dirty (instead of one big flag)
- only flush what was requested at a given point and not the whole resource
  (most often only one level and one layer has to be flushed)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
df79eb5956 r600g: remove is_flush from DSA state
we can just update the state when decompressing, there's no need to add
additional info into the DSA state

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
43e3f19c76 r600g: set DISABLE in CB_COLOR_CONTROL if colormask is 0
this will be useful for in-place DB decompression, otherwise should be harmless

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
4fe74412cf r600g: move CB_SHADER_MASK setup into cb_misc_state
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a1a1ff5ec0 r600g: move MULTIWRITE setup into cb_misc_state for r6xx-r7xx
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
0ea76916e6 r600g: move CB_TARGET_MASK setup into new cb_misc_state
to remove some overhead from draw_vbo. This is a derived state.

BTW, I've got no idea how compute interacts with 3D here, but it should
use cb_misc_state, so that 3D and compute don't conflict.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
5ba15d8d38 st/mesa: implement accelerated stencil blitting using shader stencil export
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a7f3697eb8 st/mesa: set colormask to zero when blitting depth
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
5a74e17ab0 gallium/u_blit: remove useless memset calls
the structure is calloc'd.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
24e0a26335 gallium/u_blit: drop not-very-useful wrapper around util_blit_pixels_writemask
just rename it to util_blit_pixels

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
3f13b5da15 gallium/u_blit: don't do two copies for non-2D textures
Because u_blit couldn't sample a 1D, 3D, CUBE and ARRAY texture, we created
a 2D texture holding a copy of one slice of the source texture (even for 1D).

Let's just do it right.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
2dca61bcb3 gallium/util: move pipe_tex_to_tgsi_tex helper function into u_inlines
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
bdaf0a085b gallium/u_blitter: accelerate stencil-only copying
This doesn't seem to be used by anything yet, but better safe than sorry.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
12fd81f9e7 gallium/u_blitter: accelerate depth-stencil copying using shader stencil export
This fixes stencil buffer write transfers on r600g.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
76db2c121c gallium: add util_format_stencil_only helper function
used for stencil sampler views.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
a730838a42 gallium/u_blitter: minify depth0 when initializing last_layer
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
91cf9fe988 gallium/u_gen_mipmap: accelerate depth texture mipmap generation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Marek Olšák
13b0af721a mesa: remove assertions that do not allow compressed 2D_ARRAY textures
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-07-12 02:08:30 +02:00
Paul Berry
33202b4876 i965/msaa: Enable CMS layout on Gen7 for the formats that support it.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:50 -07:00
Paul Berry
4ebbc76621 i965/msaa: Add CMS support to blorp.
This patch updates the blorp engine to properly handle the case where
the surface being textured from uses Gen7's CMS MSAA layout.  The
following changes were necessary:

- Before reading color values from the surface, we need to read from
  the MCS buffer using the ld_mcs sampler message.  This is done by
  the mcs_fetch() function, and the result is stored in the mcs_data
  register.  This only needs to be done once per pixel, since the MCS
  value is shared between all samples belonging to a pixel.

- When reading color values from the surface, we need to use the
  ld2dms sampler message instead of the ld2dss message, and we need to
  provide the value read from the MCS buffer as an argument.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
754953693d i965/msaa: Add CMS-related sampler messages to brw_defines.h.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
7b3263af69 i965/msaa: Set SURFACE_STATE properly when CMS MSAA is in use.
When a buffer using Gen7's CMS MSAA layout is bound to a texture or a
render target, the SURFACE_STATE structure needs to point to the MCS
buffer and to indicate its pitch.  This patch updates the functions
that emit SURFACE_STATE to handle CMS layout properly.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
0ba813506d i965/msaa: Add CMS MSAA settings to brw_structs.h.
Previously the DWORD used to control the CMS MSAA layout was just a
pad value, because we didn't use it.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
ccae1b1cd7 i965/msaa: Allocate MCS buffer when CMS MSAA is in use.
To implement Gen7's CMS MSAA layout, we need an extra buffer, the MCS
(Multisample Control Surface) buffer.  This patch introduces code for
allocating and deallocating the buffer, and storing a pointer to it in
the intel_mipmap_tree struct.

No functional change, since the CMS layout is not enabled yet.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
1bd4d456cd i965/msaa: Add an enum to describe MSAA layout.
From the Ivy Bridge PRM, Vol 1 Part 1, p112:

    There are three types of multisampled surface layouts designated
    as follows:
      - IMS Interleaved Multisampled Surface
      - CMS Compressed Mulitsampled Surface
      - UMS Uncompressed Multisampled Surface

Previously, the i965 driver only used IMS and UMS formats, and
distinguished beetween them using the boolean
intel_mipmap_tree::msaa_is_interleaved.  To facilitate adding support
for the CMS format, this patch replaces that boolean (and other
booleans derived from it) with an enum
INTEL_MSAA_LAYOUT_{IMS,CMS,UMS}.  It also updates the terminology used
in comments throughout the driver to match the IMS/CMS/UMS terminology
used in the PRM.  CMS layout is not yet used.

The enum has a fourth possible value, INTEL_MSAA_LAYOUT_NONE, which is
used for non-multisampled surfaces.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Paul Berry
67b0f7c7dd i965/msaa: Move {rt,tex}_interleaved into blorp program key.
On Gen6, MSAA buffers always use an interleaved layout and non-MSAA
buffers always use a non-interleaved layout, so it is not strictly
necessary to keep track of the layout of the texture and render target
surfaces in the blorp program key.  However, it is cleaner to do so,
since (a) it makes the blorp compiler less dependent on implicit
knowledge about how the GPU pipeline is configured, and (b) it paves
the way for implementing compressed multisampled surfaces in Gen7.

This patch won't cause any redundant compiles, because the layout of
the texture and render target surfaces depends on other parameters
that are already in the blorp program key.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-11 15:14:49 -07:00
Kristian Høgsberg
2adfce4a18 mapi: Move GL_NV_draw_buffers extension to es_EXT.xml
We don't generate public entrypoints for GLES extensions, so move the
GL_NV_draw_buffers definition from ARB_draw_buffers.xml to es_EXT.xml.
When the extension is defined in ARB_draw_buffers.xml, we end up with a
public entry point for it, but no prototype, which gives an error when
compiled with --disable-asm and --disable-shared-glapi.

Instead, just move the GLES extension to es_EXT.xml so this doesn't happen.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:36 -04:00
Kristian Høgsberg
e6a33570b7 egl: Add EGL_WAYLAND_PLANE_WL attribute
This lets us specify the plane to create the image for for multiplanar
wl_buffers.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:36 -04:00
Kristian Høgsberg
1aaec8c609 wayland-drm: Add protocol to create planar buffers 2012-07-11 15:28:35 -04:00
Kristian Høgsberg
379eb47ea6 wayland-drm: Pass struct wl_drm_buffer to the driver
We're going to extend this to support multi-plane buffers, so pass this
to the driver so it can access the details.
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
95bc0527e9 intel: Implement __DRIimage::createSubImage and bump supported version to 5
We use the new miptree offset to pick out the sub-image when we bind
the EGLImage to a texture.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
02ebad900d intel: Add offset field to miptree
This lets us specify an offset into the bo where the miptree starts,
which will let us set up a texture for a single plane in a planar buffer.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 15:28:35 -04:00
Kristian Høgsberg
44a2b57f93 intel: Add support for new __DRIimage formats 2012-07-11 15:28:34 -04:00
Kristian Høgsberg
c029834808 __DRIimage: version 5, add new formats and createSubImage
The additions in version 5 enables creating EGLImages for different planes
of a YUV buffer.  createImageFromName is still used to create the containing
__DRIimage, and createSubImage can then be used no that __DRIimage to create
__DRIimages that correspond to the y, u, and v planes (__DRI_IMAGE_FORMAT_R8)
or the uv planes (__DRI_IMAGE_FORMAT_RG88) for formats such as NV12 where
the u and v components are interleaved.  Packed formats such as YUYV etc
doesn't require any special treatment, we just sample those as a regular
ARGB texture.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-11 15:28:34 -04:00
Tom Stellard
c0f7fe7b79 r600g/compute: Disable growing the memory pool
The code for growing the memory pool (which is used for storing all of
the global buffers) wasn't working.  There seem to be two separate issues
with the memory pool code.  The first was the way it was growing the pool.
When the memory pool needed more space, it would:

1. Copy the data from the memory pool's backing texture to system memory.
2. Delete the memory pool's texture
3. Create a bigger backing texture for the memory pool.
4. Copy the data from system memory into the bigger texture.

The copy operations didn't seem to be working, and I suspect that since
they were using fragment shaders to do the copy, that there might have
been a problem with the mixing of compute and 3D state.

The other issue is that the size of 1D textures is limited, and I was
having trouble getting 2D textures to work.

I think these problems will be easier to solve once more code is shared
between 3D and compute, which is why I decided to disable it for now
rather than continue searching for a fix.
2012-07-11 17:53:54 +00:00
Tom Stellard
49ae102ee3 radeon/llvm: Use multiclasses for floating point loads
The original strategy for handling floating point loads, which was to
lower (f32 load) to (f32 bitcast (i32 load)) wasn't really working.  The
main problem was that the DAG legalizer couldn't handle replacing a node
with two results (load) with a node with only one result (bitcast).
2012-07-11 17:47:20 +00:00
Tom Stellard
bbdf3af857 radeon/llvm: Don't set the IMM bit in SMRD instruction definitions.
The IMM bit is already being set in SICodeEmitter.
2012-07-11 17:47:20 +00:00
Tom Stellard
d36499aa62 r600g/compute: Add more debugging output 2012-07-11 17:46:59 +00:00
Eric Anholt
f9b3e257d1 i965: Revert the VBOs-in-system-memory hack.
It didn't change performance on Lightsmark or Nexuiz, which both used
DYNAMIC_DRAW buffers, but it was killing performance (40% CPU wasted pwriting
buffers) on a closed-source app we're looking at.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 09:20:21 -07:00
Eric Anholt
b5c037f6b1 Add emacs setup for the docs/devinfo.html comment wrapping recommendation.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-11 09:20:21 -07:00
Ian Romanick
a8724d85f8 glx/dri2: Add support for GLX_ARB_create_context_robustness
Add the infrastructure required for this extension.  There is no
xserver support and no driver support yet.  Drivers can enable this be
advertising DRI2 version 4 and accepting the
__DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS flag and the
__DRI_CTX_ATTRIB_RESET_STRATEGY attribute in create context.

Some additional Mesa infrastructure is needed before drivers can do
this.  The GL_ARB_robustness spec, which all Mesa drivers already
advertise, requires:

    "If the behavior is LOSE_CONTEXT_ON_RESET_ARB, a graphics reset
    will result in the loss of all context state, requiring the
    recreation of all associated objects."

It is necessary to land this infrastructure now so that the related
infrastructure can land in the xserver.  The xserver has very long
release schedules, and the remaining Mesa parts should land long, long
before the next xserver merge window opens.

v2: Expose robustness as a DRI2 extension rather than bumping
__DRI_DRI2_VERSION.

v3: Add a comment explaining why dri2->base.version >= 3 is also
required for GLX_ARB_create_context_robustness.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-11 08:54:50 -07:00
Ian Romanick
de9ed51525 dri2: Hard-code the DRI2 version
This allows revising the dri_interface.h separately from adding driver
support.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 08:54:50 -07:00
Ian Romanick
2879f758b5 glapi: Apply Xorg indent rules to all files generated for the xserver
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-11 08:54:50 -07:00
Kenneth Graunke
a0698b000b docs: Update GL3.txt.
We neglected to list the deprecation model/forward compatible context
support.

inverse() has been done for a while.

None of us know what "highp change" means; GLSL 1.30 already added the
ability to recognize precision keywords, and it doesn't look like 1.40
has any new requirements there (precision keywords still have no meaning).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-10 16:53:49 -07:00
Chad Versace
551078bb62 mesa: Remove unneeded extern qualifiers
Remove 'extern' from the functions declared in texcompress_etc.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-10 16:51:19 -07:00
Vadim Girlin
3770847960 r600g: improve flushed depth texture handling v2
Use r600_resource_texture::flished_depth_texture for GPU access, and
allocate it in the VRAM. For transfers we'll allocate texture in the GTT
and store it in the r600_transfer::staging.

Improves performance when flushed depth texture is frequently used by the
GPU, e.g. in Lightsmark (~30%)

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-07-11 02:39:59 +04:00
Kenneth Graunke
860d5bdf98 i965: Add hardware context support.
With fixes and updates from Ben Widawsky and comments from Paul Berry.

v2: Use drm_intel_gem_context_destroy to destroy hardware context;
    remove useless initialization of hw_ctx, both suggested by Eric.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Acked-by: Paul Berry <stereotype441@gmail.com>
2012-07-10 15:09:58 -07:00
Ian Romanick
4fae5e32d5 mesa/test: Update name of GL_TIME_ELAPSED
4952caa caused the _EXT to fall off the name of this enum.  This is
fine.  Update the unit test to expect the new value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51956
2012-07-10 14:46:25 -07:00
Andreas Boll
40742fa686 docs/relnotes-8.0.4: fix html markup 2012-07-10 12:59:34 -07:00
Marek Olšák
67a8ee891b gallium/docs: document interface changes for timestamp query
the query type is already documented
2012-07-10 19:04:13 +02:00
Marek Olšák
a3fccafda9 identity: implement get_timestamp 2012-07-10 19:04:13 +02:00
Marek Olšák
e66d90ec6b noop: implement get_timestamp 2012-07-10 19:04:13 +02:00
Marek Olšák
642539e3f9 trace: implement get_timestamp 2012-07-10 19:04:12 +02:00
Marek Olšák
a471d268ec galahad: implement get_timestamp 2012-07-10 19:04:12 +02:00
Marek Olšák
768589e836 docs: update relnotes-8.1 and GL3 status 2012-07-10 19:04:12 +02:00
Marek Olšák
5ddcda060c softpipe: implement get_timestamp and expose ARB_timer_query
PIPE_QUERY_TIMESTAMP is already implemented and working.
2012-07-10 19:04:12 +02:00
Marek Olšák
21f78d2189 st/mesa: implement ARB_timer_query 2012-07-10 19:04:12 +02:00
Marek Olšák
bcc735aaca gallium: add QUERY_TIMESTAMP cap and get_timestamp screen function 2012-07-10 19:04:12 +02:00
Marek Olšák
d5a7866902 mesa: implement glGet(GL_TIMESTAMP) v2
This is adds a new driver function to retrieve the timestamp.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-10 19:04:12 +02:00
Marek Olšák
5094533040 mesa: add ARB_timer_query to the extension list
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
204777c5dc mesa: add QueryCounter display list support
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
f601dcdf70 mesa: implement TIMESTAMP query and glQueryCounter
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Marek Olšák
4952caad2d glapi: add ARB_timer_query
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-10 19:04:12 +02:00
Ian Romanick
25fec2e9ca docs: Add 8.0.4 release notes
Also add news story.  Extra, extra!  Read all about it!

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-10 09:05:39 -07:00
Eric Anholt
2d03f48a65 glsl: Add parsing for GLSL uniform blocks.
This doesn't do anything with the uniform block declarations yet, so
usage of those uniforms finds them to be undeclared.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:13:33 -07:00
Eric Anholt
912a429bc5 glsl: Don't hide the type of struct_declaration_list.
I've been trying to derive from this for UBO support, and the slightly
obfuscated types were putting me over the edge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:12:18 -07:00
Kenneth Graunke
532e99cbf2 glcpp: Add built-in #define for GL_ARB_uniform_buffer_object.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-09 11:11:59 -07:00
Vincent Lejeune
7fabb2b593 glsl: Parser handles "#extension GL_ARB_uniform_buffer_object"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:11:38 -07:00
Eric Anholt
f4fb6bf088 glsl: Reduce a bit of extra code in the merging of layout qualifiers.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:05:33 -07:00
Eric Anholt
60a784d56e glsl: Take advantage of the layout qualifier flags union to clean up parsing.
The got_one variable was set iff one of the bits in flags.i was set.

v2: Fix incorrect dropping of the ARB_conservative_depth warning.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-07-09 11:04:45 -07:00
Tom Stellard
9b00edc79a r600g: Don't create a texture for the memory_pool during screen init
This fixes a segfault in r600_screen_create() introduced by
eb065f5d9d

Reported by tilman on irc.
2012-07-09 12:14:07 -04:00
Tom Stellard
76b44034b9 radeon/llvm: Rename namespace from AMDIL to AMDGPU 2012-07-09 13:43:11 +00:00
Tom Stellard
39323e8f79 r600g: Update number of gprs when adding a vertex instruction 2012-07-09 13:42:24 +00:00
Tom Stellard
da9c8a73ec r600g/compute: Use evergreen_cb() for binding RATs 2012-07-09 13:41:18 +00:00
Tom Stellard
960906d16b r600g: Add support for RATs in evergreen_cb() 2012-07-09 13:41:18 +00:00
Tom Stellard
eb065f5d9d r600g: Use a texture as the underlying resource for compute_memory_pool
This the first step towards being able to use evergreen_cb to bind RATs.
2012-07-09 13:41:18 +00:00
Tom Stellard
9d36441374 r600g: Add is_rat flag to r600_resource_texture 2012-07-09 13:41:18 +00:00
Tom Stellard
3d3194e93c r600g: Add r600_context_pipe_state_emit()
This function is used when dispatching compute shader in order to avoid
mixing compute and 3D registers in the context's dirty list.  This
allows the compute code to resuse 3D functions like evergreen_cb, which
return a struct r600_pipe_state and still have control over when and how
the register writes are emitted.
2012-07-09 13:41:17 +00:00
Tom Stellard
e00e1586dd r600g: Add pkt_flag parameter to r600_context_block_emit_dirty()
This allows the shader type bit to be set in the pm4 header when
emitting registers for compute shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
25145de03e r600g/compute: Move LOOP_CONST initialization to start_compute_cs atom 2012-07-09 13:41:17 +00:00
Tom Stellard
5016fe2d47 r600g: Add start_compute_cs atom to struct r600_context
The start_compute_cs atom initializes some config and context registers
to the values needed for running compute shaders.  When a compute shader
is dispatched, this atom is emitted after the start_cs_cmd atom, which
initializes registers that are common to both 3D and compute.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
38be0966c7 r600g: Add pkt_flag member to struct r600_command_buffer
Some packets require the shader type bit (bit 1) to be set when
used for compute shaders.  The pkt_flag will be initialized to
RADEON_CP_PACKET3_COMPUTE_MODE for any struct r600_command_buffer used
for dispatching compute shaders and it will be or'd against the result of
the PKT3 macro when adding a new packet to a struct r600_command buffer.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-07-09 13:41:17 +00:00
Tom Stellard
7d0c17fe74 r600g: Only emit start_cs_cmd atom once for compute command streams 2012-07-09 13:41:17 +00:00
Marek Olšák
0a21b561c7 r600g: fix stencil texturing with Z32_FLOAT_S8X24_UINT 2012-07-09 13:58:00 +02:00
Marek Olšák
a460df9299 r600g: add assertions after translate_colorswap/colorformat/dbformat/texformat 2012-07-09 13:57:59 +02:00
Marek Olšák
c1e8c845ea r600g: inline r600_hw_copy_region 2012-07-09 13:57:59 +02:00
Marek Olšák
9974e9ac5d r600g: enable dual src blending on r7xx
No lockups here.
2012-07-09 13:57:59 +02:00
Marek Olšák
6657a7af61 r600g: use depth format from pipe_surface, not pipe_resource 2012-07-09 13:57:59 +02:00
Marek Olšák
b278aba423 r600g: use u_box_origin_2d helper function 2012-07-09 13:57:59 +02:00
Marek Olšák
1f50f463eb gallium/u_blitter: consolidate some state changes 2012-07-09 13:57:59 +02:00
Marek Olšák
22d032707e r600g: remove stray semicolon 2012-07-07 15:09:57 +02:00
Marek Olšák
461e9f99c7 docs: document ARB_blend_func_extended and EXT_texture_rg in relnotes-8.1
also sort the extensions
2012-07-07 15:09:57 +02:00
Eric Anholt
1e28f55ab7 i965/fs: Invalidate live intervals after copy propagation.
For copy propgation, we've dropped the use of a GRF in favor of a
(probably later) use of a different GRF.  This definitely requires
invalidating intervals.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:33 -07:00
Eric Anholt
2343fe9a5d i965/fs: Invalidate live intervals in passes that remove an instruction.
Since live intervals are based on ip, removing an instruction trashes
the intervals unless we were to go do some surgery.  These happen to
usually remove a use of a grf, so it's time to recalculate, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 release branch.
2012-07-06 14:20:33 -07:00
Eric Anholt
25ca9cc823 i965/vs: Move the other two src_reg/dst_reg constructors to brw_vec4.cpp.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:33 -07:00
Eric Anholt
b2f5d4c3ec i965/vs: Move class functions to brw_vec4.cpp.
This has less impact than for the FS (4k savings), because it was partially
done already, but makes things more consistent.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:32 -07:00
Eric Anholt
fe27916ddf i965/fs: Move class functions from the header to .cpp files.
Cuts compile time for brw_fs.h changes from 2.7s to .7s and reduces
i965_dri.so size by 70k.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-06 14:20:32 -07:00
José Fonseca
8b1f1900d1 galahad: Check that texture format is supported. 2012-07-06 20:38:41 +01:00
José Fonseca
ff8ddf399a galahad: More detailed resource checks. 2012-07-06 20:22:29 +01:00
José Fonseca
f8e13e6d69 galahad: Fix zealous warnings. 2012-07-06 20:12:56 +01:00
José Fonseca
7bd926af89 galahad: Enumerate all methods that are missing. 2012-07-06 19:13:44 +01:00
José Fonseca
3d2550be9c galahad: Implement render_condition. 2012-07-06 18:45:14 +01:00
José Fonseca
5b45775e41 galahad: Don't implement context methods that are not implemented by the underlying pipe driver. 2012-07-06 18:38:51 +01:00
José Fonseca
3cb994afca galahad: Use debug_printf.
stderr is not visible on windows.
2012-07-06 18:38:39 +01:00
José Fonseca
1abb070633 galahad: Silence creation messages.
Let galahad warnings be true warnings.
2012-07-06 18:37:48 +01:00
José Fonseca
d78dee1671 galahad: Use reference counting when destroying the wraped objects.
As the wrapped pipe driver may hold internal references.
2012-07-06 18:35:44 +01:00
José Fonseca
fe602da63f galahad: Point to the galahad objects from the galahad sampler view.
And not the wraped driver's objects.
2012-07-06 18:35:32 +01:00
José Fonseca
04d29afb8b galahad: Don't defer index buffer when it's NULL. 2012-07-06 17:02:39 +01:00
José Fonseca
232073b0d9 target-helpers: Enable debug helpers only on debug builds.
Some of these helpers use debug_get_option, which works also on releases.
2012-07-06 15:05:16 +01:00
Marek Olšák
c445b0f76d st/mesa: only expose ARB_shader_bit_encoding with GLSL 1.3
I don't think it's possible or even useful to use the extension with GLSL 1.2.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-06 00:45:38 +02:00
Kristian Høgsberg
5f5746a692 egl_dri2: Reorganize the EGLImage constructors to share more code
We factor out all the EGL book-keeping into dri2_create_image() and
simplify the wayland case by using dupImage.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
1bb15c0a08 intel: Share common __DRIimage allocation code
We have the same switch and allocation code in two places.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
454fc07dde intel: Just look up image->internal_format using _mesa_get_format_base_format
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:07 -04:00
Kristian Høgsberg
e408c17767 intel: Remove unused __DRIimage::data_type field
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-05 14:22:06 -04:00
Brian Paul
bbe92dc608 svga: whitespace fixes 2012-07-05 08:07:26 -06:00
Brian Paul
76a6801240 Revert "mesa: #define fprintf to be __mingw_fprintf() on Mingw32"
This reverts commit cbffaf20e9.

Use the PRIx64 macro in the fprintf() call instead, as suggested
by Dylan Noblesmith.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:26 -06:00
Brian Paul
df2d81ea59 mesa: use the PRIx64 macro for printing 64-bit hexadecimal values
We'll revert the #define fprintf __mingw_fprintf change next.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:25 -06:00
Brian Paul
1ab37a2284 svga: implement TGSI_OPCODE_ROUND
ROUND and TRUNC are implemented with one function to reduce code duplication.
Note: ROUND isn't actually used yet, but probably will be soon.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:07:03 -06:00
Brian Paul
d594f72e16 svga: fix CMP translation for vertex shaders
Converting CMP to SLT+LRP didn't work when src2 or src3 was Inf/NaN.
That's the case for GLSL sqrt(0).  sqrt(0) actually happens in many
piglit auto-generated tests that use the distance() function.

v2: remove debug/devel code, per Jose

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
30f8575fde svga: properly implement TRUNC instruction
Was previously implemented with FLOOR.
Fixes quite a few piglit tests of float->int conversion, integer
division, etc.

v2: clean up left over debug/devel code, per Jose

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
0bd3a75de9 svga: fix register collision issue in emit_conditional()
If the 'dst' register is the same as the 'pass' register we'll generate
invalid code.  Use a temporary register in that case.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-07-05 08:03:19 -06:00
Brian Paul
9b3d87b092 svga: emit some debug messages when shader compilation fails 2012-07-05 07:59:20 -06:00
Eric Anholt
33526a2ffe intel: Fix a comment typo. 2012-07-04 13:59:14 -07:00
Gwenole Beauchesne
69f031cc19 mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x. 2012-07-04 15:26:22 -04:00
Kristian Høgsberg
3ed8d42853 GLES2: upgrade gl2ext.h to version 18099
Redo this commit, and remove the inclusion of gl2ext.h
from src/mapi/glapi/glapi_priv.h.  The include was added in
8f3be33985 to fix a missing prototype for
glDrawBuffersNV and others, but it's not possible to include both
glext.h and gl2ext.h from the same file.

I don't see the missing prototype here (with or without shared glapi)
so I'm just removing the offending #include.

Also, since we're redoing this, update to the most recent gl2ext.2.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-07-04 15:26:22 -04:00
Olivier Galibert
e620f3e763 mesa/st: gl_ClipDistance must be interpolated in 3d space.
That old bug was hidden but the clipper always interpolating in 3d space
no matter what it should have been doing.  Now that the interpolation
has been fixed, the bug shows up.

Fixes fdo 51364.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-07-04 10:47:14 +01:00
Stuart Abercrombie
95ce454c8c gallium/util: Save and restore vertex buffer state in util_gen_mipmap.
Calling glGenerateMipmap could overwrite vertex buffer state, leading
 to incorrect rendering or crashes depending on the Gallium driver.

This was happening on WebGL Conformance test texture-size.

Before 784dd51198 this was covered up
by redundant vertex buffer validation.

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-07-04 03:48:29 +02:00
Marek Olšák
567fcd2eb9 Revert "GLES2: upgrade gl2ext.h to version 16994."
This reverts commit 8818b88748.

I get a lot of errors like this one:

In file included from ../../../src/mapi/glapi/glapi_priv.h:49:0,
                 from glapi_dispatch.c:40:
../../../include/GLES2/gl2ext.h:1074:28: error: redefinition of typedef ‘PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC’
../../../include/GL/glext.h:10237:25: note: previous declaration of ‘PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC’ was here

This with a clean build (with git clean -fdX).

I don't get the errors on my other machine. I didn't investigate why,
a wild guess is that this depends on the version of gcc.
2012-07-04 01:40:05 +02:00
Marek Olšák
2668aaa557 Revert "mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x."
This reverts commit d1665388ce.
2012-07-04 01:39:52 +02:00
Gwenole Beauchesne
d1665388ce mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x. 2012-07-03 16:23:38 -04:00
Gwenole Beauchesne
8818b88748 GLES2: upgrade gl2ext.h to version 16994. 2012-07-03 16:23:38 -04:00
Eric Anholt
dd4282e38f i965/fs: Allow copy propagation on uniforms.
This is a big win for savage2, hon and yofrankie.  62 new programs for
savage2/hon get 16-wide mode, along with one for humus demos and two
for tropics.  Even a few shaders from tropics see reductions of 15% or
more.

total instructions in shared programs: 216536 -> 207353 (-4.24%)
instructions in affected programs:     123941 -> 114758 (-7.41%)

In benchmarking Tropics, only a .040% +/- 034% performance improvement
was observed (n=90).  Rather disappointing, but I was primarily
motivated to do this patch by a regression in the number of 16-wide
shaders compiled after a GRF texturing on IVB patch I'm working on.
Hopefully this helps avoid that regression.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:57:10 -07:00
Eric Anholt
0c4630bae0 i965/fs: Allow copy propagation with source modifiers.
This shaves a few instructions off of a ton of programs.  For 12
shaders from tropics and sanctuary, it's enough reduction in register
pressure to get 16-wide mode.  7 shaders from heroes of newerth and
savage2 are hurt by about 1.1%, where copy propagation of negates ends
up preventing coalescing, but we could regain that by doing dataflow
analysis in our copy propagation.

No significant performance difference in tropics (n=11)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:57:04 -07:00
Eric Anholt
458f7f0141 i965/fs: Move copy propagation test out to a separate function.
It's going to get more complicated in a moment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-03 12:55:47 -07:00
Ian Romanick
5fb178ee43 glx/tests: Fix off-by-one error in allocating extension string buffer
NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50621
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=418161
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Markus Oehme <oehme.markus@gmx.de>
2012-07-03 12:28:45 -07:00
Brian Paul
1853f467c6 glsl: fix unop/binop errors in comments 2012-07-03 09:42:59 -06:00
Paul Berry
f34764ea53 msaa: Make meta-ops save and restore state of GL_MULTISAMPLE.
The meta-ops _mesa_meta_Clear() and _mesa_meta_glsl_Clear() need to
ignore the state of GL_SAMPLE_ALPHA_TO_COVERAGE,
GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
and GL_SAMPLE_COVERAGE_INVERT when clearing multisampled buffers.  The
easiest way to accomplish this is to disable GL_MULTISAMPLE during the
clear meta-ops.

Note: this patch also causes GL_MULTISAMPLE to be disabled during
_mesa_meta_GenerateMipmap() and _mesa_meta_GetTexImage() (since those
two meta-ops use MESA_META_ALL).  Arguably this isn't strictly
necessary, since those meta-ops use their own non-MSAA fbo's, but it
shouldn't do any harm.

Fixes Piglit tests "EXT_framebuffer_multisample/clear {2,4}
{color,stencil}" on i965.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-07-02 14:09:27 -07:00
Paul Berry
8313f44409 i965/msaa: Fix centroid interpolation of unlit pixels.
From the Ivy Bridge PRM, Vol 2 Part 1 p280-281 (3DSTATE_WM:
Barycentric Interpolation Mode):

    "Errata: When Centroid Barycentric mode is required, HW may
    produce incorrect interpolation results when a 2X2 pixels have
    unlit pixels."

To work around this problem, after doing centroid interpolation, we
replace the centroid-interpolated values for unlit pixels with
non-centroid-interpolated values (which are interpolated at pixel
centers).  This produces correct rendering at the expense of a slight
increase in shader execution time.

I've conditioned the workaround with a runtime flag
(brw->needs_unlit_centroid_workaround) in the hopes that we won't need
it in future chip generations.

Fixes piglit tests "EXT_framebuffer_multisample/interpolation {2,4}
{centroid-deriv,centroid-deriv-disabled}".  All MSAA interpolation
tests pass now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 13:27:36 -07:00
Paul Berry
3f929efa28 i965/fs: Add FS_OPCODE_MOV_DISPATCH_TO_FLAGS to fragment shader backend.
In order to compute centroid varyings correctly, the fragment shader
needs to be able to load the current pixel/sample mask into a flag
register.  This patch adds an opcode to the fragment shader back-end
to do this; the opcode gets translated into the instruction

mov(1)  f0<1>UW  g1.14<0,1,0>UW  { align1 WE_all }

Since this instruction clobbers f0, instruction scheduling has to
treat it the same as instructions that have a conditional modifier.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 13:27:36 -07:00
Jordan Justen
8aa78c104a i965: fix transform feedback with primitive restart
When querying GL_PRIMITIVES_GENERATED, if primitive restart
is also used, then take the software primitive restart
path so GL_PRIMITIVES_GENERATED is returned correctly.

GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN is also updated
since it will also affected by the same issue.

As noted in brw_primitive_restart.c, with further work we
should be able to move this situation back to a hardware
handled path.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:42:48 -07:00
Kenneth Graunke
14311ef3f2 i965: Re-enable rendering to SNORM formats.
Commit d73f6375f5 fixed the cause of the Piglit failure with
ARB_color_buffer_float fragment clamp modes.  Now that it's fixed,
there's no reason to leave snorm format rendering disabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:23:37 -07:00
Kenneth Graunke
b1802a2115 glsl: Remove unused ir_loop_jump::loop pointer.
Commit 0c005bd7 intended to make ir_loop_jump::mode public, but also
accidentally added a new pointer to the enclosing loop.  Furthermore, it
tried to initialize the new field by adding "this->loop = loop;" to the
constructor, but since there is no loop parameter, this only initialized
the field to itself---so it will likely be a garbage pointer.

A lot of code, such as lower_jumps, allocates new loop jumps without
setting this field appropriately, so any uses would probably just crash.

Thankfully, there were none, so we can just delete the field.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51574
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-07-02 11:08:59 -07:00
Kenneth Graunke
d73f6375f5 meta: Don't alter fragment color clamp in DrawPixels().
DrawPixels uses the MESA_META_CLAMP_FRAGMENT_COLOR flag to save/restore
the fragment color clamp mode.  This is unnecessary since it never
alters it.  It's also harmful: when the clamp mode is GL_FIXED_ONLY,
setting this flag causes _mesa_meta_begin to force it to GL_FALSE,
breaking clamping on SNORM formats.

DrawPixels should use the user-specified clamp mode and not change it.

Fixes Piglit's spec/ARB_color_buffer_float/GL_RGBA8_SNORM-drawpixels
test on i965/Sandybridge (with SNORM render targets re-enabled).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 11:08:48 -07:00
Marek Olšák
9f0f2f9512 mesa: use FLUSH_CURRENT and not FLUSH_VERTICES in _mesa_validate_*
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL calls FLUSH_VERTICES, which
is not what we want.

This fixes a breakage in classic drivers, introduced in:

  62b9716739
  vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around

It should fix:
  https://bugs.freedesktop.org/show_bug.cgi?id=51629
  https://bugs.freedesktop.org/show_bug.cgi?id=51642

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-02 17:48:36 +02:00
Dylan Noblesmith
876889b355 mesa: point to Makefile.old in the srcdir
Gets out-of-tree builds slightly closer to working.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:46 +00:00
Dylan Noblesmith
91ecba9d05 mesa: fix parser source gen for out-of-tree builds
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:39 +00:00
Dylan Noblesmith
261b1389eb mesa: fix api source gen for out-of-tree builds
Add $(srcdir) where needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:14:27 +00:00
Dylan Noblesmith
43bca86c1b glapi/gen: fix out of tree build
Add "-f $(srcdir)/gl_API.xml" to the arguments of all
the scripts that by default look for gl_API.xml in the
working directory when run with no arguments, and prepend
$(srcdir) to those scripts that are already using an
explicit -f argument.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-07-02 15:13:58 +00:00
José Fonseca
f5c41e16d7 gallium/tgsi: Don't declare temps individually when they are all similar.
tgsi_ureg was recently enhanced to support local temporaries, and as result
temps are declared individually.

This change avoids many TEMP register declarations on common shaders.

(And fixes performance regression due to mismatches against performance
sensitive shaders.)

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-07-02 12:14:53 +01:00
José Fonseca
e75fe7ba08 gallivm: Cleanup the 4 x float -> 16 ub special path in lp_build_conv.
No behaviour change intended.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-07-02 12:13:52 +01:00
José Fonseca
63e0e4b8f5 gallium/util: Add ULL suffix to large constants.
As suggested by Andy Furniss: it looks like some old gcc versions
require it.
2012-07-02 12:12:42 +01:00
Tom Stellard
1d21bd057a clover: Handle NULL devs argument in clBuildProgram
If devs is NULL, then the kernel should be compiled for all devices
associated with the program.
2012-07-01 15:45:24 +02:00
Francisco Jerez
c6bb41c28b clover: Define non-templated copy constructor for clover::ref_ptr.
The templated copy constructor doesn't prevent the compiler from
emitting a default copy constructor, which leads to inconsistent
memory handling and was reported to cause segfaults when doing event
manipulation.

Reported-by: Tom Stellard <thomas.stellard@amd.com>
2012-07-01 15:37:30 +02:00
Brian Paul
db2b6ca504 llvmpipe: fix comment typo 2012-06-29 17:19:12 -06:00
Brian Paul
9dfe92019a st/mesa: use DEBUG_INCOMPLETE_FBO debug flag 2012-06-29 17:19:12 -06:00
Brian Paul
b186a9df32 mesa: remove some unused gl_dlist_state fields 2012-06-29 17:19:12 -06:00
Tom Stellard
ca8fa02308 clover: Add a function internalizer pass before LTO v2
The function internalizer pass marks non-kernel functions as internal,
which enables optimizations like function inlining and global dead-code
elimination.

v2:
  - Pass vector arguments by const reference
2012-06-29 18:46:18 +00:00
Tom Stellard
a31b2f7107 radeon/llvm: Enable vec4 loads on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
e17c586d08 radeon/llvm: Enable floating point stores on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
b66ef1f48c radeon/llvm: Handle floating point loads on R600 2012-06-29 18:46:18 +00:00
Tom Stellard
c01199dfc0 radeon/llvm: Expand UDIV and UREM nodes 2012-06-29 18:46:18 +00:00
Tom Stellard
2c485cda20 radeon/llvm: Emit raw ISA for vertex fetch instructions 2012-06-29 18:46:18 +00:00
José Fonseca
16e0ebccb6 gallium/util: Truly disable INF/NAN tests on MSVC.
Thanks to Brian for spotting this.
2012-06-29 14:49:23 +01:00
José Fonseca
c9bada497c gallium/util: Disable INF/NAN tests on MSVC.
Somehow they are not recognized as constants.
2012-06-29 13:39:07 +01:00
José Fonseca
fa8dcb848f translate: Free elt8_func/elt16_func too.
These were leaking.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-06-29 12:21:08 +01:00
James Benton
6dd8e6f9cb util: Reimplement half <-> float conversions.
Removed u_half.py used to generate the table for previous method.

Previous implementation of float to half conversion was faulty for
denormalised and NaNs and would require extra logic to fix,
thus making the speedup of using tables irrelevant.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:21:02 +01:00
James Benton
c8d3481cdb tests: Updated tests to properly handle NaN for half floats.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:59 +01:00
James Benton
60dca53833 util: Updated u_format_tests to rigidly test half-float boundary values.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:57 +01:00
James Benton
d069d8ef38 util: Added functions for checking NaN / Inf for double and half-floats.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:54 +01:00
James Benton
34075d4133 util: Added util_format_is_array.
This function checks whether a format description is in a simple array format.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-29 12:20:37 +01:00
Marek Olšák
fcebb157f0 vbo: optimize validation for glMultiDrawElements
Some parameters need to be checked only once.
check_valid_to_render needs to be called only once.

The validate function is based on the one for DrawElements.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
62b9716739 vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
d9eb1a1225 vbo: don't call twice _mesa_valid_to_render in DrawArraysInstancedBaseInstance
It's called in _mesa_validate_DrawArraysInstanced already.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
Marek Olšák
15ac66e331 mesa: rename MaxTransformFeedbackSeparateAttribs to MaxTransformFeedbackBuffers
This is a cleanup for ARB_transform_feedback3, where
GL_MAX_TRANSFORM_FEEDBACK_BUFFERS is introduced for interleaved attribs and
has the same meaning as GL_MAX_.._SEPARATE_ATTRIBS for separate attribs.

Also, the maximum number of TFB buffers is reduced from 32 to 4, which makes
this patch useful even without the extension.
I don't know of any hardware which can do more than 4.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 22:46:51 +02:00
José Fonseca
638779e445 gallivm: Refactor lp_build_broadcast(_scalar) to share code.
Doesn't really change the generated assembly, but produces more compact IR,
and of course, makes code more consistent.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-28 20:20:34 +01:00
Johannes Obermayr
bf679ce1dc gallivm: Fix potential buffer overflowing in strncat.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-28 11:47:23 +01:00
Marcin Slusarz
1906d2b46b nv50: dynamically allocate space for shader local storage
Fixes 21 piglit tests:
spec/glsl-1.10/execution/variable-indexing/
fs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-row-wr

spec/glsl-1.20/execution/variable-indexing/
fs-temp-array-mat3-index-col-row-rd
fs-temp-array-mat3-index-row-rd
fs-temp-array-mat4-col-row-wr
fs-temp-array-mat4-index-col-row-rd
fs-temp-array-mat4-index-col-row-wr
fs-temp-array-mat4-index-row-rd
fs-temp-array-mat4-index-row-wr
vs-temp-array-mat3-index-col-row-rd
vs-temp-array-mat3-index-col-row-wr
vs-temp-array-mat3-index-row-rd
vs-temp-array-mat3-index-row-wr
vs-temp-array-mat4-col-row-wr
vs-temp-array-mat4-index-col-row-rd
vs-temp-array-mat4-index-col-row-wr
vs-temp-array-mat4-index-col-wr
vs-temp-array-mat4-index-row-rd
vs-temp-array-mat4-index-row-wr
vs-temp-array-mat4-index-wr

... and prevents a lot of GPU lockups
2012-06-28 00:01:02 +02:00
Marcin Slusarz
0fceaee4fd nv50: streamline screen_create error handling
Remove macro which changes control flow (it's evil).
Make all fail paths print (correct) error message.
2012-06-28 00:01:02 +02:00
Marcin Slusarz
96259b5128 nv50/ir: make colorful ir dump output optional 2012-06-28 00:01:02 +02:00
Brian Paul
9881bf6e69 mesa: more const qualifiers to match the latest glext.h
For some reason regular gcc on Linux didn't catch these but the mingw
compiler did (generated errors, not warnings).

v2: include the changes in src/mapi/ too
2012-06-27 15:37:10 -06:00
Brian Paul
827bdee7d1 glapi: add const qualifier to glShaderSourceARB() parameter
Fixes the es2 build with gcc.

Note: in glext.h the prototypes for glShaderSource() and glShaderSourceARB()
disagree:  only the former has the extra const qualifier.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-27 15:37:10 -06:00
Jordan Justen
3588098ed8 i965: enable ARB_instanced_arrays extension
Set the step_rate value when drawing to implement
ARB_instanced_arrays for gen >= 4.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-27 10:35:14 -07:00
Brian Paul
8fb1e4a462 glsl: be more careful about counting varying vars in the linker
Previously, we were counting gl_FrontFacing, gl_FragCoord and gl_PointCoord
against the limit of varying variables.  This prevented some valid shaders
from linking.

The other potential solution to this is to have the driver advertise
more varying vars or set the GLSLSkipStrictMaxVaryingLimitCheck flag.
But the above-mentioned variables aren't conventional varying attributes
so it doesn't seem right to count them.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-27 11:31:16 -06:00
Andreas Boll
d9d84068e7 docs/helpwanted: add some useful todo lists
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-27 11:19:21 -06:00
Brian Paul
098aa5f9ab softpipe: fix numFragsEmitted debug code 2012-06-27 07:50:57 -06:00
Brian Paul
81e2a238bc gallium: minor whitespace, comment changes 2012-06-27 07:50:57 -06:00
Brian Paul
51b0a0b33c mesa: update glext.h to version 81 2012-06-27 07:50:57 -06:00
Brian Paul
52dd8961eb mesa: update glxext.h to version 33 2012-06-27 07:50:57 -06:00
Brian Paul
8459f4a63a mesa: make _mesa_reference_array_object() an inline function
As we do for texture objects, buffer objects, etc.
2012-06-27 07:50:57 -06:00
Brian Paul
dcf1dafa9e mesa: look up enum name for glEnable/Disable errors 2012-06-27 07:50:56 -06:00
Brian Paul
86ccd9aaac mesa: move TEXGEN defines closer to gl_texgen struct 2012-06-27 07:50:56 -06:00
Brian Paul
4cb3579e52 mesa: rename ColorMaterialBitmask to _ColorMaterialBitmask
Since it's a derived field.
2012-06-27 07:50:56 -06:00
Brian Paul
b114ff3783 mesa: re-order, update comments on lighting-related structs 2012-06-27 07:50:56 -06:00
José Fonseca
d1c5ea9207 gallium/util: Fix parsing of options with underscore.
For example

  GALLIVM_DEBUG=no_brilinear

which was being parsed as two options, "no" and "brilinear".
2012-06-27 11:16:18 +01:00
James Benton
789436f1e0 gallivm: Added a generic lp_build_print_value which prints a LLVMValueRef.
Updated lp_build_printf to share common code.
Removed specific lp_build_print_vecX.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-27 11:16:18 +01:00
Stéphane Marchesin
45fc069600 i915g: Implement sRGB textures
Since we don't have them in hw we emulate them in the shader. Although not
recommended by the spec it is legit.

As a side effect we also get GL 2.1. I think this is as far as we can take
the i915.
2012-06-26 23:18:15 -07:00
Brian Paul
3bc39414ab svga: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 17:03:33 -06:00
Brian Paul
ac8613c298 llvmpipe: return 120 for PIPE_CAP_GLSL_FEATURE_LEVEL
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 17:03:33 -06:00
Carl Worth
d8e61f8f86 glsl: glcpp: Extend testing of #line directives
The most recent commit adds support for comments and macro expansion
on #line directives. Add testing to verify the new features.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:23:55 -07:00
Carl Worth
aac78ce823 glsl: glcpp: Move handling of #line directives from lexer to parser.
The GLSL specification requires that #line directives be interpreted
after macro expansion. Our existing implementation of #line macros in
the lexer prevents conformance on this point.

Moving the handling of #line from the lexer to the parser gives us the
macro expansion we need. An additional benefit is that the
preprocessor also now supports comments on the same line as #line
directives.

Finally, the preprocessor now emits the (fully-macro-expanded) #line
directives into the output. This allows the full GLSL compiler to also
see and interpret these directives so it can also generate correct
line numbers in error messages.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:23:49 -07:00
Carl Worth
39f8c46eaa glsl: glcpp: Rename and document _glcpp_parser_expand_if
This function is currently used only in the expansion of #if lines,
but we will soon be using it more generally (for the expansion of
(_glcpp_parser_expand_and_lex_from) and some more documentation.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:21:16 -07:00
Carl Worth
1db463ce2e glsl: Consistently use length-based ralloc string functions for info_log.
Commit b823b99ec0 switched from using
functions such as ralloc_asprintf and ralloc_strcat to
ralloc_asprintf_rewrite_tail. This change maintains the string's
length as a aparamter that is updated by the ralloc functions (rather
than recomputing it with strlen over and over).

However, the change failed to updated two locations (glcpp_error and
glcpp_warning), with the result that the string's length wasn't
updated by these calls. Then, subsequent calls to other
ralloc_asprintf_rewrite_tail would overwrite the text appended by
glcpp_error.

This commit fixes the two missing updates, and restores line numbers
to the output of glcpp error messages, (as noticed by a glcpp unit
test case that has been failing since the above-mentioned commit).

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:20:53 -07:00
Carl Worth
c96b8302a3 glsl: glcpp: Allow "#if undefined-macro' to evaluate to false.
A strict reading of the GLSL specification would have this be an
error, but we've received reports from users who expect the
preprocessor to interepret undefined macros as 0. This is the standard
behavior of the rpeprocessor for C, and according to these user
reports is also the behavior of other OpenGL implementations.

So here's one of those cases where we can make our users happier by
ignoring the specification. And it's hard to imagine users who really,
really want to see an error for this case.

The two affected tests cases are updated to reflect the new behavior.

Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-26 15:20:03 -07:00
Jerome Glisse
b75f1d973c r600g: enable DUAL_EXPORT mode when possible on r6xx/r7xx
DUAL_EXPORT can be enabled on r6xx/r7xx when all CBs use 16-bit export
and there is no depth/stencil export.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
470d00c0e2 r600g: enable DUAL_EXPORT mode when possible
It seems DUAL_EXPORT on evergreen may be enabled when all CBs use 16-bit export
mode (EXPORT_4C_16BPC), also there should be at least one CB, and the PS
shouldn't export depth/stencil.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
0c47d9dcab r600g: avoid unnecessary shader exports v2
In some cases TGSI shader has more color outputs than the number of CBs,
so it seems we need to limit the number of color exports. This requires
different shader variants depending on the nr_cbufs, but on the other hand
we are doing less exports, which are very costly.

v2: fix various piglit regressions

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-27 02:06:55 +04:00
Vadim Girlin
4acf71f01e r600g: cache shader variants instead of rebuilding v3
Shader variants are stored in the list, the key for lookup is based on the
states that require different hw shaders - currently it's rctx->two_side (all
gpus) and rctx->nr_cbufs (evergreen/cayman, when writes_all property is set).

v2:
 - use simple list instead of keymap as suggested by Marek on irc
 - call r600_adjust_gprs from r600_bind_vs_shader for r6xx/r7xx
   (r600_shader_select isn't used for vertex shaders currently)

v3:
 - fix call to r600_adjust_gprs - do it after updating current shader

Improves performance for some apps, e.g. FlightGear -
see https://bugs.freedesktop.org/show_bug.cgi?id=50360

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-06-27 02:06:55 +04:00
Brian Paul
55a89889ba svga: handle missing PIPE_CAP_x queries
And fix incorrect error message for a bad shader type/number.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-26 15:03:44 -06:00
Brian Paul
056e9b4511 llvmpipe: handle more PIPE_CAP_x queries
As with the previous commit for softpipe.

v2: remove 'default' case to get compile-time warning

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 15:03:44 -06:00
Brian Paul
7d23dcdacc softpipe: handle more PIPE_CAP_x queries
These all return zero.  Add a debug_printf() to catch the default case so
we don't accidently mishandle something important in the future.

v2: remove 'default' case to get compile-time warning

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 15:03:43 -06:00
Brian Paul
80efb524ee svga: return 1 for PIPE_CAP_MIXED_COLORBUFFER_FORMATS
This is actually required for GL_ARB_framebuffer_object, but the state
tracker doesn't currently check it.
Direct3D 9 allows mixed format color buffers with some restrictions.
Setting this allows Unigine Heaven 2.5 and 3.0 to run.  Tested both on
GL and D3D hosts.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-06-26 15:03:43 -06:00
Brian Paul
36b3ee2ffc glsl: fix comment typo 2012-06-26 10:01:03 -06:00
Olivier Galibert
27e94ba4ea u2f_emit: Fix type parameter in LLVM call.
The type is the destination type (i.e. float vector) and not the
source type.  Fixes piglit fs-{in,de}crement-uint.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-26 16:55:40 +01:00
Paul Berry
6c355cca91 i965/msaa: Set KILL_ENABLE when GL_ALPHA_TO_COVERAGE enabled.
i965 hardware needs to be informed of situations in which it's
possible for pixels (or samples) to be discarded for reasons other
than depth/stencil testing (e.g. due to an explicit "discard" in the
fragment shader).  One of these situations is when
GL_ALPHA_TO_COVERAGE is enabled, since that can cause samples to be
discarded by the color calculator when the pixel's alpha value is less
than 1.0.

Without this patch, GL_ALPHA_TO_COVERAGE does not take effect on depth
buffers.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
Paul Berry
bc53e14d98 i965/msaa: Implement GL_SAMPLE_ALPHA_TO_{COVERAGE,ONE}.
This patch enables the multisampling parameters
GL_SAMPLE_ALPHA_TO_COVERAGE and GL_SAMPLE_ALPHA_TO_ONE, which allow
the fragment shader's alpha output to be converted into a sample
coverage mask and ignored for blending.  i965 supports these
parameters through the BLEND_STATE structure.

The GL spec allows, but does not require, the implementation to dither
the conversion from alpha to a sample coverage mask, so that alpha
values that aren't a multiple of 1/num_samples result in the correct
proportion of samples being lit.  A bit exists in the BLEND_STATE
structure to enable this functionality, but according to the hardware
docs it must be disabled on Sandy Bridge (see the Sandy Bridge PRM,
Vol2, Part1, p379: AlphaToCoverage Dither Enable).  So it is enabled
for Gen7 only.

Fixes piglit tests
"EXT_framebuffer_multisample/sample-alpha-to-{coverage,one} {2,4}".

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
Paul Berry
9ea60ce58f i965/msaa: Implement glSampleCoverage.
This patch enables glSampleCoverage() functionality, which allows the
client program to specify that only a portion of the samples be lit up
when performing multisampled rendering.  i965 supports
glSampleCoverage() through the 3DSTATE_SAMPLE_MASK command packet,
which allows the driver to specify a bitfield indicating which samples
to light up.

Fixes piglit tests "EXT_framebuffer_multisample/sample-coverage {2,4}
{inverted,non-inverted}".

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-06-26 07:45:54 -07:00
José Fonseca
4bde1ba7fb st/wgl: Add a few more comments. 2012-06-26 10:15:36 +01:00
Marek Olšák
cc2cd8b356 r600g: don't disable streamout if it hasn't been started 2012-06-26 03:37:24 +02:00
Marek Olšák
496399d8e9 u_blitter: disable streamout before rendering
This fixes piglit EXT_transform_feedback tests:
- intervening-read output
- intervening-read prims_written
2012-06-26 03:37:23 +02:00
Chad Versace
cf0bbb30f6 i965/fs: Fix conversions float->bool, int->bool
Fixes gles2conform GL.equal.equal_bvec2_frag.

This fixes brw_fs_visitor's translation of ir_unop_f2b.  It used CMP to
convert the float to one of 0 or ~0. However, the convention in the
compiler is that true is represented by 1, not ~0. This patch adds an AND
to convert ~0 to 1.

By inspection, a similar problem existed with ir_unop_i2b, with a similar
fix.

[v2 kayden]: eliminate extra temporary register.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49621
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-06-25 15:56:40 -07:00
Brian Paul
345ee593e9 st/wgl: 80-column wrapping 2012-06-25 16:10:01 -06:00
Andreas Boll
19534579cf docs/lists: add piglit mailing list
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
24eebf4f88 docs/helpwanted: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
f29f5e8695 docs/sourcetree: update some info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
b347bb5dbc docs/devinfo: update release info
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
398d8be3ab docs/systems: add some useful driver links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
297309ce23 docs: update some broken/old links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
dae9b0f1d8 docs: whitespace cleanup
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
ddb0557868 docs: escape html special char
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
a5447aab96 docs: add missing target attribute
target is needed for the frame based layout

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Andreas Boll
d52419e0c3 docs/shading: use proper markup
use dl instead of ul

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-25 16:10:01 -06:00
Brian Paul
75e62024c3 docs: document the GALLIUM_LOG_FILE env var 2012-06-25 16:10:01 -06:00
Brian Paul
9ccf5bffe3 mesa: new MESA_LOG_FILE env var to log errors, warnings, etc., to a file
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-25 16:10:01 -06:00
Marek Olšák
0f530d2dff docs: update GL3.3 status 2012-06-25 23:53:49 +02:00
Marek Olšák
4891c5dc64 r600g: inline r600_blit_push_depth and use resource_copy_region
We are going to have a separate resource for depth texturing and transfers
and this is just a transfer thing.
2012-06-25 23:53:49 +02:00
Marek Olšák
da98bb6fc1 r600g: split flushed depth texture creation and flushing 2012-06-25 23:53:49 +02:00
Paul Berry
d1056541e2 i965/msaa: Add backend support for centroid interpolation.
This patch causes the fragment shader to be configured correctly (and
the correct code to be generated) for centroid interpolation.  This
required two changes: brw_compute_barycentric_interp_modes() needs to
determine when centroid barycentric coordinates need to be included in
the pixel shader thread payload, and
fs_visitor::emit_general_interpolation() needs to interpolate using
the correct set of barycentric coordinates.

Fixes piglit tests "EXT_framebuffer_multisample/interpolation {2,4}
centroid-edges" on i965.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
cf0e7aa9f8 i965/fs: Refactor interpolation code to prepare for adding centroid support.
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
6d7ebb21f8 i965/msaa: Adapt clip setup for centroid noperspective interpolation.
To save time, we only instruct the clip stage of the pipeline to
compute noperspective barycentric coordinates if those coordinates are
needed by the fragment shader.  Previously, we would determine whether
the coordinates were needed by seeing whether the fragment shader used
the BRW_WM_NONPERSPECTIVE_PIXEL_BARYCENTRIC interpolation mode.

However, with MSAA, it's possible that the fragment shader might use
BRW_WM_NONPERSPECTIVE_CENTROID_BARYCENTRIC instead.  In the future,
when we support ARB_sample_shading, it might use
BRW_WM_NONPERSPECTIVE_SAMPLE_BARYCENTRIC.

This patch modifies the upload_clip_state() functions to check for all
three possible noperspective interpolation modes.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Paul Berry
bebb043811 glsl: Add IsCentroid bitfield to gl_fragment_program.
This bitfield tells the back-ends which of a fragment shader's inputs
require centroid interpolation.  It is only set for GLSL fragment
shaders, since assembly fragment shaders don't support centroid
interpolation.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-25 11:03:26 -07:00
Brian Paul
2a4af651e6 st/mesa: added some simple fbo debugging/helper code 2012-06-25 11:28:03 -06:00
Brian Paul
45df3eb1db llvmpipe: fix the LP_NO_RAST debug option
It was only no-oping the clear() function, not actual triangle
rasterization.  Move the no_rast field from lp_context down into
lp_rasterizer so it's accessible where it's needed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-06-25 08:14:33 -06:00
Vinson Lee
37d699a296 scons: Add glsl/glcpp to the include path.
Fixes this build failure on Solaris.

  Compiling build/sunos-debug/glsl/glcpp/glcpp-lex.c ...
"src/glsl/glcpp/glcpp-lex.l", line 30: cannot find include file: "glcpp-parse.h"

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-23 13:40:09 -07:00
Laurent Carlier
78ac9af580 automake: add missing inclusion of GL headers
Building fail when GL headers are not installed in the system,
so add inclusion of these headers.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-22 17:24:37 -06:00
Brian Paul
cbffaf20e9 mesa: #define fprintf to be __mingw_fprintf() on Mingw32
So that formats such as "%llx" are understood.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-22 17:24:37 -06:00
Brian Paul
fe68af6e0d svga: init pointer to NULL to silence MSVC warning 2012-06-22 17:24:37 -06:00
Tom Stellard
ea76f03310 clover: Add --with-clang-libdir option and verify CLANG_RESOURCE_DIR
$CLANG_RESOURCE_DIR is the directory that contains all resources
needed by clang to compile programs.  When clover uses clang to
compile kernels it needs to specify a resource dir, so that clang
can find its internal headers (e.g. stddef.h).

clang defines $CLANG_RESOURCE_DIR as $CLANG_LIBDIR/clang/$CLANG_VERSION

This patch adds the --with-clang-libdir option in order to accommodate
clang intalls to non-standard locations, and it also adds a check
to the configure script to verify that $CLANG_RESOURCE_DIR/include
contains the necessary header files.
2012-06-22 16:59:24 -04:00
Paul Berry
82d25963a8 i965: Compute dFdy() correctly for FBOs.
On i965, dFdx() and dFdy() are computed by taking advantage of the
fact that each consecutive set of 4 pixels dispatched to the fragment
shader always constitutes a contiguous 2x2 block of pixels in a fixed
arrangement known as a "sub-span".  So we calculate dFdx() by taking
the difference between the values computed for the left and right
halves of the sub-span, and we calculate dFdy() by taking the
difference between the values computed for the top and bottom halves
of the sub-span.

However, there's a subtlety when FBOs are in use: since FBOs use a
coordinate system where the origin is at the upper left, and window
system framebuffers use a coordinate system where the origin is at the
lower left, the computation of dFdy() needs to be negated for FBOs.

This patch modifies the fragment shader back-ends to negate the value
of dFdy() when an FBO is in use.  It also modifies the code that
populates the program key (brw_wm_populate_key() and
brw_fs_precompile()) so that they always record in the program key
whether we are rendering to an FBO or to a window system framebuffer;
this ensures that the fragment shader will get recompiled when
switching between FBO and non-FBO use.

This will result in unnecessary recompiles of fragment shaders that
don't use dFdy().  To fix that, we will need to adapt the GLSL and
NV_fragment_program front-ends to record whether or not a given shader
uses dFdy().  I plan to implement this in a future patch series; I've
left FIXME comments in the code as a reminder.

Fixes Piglit test "fbo-deriv".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-22 07:59:34 -07:00
Brian Paul
d988ea5e81 mesa: minor transform feedback comments 2012-06-22 08:48:45 -06:00
Brian Paul
09af5783b3 mesa: fix comments on UBO buffer binding functions
The old comments were for transform feedback.
2012-06-22 08:44:00 -06:00
Olivier Galibert
b8068afafa draw: Handle the case when there isn't a fragment shader.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-22 09:58:39 +01:00
Zack Rusin
af98c6b05b mesa: update the emacs indent files
dirvars package has been replaced by built-in functionality of
dir-locals. preserve the settings in the new infrastructure
2012-06-21 17:29:11 -04:00
Tom Stellard
ff2b417245 r600g: Unify SURFACE_SYNC packet emission for 3D and compute
Drop the compute specific evergreen_set_buffer_sync() function and
instead use the r600_surface_sync_command atom for emitting SURFACE_SYNC
packets.
2012-06-21 20:42:07 +00:00
Tom Stellard
ff08f1ec6f r600g: Enable reusing of compute state 2012-06-21 20:42:07 +00:00
Tom Stellard
5cd6ce939d r600g: Fix reading vtx instruction offset from bytestream 2012-06-21 20:42:07 +00:00
Tom Stellard
563a764110 radeon/llvm: Turn on the BitExtract peephole optimization
Thie BitExtract optimization folds a mask and shift operation together
into a single instruction (BFE_UINT).
2012-06-21 20:42:06 +00:00
Tom Stellard
c53c8d0555 radeon/llvm: Lower ROTL to BIT_ALIGN 2012-06-21 20:42:06 +00:00
Tom Stellard
cd287301ec radeon/llvm: Use the VLIW Scheduler for R600->NI
It's not optimal, but it's better than the register pressure scheduler
that was previously being used.  The VLIW scheduler currently ignores
all the complicated instruction groups restrictions and just tries to
fill the instruction groups with as many instructions as possible.
Though, it does know enough not to put two trans only instructions in
the same group.

We are able to ignore the instruction group restrictions in the LLVM
backend, because the finalizer in r600_asm.c will fix any illegal
instruction groups the backend generates.

Enabling the VLIW scheduler improved the run time for a sha1 compute
shader by about 50%.  I'm not sure what the impact will be for graphics
shaders.  I tested Lightsmark with the VLIW scheduler enabled and the
framerate was about the same, but it might help apps that use really
big shaders.
2012-06-21 20:42:06 +00:00
Brian Paul
b73cf49c91 mesa: set GL_ARB_uniform_buffer_object extension year to 2009 2012-06-21 13:08:34 -06:00
Eric Anholt
cb9f35d16f mesa: Add a comment explaining my thoughts on glBindBufferBase().
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:18 -07:00
Eric Anholt
d103fead19 mesa: Add support for glGetIntegeri_v from GL_ARB_uniform_buffer_object.
Fixes piglit ARB_uniform_buffer_object/getintegeri_v.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:10 -07:00
Eric Anholt
fb76ddc133 mesa: Add support for glBindBufferBase/Range on GL_UNIFORM_BUFFER.
Fixes piglits:
GL_ARB_uniform_buffer_object/bindbuffer-general-point.
GL_ARB_uniform_buffer_object/negative-bindbuffer-buffer
GL_ARB_uniform_buffer_object/negative-bindbuffer-index
GL_ARB_uniform_buffer_object/negative-bindbuffer-target
GL_ARB_uniform_buffer_object/negative-bindbufferrange-range

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:07 -07:00
Eric Anholt
b82c472156 mesa: Move glBindBufferBase and glBindBufferRange() to bufferobj.
The rest of the TFB implementation remains in transformfeedback.c, and
this will be shared with UBOs.

v2: Move the size/offset checks shared with UBOs to common code as
    well. (Kenneth's review)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:58:00 -07:00
Eric Anholt
9627660448 mesa: Move buffer object dispatch setup to bufferobj.c.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:58 -07:00
Eric Anholt
5527c2d220 mesa: Add indexed binding points for uniform buffer objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:56 -07:00
Eric Anholt
c5c696e7fb mesa: Add support for the GL_UNIFORM_BUFFER general binding point.
Fixes piglit ARB_uniform_buffer_object/buffer-targets.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:54 -07:00
Eric Anholt
5426b1ade9 mesa: Add state and getters for the GL_ARB_uniform_buffer_object maximums.
Fixes piglit GL_ARB_uniform_buffer_object/minmax.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:51 -07:00
Vincent Lejeune
3e17d38457 glapi: Add uniform buffer object API
v2: Fix a typo spotted by Eric Anholt.
v3: Fix missing "GL" on types, fix style, fix Studly_Caps extension name,
    drop commented code duplicated with GL3x.xml [anholt]

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-21 10:57:45 -07:00
Eric Anholt
37c3cbe053 dricore: Turn it into a normal library.
Our intention is still that it's not abi stable, so make the package
version number get included in the library name.  Now you can parallel
install dricore-using drivers from multiple mesa versions.  We can put
it into lib now that we're following library versioning rules
(assuming that ABIs don't change within a single Mesa point release).

LD_LIBRARY_PATH still doesn't work with a non-/, non-/usr prefix
because libtool uses rpath instead of runpath for nonstandard
prefixes.
2012-06-21 10:10:46 -07:00
Eric Anholt
4113ac6a0f automake: Convert Mesa built sources generation to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
2d51ac84fd mesa: Move GL header installation to automake.
This cuts some cruft related to osmesa where we were being careful to
not install headers twice.
2012-06-21 10:10:46 -07:00
Eric Anholt
1bbd22ada0 automake: Move mesa subdirs processing to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
39785488e6 automake: Move .pc installation to automake. 2012-06-21 10:10:46 -07:00
Eric Anholt
417c1a6421 automake: Move the master Mesa makefile to Makefile.old.
This will let me incrementally move stuff to automake without
converting libmesa.a all at once.
2012-06-21 10:10:46 -07:00
Eric Anholt
bd18a236de automake: Convert osmesa.pc to be generated by configure. 2012-06-21 10:10:43 -07:00
Eric Anholt
fa4cf4dc0c mesa: Convert gl.pc to be generated by configure.
This saves a step of mashing variables around in our Makefile.
2012-06-21 10:10:08 -07:00
Eric Anholt
2d4b77c7c6 automake: Convert src/mesa/drivers/x11/Makefile to automake.
The weird versioning of the libGL where the package version was sort
of expressed as a big integer is dropped.  libtool didn't like the 0
prefix, and it didn't really make sense anyway -- if you interpret it
as an integer version number, old Mesa 071200 was bigger than current
Mesa 08100.  Instead, just bump the minor version and drop the
patchlevel.
2012-06-21 10:09:17 -07:00
Eric Anholt
2fb0f770a4 automake: Convert src/gallium/Makefile to automake. 2012-06-21 10:08:26 -07:00
Eric Anholt
27383cbb0b automake: Convert src/mapi/glapi/gen to silent build. 2012-06-21 10:08:26 -07:00
Eric Anholt
3a70f7526a automake: Convert src/mapi/glapi/gen/Makefile to automake. 2012-06-21 10:08:24 -07:00
Eric Anholt
d59149d3f4 automake: Convert src/mesa/drivers/Makefile to automake. 2012-06-21 10:07:38 -07:00
Eric Anholt
9ff2709ca5 automake: Directly generate configs/current instead of symlinking from it. 2012-06-21 10:07:38 -07:00
Eric Anholt
95836b46e7 automake: Convert gen_matypes building to automake. 2012-06-21 10:07:36 -07:00
Eric Anholt
acf27121a5 make: Drop HOST_CC and HOST_CFLAGS.
Except for the deleted linux-cell target, these were just the target
cc/cflags.  The only usage was for gen_matypes, which wants the
target's structure packing, not the host, anyway.
2012-06-21 09:58:12 -07:00
Eric Anholt
e426949cf1 make: Fold ASM_CFLAGS into DEFINES.
Every place that uses ASM_FLAGS already uses DEFINES.  Not including
it in DEFINES is just a way to screw up potential users, as I've done
several times while working on the build system.
2012-06-21 09:58:12 -07:00
Eric Anholt
07b28af5b5 automake: Convert src/egl/Makefile to automake. 2012-06-21 09:58:12 -07:00
Eric Anholt
a4ff3342d2 automake: Don't warn on gmake portability issues.
Even pre-automake, we rely on gmake features for pattern
substitutions, and replacing those with reams more make code is not
interesting.  This will let us turn the old Makefiles using pattern
substitutions into automake without spewing warnings.

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2012-06-21 09:57:52 -07:00
Marcin Slusarz
19fd04f5ea nv50: fix buffer reuse issues
1) We need to insert a barrier between consecutive transform feedback calls.
2) VBO cache needs to be flushed when TFB output is used as VBO draw input.

Fixes Piglit test EXT_transform_feedback/immediate-reuse.

Thanks to Christoph Bumiller for pointing out bugs in previous versions
of this patch.
2012-06-20 21:24:53 +02:00
Marcin Slusarz
7e63b613a5 st/mesa: fix transform feedback of unsubscripted gl_ClipDistance array
gl_ClipDistance needs special treatment in form of lowering pass
which transforms gl_ClipDistance representation from float[] to
vec4[]. There are 2 implementations - at glsl linker level (enabled
by LowerClipDistance option) and at glsl_to_tgsi level (enabled
unconditionally for gallium drivers). Second implementation is
incomplete - it does not take into account transform feedback (see
commit 642e5b413e "mesa: Fix transform
feedback of unsubscripted gl_ClipDistance array" for details).

There are 2 possible fixes:
- adding transform feedback support into glsl_to_tgsi version
- ripping gl_ClipDistance support from glsl_to_tgsi and enabling
  gl_ClipDistance lowering on glsl linker side

This patch implements 2nd option. All it does is:
- reverts most of the commit 59be691638
  "st/mesa: add support for gl_ClipDistance"
- changes LowerClipDistance to true

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{2,3,4,5,6,7,8}]-no-subscript" at least on nv50
and evergreen cards.
2012-06-20 21:16:20 +02:00
Paul Berry
f2f05e50b1 glx/tests: Fix signed/unsigned comparison warnings. 2012-06-20 11:42:42 -07:00
Paul Berry
cde6544ad7 i965/msaa: Only do multisample rasterization if GL_MULTISAMPLE enabled.
From the GL 3.0 spec (p.116):

    "Multisample rasterization is enabled or disabled by calling
    Enable or Disable with the symbolic constant MULTISAMPLE."

Elsewhere in the spec, where multisample rasterization is described
(sections 3.4.3, 3.5.4, and 3.6.6), the following text is consistently
used:

    "If MULTISAMPLE is enabled, and the value of SAMPLE_BUFFERS is
    one, then..."

So, in other words, disabling GL_MULTISAMPLE should prevent
multisample rasterization from occurring, even if the draw framebuffer
is multisampled.  This patch implements that behaviour by setting the
WM and SF stage's "multisample rasterization mode" to
MSRAST_ON_PATTERN only when the draw framebuffer is multisampled *and*
GL_MULTISAMPLE is enabled.

Fixes piglit test spec/EXT_framebuffer_multisample/enable-flag.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-20 11:28:09 -07:00
Paul Berry
3b0279a693 i965/msaa: Disable unsupported formats.
Due to hardware limitations, MSAA is unsupported on Gen6 for formats
containing >64 bits of data per pixel.  From the Sandy Bridge PRM,
vol4 part1, p72 ("Surface Format"):

    If Number of Multisamples is set to a value other than
    MULTISAMPLECOUNT_1, this field cannot be set to the following
    formats:
    - any format with greater than 64 bits per element
    - any compressed texture format (BC*)
    - any YCRCB* format

Gen7 has a similar, but less stringent limitation: formats with >64
bits of data per pixel only support 4x MSAA.

This patch causes the unsupported formats to report
GL_FRAMEBUFFER_UNSUPPORTED.

Fixes piglit "multisample-formats" tests on Gen6.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-20 11:28:09 -07:00
Andreas Boll
3becf98424 mesa: remove obsolete confdiff.sh
this script is obsolete since
0cc216676c
2012-06-20 01:51:38 -07:00
Christian König
0f269c5e7b st/vdpau: use template size as default for source_rect.
Fixes alignment problems with flash player.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-20 10:13:38 +02:00
Christian König
d37c3c6ebe st/vdpau: clear Cb&Cr with 0.5f
That makes the output black in case of decoding errors.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-20 10:13:29 +02:00
Kenneth Graunke
2f8351a5ac i965: Don't set brw_wm_prog_key::iz_lookup on Gen6+.
Sandy Bridge and later don't use this field, so there's no point in
setting it.  It can only cause harmful state-based recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-19 17:36:48 -07:00
Olivier Galibert
c790c2c759 llvmpipe: Add vertex id support.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
46931ecf48 llvmpipe: Simplify and fix system variables fetch.
The system array values concept doesn't really because it expects the
system values to be fixed per call, which is wrong for gl_VertexID and
iffy for gl_SampleID.  So this patch does two things:

- kill the array, have emit_fetch_system_value directly pick the
  values it needs (only gl_InstanceID for now, as the previous code)

- correctly handle the expected type in emit_fetch_system_value

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
4625a9b1ad draw: fix flat shading and screen-space linear interpolation in clipper
This includes:
- picking up correctly which attributes are flatshaded and which are
  noperspective

- copying the flatshaded attributes when needed, including the
  non-built-in ones

- correctly interpolating the noperspective attributes in screen-space
  instead than in a 3d-correct fashion.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Olivier Galibert
cfc5b30941 softpipe: Offset is not to be applied to the layer parameter of array texture fetches.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 14:40:44 -06:00
Brian Paul
fc855ed5d9 st/mesa: clamp glDrawPixels size to max texture size 2012-06-19 14:40:44 -06:00
Brian Paul
7f4786ad29 st/mesa: move st_validate_state() call earlier in st_DrawPixels() 2012-06-19 14:40:44 -06:00
Jerome Glisse
b4f0ab0b22 r600g: fix z/stencil texture creation v2
z or stencil texture should not be created with the z/stencil
flags for surface creation as they are intended to be bound
as texture.

v2: remove broken code

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-06-19 15:03:36 -04:00
Török Edwin
988ad7831c radeon/llvm: Fix CR/LF in Processors.td
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-19 16:38:23 -04:00
Török Edwin
7c005d5687 radeon/llvm: Fix sin/cos codegen on R700
Based on https://bugs.freedesktop.org/show_bug.cgi?id=50317#c4

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=50316
https://bugs.freedesktop.org/show_bug.cgi?id=50317

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-19 16:38:13 -04:00
Fredrik Höglund
4e943c375b docs: update GL3.txt for ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
c4c8c7a8f9 st/mesa: Add support for GL_ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
af372129e5 gallium: Add PIPE_CAP_START_INSTANCE
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Fredrik Höglund
ae5d7d5e89 mesa: Add support for GL_ARB_base_instance
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-19 07:57:22 -06:00
Vinson Lee
ee99647e02 scons: Do not build svga if using Solaris Studio C compiler.
Solaris Studio C compiler does not support anonymous structs and
anonymous unions.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 16:37:46 -07:00
Kenneth Graunke
5b83bdc154 i965: Fix brw_swap_cmod() for LE/GE comparisons.
The idea here is to rewrite comparisons like 2 >= x with x <= 2; we want
to simply exchange arguments, not negate the condition.  If equality was
part of the original comparison, it should remain part of the swapped
version.

This is the true cause of bug #50298.  It didn't manifest itself on
Sandybridge because we embed the conditional modifier in the IF
instruction rather than emitting a CMP.  All other platforms use CMP.

It also didn't manifest itself on the master branch because commit
be5f27a84d ("glsl: Refine the loop instruction counting.") papered over
the problem.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50298
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-18 15:25:31 -07:00
Brian Paul
6f7834ad36 docs: start release notes file for 8.1 2012-06-18 12:39:34 -06:00
Tom Stellard
7fab4b648b radeon/llvm: Update comment in AMDGPU.td 2012-06-18 18:30:36 -04:00
Tom Stellard
984ad0788c radeon/llvm: Remove unused AMDIL TableGen definitons 2012-06-18 18:30:36 -04:00
Tom Stellard
34ff22b75f radeon/llvm: Eliminate getRegClassFromType() function
We can use TargetLowering::getRegClassFor() instead.
2012-06-18 18:30:36 -04:00
Tom Stellard
440ab9ea02 radeon/llvm: Remove deadcode from AMDILISelLowering.cpp 2012-06-18 18:30:35 -04:00
Vinson Lee
cd62960a2e gallium: Add support for Solaris Studio C++ compiler.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 10:01:26 -07:00
James Benton
f34e2f484b llvmpipe: Implement cylindrical wrapping.
Tested against mesa demos cylwrap and dx9 DCT address.exe which now passes 100%.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-18 17:55:05 +01:00
Vinson Lee
d1acae2bdc st/glx: Do not undefine _R, _G, and _B.
Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-18 09:42:08 -07:00
Brian Paul
8ae93c68ea svga: fix synchronization bug between sampler views and surfaces
This fixes a bug where a sampler view was using stale texture/resource
data when the texture was modified through a surface (render to texture).
Bumping the texture and layer ages triggers sampler view revalidation.

Fixes piglit fbo-blit failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-06-18 10:22:59 -06:00
Kristian Høgsberg
2d7b2d7a87 gles2: Add GL_NV_read_buffer extension
This lets us select the front buffer for reading under GLES2.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-18 11:53:18 -04:00
Kristian Høgsberg
e841a2426e get.c: Rename EXTRA_VERSION_ES2 to EXTRA_API_ES2
This extra condition checks the API not the version of the API, so rename
to reflect that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-18 11:50:53 -04:00
Andreas Boll
1692d3ad94 docs/relnotes: comment out bug template
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
fb918727ef docs/relnotes: replace tbd with release date
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
b9fad90350 docs/relnotes: fix validation errors
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
Andreas Boll
207d52eb46 docs/relnotes: consolidate html header
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-18 08:21:47 -06:00
José Fonseca
e48d26bf40 draw: Ensure that the vertex_header type size matches expectation.
This is failing sometimes, probably because TargetData keeps a structure layout
cache, which can becomes bogus, ever since the InvalidateStructLayoutInfo API
was removed in LLVM r135245.

This change merely makes the problem easier to diagnose (an assertion
failure instead of a random crash).
2012-06-18 12:06:23 +01:00
Marek Olšák
6e7756db14 r600g: enable streamout by default on r7xx and DRM 2.17.0
Now that it's in Linus's tree.

Has anyone had a chance to test streamout on Cayman recently?
2012-06-17 18:28:32 +02:00
Marek Olšák
7c3786d780 st/mesa: properly allocate MSAA renderbuffers
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:27 +02:00
Marek Olšák
c760283159 st/mesa: make unsupported renderbuffer formats always fail as FBO incomplete
instead of failing to allocate a renderbuffer.

This also fixes piglit/get-renderbuffer-internalformat with non-renderable
formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:27 +02:00
Marek Olšák
e4b2e6b527 st/mesa: separate sw renderbuffer allocation from hw one
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-16 14:20:26 +02:00
Marek Olšák
a82227ce4a mesa: if AllocStorage doesn't choose a format, report FRAMEBUFFER_UNSUPPORTED
This allows drivers not to do any allocation in AllocStorage if the storage
cannot be allocated because of an unsupported internalformat + samples combo.

The little ugliness is that AllocStorage is expected to return TRUE in this
case.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-16 14:20:26 +02:00
Stéphane Marchesin
841eee5d44 i915g: More ops commute.
This allows using the optimizations more broadly.
2012-06-15 20:22:26 -07:00
Marek Olšák
cb4d1d377d r600g: fix lockups with streamout on r7xx
This requires the latest streamout kernel patches.

Streamout is disabled by default on r7xx, so this patch is safe for regular
users.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:43:00 +02:00
Marek Olšák
f01594be0e r600g: compute CS space for streamout correctly, add comments
SET_CONTEXT_REG was not counted in.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:43:00 +02:00
Marek Olšák
bb07e25131 r600g: set SMX_ACTION_ENA to fix streamout cache flushes on some chipsets
It helps on R7xx.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-15 22:42:59 +02:00
Alexey Shvetsov
f56f03428d clover: Fix build with LLVM libs installed to non-standard directories
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-06-15 13:22:16 -04:00
Marek Olšák
5e7e7d96b3 st/mesa: don't do srgb->linear conversion in decompress_with_blit
This fixes piglit/getteximage-formats on r600g.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-15 18:54:14 +02:00
Paul Berry
4d9c3cbce9 glsl: Use ir_unop_f2u to convert floats to uints.
Fixes piglit tests
spec/glsl-1.30/execution/{vs,fs}-float-uint-conversion on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
9d57d483cb gallium: Add TGSI_OPCODE_F2U to gallivm backend.
Note: for the moment TGSI_OPCODE_F2U is implemented using
lp_build_itrunc() (the same function used to implement
TGSI_OPCODE_F2I).  In the long run, we should create an
lp_build_utrunc() function to do the proper conversion.  But this
should allow us to limp along with mostly correct behaviour for now.
2012-06-15 08:58:55 -07:00
Paul Berry
1be7661110 gallium: Add support for ir_unop_f2u to tgsi backend.
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
fa584c50cf ir_to_mesa: Add support for ir_unop_f2u to ir_to_mesa backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
11a7b93592 i965: Add support for ir_unop_f2u to i965 backend.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
613a8170ae glsl: Add support for ir_unop_f2u to constant folding.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
8e31f961e6 glsl: Add unary operation ir_unop_f2u.
Previously, we performed conversions from float->uint by a two step
process: float->int->uint.  However, on platforms that use saturating
conversions (e.g. i965), this didn't work, because if the source value
was larger than the maximum representable int (0x7fffffff), then
converting it to an int would clamp it to 0x7fffffff.

This patch just adds the new opcode; further patches will adapt
optimization passes and back-ends to use it, and then finally the
ast_to_hir logic will be modified to emit the new opcode.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-15 08:58:55 -07:00
Paul Berry
75f409d75c i965/blorp: Implement source clipping.
This patch modifies blorp blits (which are used for MSAA) to properly
account for clipping of source coordinates.  Previously, if we
detected the possibility of source clipping, we would fall back to the
blit meta-op, which doesn't support MSAA and is very slow for depth
and stencil buffers.

Fixes piglit tests
"EXT_framebuffer_multisample/clip-and-scissor-blit" on i965/Gen6+.

Also substantially speeds up the Humble Bundle V game "Psychonauts" on
Gen6+ (without this patch, the game's depth buffer blits use the slow
blit meta-op).

Reviewed-by: Carl Worth <cworth@cworth.org>
2012-06-15 08:58:54 -07:00
Brian Paul
4d9f263d7c scons: add st_atom_array.c to the build 2012-06-15 09:31:33 -06:00
Christian König
92af184690 winsys/radeon: enable IB submission to compute rings v2
This allows to submit things to the compute only
rings on cayman+

v2: rebased on current master and actually make use
    of the new flag in evergreen_compute.c

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-06-15 09:52:38 +02:00
Marek Olšák
b4753dafcc st/mesa: atomize vertex array state
This moves the state validation to where all the other states are validated.
2012-06-15 03:15:50 +02:00
Maarten Lankhorst
6bb0151f1f winsys/radeon: Remove unnecessary pipe_thread_destroy in radeon_drm_cs_destroy
Fixes crash bug introduced with 210ddf0819 fd.o #49198
pthread_detach after a pthread_join is unneeded.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-06-15 03:01:23 +02:00
Marcin Slusarz
fc782bcbf0 nv50,nvc0: fix stream output target buffer leak
It manifests at exit as:
"WARNING: destroying GPU memory cache with some buffers still in use"
2012-06-14 23:38:28 +02:00
Christoph Bumiller
169a0ae40a nv50: disable stream output before reconfiguring it
If we don't, the GPU will just throw an ILLEGAL_OPERATION error.
2012-06-14 23:30:49 +02:00
Christoph Bumiller
ef51ce522b nv50/ir: handle NEG,ABS modifiers for short RCP encoding 2012-06-14 23:25:48 +02:00
Brian Paul
f677954e07 st/mesa: fix glDrawPixels(GL_DEPTH_COMPONENT) color output
When drawing a depth image the fragment shader also needs to emit the
current raster color.

The new piglit drawpix-z test exercises this.

NOTE: This is a candiate for the 8.0 branch.
2012-06-14 14:37:31 -06:00
Brian Paul
8031aa134e docs: add info about shortlog_mesa.sh script 2012-06-14 14:37:31 -06:00
Paul Berry
4b7b4c46c5 glx/tests and mesa/tests: Update .gitignore files.
This patch updates .gitignore files to account for the new build
artifacts introduced by the following commits:

ae376f0 glx/tests: Rename test as glx-test
8fecdcc mesa/tests: Add tests for _mesa_lookup_enum_by_{name,nr} functions
a29ad2b mesa/tests: Add tests for the generated dispatch table
2012-06-14 10:08:57 -07:00
Christian König
eb024c7488 st/vdpau: fix YCbCr down/up-loads for buffers larger than requested
When the video buffer turns out to be larger than
requested by the application we shouldn't upload
or download more data into / from it original requested.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39309

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-06-14 17:54:04 +02:00
Alexander von Gluck IV
cb3054c849 scons: Fix Haiku binary optimizations
Haiku targets the Pentium or higher processor.
To ensure compatibility we can do march 586 and
mtune 686. Mesa will still use sse however if
the cpu supports it (and the stack is properly
aligned). These flags only effect the internal
compiler optimizations.
2012-06-14 08:08:17 -07:00
Andreas Boll
c1dcf9665c mesa: fix html in shortlog_mesa.sh script
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-14 08:25:42 -06:00
Brian Paul
51c9c67a2f mesa: added Ian's shortlog_mesa.sh script in bin/ 2012-06-14 08:22:54 -06:00
Brian Paul
5234b8902c svga: make svga_surface_needs_propagation() surface const 2012-06-14 08:20:40 -06:00
Brian Paul
92b65637ab svga: add svga_surface_const() cast wrapper 2012-06-14 08:20:40 -06:00
Brian Paul
bffb3997c3 svga: fix comment typo 2012-06-14 08:20:40 -06:00
Aaron Watry
fc3bac8a40 rbug: fix make process on Linux Mint 13 x64.
Previously, rbug_*.c would fail to compile with incomplete prototype
errors when make was run from the command line on my machine. My IDE
always built fine, and still does after this patch (Netbeans 7.1.2).

Most of the includes from files in gallium/auxiliary/rbug/* were
assuming an rbug/ subdirectory, while the headers are actually in the
same directory as the .c files.

The build error was also previously a problem for me on Ubuntu 11.10
and Mint 12.

Fixes build for the following configuration: ./autogen.sh
--enable-debug --enable-texture-float --with-gallium-drivers=r600
--with-dri-drivers=radeon --enable-r600-llvm-compiler

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-14 08:14:59 -06:00
José Fonseca
93a42d1314 windows/gdi: Remove GL_NV_register_combiners and GL_NV_vertex_array_range exports 2012-06-14 12:02:03 +01:00
Ian Romanick
4bfdc83135 glsl: Fix pi/2 constant in acos built-in function
In single precision, 1.5707963 becomes 1.5707962513 which is too
small.  However, 1.5707964 becomes 1.5707963705 which is just right.
The value 1.5707964 is already used in asin.ir.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-06-13 18:26:11 -07:00
Ian Romanick
f18d3fe0cb glapi: Remove GL_NV_vertex_array_range from the dispatch table
There is no GLX protocol for these functions.  Open-source Linux
driver have not supported this extension for many years, and it seems
unlikely at this point that this support will return.  There's no
reason to have slots for these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
69d1851757 glapi: Remove GL_NV_fence from the dispatch table
There is no GLX protocol for these functions.  No open-source Linux
driver has ever supported this extension, and it seems unlikely at
this point that one ever will.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
6db7cf29b5 glapi: Remove GL_NV_register_combiners from the dispatch table
There is no GLX protocol for these functions.  No open-source Linux
driver has ever supported this extension, and it seems unlikely at
this point that one ever will.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:56 -07:00
Ian Romanick
a6002909a3 glapi: Remove GL_APPLE_texture_range from the dispatch table
There is no GLX protocol for these functions, and no Linux driver has
ever supported this extension.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
e62c4c765c glapi: Remove GL_SGIX_pixel_texture from the dispatch table
There is no GLX protocol for this function.  Open-source Linux driver
have not supported this extension for many years, and it seems
unlikely at this point that this support will return.  There's no
reason to have slots for this function in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
933714aabe glapi: Remove GL_SGIS_pixel_texture from the dispatch table
There is no GLX protocol for these functions, and no Linux driver has
ever supported this extension.  There's no reason to have slots for
these functions in the dispatch table.

The unit tests (GetProcAddress::TableDidntShrink and others) are also updated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:54 -07:00
Ian Romanick
a29ad2b421 mesa/tests: Add tests for the generated dispatch table
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:17:53 -07:00
Ian Romanick
8fecdcc587 mesa/tests: Add tests for _mesa_lookup_enum_by_{name,nr} functions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 13:14:22 -07:00
Ian Romanick
e08f9080ff glapi: Add missing GL_EXT_texture_sRGB_decode enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
1c25984b23 glapi: Add missing GL_EXT_framebuffer_sRGB enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
75c516c959 glapi: Add missing GL_EXT_packed_float enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
ffbccb8cef glapi: Add missing framebuffer sRGB enum
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
2d8d85d7fb glapi: Add uniform buffer object enums
These are from OpenGL 3.1 and ARB_uniform_buffer_object.  I only added
them to 3.1 because that required the least work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
c5071825b0 glapi: Add missing enums for GL_NV_fragment_program
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
2485a1332e glapi: Add missing enums for GL_ARB_occlusion_query2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:26 -07:00
Ian Romanick
22cdd7d817 glapi: Remove extraneous GL_ from TEXTURE_IMMUTABLE_FORMAT
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
21af1e9a0e glapi: Add missing enums for GL_ATI_fragment_shader
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
502449d71f glapi: Add texture swizzle enums
These are from OpenGL 3.3, ARB_texture_swizzle, and
EXT_texture_swizzle (with different names).  I only added them to 3.3
because that required the least work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
a4a0c1f09d glapi: Add a couple missing 3.0 enums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
cc1e74bd19 glapi: Add missing _NV extension on COMBINE4
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
78b30938cc glapi: Add missing enums for GL_EXT_vertex_array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
8fcec14417 glapi: Add missing enums for GL_EXT_compiled_vertex_array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:25 -07:00
Ian Romanick
3c22f79412 glx/tests: Add unit tests for generated code in indirect_init.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick
4c270f9c6b glx/tests: Add unit tests for generated code in indirect_size.c
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick
ae376f0567 glx/tests: Rename test as glx-test
This matches the existing test in src/glsl/tests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Ian Romanick
2e8c866f10 glx: Move tests from tests/glx to src/glx/tests
This matches the organization of other unit tests in Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-13 11:50:24 -07:00
Brian Paul
f68ab0398b util: add some comments, fix indentation 2012-06-13 08:52:40 -06:00
Matt Turner
ae419a0159 glsl: Transform dot product by a basis vector into a swizzle
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Matt Turner
9aa3fbcc2e glsl: Add is_basis function
Determines whether it's a basis vector, i.e., a vector with one element
equal to 1 and all other elements equal to 0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Matt Turner
d7bef19c7f glsl: Check for zero vectors in ir_binop_dot
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-12 18:51:25 -04:00
Brian Paul
82ce93a8fd mesa: move variable declaration out of loop to fix MSVC build 2012-06-12 16:31:36 -06:00
Stéphane Marchesin
a74c4fb89d mesa: Fix bool-int mismatch
Also include stdbool for windows.
2012-06-12 15:22:48 -07:00
Antoine Labour
3c9fab8822 mesa: Fix hash table leak
When a value was replaced, the new key was strdup'd and leaked.
To fix this, we modify the hash table implementation to return
whether the value was replaced and free() the (now useless)
duplicate string.
2012-06-12 14:42:22 -07:00
Antoine Labour
e2e9b4b10f mesa: Free uniforms correclty.
This is an array of uniforms, not a single one.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
2012-06-12 14:42:22 -07:00
Antoine Labour
53feb8ecdc meta: Cleanup the resources we allocate.
When we have multiple shared contexts, and one of them is
long-running, this will lead to never freeing those resources
since they are shared. Instead, free them right away on context
destruction since we know the other context isn't using them.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
2012-06-12 14:42:22 -07:00
Stéphane Marchesin
0256edd709 glx: Handle a null reply in QueryVersion.
Works around crashes when X connections break.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 8.0 branch.
2012-06-12 14:42:22 -07:00
Michel Dänzer
1657dec72d radeonsi: Don't always re-compile shaders after they're bound. 2012-06-12 20:18:24 +02:00
Dave Airlie
6d289390ec st/xorg: Fix crash on startup.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-06-12 18:48:28 +02:00
Michel Dänzer
90c6eacdb4 radeonsi: Use linear instead of constant interpolation for now.
Constant interpolation still hangs the GPU for some reason.
2012-06-12 18:48:28 +02:00
Thomas Stellard
4c418cf1a3 radeonsi: Handle SUB_f32.
Signed-off-by: Thomas Stellard <tom.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-06-12 18:48:16 +02:00
Michel Dänzer
4c4ef9c29a radeonsi: Only dump shaders with environment variable RADEON_DUMP_SHADERS=1. 2012-06-12 18:33:54 +02:00
Eric Anholt
7b11051a28 mesa: Build git_sha1.h before computing dependencies.
Otherwise, version.c doesn't get a dependency on it in a clean build,
and then it doesn't necessarily get generated before version.c is
compiled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50976
Reviewed-by: Jakob Bornecrantz jakob@vmware.com
2012-06-12 08:10:41 -07:00
Andreas Boll
fd64b39727 docs: whitespaces cleanup
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
5dc59455f9 docs: remove some superfluous <p> tags
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
8155ed37a1 docs: remove unused table styles
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
908f788503 docs: remove unused anchor links
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
210a27d8c3 docs: prefer lowercase html tags
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
cc4188895b docs: use id instead of <a name>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
f85d23cea4 docs/subset-A.html: fix markup
fixes tidy warnings:

line 11 column 1 - Warning: <center> isn't allowed in <h1> elements
line 10 column 1 - Info: <h1> previously mentioned
line 11 column 34 - Warning: discarding unexpected </center>
line 14 column 1 - Warning: <center> isn't allowed in <h2> elements
line 13 column 1 - Info: <h2> previously mentioned
line 13 column 1 - Warning: missing </h2> before <h3>
line 18 column 1 - Warning: discarding unexpected </center>
line 19 column 1 - Warning: discarding unexpected </h2>

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
2d7f319a0a docs/news.html: use proper markup
fixes tidy warnings:

line 1227 column 9 - Warning: missing <li>
line 1228 column 17 - Warning: missing <li>
line 1235 column 25 - Warning: missing <li>
line 1259 column 17 - Warning: missing <li>
line 1267 column 9 - Warning: missing <li>
line 1359 column 9 - Warning: missing <li>
line 1361 column 55 - Warning: discarding unexpected </i>
line 1354 column 1 - Warning: trimming empty <p>

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
df2be226d9 docs: fix html end/start tags
for more well-formed html

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:30 -06:00
Andreas Boll
703a662c15 docs: escape special html chars
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:29 -06:00
Andreas Boll
ecd5c7ceb8 docs: consolidate html header and footer
add doctype
add character encoding
add missing <head> tag
unify html header and footer

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-06-12 08:03:29 -06:00
Kenneth Graunke
45c21f852e mesa: Unbind GL_TEXTURE_BUFFER on DeleteBuffers.
Fixes oglconform's tbo/basic.buffer.delete test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-11 13:30:32 -07:00
Kenneth Graunke
bbb67c3efc mesa: Make glPrimitiveRestartIndex execute immediately in display lists.
From the GL_NV_primitive_restart spec:
"PrimitiveRestartIndexNV is not compiled into display lists, but is
 executed immediately."

Prior to this patch, calls to glPrimitiveRestartIndex would hit the noop
dispatch stub.

+2 oglconforms.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-11 13:28:23 -07:00
Kenneth Graunke
a75e704326 mesa: Check for a negative "size" parameter in glCopyBufferSubData().
From the GL_ARB_copy_buffer spec:
"An INVALID_VALUE error is generated if any of readoffset, writeoffset,
 or size are negative [...]"

Fixes oglconform's copybuffer/negative.CNNegativeValues test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-06-11 13:27:36 -07:00
Kenneth Graunke
4a5d020ee3 automake: Add AM_PROG_AR before LT_INIT to silence a lot of warnings.
The warnings appear to occur with newer automake (probably 1.12).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-11 13:27:36 -07:00
José Fonseca
ea606ee7b4 scons: Fix scons build. 2012-06-11 19:38:07 +01:00
Brad King
f3cdcb839f configure.ac: Add --with-(gl|glu|osmesa)-lib-name options
These allow one to mangle the library names, without also mangling the
symbol names, to make them distinct from other GL libraries on the
system.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
337d9c955b glsl: Put a bunch of optimization visitors under anonymous namespaces.
Because these classes are used entirely from their own source files
and not from separate DSOs, the linker gets to produce massively less
code.  This cuts about 13k of text in the libdricore case.  In the
non-libdricore case, the additional linkage information allows the
compiler to inline some code, so libglsl.a size actually increases by
about 300 bytes.

For a dricore build, improves shader_runner runtime on
glsl-fs-copy-propagation-texcoords-1 by 0.21% +/- 0.03% (n=353574,
outliers removed).  No statistically significant difference with n=322
on glslparsertest on a yofrankie shader intended to test compiler
performance.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
279efce8bb automake: Merge the dricore libglsl build into libdricore.
Now we have just one library of "all of Mesa core" instead of both
libdricore and libglsl that drivers link against.

I did this change in a sort of nonrecursive make fashion: the
generated files are still produced in the non-automake build, like the
rest of dricore, but the GLSL files are stuffed into libdricore
without building a convenience library in src/glsl (even though we
could now).  This would make a bit more sense if glsl was just another
dir under src/mesa, because right now I had to contort the prefix
variable name to look another ../ level up.
2012-06-11 09:28:00 -07:00
Eric Anholt
446faee094 automake: Add a prefix variable for libglsl sources.
See e86c40a84d for reasoning.  In the
process I did s/:=/=/ to shut up automake about nonportable make syntax.
2012-06-11 09:28:00 -07:00
Eric Anholt
7edbf4b323 automake: Convert src/Makefile to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
07abd913b6 automake: Move top-level makefile to automake.
This is part of a series to fix our build issues in the automake case
by hooking up the automatic Makefile regeneration support.  The
extract_git_sha1 is moved into src/mesa/Makefile so that we get
correct dependency generation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
743e505315 automake: Globally add stub automake targets to the old Makefiles.
I tried to update all the old Makefiles that included the default
config to be sure they had a default target if they didn't previously
have one, since this new all target will always point at it.  Almost
everything had one.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
4038dda6cd mesa: Move the version information right into configure.ac.
Nothing else called version.mk.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Eric Anholt
0cc216676c automake: Remove the old static configs system.
With the incremental automake conversion, we'd broken those that
included glx or egl.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-11 09:28:00 -07:00
Tapani Pälli
d5c1801a01 android: fix the build
Some more of the files are now autogenerated, this caused build breakage,
patch adds generation of these missing files. Patch also changes existing
make so that the files are created to be part of the local source
(not intermediate directory, this causes several problems).

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-06-11 09:27:59 -07:00
Michael Karcher
e2c08e824b i915g: Fix depth/stencil glClear
This patch fixes a copy/paste error and masking of depth/stencil (stencil
is in the top 8 bits), and makes glean/readPixSanity happy.

Both the stencil and the depth buffer piglit test also pass if
glClear(DEPTH | STENCIL) is executed instead of
glClear(DEPTH)/glClear(STENCIL).

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-06-10 16:33:42 +02:00
Kenneth Graunke
306c9f0c57 mesa: Fix "glCopyBuffserSubData" typos in error messages and comments.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 22:04:34 -07:00
Eric Anholt
a018747ac8 glsl: Clean up warnings about deleting classes without virtual destructors.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 12:42:38 -07:00
Marcin Slusarz
ea055e19c2 glsl: fix deref_hash memory leak in constant_expression_value
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 21:00:40 +02:00
Andreas Boll
ca9977d5c6 glcpp: .gitignore cleanup
*.o, *.lo and *~ are already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 11:18:55 -07:00
Andreas Boll
6224e90247 glapi: .gitignore cleanup
remove archaic .cvsignore
*.pyo is already in toplevel .gitignore
*.pyc is already in toplevel .gitignore

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-08 11:18:38 -07:00
Roland Scheidegger
dfbb18bdb5 gallivm: Fix calculating rho for 3d textures for the single-quad case
Discovered by accident, this looks like a very old typo bug.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-06-08 17:46:57 +01:00
Kenneth Graunke
529476b5e4 i965: Add forgotten bitcast operations in brw_fs_channel_expressions.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:22:11 -07:00
Paul Berry
9fd0e76a19 i965/blorp: allow all buffer formats provided src and dst match.
Previously, blits using the "blorp" mechanism only worked for 8-bit
RGBA color buffers, 24-bit depth buffers, and 8 bit stencil buffers.
This was not enough, because the blorp mechanism must be used for
blitting whenever MSAA is in use.  This patch allows all formats to be
used, provided the source and destination formats match.

So far I have confirmed that the following formats work properly with
MSAA:
- GL_RGB
- GL_RGBA
- GL_ALPHA
- GL_ALPHA4
- GL_ALPHA8
- GL_R3_G3_B2
- GL_RGB4
- GL_RGB5
- GL_RGB8
- GL_RGB10
- GL_RGB12
- GL_RGB16
- GL_RGBA2
- GL_RGBA4
- GL_RGB5_A1
- GL_RGBA8
- GL_RGB10_A2
- GL_RGBA12
- GL_RGBA16

Fixes piglit tests "EXT_framebuffer_multisample/formats {2,4}" on
Sandy Bridge and Ivy Bridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Paul Berry
530bda2aac i965/blorp: Implement logic for additional buffer formats.
Previously the blorp engine only supported RGBA8 color buffers and
24-bit depth buffers.  This patch adds support for any color buffer
format that is supported as a render target, and for 16-bit and 32-bit
depth buffers.

This required threading the brw_context struct through into
brw_blorp_surface_info::set() so that it can consult the
brw->render_target_format array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Paul Berry
9dbd0b6778 i965/blorp: De-virtualize brw_blorp_{mip,surface}_info::set() function.
Even though brw_blorp_surface_info is derived from brw_blorp_mip_info,
this function doesn't need to be virtual, because it is never accessed
through a base class pointer.  Making the function non-virtual will
allow it to take additional parameters in the brw_blorp_surface_info
case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Paul Berry
040d015734 i965/blorp: Refactor surface format determination.
This patch moves the responsibility for deciding on the format of the
source and destination surfaces from the
gen{6,7}_blorp_emit_surface_state() functions to
brw_blorp_surface_info::set(), which is shared between Gen6 and Gen7.
This will make it possible to add support for more surface formats
without code duplication.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 11:03:15 -07:00
Kenneth Graunke
05790746df i965: Enable the GL_ARB_shader_bit_encode extension.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:17:21 -07:00
Olivier Galibert
a83be8b6d7 st/mesa: Finally activate the ARB_shader_bit_encoding extension.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:17:14 -07:00
Olivier Galibert
e16b0a51be glsl: Bitwise conversion operator support in the software renderers.
TGSI doesn't need an opcode, since registers are untyped (but beware
once doubles come into the scene).  Mesa IR doesn't handle native
integers, so trying to handle them there is worthless, the case
entries are only added for warning reasons.

It was only tested with softpipe, since llvmpipe doesn't support glsl
1.3 yet.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:18 -07:00
Olivier Galibert
abe9767553 glsl: Bitwise conversion operator support in ir_constant_expression.
A "test_out = floatBitsToUint(-1.0);" fired through the GLSL compiler
gives a correct "(assign (x) (var_ref test_out)
(constant uint (3212836864)))"

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:18 -07:00
Olivier Galibert
1b8a3aad09 glsl: Bitwise conversion operator support in ir_validate.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:18 -07:00
Olivier Galibert
4fab150559 glsl: Bitwise conversion operator support in ir_expression.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:17 -07:00
Olivier Galibert
500dcbb1aa glsl: New unary opcodes for ARB_shader_bit_encoding support.
The opcodes are bitcast_f2u, bitcast_f2i, bitcast_i2f and bitcast_u2f.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:17 -07:00
Olivier Galibert
199771bc32 glsl: Scaffolding for ARB_shader_bit_encoding.
That adds support for activating the extension.  It doesn't actually
*do* anything yet, of course.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:06:00 -07:00
Kenneth Graunke
f8d40deea5 mesa: Return 8 bits for GL_TEXTURE_RED_SIZE on RGTC formats.
From the issues section of the GL_ARB_texture_compression_rgtc extension:

15) What should glGetTexLevelParameter return for
    GL_TEXTURE_GREEN_SIZE and GL_TEXTURE_BLUE_SIZE for the RGTC1
    formats?  What should glGetTexLevelParameter return for
    GL_TEXTURE_BLUE_SIZE for the RGTC2 formats?

    RESOLVED:  Zero bits.

    These formats always return 0.0 for these respective components
    and have no bits devoted to these components.

    Returning 8 bits for red size of RGTC1 and the red and green
    sizes of RGTC2 makes sense because that's the maximum potential
    precision for the uncompressed texels.

Thus, we need to return 8 bits for GL_TEXTURE_RED_SIZE on all RGTC formats
and 8 bits for GL_TEXTURE_GREEN_SIZE on RGTC2 formats.  BLUE should be 0.

Fixes oglconform/rgtc/advanced.texture_fetch.tex_param.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-07 00:01:40 -07:00
Kenneth Graunke
3603fdcebf glsl: Hook up loop_variable_state destructor to plug a memory leak.
While ~loop_state() is already freeing the loop_variable_state objects
via ralloc_free(this->mem_ctx), the ~loop_variable_state() destructor
was never getting called, so the hash table inside loop_variable_state
was never getting destroyed.

Fixes a memory leak in any shader with loops.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-07 00:01:40 -07:00
Tom Stellard
5f3f63b76d radeon/llvm: Emulate RECIP_UINT instruction on Cayman 2012-06-06 20:51:00 -04:00
Tom Stellard
0c9f5f22d5 radeon/llvm: Remove some duplicate code in the R600 CodeEmitter 2012-06-06 20:51:00 -04:00
Tom Stellard
9c46cb2368 radeon/llvm: Fix MULLO* instructions on Cayman
On Cayman, the MULLO* instructions must fill all slots in an
instruction group.
2012-06-06 20:50:36 -04:00
Tom Stellard
0c4b19ac63 r600g: Compute support for Cayman 2012-06-06 10:49:36 -04:00
Dave Airlie
2bb2e6a6e3 xorg: port to new compat API.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-06 15:22:50 +01:00
Brian Paul
ec19bdd16c mesa: consolidate internal glCompressedTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
e8fdd0e0d5 mesa: consolidate internal glCompressedTexImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
cd9ab2584f mesa: consolidate internal glCopyTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:56:00 -06:00
Brian Paul
e42d00b3f4 mesa: consolidate internal glTexSubImage1/2/3D code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:55:59 -06:00
Brian Paul
8f5fffe75d mesa: consolidate internal glTexImage1/2/3D code
The functions for handling 1D, 2D and 3D texture images were nearly
identical.  This folds them all together.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-06 07:55:59 -06:00
Brian Paul
3a62e8bcac translate_test: add support for half floats
Fixes assertion reported in
https://bugs.freedesktop.org/show_bug.cgi?id=44519
but there's still failing cases.
2012-06-06 07:55:59 -06:00
Brian Paul
adc58e96d0 docs: remove documentation of old Makefile system
It's going away in the near future.
2012-06-06 07:55:59 -06:00
Tom Stellard
d4942eb9fa radeon/llvm: Remove obselete hooks for the ConvertToISA pass
We can't remove this pass yet, because we need it to convert AMDIL
registers in BRANCH* instructions, but we don't need it for
instruction conversion any more.
2012-06-06 13:46:04 -04:00
Tom Stellard
edceed1b9a radeon/llvm: Remove AMDIL MOVE* instructions 2012-06-06 13:46:04 -04:00
Tom Stellard
f81e4663a7 radeon/llvm: Add isMov() to AMDILInstrInfo
This enables the CFGStructurizer to work without the AMDIL::MOV*
instructions.
2012-06-06 13:46:04 -04:00
Tom Stellard
1777c99bff radeon/llvm: Remove deadcode from the AMDILISelLowering class 2012-06-06 13:46:03 -04:00
Tom Stellard
8cc9b463de radeon/llvm: Don't lower RETURN to S_ENDPGM on SI
Instead create an S_ENDPGM instruction in the CodeEmitter and emit
it after all the other instructions.
2012-06-06 13:46:03 -04:00
Tom Stellard
de7366701d radeon/llvm: Remove AMDIL VCREATE* instructions
This obsoletes the AMDGPULowerInstruction pass.
2012-06-06 13:46:03 -04:00
Tom Stellard
8d53ddb375 radeon/llvm: Remove AMDIL LOADCONST* instructions
This obsoletes the R600LowerInstruction and SIPropagateImmReads passes.
2012-06-06 13:46:03 -04:00
Marcin Slusarz
17e047242e nouveau: fix scratch buffer leak
...and create common function for destroying nouveau_context
2012-06-05 23:58:43 +02:00
Marcin Slusarz
3232a86efe nv50: fix nv50_stream_output_state leak 2012-06-05 23:58:43 +02:00
Marcin Slusarz
cfa7cb991c nv50: fix symbol table memory leak 2012-06-05 23:58:43 +02:00
Kenneth Graunke
2f18698220 i965/fs: Fix user-defined FS outputs with less than four components.
OpenGL allows you to declare user-defined fragment shader outputs with
less than four components:

    out ivec2 color;

This makes sense if you're rendering to an RG format render target.

Previously, we assumed that all color outputs had four components (like
the built-in gl_FragColor/gl_FragData variables).  This caused us to
call emit_color_write for invalid indices, incrementing the output
virtual GRF's reg_offset beyond the size of the register.

This caused cascading failures: split_virtual_grfs would allocate new
size-1 registers based on the virtual GRF size, but then proceed to
rewrite the out-of-bounds accesses assuming that it had allocated enough
new (contiguously numbered) registers.  This resulted in instructions
that accessed size-1 GRFs which register numbers beyond
virtual_grf_next (i.e. registers that were never allocated).

Finally, this manifested as live variable analysis and instruction
scheduling accessing their temporary array with an out of bounds index
(as they're all sized based on virtual_grf_next), and the program would
segfault.

It looks like the hardware's Render Target Write message requires you to
send four components, even for RT formats such as RG or RGB.  This patch
continues to use all four MRFs, but doesn't bother to fill any data for
the last few, which should be unused.

+2 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
cb18472eca i965/vs: Fix texelFetchOffset() on pre-Gen7.
Commit 4650aea7a5 fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+18 piglits on Sandybridge.

NOTE: This and 4650aea7a5 are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
217b62bf00 i965/fs: Fix texelFetchOffset() on pre-Gen7.
Commit f41ecade7b fixed texelFetchOffset()
on Ivybridge, but didn't update the Ironlake/Sandybridge code.

+15 piglits on Sandybridge.

NOTE: This and f41ecade7b are both candidates for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
7fde071f04 meta: Fix GL_RENDERBUFFER binding in decompress_texture_image().
This isn't saved/restored by _mesa_meta_begin, so we need to do it
manually (like we do for the read/draw framebuffers).  Additionally,
we neglected to re-bind before the glRenderbufferStorage call.

+13 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
3edd2ba22b mesa: Unbind ARB_transform_feedback2 binding points on Delete too.
DeleteBuffer needs to unbind from these binding points as well, based on
the same rationale as the previous patch.

+51 oglconforms (together with the last patch).

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:34 -07:00
Kenneth Graunke
05b086ce93 mesa: Support BindBuffer{Base,Offset,Range} with a buffer of 0.
_mesa_lookup_bufferobj returns NULL for 0, which caused us to say
"there's no such buffer object" and raise an error, rather than
correctly binding the shared NullBufferObj.

Now you can unbind your buffers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:33 -07:00
Kenneth Graunke
cb8ed93dd0 mesa: Unbind ARB_copy_buffer and transform feedback buffers on delete.
According to the GL 3.1 spec, section 2.9 ("Buffer Objects"):
"If a buffer object is deleted while it is bound, all bindings to that
 object in the current context (i.e. in the thread that called
 DeleteBuffers) are reset to zero."

The code already checked for a number of cases, but neglected these
newer binding points.

+21 oglconforms.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-06-05 14:41:33 -07:00
Kenneth Graunke
25edfbfccf glsl/builtins: Fix textureGrad() for Array samplers.
We were incorrectly assuming that the coordinate's dimensionality is
equal to the gradient's dimensionality.  For array types, the coordinate
has one more component.

Fixes 12 subcases of oglconform's glsl-bif-tex-grad test.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-05 14:41:33 -07:00
Kristian Høgsberg
2c4f6ceeb4 configure.ac: Fail if egl x11 platform dependencies are not available
Currently, if you pass --with-egl-platforms=x11 but xcb-dri2 isn't available
we just silently fail and disables building the EGL DRI2 driver.

This commit cleans up the EGL platfrom checking and fails if a selected
platform can't find its required dependencies.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-05 14:34:33 -04:00
Alex Deucher
75f9d24ac4 r600g: add new Trinity PCI ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:16:42 -04:00
Alex Deucher
6ce298f9ce r600g: add new Sumo, Palm, BTC pci ids
Note this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:15:16 -04:00
Alex Deucher
01b7eb7c74 radeonsi: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-06-05 10:12:21 -04:00
Paul Berry
555e00fdc3 Fix .gitignore for ralloc-test
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-04 18:11:43 -07:00
Vinson Lee
105f307d90 st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Fix uninitialized scalar field defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-06-02 13:18:40 -07:00
Kenneth Graunke
adbfc4a09a i965: Implement texture buffer objects on Gen6.
Commit a07cf3397e added support for TBOs
on Gen7, but missed Gen6.

Passes piglit -t texture_buffer and oglconform's buffermapping
basic.read.texture tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-02 12:02:42 -07:00
Kenneth Graunke
608c3d2083 mesa: Restore depth texture state on glPopAttrib(GL_TEXTURE_BIT).
According to Table 6.17 in the GL 2.1 specification, DEPTH_TEXTURE_MODE,
TEXTURE_COMPARE_MODE, and TEXTURE_COMPARE_FUNC need to be restored on
glPopAttrib(GL_TEXTURE_BIT).

Makes a number of oglconform tests happier.

v2: Make restoration conditional on the ARB_shadow and ARB_depth_texture
    extensions, as suggested by Brian.  I'm not sure that any
    implementations still remain that don't support those, but why not?

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-02 12:02:42 -07:00
Eric Anholt
775ba11dcd automake: Connect the libdricore target to make clean.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50480
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-01 16:25:39 -07:00
Tapani Pälli
a9cfd95c24 automake: use -m32 in CCASFLAGS when using --enable-32-bit
this fixes libdricore directory build with --enable-32-bit on a x86_64 system

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-06-01 16:25:39 -07:00
Tom Stellard
0ebf2318b3 radeon/llvm: Fix VTX_READ patterns
The VTX_READ instructions were using the ADDRParam ComplexPattern which
allows a load instruction's offset to be a register, but VTX_READ
instructions can only handle an immediate offset.

Also, the load_param pattern fragment had an erroneous return true;
statement that was causing it to match the wrong load instructions.
2012-06-01 16:52:26 -04:00
Tom Stellard
c108831d44 radeon/llvm: Emit 2 bytes for vertex fetch offsets 2012-06-01 16:52:26 -04:00
Tom Stellard
85a68814ee radeon/llvm: Only use indirect (vertex fetch) parameters for kernels
Kernel parameters can only be retrieved via vertex fetchs.  Direct
parameters (i.e parameters stored in the constant buffer) are not
supported yet.
2012-06-01 16:52:26 -04:00
Kenneth Graunke
fb79ecb62d intel: Change vendor string to "Intel Open Source Technology Center".
Tungsten Graphics has not existed for several years, and the majority of
ongoing development and support is done by Intel.  I chose to include
"Open Source Technology Center" to distinguish it from, say, the closed
source Windows OpenGL driver.

The one downside to this patch is that applications that pattern match
against "Intel" may start applying workarounds meant for the Windows
driver.  However, it does seem like the right thing to do.

This does change oglconform behavior.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Acked-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-06-01 14:24:57 -07:00
Ian Romanick
adfe531841 glsl: Remove spurious printf messages
These look like debug messages from the switch-statement development.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-06-01 12:27:04 -07:00
Tom Stellard
d6c2d3722d radeon/llvm: Eliminate CFGStructurizer dependency on AMDIL instructions
Add some hooks to the R600,SI InstrInfo and RegisterInfo classes, so
that the CFGStructurizer pass can run without any relying on AMDIL
instructions.
2012-06-01 11:28:11 -04:00
Tom Stellard
65917004d9 radeon/llvm: Change prefix on tablegen files to AMDGPU 2012-06-01 11:28:11 -04:00
Tom Stellard
afea59bf65 radeon/llvm: Remove deadcode from the R600LowerInstructions pass 2012-06-01 11:28:10 -04:00
Tom Stellard
883a0af53a radeon/llvm: Remove AMDIL GLOBALSTORE* instructions 2012-06-01 11:28:10 -04:00
Tom Stellard
f2781271c7 radeon/llvm: Remove AMDIL GLOBALLOAD* instructions 2012-06-01 11:28:10 -04:00
Adam Rak
6a829a1b72 r600g: compute support for evergreen
Tom Stellard:
  - Updated for gallium interface changes
  - Fixed a few bugs:
    + Set the loop counter
    + Calculate the correct number of pipes
  - Added hooks into the LLVM compiler
2012-06-01 11:28:10 -04:00
Tom Stellard
46a13b3b11 clover: Add function for building a clover::module for non-TGSI targets v6
v2:
  -Separate IR type and LLVM triple
  -Do the OpenCL C->LLVM IR and linking steps for all PIPE_SHADER_IR
   types.

v3:
  - Coding style fixes
  - Removed compatibility code for LLVM < 3.1
  - Split build_module_llvm() into three functions:
    compile(), link(), and build_module_llvm()

v4:
  - Use struct pipe_compute_program

v5:
  - Don't malloc memory for struct pipe_llvm_program

v6:
  - Fix serialization of llvm bytecode

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
f2606413ec gallium: Add struct pipe_llvm_program_header v3
This structure is used as a header that precedes LLVM bytecode programs
that are passed to the drivers.

v2:
  - s/pipe_compute_program/pipe_llvm_program/

v3:
  - Rename to struct pipe_llvm_program_header
  - Drop the char * prog member

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
741463e18d clover: Remove target argument from compile_program_tgsi()
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:10 -04:00
Tom Stellard
d724190bce clover: Add constructors to some of the module classes v3
This is for the llvm code that can't use extended initializers.

v2:
  - Use const references for vector arguments
  - Move constructor defs before data members
  - Initialize all values in the default constructors

v3:
  - Fix typo
2012-06-01 11:28:09 -04:00
Tom Stellard
5cc08efe8f clover: Add necessary flags to libclllvm_la_CXXFLAGS
$(LLVM_CFLAGS) for LLVM defines
-DLIBCLC_PATH for libclc path
-DCLANG_RESOURCE_DIR for clang includes
$(DEFINES) for -DHAVE_LLVM
2012-06-01 11:28:09 -04:00
Tom Stellard
7a6b5d42d8 clover: Link to the necessary LLVM and Clang libs 2012-06-01 11:28:09 -04:00
Tom Stellard
d416780f39 configure.ac: Add variables LLVM_CPPFLAGS and LLVM_LIBDIR 2012-06-01 11:28:09 -04:00
Tom Stellard
c79e7668b2 configure.ac: Add option for libclc path 2012-06-01 11:28:09 -04:00
Tom Stellard
613323b256 clover: Add a function for retrieving a device's preferred ir v3
A device now has two function for getting information about the IR
it needs to return.

ir_format() => returns the preferred IR
ir_target() => returns the triple for the target that is understood by
                 clang/llvm.

v2:
  - renamed ir_target() to ir_format()
  - renamed llvm_triple() to ir_target()

v3:
  - Remove unnecessary include
  - Do proper conversion from std::vector<char> to std::string

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:28:09 -04:00
Francisco Jerez
c4c51153bc gallium/compute: Add PIPE_COMPUTE_CAP_IR_TARGET v4
v2: Tom Stellard
  - Update CAP description

v3: Tom Stellard
  - TGSI targets should pass an empty string for this CAP.

v4: Tom Stellard
  - TGSI targets can ignore this CAP.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:27:53 -04:00
Tom Stellard
1d118a2a76 gallium: Add PIPE_SHADER_IR_LLVM to enum pipe_shader_ir v2
v2:
  - s/PIPE_SHADER_IR_LLVM_R600/PIPE_SHADER_IR_LLVM/

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:26:57 -04:00
Tom Stellard
d85e512374 configure.ac: Add HAVE_OPENCL AM_CONDITIONAL v2
v2:
  - Drop HAVE_OPENCL variable for non-automake builds
  - s/HAVE_OPENCL/HAVE_GALLIUM_COMPUTE

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-06-01 11:26:57 -04:00
Brian Paul
091a61a8d5 scons: generate the glapitable.h file too 2012-06-01 08:27:21 -06:00
Brian Paul
8009fca501 svga: fix saturated TEX instructions
TEX instructions can't do saturation.  Do the TEX into a temp reg w/out
saturation, then do a MOV_SAT.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-31 12:54:04 -06:00
Brian Paul
dff36e900c scons: add code to generate the various GL API files
This fixes recent build breakage when we began building the generated
API files from xml as part of the normal build process.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=50475
2012-05-31 09:40:35 -06:00
Brian Paul
185ed21058 draw: simplify index buffer specification
Replace draw_set_index_buffer() and draw_set_mapped_index_buffer() with
draw_set_indexes() which simply takes a pointer and an index size.
2012-05-31 09:40:35 -06:00
Kenneth Graunke
151bf6e6cf glsl/tests: Plumb $(PYTHON2) and $(PYTHON_FLAGS) into optimization-test.
Some distributions (like Arch Linux) make /usr/bin/python Python 3,
rather than Python 2.  Since compare_ir uses /usr/bin/env python,
such systems will fail to run optimization-test, causing 'make check' to
always fail.

Automake's TESTS_ENVIRONMENT variable provides a mechanism to run
programs or set environment variables in the test environment.
Ideally, I think we would want to use AM_TESTS_ENVIRONMENT, since
TESTS_ENVIRONMENT is supposed to be user-overridable.  However, it isn't
supported using the default/serial test runner.

Fixes 'make check' on Arch Linux and Gentoo.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Matt Turner <mattst88@gmail.com>
2012-05-30 21:49:41 -07:00
Kenneth Graunke
a44ccdc876 ralloc: Add some basic unit tests.
I started writing unit tests for a new piece of code, and discovered
they all failed due to a bug in ralloc.  Clearly it needs a test suite.

v2: Rename to 'ralloc-test' and fix copyright date.  (idr review)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 21:49:41 -07:00
Kenneth Graunke
1559b2e2d7 ralloc: Fix ralloc_parent() of memory allocated out of the NULL context.
If an object is allocated out of the NULL context, info->parent will be
NULL.  Using the PTR_FROM_HEADER macro would be incorrect: it would say
that ralloc_parent(ralloc_context(NULL)) == sizeof(ralloc_header).

Fixes the new "null_parent" unit test.

NOTE: This is a candidate for the 7.9, 7.10, 7.11, and 8.0 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 21:49:40 -07:00
Kenneth Graunke
2224fb6047 automake: Check for 'indent' and fall back to 'cat' if not found.
The glapi generator code uses indent to produce more readable code.
However, we don't want to make GNU indent a hard build dependency; check
for it in configure.ac and fall back to 'cat' if it's not available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50484
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
2012-05-30 13:39:30 -07:00
Oliver McFadden
ff3eef1aff mesa: don't compile integer clear shaders for unsupported APIs
Discovered while running the Khronos conformance test suite and
receiving "implementation error: meta program compile failed."

This bug was recently introduced by the i965 clear patch set and would
only be detected while using the ES2 API and only on gen6+ hardware.

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-30 15:20:34 +03:00
Paul Berry
47b64c9290 i965/blorp: Implement destination clipping and scissoring
This patch implements clipping and scissoring of the destination rect
for blits that use the blorp engine (e.g. MSAA blits).
2012-05-29 15:35:35 -07:00
Eric Anholt
6a15790632 mesa: Clean up some dricore-related detritus in the old Makefile.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:51 -07:00
Eric Anholt
f9d1562f35 automake: Convert dricore building to automake.
This is performed in a subdirectory to avoid needing to convert all of
src/mesa/Makefile in one go.

I can now cherry-pick a commit containing glapi XML changes, do "(cd
src/mapi/glapi/gen && make) && make", and get a working driver.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:48 -07:00
Eric Anholt
e86c40a84d automake: Add a prefix variable to the common sources lists.
In order to do the minimal change for libdricore conversion to
automake, I need to put its Makefile.am in a subdirectory.  Automake
gets whiny/broken if you use GNU make features like "addprefix" or
"$(FILES:%=../%)" to munge your *_SOURCES.  So, use a plain old
variable to be able to substitute in that "../"

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:45 -07:00
Eric Anholt
7d7fe1b037 automake: Rename variables in sources.mak to be automake compatible.
*_SOURCES is reserved for files lists for particular automake targets.
 Also, "-" in the variable names is not allowed.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:42 -07:00
Eric Anholt
b284d4773b mesa: Remove generated source files during make clean.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:40 -07:00
Eric Anholt
79273b1a7a glapi: Enable silent rules for generation when used from automake.
This variable won't be set when called from non-automake makefiles,
but it cleans up shared-glapi's output.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:37 -07:00
Eric Anholt
559d592448 shared-glapi: Don't forget to clean our built file.
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:33 -07:00
Eric Anholt
26eaee3245 mesa: Restore installing of libGL for non-dri builds.
Reported-by: Sven Joachim <svenjoac@gmx.de>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 12:39:30 -07:00
Eric Anholt
0ce0f7c0c8 mesa: Remove the generated glapi from source control, and just build it.
Mesa already always depends on python to build.  The checked in
changes are not reviewed (because any trivial change rewrites the
world).  We also have been pushing commits between xml change and
regen where at-build-time xml-generated code disagrees with committed
xml-generated code.  And worst of all, sometimes we ("I") check in
*stale* xml-generated code.

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-29 11:51:57 -07:00
Kurt Roeckx
f92b2e5e90 i830: Fix crash for GL_STENCIL_TEST in i830Enable()
commit 87f12bb2d9 tried to fix rb->mt
being NULL, but change this case wrong.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-29 11:33:02 -07:00
Marcin Slusarz
8924133627 nv50: hook up forgotten short constant buffer upload method
Fixes crash in xorg st.
2012-05-29 20:24:45 +02:00
Tom Stellard
83169900fb radeon/llvm: Update and fix some comments 2012-05-29 11:59:01 -04:00
Tom Stellard
89ece086bc radeonsi: Remove use.sgpr* intrinsics, use load instructions instead
We now model loading uses sgpr values with LLVM IR load instructions that
use the USER_SGPR address space.

The definition of the sgpr parameter to the use_sgpr() helper function
in radeonsi_shader.c has changed so that you can pass raw sgpr values
rather than having to divide the sgpr value you want to use by the dword
width of the type you want to load.
2012-05-29 11:55:53 -04:00
Tom Stellard
467f51613e radeonsi: Handle TGSI CONST registers
We now emit LLVM load instructions for TGSI CONST register reads,
which are lowered in the backend to S_LOAD_DWORD* instructions.
2012-05-29 11:55:52 -04:00
Tom Stellard
32b83e0366 radeon/llvm: Remove AMDILIntrinsicInfo::GetDeclaration fuction body
This function was causing compile errors in the tablegen'd code for
some intrinsic definitions.  I don't think we really need this function,
so I'm removing the function body just as a temporary solution.  I'll
look into removing the entire AMDILIntrinsicInfo class later.
2012-05-29 11:55:52 -04:00
Tom Stellard
49fb99bd13 radeon/llvm: Remove AMDILTargetMachine 2012-05-29 11:55:52 -04:00
Christoph Bumiller
94a25b216b nouveau: unreference fences on resource destruction 2012-05-29 17:00:20 +02:00
Christoph Bumiller
1a21e36b68 nvc0: optimize blend cso by checking which by-RT data actually differs
Can save about 200 bytes of command buffer space.
2012-05-29 17:00:18 +02:00
Christoph Bumiller
f09ee76c98 nvc0: don't upload UCPs if the shader doesn't use them 2012-05-29 17:00:15 +02:00
Christoph Bumiller
79eed0d224 nvc0/ir: allow 64-bit constant loads on nve4
Looks like only 128-bit access doesn't work.
2012-05-29 17:00:10 +02:00
Christoph Bumiller
40c224a573 nvc0/ir: fix texture barrier insertion to prevent WAW hazards
Fixes, for instance, object highlighting in Diablo 3 (wine).
2012-05-29 15:01:41 +02:00
Christoph Bumiller
0d818cdacc nvc0/ir: TEX doesn't support JOIN modifier either 2012-05-29 15:01:41 +02:00
Christoph Bumiller
f80c2874ec gallium: add st_api feature mask to prevent advertising MS visuals
v2: use a define for the maximum sample count
v3: also test odd sample counts (r300 supports MS3)

While multisample renderbuffers are supported by mesa, MS visuals
are not, so we need a way to tell dri/st not to advertise them even
if the gallium driver does support multisampled surfaces.

Otherwise applications selecting these non-functional visuals would
run into trouble ...

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-29 15:01:41 +02:00
Roy Spliet
6404095fba nv30: Fix generic passing to fragment program in NV34. 2012-05-25 22:42:54 +02:00
Christoph Bumiller
384ef28cb3 nv30: handle user index buffers 2012-05-25 22:42:54 +02:00
Tom Stellard
704eac0916 radeon/llvm: Use a custom inserter for MASK_WRITE 2012-05-25 15:40:59 -04:00
Tom Stellard
4863477e22 radeon/llvm: Use tablegen pattern to lower bitconvert 2012-05-25 15:40:59 -04:00
Tom Stellard
667cdba211 radeon/llvm: Use a custom inserter to lower FNEG 2012-05-25 15:40:58 -04:00
Tom Stellard
d784bc7740 radeon/llvm: Use a custom inserter to lower CLAMP 2012-05-25 15:40:58 -04:00
Tom Stellard
17f8528923 radeon/llvm: Use a custom inserter to lower FABS 2012-05-25 15:40:58 -04:00
Kai Wasserbäch
2df2c31087 r600g: handle R16G16B16_FLOAT and R32G32B32_FLOAT in translate_colorswap
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50318

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2012-05-25 20:41:01 +02:00
Brian Paul
1609efb418 draw: fix primitive restart bug by using the index buffer offset
The code which scans the index buffer for restart indexes wasn't adding
the index buffer offset so we were always starting at offset=0.  The
offset is usually zero so it wasn't noticed before.

Fixes a failure in the piglit primitive-restart test when testing
vertex data + index data in a single VBO.

NOTE: This is a candidate for the 8.0 branch.
2012-05-25 10:02:22 -06:00
Brian Paul
93ea5cd80b svga: remove the special zero-stride vertex array code
This code actually hasn't been needed for some time now.  We can just
treat a zero-stride vertex array like any other non-zero-stride array.
2012-05-25 10:02:22 -06:00
Brian Paul
dcb4ec5ae1 gallium/docs: beef up the docs related to color clamping
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-05-25 10:02:22 -06:00
Brian Paul
9c85687439 util: add GALLIUM_LOG_FILE option for logging output to a file
Useful for logging different runs to files and diffing, etc.
2012-05-25 10:02:21 -06:00
Paul Berry
ab014adaed i965/msaa: Enable 4x MSAA on Gen7.
Basic 4x MSAA support now works on Gen7.  This patch enables it.

As with Gen6, MSAA support is still fairly preliminary.  In
particular, the following are not yet supported:
- 8x oversampling (Gen7 has hardware support for this, but we do not
  yet expose it).
- Fully general blits between MSAA and non-MSAA buffers.
- Formats other than RGBA8, DEPTH24, and STENCIL8.
- Centrold interpolation.
- Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE,
  GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
  GL_SAMPLE_COVERAGE_INVERT).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
4725ba03ca i965/msaa: Implement manual blending operation for Gen7.
On Gen6, the blending necessary to blit an MSAA surface to a non-MSAA
surface could be accomplished with a single texturing operation.  On
Gen7, the WM program must fetch each sample and blend them together
manually.  From the Bspec (Shared Functions/Messages/Initiating
Message/Message Types/sample):

    [DevIVB+]:Number of Multisamples on the associated surface must be
    MULTISAMPLECOUNT_1.

This patch implements the manual blend operation.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
8b1f467cce i965/msaa: Modify blorp code to account for Gen7 MSAA layouts.
Since blorp uses color textures and render targets to do all its work
(even when blitting stencil and depth data), it always has to
configure the Gen7 GPU to use the new "sliced" MSAA layout.  However,
when blitting stencil or depth data, the actual MSAA layout is
interleaved (as in Gen6).  Therefore, blorp has to do extra coordinate
transformation work to account for the interleaving manually.

This patch causes blorp to perform the necessary extra coordinate
transformations.

It also modifies the blorp SURFACE_STATE setup code for Gen7, so that
it does not try to correct the surface width and height to account for
MSAA, since "sliced" MSAA layout doesn't affect the surface width or
height.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
31f3dfd59b i965/msaa: Validate Gen7 surface state constraints.
When a Gen7 SURFACE_STATE is configured for MSAA, a number of
additional constaints come in to play.  This patch adds a function
gen7_check_surface_setup() which verifies that all of those
constraints are met.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
455ac56272 i965/msaa: Properly handle sliced layout for Gen7.
Starting in Gen7, there are two possible layouts for MSAA surfaces:

- Interleaved, in which additional samples are accommodated by scaling
  up the width and height of the surface.  This is the only layout
  available in Gen6.  On Gen7 it is used for depth and stencil
  surfaces only.

- Sliced, in which the surface is stored as a 2D array, with array
  slice n containing all pixel data for sample n.  On Gen7 this layout
  is used for color surfaces.

The "Sliced" layout has an additional requirement: it must be used in
ARYSPC_LOD0 mode, which means that the surface doesn't leave any extra
room between array slices for miplevels other than 0.

This patch modifies the surface allocation functions to use the
correct layout when allocating MSAA surfaces in Gen7, and to set the
array offsets properly when using ARYSPC_LOD0 mode.  It also modifies
the code that populates SURFACE_STATE structures to ensure that
ARYSPC_LOD0 mode is selected in the appropriate circumstances.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
0e11b2c5af i965/msaa: Add defines for Gen7.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
b08545199a i965/blorp: Enable blorp blits on Gen7.
Gen7 support for blorp (blits using the render bath) now works for
non-MSAA purposes.  This patch enables it.

Since blorp operations re-use the logic for HiZ ops, this required
adding a case to the switch statement in gen7_blorp_emit_wm_config(),
to allow for the case where no HiZ op is being performed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
1c73c705fa i965/blorp: Implement proper texel fetch messages for Gen7.
On Gen6, texel fetch is always accomplished using the SAMPLE_LD
message, which accepts arguments (u, v, r, lod, si).  On Gen7, there
are two* texel fetch messages: SAMPLE_LD for non-MSAA surfaces, taking
arguments (u, lod, v), and SAMPLE_LD2DSS for MSAA surfaces, taking
arguments (si, u, v).

*Technically, there are other texel fetch messages, but they are used
for "compressed" MSAA surfaces, which we don't yet support.

This patch adds the proper message types and argument orderings for
Gen7.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
f2cdfa4c85 i965/blorp: Use 16 pixel dispatch on Gen7.
Gen7 hardware requires us to enable at least one WM dispatch mode,
even if there is no program being dispatched to.  When this code was
only used for HiZ operations (which don't use a WM program), we used
32-pixel dispatch, because it didn't matter.  But blit programs are
compiled for 16-pixel dispatch.  So just enable 16-wide dispatch
unconditionally.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Enable 16-wide dispatch unconditionally rather than add the
unnecessary complication of using 32-wide dispatch when there is no WM
program.
2012-05-25 08:45:11 -07:00
Paul Berry
f7df7917e0 i965/blorp: Allocate space for push constants on Gen7.
On Gen7, push constants for shader programs are stored in the URB, so
blorp code needs to set aside space for them.  This was previously
unnecessary because blorp code was based on HiZ operations, which
don't require any shaders.

This patch adds a call from gen7_blorp_exec() to
gen7_allocate_push_constants(), to ensure that push constants are
assigned the correct location in the URB.  It also extracts a new
function gen7_emit_urb_state() from gen7_upload_urb(), which is
re-used by gen7_blorp_emit_urb_config() to ensure that the URB regions
used by all the pipeline stages leave room for the push constants.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
de9752a4e5 i965/blorp: Set the dynamic state upper bound.
We know from previous bug fixes (commits
c25e5300cb and
b2ace06cbb) that texture border color
doesn't work if the dynamic state upper bound is set to 0.  Although
the blorp engine doesn't make use of texture borders, it seems like we
ought to err on the safe side and set this value properly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
f77959b2c9 i965/blorp: Factor gen6_blorp_emit_batch_head into separate functions.
This patch separates out the portions of gen6_blorp_emit_batch_head()
that emit 3DSTATE_MULTISAMPLE, 3DSTATE_SAMPLE_MASK, and
STATE_BASE_ADDRESS.  This paves the way for making the blorp code work
on Gen7, where additional command packets
(3DSTATE_PUSH_CONSTANT_ALLOC_VS and 3DSTATE_PUSH_CONSTANT_ALLOC_PS)
need to be emitted before 3DSTATE_MULTISAMPLE.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:11 -07:00
Paul Berry
34a5f12e35 i965/blorp: Use MSDISPMODE_PERSAMPLE rendering when necessary
This patch modifies the "blorp" WM program so that it can be run in
MSDISPMODE_PERSAMPLE (which means that every single sample of a
multisampled render target is dispatched to the WM program, not just
every pixel).

Previously we were using the ugly hack of configuring multisampled
destination surfaces as single-sampled, and generating sample indices
other than zero by swizzling the pixel coordinates in the WM program.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-25 08:45:10 -07:00
Paul Berry
233c207e9e i965/blorp: Emit sample index in SAMPLE_LD message when necessary
This patch modifies the function brw_blorp_blit_program::texel_fetch()
to emit the SI (sample index) argument to the SAMPLE_LD message when
reading from a sample index other than zero.

Previously we were using the ugly hack of configuring multisampled
source surfaces as single-sampled, and accessing sample indices other
than zero by swizzling the texture coordinates in the WM program.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:10 -07:00
Paul Berry
665dc82bdc i965/blorp: Generalize sampling code in preparation for Gen7
This patch generalizes the function
brw_blorp_blit_program::texture_lookup() so that it prepares the
arguments to the sampler message based on a caller-provided array
rather than assuming the argument order is always (u, v).

This paves the way for the messages we will need to use in Gen7, which
use argument orders (u, lod, v) and (si, u, v) (si=sample index).

It will also will allow us to read from arbitrary sample indices on
Gen6, by supplying the arguments (u, v, r, lod, si) to the SAMPLE_LD
message instead of just (u, v).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-25 08:45:10 -07:00
Paul Berry
52fcc36f11 i965/msaa: Expand odd-sized MSAA surfaces to account for interleaving pattern.
Gen6 MSAA buffers (and Gen7 MSAA depth/stencil buffers) interleave
MSAA samples in a complex pattern that repeats every 2x2 pixel block.
Therefore, when allocating an MSAA buffer, we need to make sure to
allocate an integer number of 2x2 blocks; if we don't, then some of
the samples in the last row and column will be cut off.

Fixes piglit tests "EXT_framebuffer_multisample/unaligned-blit {2,4}
color msaa" on i965/Gen6.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-25 08:45:10 -07:00
Thomas Gstädtner
93594f38be gallium/targets: pass ldflags parameter to MKLIB
Without passing the -ldflags parameter before $(LDFLAGS) in some cases
flags will be passed to MKLIB which it does not understand.
This might be -m64, -m32 or similar.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Thomas Gstädtner <thomas@gstaedtner.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-25 09:36:24 -06:00
Vadim Girlin
a1a0974401 Revert "r600g: set round_mode to truncate and get rid of tgsi_f2i on evergreen"
This reverts commit 60bf0f05b4.

It seems round_mode behaves differently in some cases depending on  the
instruction/slot. Reverting it for now.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50232

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:28:08 +04:00
Vadim Girlin
1c5c4243c9 radeon/llvm: add FLT_TO_UINT, UINT_TO_FLT instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:46 +04:00
Vadim Girlin
5a1b59b4e6 radeon/llvm: prepare to revert the round mode state to default
Use TRUNC before FLT_TO_INT on evergreen/cayman.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:33 +04:00
Vadim Girlin
7fa7c608cb radeon/llvm: fix sampler index in llvm_emit_tex
Sampler index isn't a second source operand for some tgsi texture
instructions. Let's assume it's always the last.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50230

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:27:23 +04:00
Vadim Girlin
029776753b radeon/llvm: fix opcode for RECIP_UINT_r600
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50312

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:23:06 +04:00
Vadim Girlin
6806f81fb4 radeon/llvm/loader: convert hardcoded gpu name to option
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:22:38 +04:00
Vadim Girlin
482041a538 r600g: add RECIP_INT, PRED_SETE_INT to r600_bytecode_get_num_operands
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50315

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:22:12 +04:00
Vinson Lee
35f302d97e i915g: Check for geometry shader earlier in i915_set_constant_buffer.
Fix resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-24 18:50:07 -07:00
Vinson Lee
5cf693266f scons: Fix SCons build infrastructure for FreeBSD.
This patch gets the FreeBSD SCons build working again. The build still
fails though.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-24 18:49:40 -07:00
Tom Stellard
33e7db9a1d radeon/llvm: Lower UDIV using the Selection DAG 2012-05-24 14:12:32 -04:00
Tom Stellard
d088da917b radeon/llvm: Remove auto-generated AMDIL->ISA conversion code 2012-05-24 14:12:32 -04:00
Tom Stellard
662ccbfc21 radeon/llvm: Remove AMDIL instructions MULHI, SMUL 2012-05-24 14:12:32 -04:00
Tom Stellard
177b420283 radeon/llvm: Remove AMDIL bitshift instructions (SHL, SHR, USHR) 2012-05-24 14:12:32 -04:00
Tom Stellard
9d41a401dc radeon/llvm: Remove AMDIL FTOI and ITOF instructions 2012-05-24 14:12:32 -04:00
Tom Stellard
a8ba697c1e radeon/llvm: Remove AMDIL EXP* instructions 2012-05-24 14:12:31 -04:00
Tom Stellard
dd9927eb36 radeon/llvm: Remove AMDIL ADD instructions 2012-05-24 14:12:31 -04:00
Tom Stellard
1404e6b9fc radeon/llvm: Remove AMDIL binary instrutions (OR, AND, XOR, NOT) 2012-05-24 14:12:31 -04:00
Tom Stellard
3059c075a7 radeon/llvm: Remove AMDILMachinePeephole pass 2012-05-24 14:12:31 -04:00
Tom Stellard
e9d8901a80 radeon/llvm: Remove AMDIL CMP instructions and associated lowering code 2012-05-24 14:12:31 -04:00
Tom Stellard
ea00632fe0 radeon/llvm: Remove AMDIL ROUND_NEAREST instruction 2012-05-24 14:12:31 -04:00
Tom Stellard
0bfa3b3e96 radeon/llvm: Remove AMDIL ROUND_POSINF instruction 2012-05-24 14:12:31 -04:00
Tom Stellard
d4984f3463 radeon/llvm: Add custom SDNode for FRACT 2012-05-24 14:12:30 -04:00
Tom Stellard
5523502ff9 radeon/llvm: Use -1 as true value for SET* integer instructions 2012-05-24 14:12:30 -04:00
Tom Stellard
86dfae1103 radeon/llvm: Handle SETGE_INT, SETGE_UINT, and SETGT_UINT opcodes
Support for these was inadvertently dropped in commit
cee23ab246
2012-05-24 14:12:30 -04:00
Tom Stellard
cc7a6d2691 radeon/llvm: Avoid error with SI in EmitInstrWithCustomInserter()
We need to return immediately after inserting instructions that require
S_WAITCNT so that the parent class' custom inserter won't try to insert
them again.
2012-05-24 14:12:30 -04:00
Vinson Lee
0f6a3a7de3 tgsi: Initialize Padding struct fields.
Fix uninitialized scalar variable defects report by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-23 21:58:37 -07:00
Kenneth Graunke
88128516d4 i965: Gut the separate OpenGL ES extension enabling.
We should just set the bits of functionality that we support; the
GL/ES1/ES2 flags in extensions.c will take care of advertising the
appropriate extensions for the current API.

This enables the GL_EXT_texture_compression_dxt1 extension on ES1/ES2
when libtxc_dxtn is installed or the force_s3tc driconf option is set.
The main extension code set this up properly, but the ES-specific code
failed to do so.

Otherwise, the extension strings reported by es1_info, es2_info, and
glxinfo all remain the same.

This patch manually disables the ARB_framebuffer_object bit on ES
to preserve the behavior of 1c0f5d8324.

v2: Rebase, fix the i915 Makefile, and unconditionally set the
    OES_draw_texture bit as core Mesa will only apply it to ES1 now.

Tested-by: Daniel Charles <daniel.charles@intel.com> [v1]
Reviewed-by: Chad Versace <chad.versace@linux.intel.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 17:17:54 -07:00
Kenneth Graunke
d4667516b6 mesa: Remove the OES_draw_texture extension from ES2.
This extension appears to be written against ES 1.0.
In ES 2.0, you really want to be using FBOs instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 17:03:35 -07:00
Jordan Justen
dc50145253 i965: use cut index to handle primitive restart when possible
If the primitive restart index and the primitive type can
be handled by the cut index feature, then use the hardware
to handle the primitive restart feature.

The VBO module's software handling of primitive restart is
used as a fall back.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Jordan Justen
f9389fbfb2 i965: add flag to enable cut_index
When brw->prim_restart.enable_cut_index is set, the cut index
will be enabled when uploading index_buffer commands.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Jordan Justen
df7d1323de i965: create code path to handle primitive restart in hardware
For newer hardware we disable the VBO module's software handling
of primitive restart. We now handle primitive restarts in
brw_handle_primitive_restart.

The initial version of brw_handle_primitive_restart simply calls
vbo_sw_primitive_restart, and therefore still uses the VBO
module software primitive restart support.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 15:19:09 -07:00
Paul Berry
9f6932cb83 glsl/tests: Add .gitignore for uniform initialization unit test.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-23 14:24:33 -07:00
Paul Berry
aa173e16a0 glsl/constant propagation: kill whole var if LHS involves array indexing.
When considering which components of a variable were killed by an
assignment, constant propagation would previously just use the write
mask of the assignment.  This worked if the LHS of the assignment was
simple, e.g.:

v.xy = ...; // (assign (xy) (var_ref v) ...)

But it did the wrong thing if the LHS of the assignment involved an
array indexing operator, since in this case the write mask is always
(x):

v[i] = ...; // (assign (x) (deref_array (var_ref v) (var_ref i)) ...)

In general, we can't predict which vector component will be selected
by array indexing, so the only safe thing to do in this case is to
kill the entire variable.

Fixes piglit tests {fs,vs}-vector-indexing-kills-all-channels.shader_test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-23 14:21:48 -07:00
Ian Romanick
b45052b3f7 glsl/tests: Add test for uniform initialization by the linker
v2: Put unit tests in src/glsl/tests rather than tests/glsl.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
49da2590c2 mesa: Use initializers to configure samplers
Now that the linker handles initializers of samplers just like any
other uniform, a bunch of this annoying code is unnecessary.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
75dac69262 ir_to_mesa: Don't set initial uniform values again
This work is now done by the linker, so we don't need to keep doing it
here.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
c343b980d6 ir_to_mesa: Propagate initial values in _mesa_associate_uniform_storage
The linker may have set initial values for uniforms.  Propagate these
values to the driver's backing storage when it is first associated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:08 -07:00
Ian Romanick
76027f5b5c glsl: Propagate sampler uniform initializers to gl_shader_program::SamplerUnits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:42:07 -07:00
Ian Romanick
b610881317 glsl: Initialize samplers to 0, propagate sampler values to the gl_program
The spec requires that samplers be initialized to 0.  Since this
differs from the 1-to-1 mapping of samplers to texture units assumed
by ARB assembly shaders (and the gl_program structure), be sure to
propagate this date from the gl_shader_program to the gl_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
CC: Vadim Girlin <vadimgirlin@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49088
2012-05-23 11:42:07 -07:00
Ian Romanick
a2e623054b glsl: Set initial values for uniforms in the linker
v2: Fix handling of arrays-of-structure.  Thanks to Eric Anholt for
pointing this out.

v3: Minor comment change based on feedback from Ken.

Fixes piglit glsl-1.20/execution/uniform-initializer/fs-structure-array
and glsl-1.20/execution/uniform-initializer/vs-structure-array.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 11:41:49 -07:00
Eric Anholt
29362875f2 i965/gen6+: Add support for GL_ARB_blend_func_extended.
v2: Add support for gen6, and don't turn it on if blending is
    disabled. (fixes GPU hang), and note it in docs/GL3.txt

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-23 10:46:15 -07:00
Eric Anholt
175ad8050e mesa: Keep a computed value for dual source blend func with each buffer.
The i965 driver needed this as well for hardware setup, so instead of
duplicating the logic, just save it off.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-05-23 10:45:43 -07:00
Eric Anholt
68216f3581 i965/gen6+: Add support for fast depth clears.
Improves citybench high-res performance 3.0% +- 0.4%, n=10.  Improves
Lightsmark 1024x768 performance 0.74% +/- 0.20% (n=78).  No
significant difference on openarena (n=5, didn't fast clear) or nexuiz
(n=3).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:40:11 -07:00
Eric Anholt
5b248e5982 i965/gen6: Add CC viewport state setup to blorp code.
While it doesn't have the same warning in the simulator as in gen7,
let's emit it out of paranoia.  We wouldn't want our resolves of some
previous clear to get clamped to some current clamping value.

Suggested-by: pretty much everyone
2012-05-23 10:39:45 -07:00
Eric Anholt
39a91be20d i965/gen7: Add CC viewport setup to blorp code.
When doing fast clears, a fulsim warning said that the batch was being
emitted without the viewport set up.  While the fast clear pass I was
looking at doesn't use the clear value, the later resolves which also
didn't set up the vieport would trigger the same.  It's not obvious
from the error message whether it meant "fast clear value gets clamped
to something you haven't defined" or "fast clear value doesn't get
clamped, and I saw it was out of the current (uninitialized) range,
and you probably wanted it clamped to that (uninitialized) range".  Be
paranoid and assume the first case.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
54308f78a2 i965: Drop a layer of indirection in doing HiZ resolves.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
072634da4a i965: Replace intel_need_resolve with the hiz ops it maps to.
Having this enum separate caused us to need a bunch of helper
functions to translate to the op to be executed.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
5b226ad603 i965: Add an interface for doing hiz ops from C code.
This required moving gen6_hiz_op, and I put it in intel_resolve_map.h
for the next commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:27 -07:00
Eric Anholt
7da9795070 i965: Rename the clear function for this driver.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
3e1656567c i965: Simplify the remaining clear logic by relying on the meta clear.
The GLSL clear path doesn't need any buffer presence checks, since
those are already handled in the normal drawing path code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
7c3e88f1fc i965: Switch blit color clears to tri clears on gen4/5.
Our understanding is that the 3D engine is supposed to be faster
anyway.  We used to have more overhead in our tri clear path than we
do today, which would have led to this choice.  But given that we
almost always see a depth clear along with a color clear, the path was
hardly exercised anyway.

Also, the color mask logic was broken in the presence of
GL_EXT_draw_buffers2's per-buffer colormask.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
fa15b0f3f0 i965: Remove dead logic for non-tri depth/stencil clears.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
a3967ff441 i965: We always have GLSL, so always use it for tri clears.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
03c9044c2e i915: Drop gen4+ code from the forked clear code.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Eric Anholt
11892ea986 intel: Fork the intel_clear.c file between i915 and i965.
This logic is wasted on i965 when we want to just always do GLSL tri
clears.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-23 10:18:26 -07:00
Vadim Girlin
c91b4edff9 st/mesa: set stObj->lastLevel in guess_and_alloc_texture
Fixes lockups/asserts with depthstencil-render-miplevels tests and r600g.
Should also fix https://bugs.freedesktop.org/show_bug.cgi?id=50033

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-23 06:07:00 +04:00
Paul Berry
ea8e854b2c i965: Completely annotate the batch bo when aub dumping.
Previously, when the environment variable INTEL_DEBUG=aub was set,
mesa would simply instruct DRM to start dumping data to an .aub file,
but we would not provide DRM with any information about the format of
the data in various buffers.  As a result, a lot of the data in the
generate .aub file would be unannotated, making further data analysis
difficult.

This patch causes the entire contents of each batch buffer to be
annotated using the data in brw->state_batch_list (which was
previously used only to annotate the output of INTEL_DEBUG=bat).  This
includes data that was allocated by brw_state_batch, such as binding
tables, surface and sampler states, depth/stencil state, and so on.

The new annotation mechanism requires DRM version 2.4.34.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-22 15:19:00 -07:00
Paul Berry
1b87a93983 intel: When AUB dumping, flush before emitting final bitmap command.
When we are generating an AUB dump, we make a final call to
aub_dump_bmp() as the context is being destroyed, to ensure that any
rendering performed before the application exits can be seen during a
simulation run.  However, we were doing this before flushing the batch
buffer; as a result simulation runs would not always see the effect of
all rendering commands.

This patch flushes the batch buffer just before making the final call
to aub_dump_bmp(), to ensure that all rendering is properly captured
in the final bitmap.
2012-05-22 15:19:00 -07:00
José Fonseca
7a75e7d6e8 llvmpipe: Fix alpha testing precision on rgba8 formats.
This is a long standing problem, that recently surfaced with the change
to enable perspective correct color interpolation.

A fix for all possible formats is left to the future.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-05-22 19:23:49 +01:00
Vinson Lee
e4fb332af1 scons: Do not build glx and egl on Cygwin.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-22 10:15:14 -07:00
Christoph Bumiller
89155ba71d nv30: check for NULL vertex buffers in prevalidate_vbufs 2012-05-22 15:22:10 +02:00
Christoph Bumiller
a054fd8268 nv50: make unaligned index buffer offsets work again
Messed up in ef7bb28129.
2012-05-22 12:50:12 +02:00
Christoph Bumiller
91fb5e0394 nvc0: don't set NEW_IDXBUF in nvc0_switch_pipe_context if none is bound 2012-05-22 12:45:19 +02:00
James Benton
8a933e36d1 llvmpipe: Added a error counter to lp_test_conv.
Useful for keeping track of progress when fixing errors!

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:53 +01:00
James Benton
383c1b649b llvmpipe: Changed known failures in lp_test_conv.
To comply with the recent fixes to lp_bld_conv.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:51 +01:00
James Benton
4203a0b034 llvmpipe: Added fixed point types tests to lp_test_conv.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:49 +01:00
James Benton
a3d4af0c00 gallivm: Fixed erroneous optimisation in lp_build_min/max.
Previously assumed normalised was 0 to 1, but it can be -1 to 1
if type is signed.
Tested with lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:47 +01:00
James Benton
fdeb0394cb gallivm: Compensate for lp_const_offset in lp_build_conv.
Fixing a /*FIXME*/ to remove errors in integer conversion in lp_build_conv.
Tested using lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:46 +01:00
James Benton
f89b1f4ba4 gallivm: Fixed overflow in lp_build_clamped_float_to_unsigned_norm.
Tested with lp_test_conv and lp_test_format, reduced errors.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 20:24:44 +01:00
Brian Paul
c286278481 docs: add link to 8.0.3 release notes 2012-05-21 09:26:04 -06:00
Paul Seidler
a0dffe8701 tests: include mesa headers
else they will fail for fresh installs

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:42:19 -06:00
Lukas Rössler
6178b653c7 glu: fix two Clang warnings
This patch removes two Clang warnings in GLU:

The first one seems to be an actual bug in mapdesc.cc: Clang complains
that sizeof(dest) will return the size of REAL*[MAXCOORDS], instead of
the intended REAL[MAXCOORDS][MAXCOORDS]. The second one is just
cosmetic because Clang doesn't like extra parentheses.

NOTE: This is a candidate for the 8.0 branch

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:29:23 -06:00
Homer Hsing
ed9d1bef81 docs: fix a typo
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-21 08:07:20 -06:00
ojab
3d2bf91cc1 Filter out -Wcovered-switch-default from LLVM_CFLAGS
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-21 08:37:06 +01:00
Tom Stellard
cee23ab246 radeon/llvm: Handle selectcc DAG node
R600 can now select instructions from the selectcc DAG node, which is
typically lowered to one of the SET* instructions.
2012-05-20 16:27:31 -04:00
Brian Paul
239792fb22 st/mesa: use pipe_sampler_view_release() in st_destroy_context_priv()
Fixes another case of sampler views being created by one context,
shared by another, then deleted by the first, leaving a dangling
pipe context pointer.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
c9cb9cf050 mesa: use F_TO_I() instead of IROUND()
Use it where performance matters more and the exact method of float->int
conversion/rounding isn't terribly important.  There should no net change
here since F_TO_I() is the new name of the old IROUND() function.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
699c1894ee mesa: reimplement IROUND(), add F_TO_I()
The different implementations of IROUND() behaved differently and in
the case of fistp, depended on the current x86 FPU rounding mode.
This caused some tests like piglit roundmode-pixelstore and
roundmode-getintegerv to fail on 32-bit x86 but pass on 64-bit x86.

Now IROUND() always rounds to the nearest integer (away from zero).
The new F_TO_I function converts a float to an int by whatever means
is fastest.  We'll use this where we're more concerned with performance
and not too worried to how the conversion is done.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
31d59c78f0 mesa: fix Z32_FLOAT -> uint conversion functions
The IROUND converted all arguments to 0 or 1.  That's not what we wanted.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-19 08:28:57 -06:00
Brian Paul
c3991e1c57 st/mesa: remove unused pipe variable 2012-05-19 08:28:57 -06:00
Brian Paul
bd302f36c4 svga: whitespace, comments, formatting clean-ups 2012-05-19 08:28:57 -06:00
Brian Paul
6792969cbc st/mesa: added st_print_current_vertex_program(), for debugging 2012-05-19 08:28:56 -06:00
Brian Paul
2786343896 svga: return PIPE_OK instead of 0
And fix the emit_rss() function's return type.
2012-05-19 08:28:56 -06:00
Brian Paul
fc71e0b4a8 svga: fix zero-stride vertex array bug
For zero-stride vertex arrays, the svga driver copies the value into
the constant value and uses that value in the shader.  The recent
gallium-userbuf changes caused a regression in this.  An example
symptom was per-primitive glColor3f() calls getting ignored.

Where we copied the vertex value from the vertex buffer to the
constant buffer we neglected to take into account the
pipe_vertex_buffer::buffer_offset field.  Adding that value to the
source offset fixes the problem.  Actually, it looks like we should
have been doing this all along, but it never was an issue before for
some reason.
2012-05-19 08:28:56 -06:00
Brian Paul
0161691f35 mesa: add GLSL_REPORT_ERRORS debug flag
If the MESA_GLSL env var contains "errors", GLSL compilation and
link errors will be reported to stderr.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-19 08:28:56 -06:00
Brian Paul
1c333745f3 mesa: add some comments on shaderapi.c functions 2012-05-19 08:28:56 -06:00
Vinson Lee
315140969d mesa: Remove undefinition of _P symbol.
IRIX isn't used anymore.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-18 23:24:33 -07:00
Ian Romanick
0c6f4cd335 Import release notes for 8.0.3, add news item
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-18 16:27:17 -07:00
Jeremy Huddleston
27b821bc95 darwin: Address a build failure on Leopard and earlier OS versions
<https://trac.macports.org/ticket/34499>

Regression-from: 51691f0767
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-18 11:32:40 -07:00
Michel Dänzer
d59b2c4b53 radeonsi: Only honour point related rasterizer state when rendering points.
Avoids hangs when not rendering points.
2012-05-18 18:13:56 +02:00
Michel Dänzer
dd9d619459 radeonsi: Fix parameter cache offsets for fragment shader inputs. 2012-05-18 15:01:10 +02:00
Vinson Lee
e8a86d36f3 gallium/tgsi/text: Ensure ret is initialized in parse_immediate_data.
Fix uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-17 21:59:08 -07:00
Tom Stellard
c20e741799 radeon/llvm: Fix segfault while lowering lrp intrinsic 2012-05-17 20:42:16 -04:00
Tom Stellard
7e3cd8df18 radeon/llvm: Add DAG nodes for MIN instructions
Also, remove the AMDIL MIN* instruction defs.
2012-05-17 20:42:16 -04:00
José Fonseca
3f7a5ffac7 llvmpipe: Avoid adding floating point zero to flat inputs.
Which could clobber integer inputs, if the addition is not optimized away
(e.g., if optimizations are disabled for debugging purposes).
2012-05-18 01:03:13 +01:00
José Fonseca
00eb74b275 Fix fetching integer inputs. 2012-05-18 00:55:13 +01:00
Olivier Galibert
5d10d75727 llvmpipe: Implement TXQ.
Piglits test for fragment shaders pass, vertex shaders fail.  The
actual failure seems to be in the interpolators, and not the
textureSize query.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-18 00:27:28 +01:00
Olivier Galibert
1ec421823b llvmpipe: Don't mess with the provoking vertex when inverting a triangle.
Fixes a bunch of piglit tests related to flat interpolation of floats.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-18 00:07:18 +01:00
Tom Stellard
c6c8a05c50 radeon/llvm: Lower lrp intrinsic during ISel 2012-05-17 14:48:10 -04:00
Tom Stellard
ef8e66bc16 radeon/llvm: Remove AMDIL MAD instruction defs 2012-05-17 14:48:10 -04:00
Tom Stellard
d07473fcf4 radeon/llvm: Remove AMDIL MUL_IEEE* instructions 2012-05-17 14:48:10 -04:00
Tom Stellard
5187948bc2 r600g: Handle MUL_IEEE in r600_bytecode_get_num_operands 2012-05-17 14:48:09 -04:00
Tom Stellard
1fe70c6ae1 radeon/llvm: Expand fsub during ISel 2012-05-17 14:48:09 -04:00
Tom Stellard
9916f2d2af radeon/llvm: Remove AMDIL floating-point ADD instruction defs 2012-05-17 14:48:09 -04:00
Tom Stellard
91484de22d radeon/llvm: Remove AMDIL CMOVLOG* instruction defs 2012-05-17 14:48:09 -04:00
Tom Stellard
9a020092ae radeon/llvm: Move lowering of ABS_i32 to ISel 2012-05-17 14:48:09 -04:00
Tom Stellard
89b945591b radeon/llvm: Remove sub patterns from AMDILInstrPatterns.td 2012-05-17 14:48:09 -04:00
Tom Stellard
431bb79a41 radeon/llvm: Add custom SDNodes for MAX
We now lower the various intrinsics for max to SDNodes and then use
tablegen patterns to lower the SDNodes to instructions.
2012-05-17 14:48:09 -04:00
Jordan Justen
602913192d state_tracker: remove sw_primitive_restart from st_context
The VBO module now can handle primitive restart in software
if required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
eef193560e state_tracker: remove software handling of primitive restart
The VBO module now can handle primitive restart in software
if required. Therefore this support is no londer required.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
f16b39f05c state_tracker: set PrimitiveRestartInSoftware if needed
If the PIPE_CAP_PRIMITIVE_RESTART screen param is not set, then enable
PrimitiveRestartInSoftware to enable software primitive restart
support in the VBO module.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:54:26 -07:00
Jordan Justen
862667b6d9 vbo: use software primitive restart in the VBO module
When PrimitiveRestartInSoftware is set, the VBO module will handle
primitive restart scenarios before calling the vbo->draw_prims
drawing function.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Jordan Justen
fc22fde9d8 mesa: add PrimitiveRestartInSoftware to gl_context.Const
If set, then the VBO module will handle all primitive
restart scenarios before calling the driver draw_prims.

Software primitive restart support is disabled by default.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Jordan Justen
bc8e0f5b0f vbo: add software primitive restart support
vbo_sw_primitive_restart implements primitive restart in software
by splitting primitive draws apart.

This is based on similar support in mesa/state_tracker/st_draw.c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-17 10:54:26 -07:00
Eric Anholt
5a827d9a2b mesa: Check for framebuffer completeness before looking at the rb.
Otherwise, an incomplete framebuffer could have a NULL
_ColorReadBuffer and we'd deref that.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
8b7ba92605 mesa: Fix assertion failure when a cube face is not present.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
aa5ec13775 glsl: Drop the extra NULL specifiction on ir_assignment constructors.
It's an implied argument, and I don't think being explicit about it
helps.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
9c4e9ce051 glsl: Fix assertion failure on handling switch on uint expressions.
Fixes piglit glsl-1.30/execution/switch/fs-uint.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
bbbc7c7d56 glsl: Reject non-scalar switch expressions.
The comment quotes spec saying that only scalar integers are allowed,
but we only checked for integer.

Fixes piglit switch-expression-const-ivec2.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
5d6ea16dfe glsl: Let the constructor figure out the types of switch-related expressions.
I noticed this while unindenting the code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:24 -07:00
Eric Anholt
5462f3679a glsl: Fix indentation of switch code.
I managed to completely trash it in 22d81f15.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
aa02884c4f i965/vs: Fix up swizzle for dereference_array of matrices.
Fixes assertion failure in piglit:
vs-mat2-struct-assignment.shader_test
vs-mat2-array-assignment.shader_test

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
ef691885c9 mesa: Throw error on glGetActiveUniform inside Begin/End.
Fixes piglit GL_ARB_shader_objeccts/getactiveuniform-beginend.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-05-17 10:05:23 -07:00
Eric Anholt
05c200bac0 glsl: Improve the local dead code optimization to eliminate unused channels.
Total instructions: 261582 -> 261316
135/2147 programs affected (6.3%)
36752 -> 36486 instructions in affected programs (0.7% reduction)

This excludes a tropics shader that now gets 16-wide mode and throws
off the numbers.  5 shaders are hurt: two extra MOVs in 4 tropics
shaders it looks like because we don't split register names according
to independent webs, and one gstreamer shader where it looks like
try_rewrite_rhs_to_dst() is falling on its face.

This should also help avoid a regression in VSes from idr's ARB
programs to GLSL work.
2012-05-17 10:05:23 -07:00
Eric Anholt
f220f73b9c i965/fs: Do more register coalescing by using the interference graph.
By using the live variables code for determining interference, we can
handle coalescing in the presence of control flow, which the other
register coalescing path couldn't.

Total instructions: 207184 -> 206990
74/1246 programs affected (5.9%)
33993 -> 33799 instructions in affected programs (0.6% reduction)

There is a newerth shader that loses out, because of some extra MOVs
that now get their dead-code nature obscured by coalescing.  This
should be fixed by doing better at dead code elimination.
2012-05-17 10:05:23 -07:00
Christoph Bumiller
1befacc764 nouveau: place static buffers in VRAM if preferred by the driver 2012-05-17 15:24:58 +02:00
Christoph Bumiller
717f55d79d nv50/ir: fix reversed order of lane ops in quadops 2012-05-17 15:24:58 +02:00
Christoph Bumiller
e6caafd9d7 nv50,nvc0: handle user vertex buffers
And restructure VBO validation a little in the process.
2012-05-17 15:24:58 +02:00
Christoph Bumiller
ef7bb28129 nv50,nvc0: handle user index buffers 2012-05-17 15:24:58 +02:00
Christoph Bumiller
fcb2868210 nv50,nvc0: handle user constbufs without wrapping them in a resource 2012-05-17 15:24:58 +02:00
Christoph Bumiller
07323a80a2 st/mesa: set PIPE_BIND_STREAM_OUTPUT for TFB target in st_bufferobj_data 2012-05-17 15:24:58 +02:00
Jeremy Huddleston
d65bd195ec darwin: Eliminate a possible race condition while destroying a surface
Introduced by: c60ffd2840
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:30 -07:00
Jeremy Huddleston
a73a800b32 darwin: Unlock our mutex before destroying it
http://xquartz.macosforge.org/trac/ticket/575

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-16 18:58:29 -07:00
Michel Dänzer
7446a0407d gallium/radeon: Fix r300g tiling breakage.
Commit 11f056a3f0 broke the r300g build. Fix it
up, and reinstate some code which isn't needed by r600g and radeonsi but is
by r300g.
2012-05-16 23:52:19 +02:00
Francisco Jerez
03e3bc4ba5 gallium/auxiliary/pipe-loader: Fix usage of anonymous union.
Anonymous unions aren't part of the C99 standard.  Fixes build on GCC
versions older than 4.6.

https://bugs.freedesktop.org/show_bug.cgi?id=50001

Reported-by: Michael Lange <michaell@gmx.org>
2012-05-16 18:51:35 +02:00
Michel Dänzer
88a2e2388b radeonsi: Initial tiling support.
Largely based on the corresponding Evergreen support in r600g.
2012-05-16 18:30:50 +02:00
Michel Dänzer
11f056a3f0 r600g: Set tiling information for BOs being shared.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48747
2012-05-16 18:30:45 +02:00
Michel Dänzer
76d6a64de3 st/xorg: Better handling of EXA copies.
Always use the resource_copy_region hook. If a source and destination rectangle
overlap, copy to/from a temporary pixmap.
2012-05-16 18:30:39 +02:00
Michel Dänzer
0201c7d0af radeonsi: Bump MAX_DRAW_CS_DWORDS.
I missed this when updating si_context_draw().
2012-05-16 18:30:07 +02:00
José Fonseca
9af1ba565d draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.
Starting with LLVM 3.0, named structures are meant not for debugging, but
for recursive data types, previously also known as opaque types.

The recursive nature of these types leads to several memory management
difficulties.  Given that we don't actually need recursive types, avoid
them altogether.

This is an attempt to address fdo bugs 41791 and 44466. The issue is
somewhat random so there's no easy way to check how effective this is.
2012-05-16 15:00:23 +01:00
Olivier Galibert
982df3c1a5 llvmpipe: Color slot interpolation can be flat or perspective, not linear.
Fixes a bunch of glsl 1.10 interpolation piglit tests.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-16 13:12:04 +01:00
Homer Hsing
4050756804 configure.ac: Fix typos in the r600-llvm-compiler option
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 19:02:27 -04:00
José Fonseca
563489e5c9 gallivm: Add MCRegisterInfo.h to silence benign warnings about missing implementation.
Trivial.
2012-05-15 23:48:24 +01:00
Paul Berry
6335e0b073 i965/blorp: Move exec() out of brw_blorp_params.
No functional change.  This patch replaces the
brw_blorp_params::exec() method with a global function
brw_blorp_exec() that performs the operation described by the params
data structure.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-15 15:15:26 -07:00
Paul Berry
19e9b24626 i965/gen6: Initial implementation of MSAA.
This patch enables MSAA for Gen6, by modifying intel_mipmap_tree to
understand multisampled buffers, adapting the rendering pipeline setup
to enable multisampled rendering, and adding multisample resolve
operations to brw_blorp_blit.cpp. Some preparation work is also
included for Gen7, but it is not yet enabled.

MSAA support is still fairly preliminary.  In particular, the
following are not yet supported:
- Fully general blits between MSAA and non-MSAA buffers.
- Formats other than RGBA8, DEPTH24, and STENCIL8.
- Centroid interpolation.
- Coverage parameters (glSampleCoverage, GL_SAMPLE_ALPHA_TO_COVERAGE,
  GL_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE_VALUE,
  GL_SAMPLE_COVERAGE_INVERT).

Fixes piglit tests "EXT_framebuffer_multisample/accuracy" on
i965/Gen6.

v2:
- In intel_alloc_renderbuffer_storage(), quantize the requested number
  of samples to the next higher sample count supported by the
  hardware.  This ensures that a query of GL_SAMPLES will return the
  correct value.  It also ensures that MSAA is fully disabled on Gen7
  for now (since Gen7 MSAA support doesn't work yet).
- When reading from a non-MSAA surface, ensure that s_is_zero is true
  so that we won't try to read from a nonexistent sample.
2012-05-15 15:09:23 -07:00
Paul Berry
506d70be21 i965/gen6+: Add code to perform blits on the render path ("blorp").
This patch expands the "blorp" component to be able to perform blits
as well as HiZ resolves.  The new blitting code is located in
brw_blorp_blit.cpp.  This includes the necessary fragment shader code
to look up pixels in the source buffer (which is configured as a
texture) and output them to the destination buffer (which is
configured as the render target).

Most of the time the fragment shader code is simple and
straightforward, since it merely has to apply a coordinate offset,
read from the texture, and write to the render target.  However, in
the case of blitting stencil buffers, things are more complicated,
since the GPU stores stencil data using W tiling, and W tiling is not
supported for textures or render targets.  So, we set up the stencil
buffers as Y tiled, and emit fragment shader code that adjusts the
coordinates to account for the difference between W and Y tiling.
Furthermore, since a rectangular region in W tiling does not
necessarily correspond to a rectangular region in Y tiling, we widen
the rectangle primitive to the nearest tile boundary and have the
fragment shader "kill" any pixels that don't fall inside the actual
desired destination rectangle.

All of this is a necessary prerequisite for implementing MSAA, since
we'll need to be able to blit between multisample color, depth, and
stencil buffers and their non-multisampled counterparts, and none of
the existing blitting mechanisms support multisampling.

In addition, the new blitting code should speed up operations where we
previously fell back to software rasterization, such as blitting of
stencil buffers.  The current fallback sequence is: first we try to do
a blit using the hardware blitting engine.  If that fails we try to do
a blit using the render path.  If that also fails then we do the blit
using a meta-op (which may or may not fall back to software
rasterization).

Note that blitting using the render path has some limitations at the
moment: it only supports a few formats, and it doesn't support
clipping or scissoring.  These limitations will be addressed in future
patch series.

v2:
- Add the code that configures the WM program to
  gen{6,7}_emit_wm_config() and gen7_emit_ps_config() rather than
  creating separate ...enable() functions.
- Call intel_prepare_render before determining which miptrees we are
  blitting from/to, because it may cause miptrees to be reallocated.
- Allow the blit to mirror X and/or Y coordinates.
- Disable blorp blits on Gen7 for now, since they aren't working yet.
2012-05-15 15:09:23 -07:00
Paul Berry
36e3413418 i965: Expose surface setup internals for use by blits.
This patch exposes the functions brw_get_surface_tiling_bits and
gen7_set_surface_tiling, so that they can be re-used when setting up
surface states in gen6_blorp.cpp and gen7_blorp.cpp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-15 15:09:22 -07:00
Paul Berry
586b389474 i965: split gen{6,7}_blorp_exec functions into manageable chunks.
This patch splits up the gen6_blorp_exec and gen7_blorp_exec
functions, which were very long, into simple component functions.
With a few exceptions, there is one function per state packet.

This will allow blit functionality to be added without significantly
complicating the code.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Rename the functions gen{6,7}_emit_wm_disable() to
gen{6,7}_emit_wm_config() (since the WM is not actually disabled
during HiZ ops; it simply doesn't have a program).  Also, on gen7,
split out the configration of 3DSTATE_PS to a separate function
gen7_emit_ps_config().
2012-05-15 15:09:22 -07:00
Paul Berry
2c5510b71b i965: Parameterize HiZ code to prepare for adding blitting.
This patch groups together the parameters used by the HiZ functions
into a new data structure, brw_hiz_resolve_params, rather than passing
each parameter individually between the HiZ functions.  This data
structure is a subclass of brw_blorp_params, which represents the
parameters of a general-purpose blit or resolve operation.  A future
patch will add another subclass for blits.

In addition, this patch generalizes the (width, height) parameters to
a full rect (x0, y0, x1, y1), since blitting operations will need to
be able to operate on arbitrary rectangles.  Also, it renames several
of the HiZ functions to reflect the expanded role they will serve.

v2: Rename brw_hiz_resolve_params to brw_hiz_op_params.  Move
gen{6,7}_blorp_exec() functions back into gen{6,7}_blorp.h.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-15 15:09:22 -07:00
Kenneth Graunke
610910a66d i965: Implement guardband clipping on Ivybridge.
Improves performance in Citybench:
- 320x240: 9.19589% +/- 0.557621%
- 1280x480: 3.90797% +/- 0.774429%

No apparent difference in OpenArena.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-15 14:52:24 -07:00
Kenneth Graunke
85cd30406f i965: Implement guardband clipping on Sandybridge.
Improves performance in Citybench:
- 320x240:  19.8008% +/- 0.937818%
- 1280x480: 6.53856% +/- 0.859083%

No apparent difference in OpenArena nor Xonotic.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-15 14:52:24 -07:00
José Fonseca
5994a641d8 llvmpipe: Add a test for lp_build_sgn.
Only floating point though, but better than nothing.
2012-05-15 22:39:25 +01:00
José Fonseca
9fb4eef6a1 gallivm: Fix lp_build_sgn for normalized/fixed-point integers.
These types got broken with the recent commit that fixed lp_build_sgn
for negative integers.
2012-05-15 22:39:24 +01:00
José Fonseca
c95cea50a9 gallivm: Fix lp_build_const_xxx for negative integers.
Do proper rounding.

Thanks to Olivier Galibert for investigating this.
2012-05-15 22:39:24 +01:00
Brian Paul
1459c18f45 svga: fix FBO / viewport bugs
When drawing to a FBO, the viewport wasn't always set correctly.  It
was fine in the usual case of the viewport dims matching the surface
dims but broken otherwise.  In particular, this was happening because
the viewport scale is negative for FBO rendering.

The piglit fbo-viewport test exercises this.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-15 14:56:54 -06:00
Vadim Girlin
4a8d47c264 radeon/llvm: add support for texture offsets, fix TEX_LD
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:53:20 +04:00
Vadim Girlin
fa5a963dd6 radeon/llvm: add SET_GRADIENTS*, fix SAMPLE_G
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:53:06 +04:00
Vadim Girlin
b655f78b25 radeon/llvm: increase const regs count
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:26 +04:00
Vadim Girlin
12a2374da3 radeon/llvm: use IntrNoMem property for intrinsics where possible
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:16 +04:00
Vadim Girlin
63a8595271 radeon/llvm: use correct intrinsic for CEIL
Should be round_posinf instead of round_neginf.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:48:06 +04:00
Vadim Girlin
0298238bdd radeon/llvm: improve ABS_i32 lowering
We can save one instruction by lowering it to:
  SUB_INT tmp, 0, src
  MAX_INT dst, src, tmp

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:53 +04:00
Vadim Girlin
76e4898ba3 radeon/llvm: fix BUILD_VECTOR lowering for replicated value
We expect that all elements will be assigned even if they are equal

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:38 +04:00
Vadim Girlin
4b8db65dbf radeon/llvm: add names for AMDGPU* passes
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:22 +04:00
Vadim Girlin
76ba7e2205 radeon/llvm: add generated files to .gitignore
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-15 18:47:02 +04:00
Paul Berry
821c34ecd9 Add .gitignore files for recently-added gallium projects
This patch adds .gitignore files to ignore the makefiles generated by
the gallium pipe loader and the clover OpenCL state tracker.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-05-15 07:39:05 -07:00
José Fonseca
e88f9b9546 glsl: Fix lower_discard_flow prototype mismatch.
Should fix MSVC link failure.
2012-05-15 12:27:15 +01:00
Eric Anholt
9e9ae280e2 Revert "i965/fs: Jump from discard statements to the end of the program when done."
This reverts commit 31866308fc.

Fixes piglit glsl-fs-discard-exit-3 and unigine tropics rendering.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:53 -07:00
Eric Anholt
3de1395fa5 glsl: Implement the GLSL 1.30+ discard control flow rule in GLSL IR.
Previously, I tried implementing this in the i965 driver, but did so
in a way that violated the intent of the spec, and broke Tropics.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:51 -07:00
Eric Anholt
e21b9f1f19 glsl: Remove the opt_discard_simplification pass.
This conflicts with the GLSL 1.30+ rules for derivatives after a
discard has occurred.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 17:03:44 -07:00
Eric Anholt
f42cdc7984 i965/fs: Remove the requirement of no dead code for interference checks.
This will be convenient when I want to comment out optimization code
to see the raw program being optimized, but more importantly will let
the interference check be used during optimization.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:53:19 -07:00
Eric Anholt
d7787adda8 i965/fs: Add support for copy propagation.
We could do more by handling abs/negate and non-GRF sources, but this is
a good start.  Improves tropics performance 0.30% +/- .17% (n=43).

shader-db results:
Total instructions: 208032 -> 207184
60/1246 programs affected (4.8%)
23286 -> 22438 instructions in affected programs (3.6% reduction)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:53:19 -07:00
Eric Anholt
f7a71e2570 i965/fs: When doing no work for live interval calculation, do no allocation.
When I had a bug causing the backend to never finish optimizing, it
also sent me deep into swap.  This avoids extra memory allocation per
trip through optimization, and thus may reduce the peak memory
allocation of the driver even in the success case.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-14 16:51:00 -07:00
Eric Anholt
206eca631b i965/gen7: Set tile_x/y to 0 in the no-stencil case.
Fixes compiler warnings.
2012-05-14 16:51:00 -07:00
Eric Anholt
1e188f2dae intel: Fix signed/unsigned comparison warnings. 2012-05-14 16:51:00 -07:00
Eric Anholt
1c1040dcf0 intel: Fix compile warning from 7b6424143d 2012-05-14 16:51:00 -07:00
Eric Anholt
cdca6e3c9f intel: Fix compiler warning from 3cd7bee48f 2012-05-14 16:51:00 -07:00
Kenneth Graunke
a4e9b5a768 i965/fs: Add a local common subexpression elimination pass.
Total instructions: 18210 -> 17836
49/163 programs affected (30.1%)
12888 -> 12514 instructions in affected programs (2.9% reduction)

This reduces Lightsmark's "Scale down filter" shader from 395
instructions to 283, a whopping 28%.  It also reduces register pressure
significantly: the SIMD8 program now uses 29 registers instead of 101,
giving us more than enough room for a SIMD16 program.

v2: Add && !inst->conditional_mod to the "skip some instructions" check.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-14 15:13:55 -07:00
Kenneth Graunke
d1029f9988 i965/fs: Use a const reference in fs_reg::equals instead of a pointer.
This lets you omit some ampersands and is more idiomatic C++.  Using
const also marks the function as not altering either register (which
was obvious, but nice to enforce).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-14 15:12:46 -07:00
Oliver McFadden
bf78806133 mesa: print the Git SHA1 in GL_VERSION for ES1 and ES2.
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 19:13:44 +03:00
Oliver McFadden
60e8a49440 mesa: GLES specifies restrictions on uniform matrix transpose.
GL_INVALID_VALUE is generated if transpose is not GL_FALSE.

http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 19:13:43 +03:00
Michel Dänzer
8969de7e98 radeonsi: Keep around copies of original sampler states.
Fixes crashes when restoring sampler states after blits.
2012-05-14 17:56:03 +02:00
Michel Dänzer
1deb2be2b7 radeonsi: Flesh out shader interpolation related code.
Handle perspective interpolation and ceontroid vs. center.
2012-05-14 17:56:03 +02:00
Michel Dänzer
de52a56a0e radeonsi: Add proper SI family names. 2012-05-14 17:56:02 +02:00
Michel Dänzer
23e4fe2a53 radeonsi: Separate states for samplers and sampler views.
And reset nregs on updates. Prevents eventual assertion failure.
2012-05-14 17:56:02 +02:00
Michel Dänzer
36abadd0db radeonsi: Fixups for drawing with an index buffer.
Mostly using the DRAW_INDEX_2 type 3 packet instead of DRAW_INDEX, which is
no longer supported on SI.
2012-05-14 17:56:02 +02:00
Vinson Lee
599140119e vl: Initialize pipe_vertex_buffer.user_buffer fields.
Fix uninitialized scalar variable defects reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-14 08:44:16 -07:00
James Benton
24678700ed llvmpipe: Calculate fixed point coordinates for triangle setup earlier.
This allows us to calculate the triangle's area using fixed point,
previously it was cacluated in floating point space. It was possible
that a triangle which had negative area in floating point space had
a positive area in fixed point space.

Fixes fdo 40920.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-14 16:07:49 +01:00
Tom Stellard
ec201667bf radeon/llvm: Coding style fixes for R600CodeEmitter.cpp 2012-05-14 10:40:58 -04:00
Tom Stellard
224e187f98 radeon/llvm: Lower bitcast instructions to copies 2012-05-14 10:40:58 -04:00
Marek Olšák
ed9955dc29 radeonsi: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-13 14:32:57 +02:00
Marek Olšák
05ea705c7c r600g: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-13 14:32:57 +02:00
Marek Olšák
b2d6386086 r600g: handle R16G16B16_FLOAT and R32G32B32_FLOAT in translate_colorswap (EG) 2012-05-12 23:13:45 +02:00
Marek Olšák
b496136af8 gallium: remove user_buffer_create from the interface
Nothing uses it now.
2012-05-12 23:13:45 +02:00
Marek Olšák
1a840cc592 gallium/graw: stop using user_buffer_create
This is compile-tested.
2012-05-12 23:13:45 +02:00
Marek Olšák
685a28fd8a gallium/util: remove unused parameter nr_vertex_buffers in util_draw_max_index 2012-05-12 23:13:45 +02:00
Francisco Jerez
b70736fa82 clover: Fix build on i386. 2012-05-12 19:43:06 +02:00
Francisco Jerez
fcab4d4a34 clover: Check the total work-group size provided to clEnqueueNDRangeKernel. 2012-05-12 19:43:01 +02:00
Christoph Bumiller
5c9bccc97e clover, gallium: add PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK
This is not necessarily the product of MAX_BLOCK_SIZE[i].

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2012-05-12 19:33:48 +02:00
Francisco Jerez
ec848d2730 r600g: Handle compute caps. 2012-05-12 19:17:18 +02:00
Francisco Jerez
4065639310 r300g: Handle compute caps. 2012-05-12 19:17:13 +02:00
José Fonseca
f96540847e auxiliary/util: Ensure pipe_constant_buffer::user_buffer is initialized. 2012-05-12 17:23:52 +01:00
José Fonseca
7b49d4f05d scons: Fix missing gbm symbols in st/egl. 2012-05-12 17:10:32 +01:00
José Fonseca
96e73cc4ae targets/egl-static: Fix some missing symbols. 2012-05-12 17:10:32 +01:00
José Fonseca
fd687e06f0 trace: Fix pipe_context::clear dumping. 2012-05-12 17:10:31 +01:00
José Fonseca
b275bed549 trace: Fix pipe_shader_state dumping. 2012-05-12 17:10:31 +01:00
José Fonseca
e9efcd99d1 scons: Link r600_drm.so against libdrm-radeon 2012-05-12 17:10:31 +01:00
José Fonseca
9a23a69f45 trace: Match NULL context members. 2012-05-12 17:10:31 +01:00
Marek Olšák
7c799f8f6b gallium/docs: remove documentation of redefine_user_buffer 2012-05-12 13:09:19 +02:00
Michel Dänzer
74b9ef83cf radeonsi: Fixed point vertex formats aren't supported. 2012-05-12 12:27:10 +02:00
Michel Dänzer
24bc382010 radeonsi: Fixups for recent build infrastructure changes.
In particular for the pipe loader changes.
2012-05-12 12:12:21 +02:00
Dave Airlie
31a25dac98 r600g: setup COLOR1 for possible dual-src in the framebuffer bind
As pointed out by Marek, if we have only one cb, we may as well add this
single register write here rather than adding it in the draw loop.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-12 08:25:21 +01:00
Roy Spliet
e253ead78e nv30: Silence pipe_cap warnings
Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:48 +10:00
Roy Spliet
897d235132 nv30/shader: SSG, LIT only requires one source register
Fixes crashing due to assertion error

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:47 +10:00
Ben Skeggs
6660041483 nouveau/vieux: finish != flush, how about we do that..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-05-12 12:42:47 +10:00
Marek Olšák
9d6b46b1cd r300g/swtcl: move vertex buffer updates into set_vertex_buffers 2012-05-12 00:50:53 +02:00
Marek Olšák
735d0d93a7 r300g/swtcl: move index buffer updates from swtcl_draw_vbo into set_index_buffer 2012-05-12 00:50:53 +02:00
Marek Olšák
21b012d3b0 r300g/swtcl: malloc vertex and index buffers (don't use radeon DRM to get them)
Vertex and index buffers are never used by hardware, only by Draw.
SWTCL chipsets usually have very little memory, so this might help
with stability and reliability.
2012-05-12 00:50:53 +02:00
Marek Olšák
8a963d122d r300g/swtcl: don't do stuff which is only for HWTCL 2012-05-12 00:50:52 +02:00
Marek Olšák
f808984f43 r300g: remove slab allocator for pipe_resource (used mainly for user buffers) 2012-05-12 00:50:52 +02:00
Marek Olšák
4fd60ad6da r300g: remove user_buffer_create 2012-05-12 00:50:52 +02:00
Marek Olšák
bdba35befa r300g: fix breakage after gallium-userbuf merge 2012-05-12 00:50:52 +02:00
Brian Paul
550de24c17 llvmpipe: add cast to silence warning 2012-05-11 16:16:11 -06:00
Andreas Betz
9d6e908f14 vega: fix 565 color unpacking bug
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-05-11 16:13:14 -06:00
Brian Paul
93bcf7825d mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flags
Instead of having to hack the code to enable these debugging options,
set them through the MESA_DEBUG env var.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-11 16:13:14 -06:00
Brian Paul
014306578b mesa: implement DEBUG_ALWAYS_FLUSH debug option
This flag has been around for a while but it wasn't actually used anywhere.

Now, setting this flag causes a glFlush() to be issued after each
drawing call (including glBegin/End, glDrawElements, glDrawArrays,
glDrawPixels, glCopyPixels and glBitmap).
2012-05-11 16:13:14 -06:00
Brian Paul
da35c2b38c mesa: define DEBUG_SILENT flag, use in output_if_debug() 2012-05-11 16:13:14 -06:00
Brian Paul
88cd47187c mesa: clean-up the debug/verbose flag setup code
Split the verbose and debug flag setup code into separate functions.
2012-05-11 16:13:14 -06:00
Brian Paul
443195bdf8 mesa: do FLUSH_VERTICES() in _mesa_flush/finish()
This was being done in the _mesa_Flush/Finish() calls but if there
was an internal call to _mesa_flush/finish() the FLUSH_VERTICES()
wouldn't happen.  Looks like only the intel and radeon drivers made
such calls in MakeCurrent().
2012-05-11 16:13:14 -06:00
Brian Paul
1bc16bf98a mesa: fix glMaterial / dlist bug
When glColorMaterial() is used to latch glColor commands to a material
attribute, glMaterial calls to change that material should become no-ops.
This failed to work properly when the glMaterial call was inside a
display list.

This removes the Material function from the vbo_attrib_tmp.h template
file.  We have separate/different implementations for the "save" and
"exec" cases now.

NOTE: This is a candidate for the 8.0 branch.
2012-05-11 16:13:14 -06:00
Brian Paul
f272490546 mesa: fix/add error check in _mesa_ColorMaterial()
_mesa_material_bitmask() will record a GL error and return 0 if
face or mode are illegal.  Return early in that case.

NOTE: This is a candidate for the 8.0 branch.
2012-05-11 16:13:14 -06:00
Tom Stellard
bcfc97dbf4 radeon/llvm: More comments and cleanups 2012-05-11 15:09:52 -04:00
José Fonseca
23c0d469e5 gallivm: Fix copy'n'paste typo bug translating CEIL opcode.
Trivial.
2012-05-11 16:44:42 +01:00
Marek Olšák
d3bab0c7be r600g: assume DISCARD_WHOLE_RESOURCE is always used with WRITE 2012-05-11 17:36:11 +02:00
Marek Olšák
7435c04398 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2012-05-11 16:42:20 +02:00
Marek Olšák
bb4c5d72d7 Merge branch 'gallium-userbuf'
Conflicts:
	src/gallium/docs/source/screen.rst
	src/gallium/drivers/nv50/nv50_state.c
	src/gallium/include/pipe/p_defines.h
	src/mesa/state_tracker/st_draw.c
2012-05-11 16:38:13 +02:00
Tom Stellard
4d11a6a0c7 radeon/llvm: Fix Evergreen/Cayman tablegen predicates
Some Evergreen/Cayman instructions were being enabled for SI.
2012-05-11 09:43:47 -04:00
José Fonseca
96956dc507 gallium/tgsi: s/TGSI_BUFFER/TGSI_TEXTURE_BUFFER/
For consistency.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-11 14:37:00 +01:00
José Fonseca
223831ca14 gallium/tgsi: Redefine the TGSI_TEXTURE_UNKNOWN texture target.
Some code relies on the existing of an invalid texture target. It seems
safer to bring it back than to deal with unintended consequences.

This partially reverts commit a4ebb04214.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-11 14:36:20 +01:00
James Benton
11aa82cc0b llvmpipe: Fix triangle bounding box calculation to be correctly inclusive or exclusive
Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-11 13:21:23 +01:00
James Benton
0c8a8a35e1 llvmpipe: Change triangle rasterization comparison from < 0 to <= 0
Tested with custom rasterisation test tool added to piglit suite, reduced errors

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-11 13:21:21 +01:00
Francisco Jerez
60e7b08101 clover: Implement CL_MEM_COPY_HOST_PTR. 2012-05-11 12:39:44 +02:00
Alexey Shvetsov
19eae45e01 gallium/targets/pipe-loader: Prepend DESTDIR to the installation directory.
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
2012-05-11 12:39:44 +02:00
Tom Stellard
79d77b38b8 clover: Assorted build fixes.
Contains the following patches squashed in:

commit 9fff1dc0875f7c9591550fa3ebbe1ba7a18483fa
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:20:03 2012 +0100

    configure.ac: Build gallium loader when OpenCL is enabled

commit 542111cb02957418c6a285cb6ef2924e49adc66e
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:30:29 2012 +0100

    configure.ac: Add sw/null to GALLIUM_WINSYS_DIRS for gallium loader

commit 876f8de46062dde76b6075be3b6628f969b16648
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Thu Feb 9 11:26:05 2012 -0500

    configure.ac: Require gcc > 4.6.0 for clover

commit 99049d50fa3d9a23297ae658189c19c89dca1766
Author: Tom Stellard <thomas.stellard@amd.com>
Date:   Tue Mar 20 23:32:06 2012 +0100

    configure.ac: Require Gallium drm loader when gallium loader is enabled

    No longer silently exclude this when building OpenCL drivers
    for nouveau and r600.
2012-05-11 12:39:44 +02:00
Francisco Jerez
c6db1b3396 clover: Import OpenCL state tracker. 2012-05-11 12:39:44 +02:00
Francisco Jerez
309a186987 gallium/tests/trivial: Import compute unit tests.
Add a test program that tries to exercise some of the language
features commonly used by compute programs at the Gallium API level:

   - Correctness of the values returned by the grid parameters.
   - Proper functioning of resource LOADs and STOREs.
   - Subroutine calls.
   - Argument passing to the compute parameter through the INPUT
     memory space.
   - Mapping of buffer objects to the GLOBAL memory space.
   - Proper functioning of the PRIVATE and LOCAL memory spaces.
   - Texture sampling and constant buffers.
   - Support for multiple kernels in the same program.
   - Indirect resource indexing.
   - Formatted resource loads and stores (i.e. with channel conversion
     and scaling) using several different formats.
   - Proper functioning of work-group barriers.
   - Atomicity and semantics of the atomic opcodes.

As of now all of them seem to pass on my nvA8.
2012-05-11 12:39:44 +02:00
Francisco Jerez
b52a0f2281 gallium/gbm: Switch to auxiliary/pipe-loader.
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:44 +02:00
Francisco Jerez
66f7fd99fa gallium/tests/trivial: Switch to the pipe loader.
It simplifies things slightly, and besides, it makes possible to
execute the trivial tests on a hardware device instead of being
limited to software rendering.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:44 +02:00
Francisco Jerez
317be33d73 gallium: Add "pipe-loader" target.
This target generates pipe driver modules intended to be consumed by
auxiliary/pipe-loader.  Most of it was taken from the "gbm" target --
the duplicated code will be replaced with references to this target in
a future commit.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:43 +02:00
Francisco Jerez
e136453062 gallium: Add pipe loader for device enumeration and driver multiplexing.
The goal is to have a uniform interface to create winsys and
pipe_screen instances for any driver, exposing the device enumeration
capabilities that might be supported by the operating system (for now
there's a "drm" back-end using udev and a "sw" back-end that always
returns the same built-in devices).

The typical use case of this library will be:
>
> struct pipe_loader_device devs[n];
> struct pipe_screen *screen;
>
> pipe_loader_probe(&devs, n);
>[pick some device from the array...]
>
> screen = pipe_loader_create_screen(dev, library_search_path);
>[do something with screen...]
>
> screen->destroy(screen);
> pipe_loader_release(&devs, N);
>

A part of the code was taken from targets/gbm/pipe_loader.c, which
will be removed and replaced with calls into this library by a future
commit.
2012-05-11 12:39:43 +02:00
Francisco Jerez
2faf01c840 gallium/tgsi/text: Replace open-coded integer parsing with parse_int(). 2012-05-11 12:39:43 +02:00
Francisco Jerez
40123dae43 gallium/tgsi/text: Parse immediates of non-float data types. 2012-05-11 12:39:43 +02:00
Francisco Jerez
e9072863b1 gallium/tgsi: Fix tgsi_build_full_immediate() for non-float data types. 2012-05-11 12:39:43 +02:00
Francisco Jerez
a426b0d5bc gallium/tgsi/text: Make label parsing optional for branch instructions.
Structured branch instructions like IF, ELSE, BGNLOOP, ENDLOOP no
longer require a label argument, make it optional for them.
2012-05-11 12:39:43 +02:00
Francisco Jerez
49468a1b2a st/mesa: Use local temporary registers.
Local makes more sense in most places because non-inline function
calls are unimplemented anyway.
2012-05-11 12:39:42 +02:00
Francisco Jerez
b52e374ad3 gallium/tgsi/ureg: Support local temporary emission. 2012-05-11 12:39:42 +02:00
Francisco Jerez
1b8aecc797 gallium/tgsi/ureg: Lift the restriction on releasing temporaries over UREG_MAX_TEMP. 2012-05-11 12:39:42 +02:00
Francisco Jerez
0a62af3bcc gallium/util: Define util_strchrnul.
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-05-11 12:39:42 +02:00
Francisco Jerez
57c048f291 gallium/compute: Drop TGSI dependency.
Add a shader cap for specifying the preferred shader representation.
Right now the only supported value is TGSI, other enum values will be
added as they are needed.

This is mainly to accommodate AMD's LLVM compiler back-end by letting
it bypass the TGSI representation for compute programs.  Other drivers
will keep using the common TGSI instruction set.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-11 12:39:42 +02:00
Francisco Jerez
2644952bd4 gallium/tgsi: Introduce the "LOCAL" register declaration modifier.
This change will be useful to implement function parameter passing on
top of TGSI.  As we don't have a proper stack, a register-based
calling convention will be used instead, which isn't necessarily a bad
thing given that GPUs often have plenty of registers to spare.

Using the same register space for local temporaries and
inter-procedural communication caused some inefficiencies, because in
some cases the register allocator would lose the freedom to merge
temporary values together into the same physical register, leading to
suboptimal register (and sometimes, as a side effect, instruction)
usage.

The LOCAL declaration modifier specifies that the value isn't intended
for parameter passing and as a result the compiler doesn't have to
give any guarantees of it being preserved across function boundaries.

Ignoring the LOCAL flag doesn't change the semantics of a valid
program in any way, because local variables are just supposed to get a
more relaxed treatment.  IOW, this should be a backwards-compatible
change.
2012-05-11 12:39:41 +02:00
Francisco Jerez
c2d31a83a8 gallium/tgsi: Add support for atomic opcodes. 2012-05-11 12:39:41 +02:00
Francisco Jerez
9e550c3423 gallium/tgsi: Add support for barriers. 2012-05-11 12:39:41 +02:00
Francisco Jerez
581ddbcf93 gallium/tgsi: Define system values used to query the compute grid parameters. 2012-05-11 12:39:41 +02:00
Francisco Jerez
b8e808f1ef gallium/tgsi: Add resource write-back support.
Define a new STORE opcode with a role dual to the LOAD opcode, and add
flags to specify that a shader resource is intended for writing.
2012-05-11 12:39:41 +02:00
Francisco Jerez
82c90b2da8 gallium/tgsi: Add support for raw resources.
Normal resource access (e.g. the LOAD TGSI opcode) is supposed to
perform a series of conversions to turn the texture data as it's found
in memory into the target data type.

In compute programs it's often the case that we only want to access
the raw bits as they're stored in some buffer object, and any kind of
channel conversion and scaling is harmful or inefficient, especially
in implementations that lack proper hardware support to take care of
it -- in those cases the conversion has to be implemented in software
and it's likely to result in a performance hit even if the pipe_buffer
and declaration data types are set up in a way that would just pass
the data through.

Add a declaration flag that marks a resource as typeless.  No channel
conversion will be performed in that case, and the X coordinate of the
address vector will be interpreted in byte units instead of elements
for obvious reasons.

This is similar to D3D11's ByteAddressBuffer, and will be used to
implement OpenCL's constant arguments.  The remaining four compute
memory spaces can also be understood as raw resources.
2012-05-11 12:39:41 +02:00
Francisco Jerez
a4ebb04214 gallium/tgsi: Define the TGSI_BUFFER texture target.
This texture type was already referred to by the documentation but it
was never defined.  Define it as 0 to match the pipe_texture_target
enumeration values.
2012-05-11 12:39:40 +02:00
Francisco Jerez
63428372ca gallium/tgsi: Introduce the compute processor. 2012-05-11 12:39:40 +02:00
Francisco Jerez
1279923d72 gallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.
Move Interpolate, Centroid and CylindricalWrap from tgsi_declaration
to a separate token -- they only make sense for FS inputs and we need
room for other flags in the top-level declaration token.
2012-05-11 12:39:40 +02:00
Francisco Jerez
5f55cbc7d9 gallium: Add context hooks for binding shader resources. 2012-05-11 12:39:40 +02:00
Francisco Jerez
a5f44cc8c2 gallium/tgsi: Split sampler views from shader resources.
This commit splits the current concept of resource into "sampler
views" and "shader resources":

"Sampler views" are textures or buffers that are bound to a given
shader stage and can be read from in conjunction with a sampler
object.  They are analogous to OpenGL texture objects or Direct3D
SRVs.

"Shader resources" are textures or buffers that can be read and
written from a shader.  There's no support for floating point
coordinates, address wrap modes or filtering, and, unlike sampler
views, shader resources are global for the whole graphics pipeline.
They are analogous to OpenGL image objects (as in
ARB_shader_image_load_store) or Direct3D UAVs.

Most hardware is likely to implement shader resources and sampler
views as separate objects, so, having the distinction at the API level
simplifies things slightly for the driver.

This patch introduces the SVIEW register file with a declaration token
and syntax analogous to the already existing RES register file.  After
this change, the SAMPLE_* opcodes no longer accept a resource as
input, but rather a SVIEW object.  To preserve the functionality of
reading from a sampler view with integer coordinates, the
SAMPLE_I(_MS) opcodes are introduced which are similar to LOAD(_MS)
but take a SVIEW register instead of a RES register as argument.
2012-05-11 12:39:39 +02:00
Francisco Jerez
d9d82dcd00 gallium: Basic compute interface.
Define an interface that exposes the minimal functionality required to
implement some of the popular compute APIs.  This commit adds entry
points to set the grid layout and other state required to keep track
of the usual address spaces employed in compute APIs, to bind a
compute program, and execute it on the device.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-05-11 12:39:39 +02:00
Michel Dänzer
c2f1fbf912 radeonsi: Properly translate vertex format swizzle.
egltri_screen works correctly!
2012-05-11 11:54:58 +02:00
Tom Stellard
03d9c24c04 radeon/llvm: Remove AMDILMCCodeEmitter.cpp 2012-05-10 15:54:43 -04:00
Tom Stellard
628e5b208a radeon/llvm: Remove SILowerShaderInstructions.cpp 2012-05-10 15:41:32 -04:00
Tom Stellard
f8e9c29020 radeonsi/llvm: Move lowering of RETURN to ConvertToISA pass 2012-05-10 15:41:32 -04:00
Tom Stellard
fa63f97652 radeon/llvm: Add some comments 2012-05-10 15:41:31 -04:00
Tom Stellard
92faa21d29 radeon/llvm: Move util functions into AMDGPU namespace 2012-05-10 15:41:31 -04:00
Paul Berry
c569182461 i965/hiz: Convert gen{6,7}_hiz.h to gen{6,7}_blorp.h
This patch renames the gen6_hiz.h and gen7_hiz.h files to correspond
to the renames of the corresponding .cpp files (see previous commit).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:01 -07:00
Paul Berry
ea1274c9a6 i965/hiz: Convert gen{6,7}_hiz.c to C++
This patch converts the files gen6_hiz.c and gen7_hiz.c to C++, in
preparation for expanding the HiZ code to support arbitrary blits.

The new files are called gen6_blorp.cpp and gen7_blorp.cpp to reflect
the expanded role that this code will serve--"blorp" stands for "BLit
Or Resolve Pass".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:01 -07:00
Paul Berry
20b153b9ca i965/hiz: Make void pointer type casts explicit
Previous to this patch, gen6_hiz.c contained two implicit type casts
from void * to a a non-void pointer type.  This is allowed in C but
not in C++.  This patch makes the type casts explicit, so that
gen6_hiz.c can be converted into a C++ file.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Paul Berry
f28a7d0e77 intel: Work around differences between C and C++ scoping rules.
In C++, if a struct is defined inside another struct, or its name is
first seen inside a struct or function, the struct is nested inside
the namespace of the struct or function it appears in.  In C, all
structs are visible from toplevel.

This patch explicitly moves the decalartions of intel_batchbuffer to
toplevel, so that it does not get nested inside a namespace when
header files are included from C++.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Paul Berry
434fc8bde4 intel: Add extern "C" declarations to headers
These declarations are necessary to allow C++ code to call C code
without causing unresolved symbols (which would make the driver fail
to load).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-10 10:30:00 -07:00
Tom Stellard
b0bb125736 radeon/llvm: Auto-encode RAT_WRITE_CACHELESS_eg 2012-05-10 11:52:00 -04:00
Tom Stellard
fa3747ff2c radeon/llvm: Delete all instructions that have been custom lowered 2012-05-10 11:34:32 -04:00
Michel Dänzer
839cbd7853 radeonsi: Set NONE format for unused vertex shader position export slots. 2012-05-10 13:54:39 +02:00
Michel Dänzer
8f45cea81f radeonsi: Eliminate one more magic number for texture image resources. 2012-05-10 13:54:27 +02:00
Michel Dänzer
36d2914a19 radeonsi: Fix vertex buffer resource for stride 0. 2012-05-10 13:54:27 +02:00
Tom Stellard
788fd04dac radeon/llvm: Remove AMDGPUConstants.pm 2012-05-09 12:49:44 -04:00
Tom Stellard
c2e081030e radeon/llvm: Don't rely on tablegen for lowering int_AMDGPU_load_const 2012-05-09 12:49:44 -04:00
Tom Stellard
d0403cafd4 radeon/llvm: Make sure the LOAD_CONST def uses the isSI predicate 2012-05-09 12:49:44 -04:00
Brian Paul
a1c5513c17 svga: implement CEIL opcode translation
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-09 10:53:15 -06:00
Christoph Bumiller
f7665ca4fc glsl_to_tgsi: use TGSI_OPCODE_CEIL for ir_unop_ceil
The implementation using FLR was buggy, the second negation could
get lost.
2012-05-09 17:13:14 +02:00
Christoph Bumiller
6ae12bac59 gallium/drivers: handle TGSI_OPCODE_CEIL 2012-05-09 17:09:30 +02:00
Kai Wasserbäch
8c98635d4f r600g: Handle TGSI_OPCODE_CEIL (v2)
v2: Enabled CEIL on Cayman too.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-09 09:40:16 -04:00
Dave Airlie
729d914824 gallivm: implement iabs/issg opcode.
Reimplemented by Olivier Galibert <galibert@pobox.com>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-09 08:26:55 +01:00
Yuanhan Liu
f939776cb2 i965: fix wrong cube/3D texture layout
Fix wrong cube/3D texture layout for the tailing levels whose width or
height is smaller than the align unit.

From 965 B-spec http://intellinuxgraphics.org/VOL_1_graphics_core.pdf at
page 135:
   All of the LOD=0 q-planes are stacked vertically, then below that,
   the LOD=1 qplanes are stacked two-wide, then the LOD=2 qplanes are
   stacked four-wide below that, and so on.

Thus we should always inrease pack_x_nr, which results to the pitch of LODn
may greater than the pitch of LOD0. So we should refactor mt->total_width
when needed.

This would fix the following webgl test case on all gen4 platforms:
  conformance/textures/texture-size-cube-maps.html

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-05-09 15:13:56 +08:00
Tom Stellard
5aaaa6a426 radeon/llvm: Remove AMDILUtilityFunctions.cpp 2012-05-08 15:47:46 -04:00
Tom Stellard
21ab46eae8 radeon/llvm: Remove some unused functions from AMDILInstrInfo 2012-05-08 15:47:46 -04:00
Tom Stellard
f903da7335 radeon/llvm: Add some comments and fix coding style 2012-05-08 15:47:46 -04:00
Tom Stellard
a8d82c44f7 radeon/llvm: Remove the EXPORT_REG instruction 2012-05-08 15:47:46 -04:00
Tom Stellard
8a4c25dd7e radeon/llvm: Use a custom inserter to lower RESERVE_REG 2012-05-08 15:47:46 -04:00
Tom Stellard
94e797d0fa radeon/llvm: Use a custom inserter to lower STORE_OUTPUT 2012-05-08 15:47:46 -04:00
Tom Stellard
4226433625 radeon/llvm: Remove AMDGPULowerShaderInstructions class
It is no longer used.
2012-05-08 15:47:46 -04:00
Tom Stellard
ad385c402e radeon/llvm: Use a custom inserter to lower LOAD_INPUT 2012-05-08 15:47:45 -04:00
Tom Stellard
52a7f212d3 radeon/llvm: Remove the ReorderPreloadInstructions pass 2012-05-08 15:47:45 -04:00
Tom Stellard
e042b3aeed radeon/llvm: Remove old comment from AMDIL.h 2012-05-08 15:47:45 -04:00
Paul Berry
e19741c4d8 Add bin/compile to .gitignore
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 13:10:00 -07:00
Olivier Galibert
363c14ae0c glsl: Change built-in constant expression evaluation to run the IR.
This removes code duplication with
ir_expression::constant_expression_value and builtins/ir/*.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:55:52 -07:00
Olivier Galibert
2ff7b121ca glsl: Add an origin pointer in the function signature object.
This points to the object with the function body, allowing us to map
from a built-in prototype to the actual body with IR code to execute.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:55:52 -07:00
Olivier Galibert
8ec01ba2ff glsl: Add methods to copy parts of one ir_constant into another.
- copy_masked_offset copies part of a constant into another,
  assign-like.

- copy_offset copies a constant into (a subset of) another,
  funcall-return like.

These methods are to be used to trace through assignments and function
calls when computing a constant expression.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:50 -07:00
Olivier Galibert
a270e86d38 glsl: Add a constant_referenced method to ir_dereference*
The method is used to get a reference to an ir_constant * within the
context of evaluating an assignment when calculating a
constant_expression_value.

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:47 -07:00
Olivier Galibert
6e4852a3a5 glsl: Add a variable context to constant_expression_value().
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:46 -07:00
Olivier Galibert
27a198388e glsl: Extend ir_constant::zero to handle more types.
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
2012-05-08 12:55:38 -07:00
Kenneth Graunke
f72e9b2041 glsl: Fix broken constant expression handling for <, <=, >, and >=.
We were looping over all the vector components, but only dealing with
the first one.  This was masked by the fact that constant expression
handling on built-ins went through custom code for the lessThan()
/function/ rather than the ir_binop_less expression operator.

NOTE: This is a candidate for all release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Olivier Galibert <galibert@pobox.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-08 12:28:44 -07:00
Brian Paul
c55ebc3e3e vbo: add some comments 2012-05-08 12:12:03 -06:00
Brian Paul
ad5e3609d4 mesa: remove needless casts in save_EdgeFlag() 2012-05-08 12:12:03 -06:00
Brian Paul
2428de1c50 mesa: minor clean-ups in dlist material code 2012-05-08 12:12:03 -06:00
Brian Paul
b13ecbadea mesa: fix error strings in dlist code 2012-05-08 12:12:03 -06:00
Marek Olšák
c5e473fbe2 mesa: add gl_context::NewDriverState and use it for vertex arrays
The vbo module recomputes its states if _NEW_ARRAY is set, so it shouldn't use
the same flag to notify the driver. Since we've run out of bits in NewState
and NewState is for core Mesa anyway, we need to find another way.

This patch is the first to start decoupling the state flags meant only
for core Mesa and those only for drivers.

The idea is to have two flag sets:
- gl_context::NewState - used by core Mesa only
- gl_context::NewDriverState - used by drivers only (the flags are defined
                               by the driver and opaque to core Mesa)

It makes perfect sense to use NewState|=_NEW_ARRAY to notify the vbo module
that the user changed vertex arrays, and the vbo module in turn sets
a driver-specific flag to notify the driver that it should update its vertex
array bindings.

The driver decides which bits of NewDriverState should be set and stores them
in gl_context::DriverFlags. Then, Core Mesa can do this:
ctx->NewDriverState |= ctx->DriverFlags.NewArray;

This patch implements this behavior and adapts st/mesa.
DriverFlags.NewArray is set to ST_NEW_VERTEX_ARRAYS.

Core Mesa only sets NewDriverState. It's the driver's responsibility to read
it whenever it wants and reset it to 0.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Marek Olšák
50f7e75f9e mesa: move gl_client_array*[] from vbo_draw_func into gl_context
In the future we'd like to treat vertex arrays as a state and
not as a parameter to the draw function. This is the first step
towards that goal. Part of the goal is to avoid array re-validation
for every draw call.

This commit adds:
const struct gl_client_array **gl_context::Array::_DrawArrays.

The pointer is changed in:
* vbo_draw_method
* vbo_rebase_prims - unused by gallium
* vbo_split_prims - unused by gallium
* st_RasterPos

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Marek Olšák
a7ac9c9c7d vbo: move vbo_draw_method into vbo_context.h
I'll need vbo_context in that function soon.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-08 15:57:51 +02:00
Vadim Girlin
d6aa7cd7f8 radeon/llvm: add suport for cube textures
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
e98e209528 radeon/llvm: add support for CUBE ALU instruction
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
996fa375ec radeon/llvm: add support for some ALU instructions
Add support for IABS, NOT, AND, XOR, OR, UADD, UDIV, IDIV, MOD, UMOD, INEG,
I2F, U2F, F2U, F2I, USEQ, USGE, USLT, USNE, ISGE, ISLT, ROUND, MIN, MAX,
IMIN, IMAX, UMIN, UMAX

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:23 +04:00
Vadim Girlin
e9be193430 radeon/llvm: add missing cases for BREAK/CONTINUE
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
e740b60845 radeon/llvm: add support for AHSR/LSHR/LSHL instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
95ed0e9b6b radeon/llvm: add support for TXQ/TXF/DDX/DDY instructions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
d8a1204854 radeon/llvm: add support for VertexID, InstanceID
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
e3e7ae732c radeon/llvm: fix live-in handling for inputs
Set the input registers as live-in for entry basic block.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
757f471ba9 radeon/llvm: add support for v4i32
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
06db74a753 radeon/llvm: fix ABS_i32 instruction lowering
Swap source operands.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
3a6a1cd75f radeon/llvm: use integer comparison for IF
Replacing "float equal to 1.0f" with "int not equal to 0".
This should help for further optimization of boolean computations.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:22 +04:00
Vadim Girlin
2a88dfc521 radeon/llvm: use bitcasts for integers
We're using float as default type, so basically for every instruction that
wants other types for dst/src operands we need to perform the bitcast
to/from default float. Currently bitcast produces no-op MOV instruction,
will be eliminated later.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-05-08 01:18:21 +04:00
Tom Stellard
3f8c37967a r600g: Fix out of tree builds that use the LLVM backend
https://bugs.freedesktop.org/show_bug.cgi?id=49567
2012-05-07 15:05:25 -04:00
Tom Stellard
c425c3823f radeon/llvm: Remove references to DebugFlag and isCurrentDebugType()
These weren't being used at all and they were causing build failures
when LLVM was built with NDEBUG defined and mesa was not.

https://bugs.freedesktop.org/show_bug.cgi?id=49110
2012-05-07 14:01:53 -04:00
Paul Berry
714b4f6184 i965/Gen7: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen7, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
2012-05-07 10:50:33 -07:00
Paul Berry
a683012a80 i965/Gen6: Work around GPU hangs due to misaligned depth coordinate offsets.
In i965 Gen6, Mesa has for a long time used the "depth coordinate
offset X/Y" settings (in 3DSTATE_DEPTH_BUFFER) to cause the GPU to
render to miplevels other than 0.  Unfortunately, this doesn't work,
because these offsets must be aligned to multiples of 8, and miplevels
in the depth buffer are only guaranteed to be aligned to multiples of
4.  When the offsets aren't aligned to a multiple of 8, the GPU
sometimes hangs.

As a temporary measure, to avoid GPU hangs, this patch smashes the 3
LSB's of "depth coordinate offset X/Y" to 0.  This results in
incorrect rendering to mipmapped depth textures, but that seems like a
reasonable stopgap while we figure out a better solution.

(Note that we have only ever observed this GPU hang on Gen6 when HiZ
is enabled, so another possible stopgap would be to disable HiZ).

Avoids GPU hangs in piglit test "depthstencil-render-miplevels" at
texture sizes that are not powers of 2.

Reviewed-by: Chad Verace <chad.versace@linux.intel.com>
2012-05-07 10:50:04 -07:00
Paul Berry
b9819a027d fbo: Only reuse depth/stencil attachments if the parameters match.
When the user attaches a texture to one of the depth/stencil
attachment points (GL_STENCIL_ATTACHMENT or GL_DEPTH_ATTACHMENT), we
check to see if the same texture is also attached to the other
attachment point, and if so, we re-use the existing texture
attachment.  This is necessary to ensure that if the user later
queries what is attached to GL_DEPTH_STENCIL_ATTACHMENT, they will not
receive an error.

If, however, the user attaches buffers to the two different attachment
points using different parameters (e.g. a different miplevel), then we
can't re-use the existing texture attachment, because it is pointing
to the wrong part of the texture.  This might occur as a transitory
condition if, for example, if the user attached miplevel zero of a
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT, rendered to
it, and then later attempted to attach miplevel one of the same
texture to GL_STENCIL_ATTACHMENT and GL_DEPTH_ATTACHMENT.

This patch causes Mesa to check that GL_STENCIL_ATTACHMENT and
GL_DEPTH_ATTACHMENT use the same attachment parameters before
attempting to share the texture attachment.

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 depth_stencil_shared"
and "texturing/depthstencil-render-miplevels 1024
stencil_depth_shared".

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-07 10:48:53 -07:00
Paul Berry
3ec0e55b63 i965: Fix mipmap offsets for HiZ and separate stencil buffers.
When rendering to a miplevel other than 0 within a color, depth,
stencil, or HiZ buffer, we need to tell the GPU to render to an offset
within the buffer, so that the data is written into the correct
miplevel.  We do this using a coarse offset (in pages), and a fine
adjustment (the so-called "tile_x" and "tile_y" values, which are
measured in pixels).

We have always computed the coarse offset and fine adjustment using
intel_renderbuffer_tile_offsets() function.  This worked fine for
color and combined depth/stencil buffers, but failed to work properly
when HiZ and separate stencil were in use.  It failed to work because
there is only one set of fine adjustment controls shared by the HiZ,
depth, and stencil buffers, so we need to choose tile_x and tile_y
values that are compatible with the tiling of all three buffers, and
then compute separate coarse offsets for each buffer.

This patch fixes the HiZ and separate stencil case by replacing the
call to intel_renderbuffer_tile_offsets() with calls to two functions:
intel_region_get_tile_masks(), which determines how much of the
adjustment can be performed using offsets and how much can be
performed using tile_x and tile_y, and
intel_region_get_aligned_offset(), which computes the coarse offset.

intel_region_get_tile_offsets() is still used for color renderbuffers,
so to avoid code duplication, I've re-worked it to use
intel_region_get_tile_masks() and intel_region_get_aligned_offset().

On i965 Gen6, fixes piglit tests
"texturing/depthstencil-render-miplevels 1024 X" where X is one of
(depth, depth_and_stencil, depth_stencil_single_binding, depth_x,
depth_x_and_stencil, stencil, stencil_and_depth, stencil_and_depth_x).

On i965 Gen7, the variants of
"texturing/depthstencil-render-miplevels" that contain a stencil
buffer still fail, due to another problem: Gen7 seems to ignore the 3
LSB's of the tile_y adjustment (and possibly also tile_x).

v2: Removed spurious comments.  Added assertions to check
preconditions of intel_region_get_aligned_offset().

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-07 10:47:49 -07:00
Chad Versace
1c0f5d8324 intel: Disable ARB_framebuffer_object in ES contexts
This patch removes ARB_framebuffer_object from the GLES1 and GLES2
extension lists in intel_extensions_es.c.

Fixes a crash in the Android browser on Ice Cream Sandwich.

The Android browser crashed because it did the following, which is legal
in GLES2 but not in ARB_framebuffer_object.
    glGenFramebuffers(1, &fb);
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // render render render...
    glDeleteFramebuffers(1, &fb);
    // go do other stuff...
    glBindFramebuffer(GL_FRAMEBUFFER, fb);
    // This bind unexpectedly failed, and the app panics.

The semantics of glBindFramebuffer specified by ARB_framebuffer_object (a
desktop GL extension) and GLES2 specs are incompatible. The ideal solution
to fix this is to create separate API entry points for glBindFramebuffer,
one for GL and the other for GLES2. But, until that work is complete,
disabling ARB_framebuffer_object in GLES2 contexts safely fixes the problem.

Likewise, the semantics of glBindFramebuffer in ARB_framebuffer_object and
of glBindFramebufferOES in OES_framebuffer_object (a GLES1 extension) are
incompatible. Even though the functions have different names, the semantic
difference still results in a bug because both API calls are implemented
by a single function, _mesa_BindFramebufferEXT, which handles the semantic
difference incorrectly. Again, disabling ARB_framebuffer_object in GLES1
contexts safely fixes this problem.

According to the ARB_framebuffer_object spec, the extension is an
amalgamation of
    EXT_framebuffer_object
    EXT_framebuffer_blit
    EXT_packed_depth_stencil
    EXT_framebuffer_multisample
By disabling this extension, however, no functionality is removed from
GLES1 and GLES2 contexts because 1) the first three extensions are
explicitly enabled in Intel's ES extension lists and 2) no functionality
of the last extension is exposed in an ES context.

Note: This is a candidate for the 8.0 branch.
See-also: http://www.mail-archive.com/mesa-dev@lists.freedesktop.org/msg21006.html
CC: Charles Johnson <charles.f.johnson@intel.com>
CC: Sean Kelley <sean.v.kelley@intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-07 08:38:12 -07:00
Brian Paul
64c510bb72 mesa: bump version to 8.1.0 in configs/default 2012-05-07 07:30:04 -06:00
Marcin Slusarz
ecc7e5e85b nv50: handle VP without inputs 2012-05-07 14:05:35 +02:00
Christoph Bumiller
c19672f90a nvc0/ir: allow abs,neg source modifiers with ceil,floor,trunc 2012-05-06 22:03:06 +02:00
Christoph Bumiller
28d6a268af nv50/ir/opt: don't lose saturation in tryCollapseChainedMULs 2012-05-06 22:03:06 +02:00
Christoph Bumiller
38a20281fc nvc0/ir: fix lowering of textureGrad 2012-05-06 22:03:06 +02:00
Christoph Bumiller
9dfac63ae0 nouveau: fix nouveau_scratch_runout_release bo count underflow 2012-05-06 22:03:06 +02:00
Jordan Justen
5795d3b5ae mesa: Add primitive restart support to glArrayElement
When primitive restart is enabled, and glArrayElement is called
with the restart index value, then call glPrimitiveRestartNV.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul<brianp@vmware.com>
2012-05-05 20:35:08 -07:00
Baldo Davide
0ad0bc5af5 auxiliary/os: Add missing signal.h include.
The signal.h include was missed in the commit
bc16c73407 which leads to broken
compilations under Linux.

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-05-05 04:51:32 +01:00
Kenneth Graunke
3cd7bee48f intel: Remove pointless software fallback for glBitmap on Gen6.
We already have a meta path below that works just fine; no apparent
regressions in oglconform.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46834
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-05-04 17:19:43 -07:00
Eric Anholt
4595288ba8 glsl: Fix regression in function out-parameter lvalue detection.
When doing the var->assigned change in
f2475ca424, I overzealously indented the
second block of code into the "if (var)" test.  Revert these blocks to
the way they were before, just taking advantage of "var" to avoid
re-calling variable_referenced().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49066
2012-05-04 14:00:32 -07:00
Eric Anholt
3362c7d9b6 mesa: Prevent buffer underrun when handling MESA_GL_EXTENSION_OVERRIDE. 2012-05-04 14:00:32 -07:00
Eric Anholt
dc42910e98 i965/fs: Fix regression in comparison handling from ANDs change.
I had fixed up the logic ops for delayed ANDing, but not equality
comparisons on bools.  Fixes new piglit fs-bool-less-compare-true.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48629
2012-05-04 14:00:32 -07:00
Eric Anholt
b2ee5a08ba glsl: Don't consider unused FS out variables as being statically assigned.
I only considered var->assigned for FragColor and FragData, but
ignored when it was false for out vars.  Fixes piglit
write-gl_FragColor-and-not-user-output.frag

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49068
2012-05-04 14:00:32 -07:00
Eric Anholt
fcd57280ae i965: Add a comment about the state flag for sRGBEnabled.
I thought this might be _NEW_COLOR, but it isn't.
2012-05-04 14:00:32 -07:00
Eric Anholt
b7406404ab intel: Return success when asked to allocate a 0-width/height renderbuffer.
It seems silly that GL lets you allocate these given that they're
framebuffer attachment incomplete, but the webgl conformance tests
actually go looking to see if the getters on 0-width/height
depth/stencil renderbuffers return good values.  By failing out here,
they all got smashed to 0, which turned out to be correct for all the
getters they tested except for GL_RENDERBUFFER_INTERNAL_FORMAT.  Now,
by succeeding but not making a miptree, that one also returns the
expected value.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-04 14:00:32 -07:00
Eric Anholt
6508b0b9b0 glsl: Always copy the index when cloning a variable.
The index is also used for GL_ARB_blend_func_extended.  Cloning in
i965 was dropping a non-ARB_explicit_attrib_location index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-05-04 14:00:32 -07:00
Eric Anholt
b7932e183c i965: Add support for GL_ARB_draw_buffers_blend.
Tested with piglit fbo-draw-buffers-blend and intel oglconform.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-05-04 14:00:32 -07:00
Christoph Bumiller
9ef549d7cd nv50: fix typo causing NULL-deref in nv50_resource_resolve
Introduced in b328949a37.
2012-05-04 18:00:46 +02:00
Christoph Bumiller
dffc2fb4e6 nv50/ir: move expansion of IMUL to later stage and handle memory operands 2012-05-04 18:00:40 +02:00
Christoph Bumiller
02fac29305 nv50: implement stream output 2012-05-04 18:00:07 +02:00
Christoph Bumiller
8a44ecdae8 nv50: enable array textures 2012-05-04 18:00:03 +02:00
Brian Paul
c66dc0ea8e svga: specify 4-byte aligned vertex elements
We haven't found a case where this is needed, but it would be prudent
for some hosts, per Jose.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-04 08:12:53 -06:00
Brian Paul
e039fd079b gallivm: fix comment typo 2012-05-04 08:07:58 -06:00
Brian Paul
a0c380a744 docs: another viewperf bug 2012-05-04 08:07:58 -06:00
Brian Paul
a36581ccc0 mesa: do more teximage error checking for generic compressed formats
When glTexImage or glCopyTexImage is called with internalFormat being a
generic compressed format (like GL_COMPRESSED_RGB) we need to do the same
error checks as for specific compressed formats.  In particular, check if
the texture target is compatible with the format.  None of the texture
compression formats we support so far work with GL_TEXTURE_1D, for example.

See also https://bugs.freedesktop.org/show_bug.cgi?id=49124

NOTE: This is a candidate for the 8.0 branch.
2012-05-04 08:07:58 -06:00
Vinson Lee
5cc4b4aaf4 scons: Do not build EGL on Solaris.
The current EGL headers do not support Solaris.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-03 22:58:35 -07:00
Jeremy Huddleston
51691f0767 darwin: Use ASL for logging
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:34 -07:00
Jeremy Huddleston
cf5db0a418 darwin: Make reported errors more user-friendly
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Jeremy Huddleston
244dc05214 darwin: Fix an error message
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-05-03 10:58:33 -07:00
Robert Hooker
c384c5d4d7 egl_dri2: Fix out of tree builds with the wayland backend enabled
Otherwise it fails like so:

  CC     egl_dri2.lo
In file included from egl_dri2.h:40:0,
                 from egl_dri2.c:42:
../../../../../../src/egl/wayland/wayland-drm/wayland-drm.h:8:41:
fatal error: wayland-drm-server-protocol.h: No such file or directory
compilation terminated.
2012-05-03 11:45:59 -04:00
Kristian Høgsberg
4fddb2ba21 gbm: Add gbm_bo_write entry point
This new gbm entry point allows writing data into a gbm bo.  The bo has
to be created with the GBM_BO_USE_WRITE flag, and it's only required to
work for GBM_BO_USE_CURSOR_64X64 bos.

The gbm API is designed to be the glue layer between EGL and KMS, but there
was never a mechanism initialize a buffer suitable for use with KMS
hw cursors.  The hw cursor bo is typically not compatible with anything EGL
can render to, and thus there's no way to get data into such a bo.

gbm_bo_write() fills that gap while staying out of the efficient
cpu->gpu pixel transfer business.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2012-05-03 10:57:32 -04:00
Tom Stellard
b4789860c4 r600g/llvm: Mask write of pred_inst in llvm_if() 2012-05-03 09:20:24 -04:00
Tom Stellard
9e522bd201 r600g/llvm: Lower ULT A, B, C to SETGT_UINT A, C, B 2012-05-03 09:20:23 -04:00
Tom Stellard
a2e08a40f5 r600g: Print integer values of literal constants in shader dumps 2012-05-03 09:20:23 -04:00
Tom Stellard
18617d7423 r600g: Add support for reading BREAK_LOGICALZ_i32 from bytestream 2012-05-03 09:20:23 -04:00
Tom Stellard
ddb4dac133 r600g/llvm: Don't duplicate R600 intrinsics installed by LLVM
At this point, in order for OpenCL to work correctly with r600g, OpenCL
specific intrinsics need to be defined in the LLVM tree.  So, we need
to check for these intrinsics in the LLVM include directory to make sure
not to re-define them.
2012-05-03 09:20:17 -04:00
Tom Stellard
1bd3dafeca r600g: Fix the evergreen offset/end register definitions 2012-05-02 15:59:57 -04:00
Dylan Noblesmith
d5a10dba64 glsl: report errors via GL_ARB_debug_output
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:23 +00:00
Dylan Noblesmith
8c99906cf5 glsl: add gl_context member
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Dylan Noblesmith
58fee81c78 mesa: add _mesa_shader_debug()
This should be the one entrypoint libglsl needs
for GL_ARB_debug_output.

v2: added comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Dylan Noblesmith
48e8a010ae glsl: consolidate error/warning code
And lay the groundwork for GL_ARB_debug_output.

v2: Add descriptive comments.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 16:12:22 +00:00
Tom Stellard
c8fb30abf1 radeon/llvm: Fix MachineInstr dump 2012-05-02 11:53:13 -04:00
Adam Rak
4731f1f52d r600g: fixed the bug with VTX fetches in TEX clauses for evergreen
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:10 -04:00
Tom Stellard
d0f6274489 winsys/radeon: Get max_pipes from the kernel
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:10 -04:00
Tom Stellard
e42df8e10a r600g: Add support for reading vertex fetches from bytestream
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Tom Stellard
6f50f939ef r600g: Add support for reading native instructions from the LLVM bytestream
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Tom Stellard
94a6a36379 r600g: Add FC_NATIVE instruction
This is a pseudo instruction that enables the LLVM backend to encode
instructions and pass it through r600_bytecode_build()

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Dave Airlie
4a26454e97 r600g: bypass alpha for integer types (v2)
This moves the alpha test control to derived state and disables alpha
testing for integer fbs.

fbo-blending test in piglit gets further when we do this (not a pass
but less fail).

v2: drop the fb_sx_alpha_test_control

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-02 12:06:22 +01:00
José Fonseca
494619ebac gallivm: Use debug_printf in lp_build_printf.
So that its output can be seen on GUI window apps.

Tested-by: James Benton <jbenton@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-05-02 10:24:34 +01:00
José Fonseca
9ad2cb1885 gallivm: Avoid LLVMAddGlobalMapping() in lp_bld_assert().
Brittle, complex, and unecesary. Just use function pointer constant.
2012-05-02 10:24:34 +01:00
José Fonseca
6cd76b800b gallivm: Add a lp_build_const_func_pointer() helper.
To be reused in all places where we want to call C code.
2012-05-02 10:24:34 +01:00
José Fonseca
0005bd9da2 gallivm: Cleanup/simplify lp_build_const_string_variable.
- Move to lp_bld_const where it belongs
- Rename to lp_build_const_string
- take the length from the argument (and don't count the zero terminator twice)
- bitcast the constant to generic i8 *
2012-05-02 10:24:34 +01:00
James Benton
c23fd547c0 gallivm: Added lp_build_const_mask_aos_swizzled
Allows the creation of const aos masks which have the mask swizzled
to match the correct format.

Updated existing mask creation code to use the swizzled version where
necessary (tgsi register masks and llvmpipe aos blending).

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:24:34 +01:00
José Fonseca
7d1f414103 gallivm: Move loop var declaration to beginning of scope. 2012-05-02 10:24:33 +01:00
James Benton
f64fe7d333 gallivm: added a debug function which allows llvm to print vectors of 16 unsigned ints
This is useful for debugging the linear llvm path as it handles pixels in this format

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:24:33 +01:00
James Benton
16b081f1b0 llvmpipe: add masking support to aos blend
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:23:52 +01:00
James Benton
9bc58d941a llvmpipe: Check when a shader does not satisfy 0 < imm < 1.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:23:21 +01:00
James Benton
c426e63aa0 gallivm: fixed memory leak in lp_build_tgsi_aos
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-05-02 10:13:00 +01:00
James Benton
0b0f4628d6 llvmpipe: Added support for color masks in AoS blending.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-05-02 10:12:48 +01:00
James Benton
85d09d1c61 gallivm: added aligned pointer get/set 2012-05-02 10:12:48 +01:00
James Benton
630fa26886 gallivm: llvm c-style for loops, allows us to create loops with conditions on entry, rather than condition check on loop 2012-05-02 10:12:48 +01:00
Viktor Novotný
83a02427e5 dri/nv10-nv20: Add support for S3TC
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2012-05-02 03:14:29 +02:00
Viktor Novotný
6d5efe96ee dri/nouveau: Add general support for compressed formats.
Signed-off-by: Viktor Novotný <noviktor@seznam.cz>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2012-05-02 03:13:42 +02:00
Kenneth Graunke
b389b608d8 glsl: Remove some completed tasks from the old "TODO" file. 2012-05-01 14:46:43 -07:00
Tom Stellard
d742d812d8 radeon/llvm: Fix build for updated LLVM 3.1 release branch 2012-05-01 16:42:58 -04:00
Brian Paul
07f5dabc01 softpipe: use any_swizzle() helper in sp_tex_sample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
b5e44c2cfb softpipe: whitespace, comment clean-ups in sp_tex_sample.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
92d899303a softpipe: implement coord clamping for texel fetches (TXF)
The GL spec says out of bounds fetches produce undefined results.
Use clamping to avoid failed assertions or crashes.

Fixes failed assertion in https://bugs.freedesktop.org/show_bug.cgi?id=49125
but the test still fails.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-05-01 11:42:58 -06:00
Brian Paul
7b610d5516 xlib: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
4433b0302d intel: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
264b584294 nouveau: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-05-01 11:39:34 -06:00
Brian Paul
47941bfaea radeon: use _mesa_is_winsys/user_fbo() helpers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-05-01 11:39:34 -06:00
Tom Stellard
ff10dbf35f radeon/llvm: Add subtarget feature: DumpCode
With this feature enabled, the LLVM backend will dump the MachineIntrs
prior to emitting code.  The mesa env variable R600_DUMP_SHADERS will enable
this feature in the backend.
2012-05-01 13:12:27 -04:00
Brian Paul
8dd3e341b3 svga: check for and skip null vertex buffer pointers
Fixes regressions with google earth and other things.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-05-01 08:14:23 -06:00
Brian Paul
b5752e16e8 softpipe: cast away const to silence warning 2012-05-01 08:14:19 -06:00
Brian Paul
6e588dff57 svga: cast away const to silence warning 2012-05-01 08:14:19 -06:00
Vinson Lee
2d75a1e25e glsl: Initialize member variable in ir_copy_propagation_elements_visitor.
Fix uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-30 22:28:05 -07:00
Marek Olšák
96863baa42 u_vbuf: set user buffer pointer for drivers which support user buffers
It's not common to end up in u_vbuf and at the same time support user buffers
in a driver, but such a combination should work.
2012-05-01 00:19:45 +02:00
Dragomir Ivanov
7bf3fe851c r600g/llvm: Remove unnecessary dynamic casts
When the result of dynamic_cast is not checked, it can be replaced with
static_cast

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-30 16:43:34 -04:00
Dragomir Ivanov
7ed04fa7d8 r600g/llvm: Add pattern for llvm.AMDGPU.kill v2
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-30 16:43:34 -04:00
Tom Stellard
4da1fcacf1 r600g/llvm: Fix handling of MASK_WRITE instructions
We can't delete MASK_WRITE instructions from the program, because this
will cause instructions being masked by MASK_WRITE to be marked dead and
then deleted in the dce pass.
2012-04-30 16:43:34 -04:00
Tom Stellard
77d2780cbc radeon/llvm: Use a custom emit function for TGSI_OPCODE_KIL 2012-04-30 16:43:34 -04:00
Marek Olšák
8c5ff5a41f st/mesa: unmap upload buffer after uploading indices and constants 2012-04-30 20:56:25 +02:00
Sean V Kelley
fd0082c47e i965: Support Android RGBX8888 format for EGL generated images
Enabled MESA_FORMAT_RGBX8888_REV for RGBX.  Android software
requires RGBX8888 format to be supported for software rendering.
That requires EGL to be capable of generating images from this
format.

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-30 11:22:46 -07:00
Sean V Kelley
81f95ce13d egl/android: Add support for RGBX_8888 used in Android native buffers
Add new format __DRI_IMAGE_FORMAT_XBGR8888 to __DRI_IMAGE.
HAL_PIXEL_FORMAT_RGBX_8888 now maps to __DRI_IMAGE_FORMAT_XBGR8888.

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-30 11:22:46 -07:00
David Herrmann
1de377bd30 egl-fbdev: Fix compile-error by including errno.h
We use errno and EINVAL so include errno.h.

This patch introduced this bug:
http://cgit.freedesktop.org/mesa/mesa/commit/src/gallium/state_trackers/egl/fbdev/native_fbdev.c?id=b60120608f6ddf4098bc324363197c979ee04cb7

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Cc: Chia-I Wu <olv@lunarg.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-04-30 13:27:05 -04:00
Ander Conselvan de Oliveira
249817e928 intel: set dri_format field for all images
Only images created with intel_create_image() had the field properly
set. Set it also on intel_dup_image(), intel_create_image_from_name()
and intel_create_image_from_renderbuffer().
2012-04-30 13:18:16 -04:00
Ander Conselvan de Oliveira
fc7d224e29 intel: properly return the image format on intel_query_image 2012-04-30 13:13:34 -04:00
Ander Conselvan de Oliveira
6c84f2992f gbm: add gbm_bo_get_device() function 2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
55aab92495 gbm: update documentation to reflect current behavior 2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
310d8d189d gbm: add gbm_bo_get/set_user_data()
This allows the user to associate some data to a gbm_bo and get a
callback when the bo is destroyed.
2012-04-30 13:09:39 -04:00
Ander Conselvan de Oliveira
f641c57cfa gbm: remove unused fields from gbm_dri_surface 2012-04-30 13:09:39 -04:00
Brian Paul
a53394ba66 svga: add cases for recently added PIPE_CAP queries 2012-04-30 10:38:05 -06:00
Dylan Noblesmith
18bb6852b2 mesa: reject immutable textures in glEGLImageTargetTexture2DOES()
GL_ARB_texture_storage says:

    The commands eglBindTexImage, wglBindTexImageARB, glXBindTexImageEXT or
    EGLImageTargetTexture2DOES are not permitted on an immutable-format
    texture.
    They will generate the following errors:
      - EGLImageTargetTexture2DOES: INVALID_OPERATION
      - eglBindTexImage: EGL_BAD_MATCH
      - wglBindTexImage: ERROR_INVALID_OPERATION
      - glXBindTexImageEXT: BadMatch

Fixing the EGL and GLX cases requires extending the DRI interface,
since setTexBuffer2 doesn't currently return any error information.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-30 14:52:47 +00:00
José Fonseca
4c23acb269 scons: Fix build without llvm.
radeonsi depends on llvm, so it must be disabled if llvm support is not enabled.
2012-04-30 07:47:01 +01:00
Marek Olšák
3ed72dd31d st/xorg: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
889c9a566c st/xa: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
fa20733a62 st/vega: don't use user_buffer_create 2012-04-30 01:18:49 +02:00
Marek Olšák
0279d15c99 st/vega: use cso_draw_arrays 2012-04-30 01:18:49 +02:00
Marek Olšák
46fe17930e cso: cso_context should install u_vbuf by itself and not st/mesa
so that it's installed in the other state trackers too
2012-04-30 01:18:49 +02:00
Marek Olšák
f656607c35 st/xorg: fix compilation - wrong libkms include file 2012-04-30 01:18:49 +02:00
Marek Olšák
3b5f4b173b gallium/util: stop using user buffers in util_draw_texquad 2012-04-30 01:18:49 +02:00
Marek Olšák
3ac0683d63 gallium: remove pipe_resource::user_ptr
It's unused now.
2012-04-30 01:18:49 +02:00
Marek Olšák
65d451d9fa radeonsi: don't create temporary user buffer for r600_upload_const_buffer 2012-04-30 01:18:48 +02:00
Marek Olšák
0b7d48cbad gallium: add void *user_buffer to pipe_constant_buffer
This reduces CPU overhead when updating constants.
2012-04-30 01:18:48 +02:00
Marek Olšák
01bf5569c4 st/mesa: reorder code in draw_vbo 2012-04-30 01:18:47 +02:00
Marek Olšák
944b97990b st/mesa: remove more unnecessary code in draw_vbo
The variables set here are not used anywhere.
2012-04-30 01:16:03 +02:00
Marek Olšák
bf469f4edc gallium: add void *user_buffer in pipe_index_buffer
Adapted drivers: i915, llvmpipe, r300, r600, radeonsi, softpipe.

User index buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
2012-04-30 01:14:28 +02:00
Marek Olšák
43995c9470 gallium: remove pipe_context::redefine_user_buffer 2012-04-30 01:14:28 +02:00
Marek Olšák
4552fd50d9 gallium: add void *user_buffer in pipe_vertex_buffer
This reduces CPU overhead in st_draw_vbo and removes a lot of unnecessary code
in that function which was required only to comply with the gallium interface,
but wasn't any useful really.

Adapted drivers: i915, llvmpipe, r300, softpipe.
No changes required in: r600, radeonsi.

User vertex buffers have been disabled in nv30, nv50, nvc0 and svga to keep
things working.
2012-04-30 01:14:26 +02:00
Marek Olšák
7a05459726 st/mesa: make user constant buffers optional 2012-04-30 01:09:57 +02:00
Marek Olšák
507337864f gallium: change set_constant_buffer to be UBO-friendly 2012-04-30 01:09:57 +02:00
Marek Olšák
1b749dc34f gallium: add PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT
This is required for any serious constant buffer support.
Constant buffer offsets on ATI and NVIDIA DX10 and DX11 GPUs must be
a multiple of 256.

In OpenGL, this can be queried via GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT.
2012-04-30 01:09:57 +02:00
Marek Olšák
8c655f499c st/mesa: make user index buffers optional
v2: use a separate upload buffer for indices
2012-04-30 01:09:57 +02:00
Marek Olšák
989bdaab51 st/mesa: only set index buffer when drawing is indexed
and restructure the code a bit
2012-04-30 01:09:57 +02:00
Marek Olšák
437ab1d6df gallium: add PIPE_CAP_USER_INDEX_BUFFERS and PIPE_CAP_USER_CONSTANT_BUFFERS 2012-04-30 01:09:57 +02:00
José Fonseca
4c15a77f27 scons: Parse = operator in source lists too.
Should fix the scons build.
2012-04-29 21:44:05 +01:00
Christoph Bumiller
b328949a37 nv50,nvc0: fix depth/stencil resolve
Cannot sample depth/stencil with a single view, and needed to use
different shader code for nve4.
2012-04-29 18:03:18 +02:00
Christoph Bumiller
d46f969b84 nvc0/ir/opt: INTERP does not support JOIN 2012-04-29 18:03:15 +02:00
Christoph Bumiller
1f4c154f02 nv50/ir/opt: try to convert ABS(SUB) to SAD 2012-04-29 18:03:11 +02:00
Christoph Bumiller
d6ab3106cf nvc0/ir: try to use the optimal texture op mode
Don't really know what they are yet but for groups of textures, the
last one should use mode "p" and the others "t".
2012-04-29 18:02:37 +02:00
Christoph Bumiller
afcd7b5d16 nvc0/ir: initial implementation of nve4 scheduling hints 2012-04-29 17:59:06 +02:00
Christoph Bumiller
00fe442253 nvc0/ir: implement better placement of texture barriers
Put them before first uses instead of right after the texturing
instruction and cull unnecessary barriers.
2012-04-29 17:56:57 +02:00
Christoph Bumiller
163b290f88 nv50/ir/tgsi: fix handling of early RET
We have to actually emit RET, too, of course, not just the PRERET.
2012-04-29 17:55:36 +02:00
Christoph Bumiller
d9baa004ea nvc0/ir/emit: fix emitTXQ 2nd src 2012-04-29 17:55:13 +02:00
Christoph Bumiller
3a9f036e00 nvc0/ir/target: integer ADD doesn't support ABS modifier 2012-04-29 17:54:34 +02:00
Marek Olšák
18bcb962bb u_vbuf: unbind vertex buffers on destroy 2012-04-29 17:41:37 +02:00
Marek Olšák
7622496d7b u_blitter: fix resource leak 2012-04-29 17:31:27 +02:00
Marek Olšák
63ca2eda13 radeonsi: make r600_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
c69248fa3f r600g: make r600_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
498e71c156 r300g: make r300_buffer_transfer_unmap a no-op
It's a no-op already in the winsys.
2012-04-29 14:48:45 +02:00
Marek Olšák
a784d86508 r300g: use u_default_transfer_inline_write 2012-04-29 14:48:45 +02:00
Marek Olšák
2ed1cdb2a5 radeonsi: use u_default_transfer_inline_write 2012-04-29 14:48:45 +02:00
Marek Olšák
0a6120244e winsys/radeon: simplify buffer map/unmap functions
The idea is not to use pb_map and pb_unmap wrappers, calling straight
into the winsys.
2012-04-29 14:46:52 +02:00
Dylan Noblesmith
8e90913e9f mesa: require GL_MAX_SAMPLES >= 4 for GL 3.0
As noted in commit be4e46b21a,
this was missing before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-29 11:18:31 +00:00
Dylan Noblesmith
e4c97f1e60 autoconf: pass -Wall to automake
And fix these warning that appear at autoreconf time:
"`:='-style assignments are not portable"

v2: Fix the recently-converted-to-automake r600.
2012-04-29 11:17:47 +00:00
Vinson Lee
e372aa6949 glsl: Remove unused member predicate from ir_dead_functions_visitor.
Fix uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-28 14:00:36 -07:00
Kenneth Graunke
b443ca96a5 i965/fs: Fix FB writes that tried to use the non-existent m16 register.
A little analysis shows that the worst-case value for "nr" is 17:
- base_mrf = 2                       ... 2
- header present (say gen == 5)      ... 4
- aa_dest_stencil_reg (stencil test) ... 5
- SIMD16 mode: += 4 * reg_width      ... 13
- source_depth_to_render_target      ... 15
- dest_depth_reg                     ... 17

This resulted in us setting base_mrf to 2 and mlen to 15.  In other
words, we'd try to use m2..m16.  But m16 doesn't exist pre-Gen6.  Also,
the instruction scheduler data structures use arrays of size 16, so this
would cause us to access them out of bounds.

While the debugger system routine may need m0 and m1, we don't use it
today, so the simplest solution is just to move base_mrf back to 1.
That way, our worst case message fits in m1..m15, which is legal.

An alternative would be to fail on SIMD16 in this case, but that seems
a bit unfortunate if there's no real need to reserve m0 and m1.

Fixes new piglit test shaders/depth-test-and-write on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48218
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-27 16:53:37 -07:00
Vinson Lee
6af4c9006c glsl: Remove unused member mem_ctx from ir_dead_functions_visitor.
Fix uninitialized pointer field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-26 21:09:42 -07:00
Ben Skeggs
9856fd02a0 nv30: properly init window information
Should fix >2k rendering issues reported on nv4x.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-27 09:32:57 +10:00
Tom Stellard
a2f7ecfa74 radeonsi/llvm: Silence a warning 2012-04-25 18:09:05 -04:00
Tom Stellard
21d3dd831e radeon/llvm: Remove unused header files 2012-04-25 12:52:44 -04:00
Tom Stellard
30f2a38cef radeon/llvm: Remove AMDILMachineFunctionInfo.cpp 2012-04-25 12:52:44 -04:00
Tom Stellard
540ec964db radeon/llvm: Remove AMDILModuleInfo.cpp 2012-04-25 12:52:43 -04:00
José Fonseca
914244e59d gallivm: Use lp_build_alloca instead of LLVMBuildAlloca on the loop limiter.
To ensure that the alloca is at the top of the function body, otherwise
LLVM will not eliminate them, causing stack misalignment on 32bits.

Reviewed-by: James Benton <jbenton@vmware.com>
2012-04-25 18:09:38 +01:00
Tom Stellard
9f45093433 radeon/llvm: Remove AMDILELFWriterInfo.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
d96682169e radeon/llvm: Remove AMDILLiteralManager.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
ba333a6518 radeon/llvm: Remove AMDILInliner.cpp 2012-04-25 09:02:17 -04:00
Tom Stellard
160d4a7891 radeon/llvm: Remove AMDILBarrierDetect.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
0e7161cce8 radeon/llvm: Remove AMDILPrintfConvert.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
04993c9630 radeon/llvm: Remove GlobalManager and KernelManager 2012-04-25 09:02:16 -04:00
Tom Stellard
8d3bf7ced5 radeon/llvm: Remove AsmPrinter files 2012-04-25 09:02:16 -04:00
Tom Stellard
ba9bd41880 radeon/llvm: Remove IOExpansion files 2012-04-25 09:02:16 -04:00
Tom Stellard
4b11f4321b radeon/llvm: Remove AMDILPointerManager.cpp 2012-04-25 09:02:16 -04:00
Tom Stellard
76940ba852 radeonsi/llvm: Fix initialization of SIMachineFunctionInfo
SIMachineFunctionInfo needs to be initialized before any of the
AMDIL passes.
2012-04-25 09:02:16 -04:00
José Fonseca
63da1aa5be mesa/st: Fix derreference after free. 2012-04-25 11:41:13 +01:00
Marek Olšák
1781d26faa gallium/docs: document the new vertex fetch CAPs 2012-04-24 23:10:46 +02:00
Christoph Bumiller
29a0c8cd60 nv50: fix typo in nv50_fragprog_assign_slots 2012-04-24 20:05:35 +02:00
Eric Anholt
e9df9636b9 glsl: Add implementation of inverse() for mat2/3/4.
This is taken from the ogl-math project, with Inverse renamed to adj
(since it's not actually the inverse), transposed, and our types
plugged in.  There are potential CSE opportunities in this code
(particularly for hardware with RCP but not DIV), but we should be
doing CSE anyway, so don't hand-optimize.

Fixes piglit inverse tests.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:15:47 -07:00
Eric Anholt
7de1331662 glsl: Add support for generating builtin code from GLSL instead of IR.
This takes advantage of the builtin compiler to generate IR into a
string, the same way we read GLSL for function prototypes for our
profiles.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:01:10 -07:00
Eric Anholt
41b47441d7 glsl: Make ir_reader parse the "temporary" variable qualifier.
This lets ir_reader eat the output of builtin_compiler on actual
function definitions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:01:07 -07:00
Eric Anholt
6a6cb03507 glsl: Add doxygen explaining what main.cpp is for.
I keep getting lost in the Makefile trying to figure out what to edit
to work on builtin_compiler or glsl_compiler.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-24 10:00:54 -07:00
Eric Anholt
4650aea7a5 i965/vs: Fix texelFetchOffset()
It appears that when using 'ld' with the offset bits, address bounds
checking happens before the offset is applied, so parts of the drawing
in piglit texelFetchOffset() with a negative texcoord go black.
2012-04-24 10:00:54 -07:00
Eric Anholt
f41ecade7b i965/fs: Fix texelFetchOffset()
It appears that when using 'ld' with the offset bits, address bounds
checking happens before the offset is applied, so parts of the drawing
in piglit texelFetchOffset() with a negative texcoord go black.
2012-04-24 10:00:54 -07:00
Christoph Bumiller
587c221a29 nv50,nvc0: handle new vertex fetch caps 2012-04-24 13:37:03 +02:00
Christoph Bumiller
a48e5dee94 nv50,nvc0: don't initialize the draw module, we don't use it
But some day we might (e.g. for blending 16 bpp formats on nv50).
2012-04-24 13:35:44 +02:00
Christoph Bumiller
2170fed8f4 nv50: enable shader watchdog timer 2012-04-24 12:26:31 +02:00
Jeremy Huddleston
1a33c1b2b8 darwin: Eliminate a pthread mutex leak
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Charles Davis <cdavis@mines.edu>
2012-04-24 00:26:48 -07:00
Marek Olšák
2a311b18fc radeonsi: stop using u_vbuf and adapt to gallium interface changes 2012-04-24 01:39:22 +02:00
Marek Olšák
89c4888710 u_vbuf: don't call u_vbuf_upload_buffers if there's nothing to upload 2012-04-24 01:39:22 +02:00
Marek Olšák
634066946e u_vbuf: don't upload user buffers if the driver supports them 2012-04-24 01:39:22 +02:00
Marek Olšák
6fe30fbc96 u_vbuf: optimize u_vbuf_translate_find_free_vb_slots 2012-04-24 01:39:22 +02:00
Marek Olšák
b5e5e61439 u_vbuf: turn bool arrays into bitmasks and loops into bitwise operations
Optimized functions:
- u_vbuf_need_minmax_index
- u_vbuf_mapping_vertex_buffer_blocks
2012-04-24 01:39:22 +02:00
Marek Olšák
eaf8fe3335 u_vbuf: take advantage of all new vertex fetch caps 2012-04-24 01:39:22 +02:00
Marek Olšák
a0e352f5eb u_vbuf: simplify u_vbuf_set_vertex_buffers 2012-04-24 01:39:22 +02:00
Marek Olšák
039f53b814 u_vbuf: rename native_attribs -> driver_attribs 2012-04-24 01:39:22 +02:00
Marek Olšák
23b948057a r600g: move updating vertex buffer state into set_vertex_buffers 2012-04-24 01:39:22 +02:00
Marek Olšák
3e3737e9e2 st/mesa: always expose ARB_ES2_compatibility
u_vbuf translates GL_FIXED too if needed.
2012-04-24 01:39:22 +02:00
Marek Olšák
a78fd815d4 st/mesa: always expose ARB_half_float_vertex
u_vbuf kicks in and translates it to float if it's unsupported.
2012-04-24 01:39:22 +02:00
Marek Olšák
e0773da1e8 gallium: make user vertex buffers optional
This couldn't be split because it would break bisecting.

Summary:
* r300g,r600g: stop using u_vbuf
* r300g,r600g: also report that the FIXED vertex type is unsupported
* u_vbuf: refactor for use in the state tracker
* cso: wire up u_vbuf with cso_context
* st/mesa: conditionally install u_vbuf
2012-04-24 01:39:22 +02:00
Marek Olšák
79eafc14ca i915g: report that all vertex formats are supported
So that u_vbuf isn't enabled.
2012-04-24 01:39:22 +02:00
Marek Olšák
428855eea3 r600g: don't share u_upload_mgr with u_vbuf, create its own 2012-04-24 01:39:22 +02:00
Marek Olšák
e54cc2c070 r300g: don't share u_upload_mgr with u_vbuf, create its own 2012-04-24 01:39:22 +02:00
Marek Olšák
ae799a4948 u_vbuf: pull u_vbuf_draw_max_vertex_count into r300g 2012-04-24 01:39:22 +02:00
Marek Olšák
7fe3631a7a u_vbuf: make use of the new CAPs to determine what to do
This adds the ability to initialize u_vbuf_caps before creating u_vbuf itself.
It will be useful for determining if u_vbuf should be used or not.

Also adapt r300g and r600g.
2012-04-24 01:39:22 +02:00
Marek Olšák
978c1aa1d0 gallium drivers: report that user vertex buffers are supported 2012-04-24 01:39:21 +02:00
Marek Olšák
c9a9d1ba11 gallium: add CAPs for vertex fetcher
Supported vertex formats will be queried using
is_format_supported(.., PIPE_BIND_VERTEX_BUFFER, ..).
2012-04-24 01:39:21 +02:00
Marek Olšák
a52b3338c6 u_vbuf: remove u_vbuf_resource 2012-04-24 01:39:21 +02:00
Marek Olšák
7d36478d88 u_vbuf: use user_ptr from pipe_resource 2012-04-24 01:39:21 +02:00
Marek Olšák
e8ab3b1ce7 gallium: add user_ptr in pipe_resource
I need to access the pointer in st/mesa when I only have pipe_resource.
2012-04-24 01:39:21 +02:00
Marek Olšák
5ec7c28fdb u_vbuf: override draw_vbo 2012-04-24 01:39:21 +02:00
Marek Olšák
889238c8b1 u_vbuf: override create/bind/destroy_vertex_elements_state 2012-04-24 01:39:21 +02:00
Marek Olšák
2d03d4f4a3 u_vbuf: override set_vertex_buffers 2012-04-24 01:39:21 +02:00
Marek Olšák
31714ea4d5 u_vbuf: override set_index_buffer
This makes u_vbuf_mgr call the driver instead of the other way around.
2012-04-24 01:39:21 +02:00
Marek Olšák
76c4760e5d st/mesa: use cso_set_index_buffer and cso_draw_vbo
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Marek Olšák
0f00786868 gallium/util: use cso_draw_arrays in util_draw_vertex_buffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Marek Olšák
76eefcc70c cso: add set_index_buffer and draw_vbo passthrough functions
v2: use util_draw_init_info

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-24 01:39:21 +02:00
Jeremy Huddleston
d9c9c7a111 darwin: Don't build gallium
fe3f98ed70 intentionally broke it, so
don't build it.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 16:17:39 -07:00
Jonas Maebe
c60ffd2840 apple: Fix a use after free
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-23 16:17:39 -07:00
Marek Olšák
802ca81e26 vbo: call UpdateState directly when notifying a driver about _NEW_ARRAY
Core Mesa doesn't need to know about this.

This also removes the hack in recalculate_input_bindings.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
6fc565a94b vbo: do FLUSH_CURRENT before validating and updating state
This fixes an assertion failure since:
   commit 81afdd20f3
   vbo: don't check twice whether it's valid to render

FLUSH_CURRENT may set _NEW_CURRENT_ATTRIB.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
edec3fa812 r300g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 22:58:02 +02:00
Marek Olšák
f940c0a3d9 r600g/automake: add $ARCH_FLAGS and $OPT_FLAGS
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 22:58:02 +02:00
Brian Paul
7f5420762c r600g: init vars to silence warnings 2012-04-23 13:29:06 -06:00
Han Shen(沈涵)
b352d676e4 bin/mklib: remove '-m32' for arm linux
-m32 is not a valid option for ARM.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-04-23 13:27:07 -06:00
Brian Paul
99ed0b2f9b st/mesa: no-op glCopyPixels if source region is out of bounds
If the source region for a glCopyPixels is completely outside the
source buffer bounds, no-op the copy.  Fixes a failed assertion.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-04-23 13:27:07 -06:00
Tom Stellard
d7f9b6ce13 radeon/llvm: Don't print an error message when there is no error
A blank line with an empty error message was being printed even when the
target lookup succeeded.
2012-04-23 09:34:05 -04:00
Tom Stellard
f5fc3ac284 radeon/llvm: Lower VCREATE_v4f32 for R600 and SI 2012-04-23 09:34:05 -04:00
Tom Stellard
519789d7e6 r600g/llvm: Let ISel handle lowering to {INSERT,EXTRACT}_SUBREG 2012-04-23 09:34:05 -04:00
Tom Stellard
3c0f521cbf r600g/llvm: Only emit an instruction's explicit operands 2012-04-23 09:34:05 -04:00
Tom Stellard
b3863eb9a5 r600g/llvm: Handle copies between vector registers 2012-04-23 09:34:05 -04:00
Tom Stellard
d4da0a0627 r600g/llvm: Remove debugging hack from R600InstrInfo::copyPhysReg() 2012-04-23 09:34:05 -04:00
Tom Stellard
90a42df0d0 r600g/llvm: Tell the code emitter to ignore KILL and BUNDLE 2012-04-23 09:34:04 -04:00
Tom Stellard
fa52aeb396 r600/llvm: Add LOAD_VTX instruction 2012-04-23 09:34:04 -04:00
Tom Stellard
ced73ea5df r600g: Add hooks for the LLVM shader compiler
The LLVM backend can now be enabled for r600g by using the
--enable-r600-llvm-compiler configure flag.  If you configure with this
flag, you can still use the default compiler by setting the envrionment
variable R600_USE_LLVM=0

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:34:04 -04:00
Tom Stellard
2da9610566 r600g: Add TGSI->LLVM implementation v2
v2: Add case for ARUBA in r600_llvm_gpu_string()

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:34:04 -04:00
Tom Stellard
509ddb0a04 radeon: Move radeon_llvm_emit.cpp declarations into their own header
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 09:33:55 -04:00
Tom Stellard
6e238bf27c radeon: Remove HAVE_LLVM ifdefs
Only LLVM 3.1 is supported, so these are not necessary.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 08:53:48 -04:00
Vadim Girlin
65b35b63d3 r600g: fix gpr number calculation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 08:53:47 -04:00
Tom Stellard
adb8eca1d8 configure.ac: Move HAVE_LLVM definition into configure.ac
Otherwise HAVE_LLVM won't be included in the $(DEFINES) variable for
Automake generated Makefiles.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-23 08:53:47 -04:00
Dave Airlie
62b0323cf6 r600g: split add_reg into add_reg and add_reg_bo variants
This shaves 2k off the final dri.so, and removes lots of pointless
NULL, 0 passing.

most like pointless - but it looked nicer to me.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-23 10:23:46 +01:00
Jonas Maebe
8d09f4d0cc glapi: Correct size of allocated _glapi_table struct
The __glapi_gentable_set_remaining_noop() routine treats the _glapi_struct
as an array of _glapi_get_dispatch_table_size() pointers, so we have to
allocate _glapi_get_dispatch_table_size()*sizeof(void*) bytes rather
than sizeof(struct _glapi_struct) bytes.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-04-22 20:39:32 -07:00
Dave Airlie
e6aad9ba04 r600g: enable GLSL130 on all cards
Alexandre Demers sent me some cayman results with no major problems.

I'll rip out the env var in a week or so.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-22 08:09:05 +01:00
Dave Airlie
47d22e56de r600g: enable dual src blending on r600 cards
tested on my rv610 and it passes the tests with no hangs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 17:46:35 +01:00
Dave Airlie
7745cf2be4 r600g: enable GLSL 1.30 for r600 class
Full piglit run on my rv610 with no regressions.

This only leaves cayman, however my cayman is resisting my attempt
to get through a full piglit run.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 17:40:32 +01:00
Dave Airlie
12bedaa24b r600: enable glsl 1.30 on r700
I've done a piglit run on rv740 and confirmed no regressions.

We don't get GL3 on r700 due to transform feedback being busted still.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-21 10:38:31 +01:00
Dave Airlie
5f457f6618 r600g: report INTEGERS cap if glsl130 is on.
This cap is used by u_blitter to decide if it can use integers
in vertex data.

fixes some crashes with glsl130 in piglit

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 19:33:22 +01:00
Dave Airlie
7af9f6325e r600g: enable glsl 130 on evergreen.
I've done a piglit run on my SUMO machine and I see no regressions.

Lots of things to fix (skip->fail), but hey maybe we can fix them
if we can see them.

I'll try and work my way across r600,700,cayman sometime if nobody
else gets to them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 19:01:57 +01:00
Vadim Girlin
951b888be4 r600g: disable I2F conversion for InstanceID if integers are supported
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 17:44:06 +01:00
Vadim Girlin
e382a0c142 r600g: store glsl_feature_level in the r600_screen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-20 17:43:24 +01:00
Brian Paul
b0e048f0b9 mesa: move gl_array_attrib::NewState to gl_array_object::NewArrays
The field wasn't actually used before and it's not used now either.
But this is a more logical place for it and will hopefully allow
doing smarter draw/array validation (per array object) in the future.

Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-20 07:32:33 -06:00
Brian Paul
0615eb8fc3 docs: recommend 2GB of RAM for Viewperf tests 2012-04-20 07:10:17 -06:00
Eric Anholt
137c5ece7d i965: Convert live interval computation to using live variable analysis.
Our previous live interval analysis just said that anything in a loop
was live for the whole loop.  If you had to spill a reg in a loop,
then we would consider the unspilled value live across the loop too,
so you never made progress by spilling.  Eventually it would consider
everything in the loop unspillable and fail out.

With the new analysis, things completely deffed and used inside the
loop won't be marked live across the loop, so even if you
spill/unspill something that used to be live across the loop, you
reduce register pressure.  But you usually don't even have to spill
any more, since our intervals are smaller than before.

This fixes assertion failure trying to compile the shader for the
"glyphy" text rasterier and piglit glsl-fs-unroll-explosion.

Improves Unigine Tropics performance 1.3% +/- 0.2% (n=5), by allowing
more shaders to be compiled in 16-wide mode.
2012-04-19 17:44:55 -07:00
Eric Anholt
34b17ee598 i965: Move the old live interval analysis code next to the new live vars code.
I'm about to replace the insides of this using the new analysis.
2012-04-19 17:44:55 -07:00
Eric Anholt
0d6c96a5c3 i965: Add support for live variable analysis using dataflow analysis. 2012-04-19 17:44:54 -07:00
Eric Anholt
080b125c64 i965: Add basic block generator.
This takes the fs_inst list generated by the visitor, and generates a
list of basic blocks with edges between them.  This is a building
block for data-flow analysis.
2012-04-19 17:44:54 -07:00
Eric Anholt
8890c75951 i965/fs: Suppress printing the whole loop in BRW_OPCODE_DO annotation. 2012-04-19 17:44:54 -07:00
Eric Anholt
4b2a4cb7c2 glsl: Properly throw compile-time errors for conflicting FS output writes.
We were checking for these at link time previously, which is not as
early as mandated, and would actually fail to detect conflicting
writes if dead code removal removed some writes.

Fixes failures in piglit
glsl-*/compiler/fragment-outputs/write-gl_Frag*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:45 -07:00
Eric Anholt
f2475ca424 glsl: Track in each ir_variable whether it was ever assigned.
This will be used for some compile-and-link-time error checking, where
currently we've been doing error checking only at link time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:36 -07:00
Eric Anholt
cc7e0de009 glsl: Convert the tests directory to automake.
This runs optimization-test and produces the usual automake test
output, which may be interesting to automated build systems.

This doesn't convert the tests to be individually exposed to the
automake runner, because automake doesn't like wildcards (due to being
nonportable in make, not that we care).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:31 -07:00
Eric Anholt
86f270e0a9 glsl: Fix up some comments in structure splitting, based on array-split work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:28 -07:00
Eric Anholt
6de5da0796 glsl: Don't allow array splitting on function arguments.
This is the reason the declaration member existed in the reference
visitor, but I didn't copy the code from structure splitting that
avoided setting it.

This wasn't currently a problem, because we don't allow splitting of
in/out variables.  But that would be nice to change some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:14 -07:00
Eric Anholt
538ba0a363 glsl: Rename the "whole_array_access" member in array splitting.
This was carried over from structure splitting, without thinking about
whether the name still made sense in this context.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:12 -07:00
Eric Anholt
36a8c9caaf glsl: Fix up a comment explaining what a visitor class does.
Ken noted that some of the "actual work" was happening in the caller
of this class.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:09 -07:00
Eric Anholt
c07290ddb2 glsl: Use the column_types() helper method.
Ken noted this in a review of this patch that I pushed early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-19 16:33:02 -07:00
Eric Anholt
40da3b0320 glx: Use AM_CPPFLAGS to pass -I and -D to both C and C++ compiles.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-04-19 16:32:46 -07:00
Marek Olšák
bf3304a84b Revert "mesa: only update _MaxElement when we actually need it"
This reverts commit 0de5a21470.

I was wrong, we use it in the vbo module too.
This fixes a performance regression in Nexuiz.
2012-04-19 20:48:52 +02:00
Michel Dänzer
dbf48e88eb radeonsi: Fix VGPR_BIT() definition.
Fixes encoding of VOP3 shader instructions.

The shift was wrong for source registers 2 and 3, and the resulting value was
only 32 bits, so the shift in SICodeEmitter::VOPPostEncode() didn't work as
intended.
2012-04-19 19:59:54 +02:00
Michel Dänzer
09b2cd7ade radeonsi: Replace magic numbers for vertex buffer resource. 2012-04-19 19:59:54 +02:00
Michel Dänzer
9918fbd026 radeonsi: (User) SGPR related cleanups.
Use the same user SGPRs for the same purpose in vertex and pixel shaders.

Better calculation of the number of SGPRs to reserve.
2012-04-19 19:59:54 +02:00
Michel Dänzer
de12c6cb54 radeonsi: Fix sampler offsets for shader intrinsic.
The sampler number is in TGSI source register 1, and the S_LOAD_DWORD*
instructions take offsets in DWORDs, not bytes.
2012-04-19 19:59:54 +02:00
Brian Paul
7103a18c12 docs: overhaul the Mesa build/install instructions
Rearrange thing in general.  Mark the legacy Makefile system as deprecated.
2012-04-19 11:22:47 -06:00
Brian Paul
f64bae2e2a docs: freshen up the download/unpack instructions 2012-04-19 11:22:47 -06:00
Brian Paul
0e5327ecf4 mesa: move unrefs of array objects earlier in _mesa_free_context_data()
If a non-default array object was bound at context destruction time
we'd try to unreference the array object after it was already deleted
in _mesa_free_varray_data().  Now do the unref first.

Fixes a regression from commit 86f53e6d6b.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-19 11:22:37 -06:00
Christoph Bumiller
939b26639f nv50,nvc0: prevent multiple flushes when user spins on get_query_result 2012-04-19 14:56:04 +02:00
Christoph Bumiller
90b5301cea nv50/ir/opt: swap VP inputs to first source where possible 2012-04-19 14:56:03 +02:00
Marek Olšák
97e2f625b8 vbo: remove vbo_context::mat_currval
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
8c990de0d6 vbo: remove vbo_context::generic_currval
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
fa48137f29 vbo: remove vbo_context::legacy_currval
It's not nice when you have several variables pointing to the same array
and you wanna ask your editor "where is this used" and you only get an answer
for one of the four currval, legacy_currval, generic_currval, mat_currval,
which is quite useless, because you never see the whole picture.

Let's get rid of the additional pointers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
f9c40dbb0d vbo: remove unused variables in vbo_context
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
81afdd20f3 vbo: don't check twice whether it's valid to render
It's already done in _mesa_validate_Draw* and it's not needed to do it again
unless I am missing something.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
fb4a34e60e mesa: set _NEW_VARYING_VP_INPUTS flag only if fixed-func VP is enabled & valid
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
576c8c592a mesa: add _NEW_VARYING_VP_INPUTS for gl_context::varying_vp_inputs
This is a frequently-updated state and _NEW_ARRAY already causes revalidation
of the vbo module. It's kinda counter-productive to recompute arrays
in the vbo module if _NEW_ARRAY is set and then set _NEW_ARRAY again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
784dd51198 mesa,vbo: properly detect when vertex arrays need to be recalculated
This moves the RebindArrays flag into the vbo module, consolidates the code,
and adds missing vbo_draw_method calls.

Also with this change, the vertex arrays are not needlessly recalculated twice.
The issue with the old code was:
- If recalculate_input_bindings updates vp_varying_inputs, _NEW_ARRAY is set.
- _mesa_update_state is called and the vp_varying_inputs change causes
  regeneration of the fixed-function shaders, which also sets _NEW_PROGRAM.
- The occurence of either _NEW_ARRAY or _NEW_PROGRAM sets
  the recalculate_inputs flag to TRUE again.
- The new code sets the flag to FALSE after the second _mesa_update_state,
  because there can't possibly be any change which would require recalculating
  the arrays.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
0de5a21470 mesa: only update _MaxElement when we actually need it
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Marek Olšák
233da380a9 st/mesa: use bitshifting to define state flags
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-04-19 14:47:21 +02:00
Michel Dänzer
e1a173fb33 radeonsi: MIMG shader instructions require waiting for the results. 2012-04-19 09:36:52 +02:00
Michel Dänzer
2308cf8daf radeonsi: Replace more magic numbers for sampler state. 2012-04-19 09:36:52 +02:00
Michel Dänzer
a1b67da0e1 radeonsi: Fix mip filter encoding in sampler state.
Blits are starting to work.
2012-04-19 09:36:51 +02:00
Michel Dänzer
81c847f0f7 radeonsi: Set tiling mode index for depth/stencil buffers. 2012-04-19 09:36:51 +02:00
Kenneth Graunke
14e9942841 glsl: Remove unused mem_ctx field from ir_array_splitting_visitor.
Vinson reported that we failed to initialize this, which would lead to
all kinds of crashes if we actually used it.  Since we don't use it,
we may as well just delete the broken code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 19:11:10 -07:00
Kenneth Graunke
4f96e9830f i965: Rename BRW_MAX_SURFACES to BRW_MAX_WM_SURFACES.
Now that we use separate binding tables for WM, VS, and GS, and have
BRW_MAX_VS_SURFACES and BRW_MAX_GS_SURFACES macros, we really shouldn't
have an unqualified BRW_MAX_SURFACES macro.  It's confusing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 18:28:31 -07:00
Kenneth Graunke
5177f6b1b9 i965: Fix outdated comments about binding tables.
They had a number of issues:
- A paragraph states that we use a single binding table, but we don't.
- We labelled the WM binding table diagram as SOL/WM.
- The WM diagram had an "Only relevant to the WM" comment.  Duh.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-18 18:28:31 -07:00
Mathias Fröhlich
86f53e6d6b mesa: Use array object constructor.
This change uses the array object factory for gl_array_objects. This
prevents crashes when deriving from gl_array_object.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-04-18 19:51:16 +02:00
Brian Paul
8ec18dfc1a svga: flush drawing before clearing
We don't normally clear immediately after drawing something.  But as it
was, the drawing would incorrectly appear after the clear.

Fixes piglit clear-varray-2.0 failure.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-18 08:34:48 -06:00
Brian Paul
168a3b8627 pipebuffer: split up assertion
The problem with assert(a && b) is you don't know which term is zero
when there's a failure.
2012-04-18 08:34:48 -06:00
Brian Paul
cf736aa098 svga: return PIPE_OK instead of 0 2012-04-18 08:34:48 -06:00
Marek Olšák
bdb0ad77c2 gallium/u_gen_mipmap: don't release vertex buffer at end of frame / in glFlush
There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.
2012-04-18 16:19:39 +02:00
Marek Olšák
462dcf6173 gallium/u_blit: don't release vertex buffer at end of frame / in glFlush
There's no reason to do that. The buffer being used for rendering is always
mapped as unsynchronized.
2012-04-18 16:19:39 +02:00
Marek Olšák
5db9cedeaf gallium: remove PIPE_TRANSFER_NOOVERWRITE, use equivalent UNSYNCHRONIZED 2012-04-18 16:19:39 +02:00
Marek Olšák
a8a478999c st/mesa: write vertices directly into the buffer for glClear fallback 2012-04-18 16:19:39 +02:00
Marek Olšák
2b151bbb95 st/mesa: use u_upload_mgr to upload vertices for glClear fallback 2012-04-18 16:19:39 +02:00
Marek Olšák
6c1fbe912f st/mesa: write vertices directly into the buffer in glDrawPixels 2012-04-18 16:19:39 +02:00
Marek Olšák
b69dad1683 st/mesa: use u_upload_mgr to upload vertices for glDrawPixels 2012-04-18 16:19:39 +02:00
Marek Olšák
0a43fd4c01 st/mesa: use u_upload_mgr to upload vertices for glDrawTexOES 2012-04-18 16:19:39 +02:00
Marek Olšák
3e8093d068 st/mesa: write vertices directly into the buffer for glBitmap 2012-04-18 16:19:39 +02:00
Marek Olšák
76d9a99d6b st/mesa: use u_upload_mgr to upload vertices for glBitmap
instead of recreating the vertex buffer for each draw_vbo call.
2012-04-18 16:19:38 +02:00
Michel Dänzer
0ef90e52d1 radeonsi: Improve calculation of number of pixel shader interpolants. 2012-04-18 10:53:59 +02:00
Michel Dänzer
bb79126420 radeonsi: Fix calculation of pitch value in sampler view state. 2012-04-18 10:52:33 +02:00
Michel Dänzer
f2c81a4bff radeonsi: Set tiling mode index in sampler view state.
Hardcode index for linear mode for now.
2012-04-18 10:51:48 +02:00
Michel Dänzer
29d7186e4c radeonsi: Replace magic numbers with register definitions in sampler state. 2012-04-18 10:49:00 +02:00
Michel Dänzer
c4bf6517ed radeonsi: Fix white border color type in sampler state. 2012-04-18 10:48:26 +02:00
Kenneth Graunke
32f7676e9c glsl/builtins: Rework profiles to use the new '.glsl' common suffix.
Deletes a lot of pointless duplication, as well as some run-time effort.

Conveniently, GLSL 1.40 no longer needs a .vert variant, since it
doesn't define any built-ins specific to the vertex shader stage.

ARB_texture_rectangle and OES_EGL_image_external also only need a single
profile, since the .vert and .frag variants were identical.

I didn't bother with EXT_texture_array and OES_texture_3D because
they're so tiny that the savings would be miniscule.

Cuts the generated builtin_function.cpp from 1.7MB to 1.0MB (41%).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:18 -07:00
Kenneth Graunke
fbea94ae59 glsl/builtins: Support stage-agnostic built-in profiles.
The built-in subsystem uses "profiles," or GLSL shaders containing
prototypes for all built-ins supported within a particular language
version (or extension) and shader stage.

Since profiles were stage-specific, we had to cut and paste almost all
the prototypes between (e.g.) 110.vert and 110.frag.  Naturally, this
led to sundry cut and paste bugs, where someone fixed an issue in .frag
but neglected to update .vert, or vice-versa.  Geometry shaders would
have only made this worse.

This patch introduces support for a new '.glsl' profile suffix which
contains prototypes common to all shader stages.  The existing '.frag'
and '.vert' profiles need only contain the few stage-specific built-ins.

Not only does this remove duplication, it makes built-in setup slightly
faster: we don't need to re-read the common prototypes and function
bodies for both the vertex and fragment shader stage.

Internally, this was trivial.  We already create a list of gl_shader
objects to search through for built-ins: one for the core language
version/stage, and additional shaders for any extensions in use.  This
patch simply adds another shader to the list: core/common, core/stage,
and extensions.

The next patch will update the profiles to remove the duplication.
It's separated out purely to make review easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:05:15 -07:00
Kenneth Graunke
7e35d97a02 glsl: Make the standalone compiler accept '.glsl' files.
These ought to be treated as 'any stage', but for now, they're just
treated as vertex shaders.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-17 16:04:57 -07:00
Brian Paul
a5e95a419e mesa: add a couple fast-paths to fast_read_rgba_pixels_memcpy()
Accelerates a few glReadPixels cases for WebGL.
See https://bugs.freedesktop.org/show_bug.cgi?id=48545

v2: Per Jose, use bit twiddling for the swizzle case instead of ubyte
arrays (it's about 44% faster).

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-17 13:22:18 -06:00
Dave Airlie
b814506e87 configure.ac: add IA64 support.
ia64 on Linux can use DRI as well.

Reported-by: russiane39 on #radeon
Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=48788
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-17 19:59:26 +01:00
Kenneth Graunke
f4f6e1f5a0 glsl/builtins: Use ivec for texel offsets in textureProjGradOffset.
The GLSL 1.30 -> 4.10 specs all erroneously say "vec2" for a few
overloads of textureProjGradOffset, while most overloads and all other
texturing functions use ivec types.

The GLSL 4.20 specification corrects these to "ivec2", but doesn't
mention this as being a conscious change in behavior.  Nor does the
ARB_shading_language_420pack extension.  So presumably it was a typo.

At any rate, our builtin functions all use ivec already, so the fact
that these prototypes use plain vecs will only lead to applications
dying in a fire when trying to use them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-17 11:27:51 -07:00
Christoph Bumiller
48aec56559 nv50: specify location of UCPs to code generator
Was made configurable in e44089b2f7
for Kepler but forgot to update nv50.
2012-04-17 18:35:16 +02:00
Tom Stellard
6077b347ae r600g: Use automake to generate Makefile 2012-04-17 09:54:02 -04:00
Eric Anholt
35f2fb70d3 Revert "glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function."
This reverts commit 4ec449a6ed.

I meant to not push this one.  Review found that a link error is not
mandated: it should link, but you get undefined rendering if you rely
on a missing stage.

     page 42/55 section 2.11 "Vertex Shaders":

     "If the program object has no vertex shader, or no program object
      is currently in use, the results of vertex shader execution are
      undefined."

(and similar for page 160/173 section 3.9 "Fragment Shaders" for FS,
and page 45/58 section 2.11.2 "Program Objects" for program being 0)

It turns out the commit was broken anyway, because it was missing a
"goto done", so linkstatus got smashed back to true later and the
error just showed up as a warning in the infolog.
2012-04-16 13:50:05 -07:00
Eric Anholt
f084b5ad32 docs: Update GLSL 1.40 status.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
252d99e4fa docs: Update that int textures got done for GL3.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
45f460f61e docs: Update that ARB_draw_instanced is on in i965.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
61c4e5cd68 docs: Update TBO support.
All I know of that needs finishing in Mesa is to enable the extension
in a GL3.1 core context on i965 -- we're not going to expose it in
non-3.1 core contexts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
4ec449a6ed glsl: Refuse to link GLSL 1.40+ shaders that would use fixed function.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:29 -07:00
Eric Anholt
acd4024e0a glsl: Add remaining *sampler2DRect* texture functions.
Fixes the new piglit texelFetch() tests on these.  Note that the rest
of the new functions are not tested (same as the non-2DRect versions
of most of them).
2012-04-16 11:59:29 -07:00
Eric Anholt
b9fed9f3d5 glsl: Fix the prototype of textureProjGradOffset(sampler2DShadow)
Indirectly caught by Ken's review of my GLSL 1.40 changes where I
copy-and-pasted this line.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:59:19 -07:00
Eric Anholt
56e2f97697 glsl: Mark [iu]sampler{Buffer,2DRect}as reserved in GLSL 1.40.
The non-integer versions were already reserved in 1.30, but apparently
these were forgotten.

Fixes piglit glsl-1.40/compiler/reserved/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:21 -07:00
Eric Anholt
d91c8edd85 glsl: Add textureSize(*samplerBuffer) support.
Fixes the corresponding new tests in piglit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:18 -07:00
Eric Anholt
9a01e09ee5 glsl: Fix comment typo in 1.40 work.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:16 -07:00
Eric Anholt
ecc4c361a6 mesa: Remove dead _mesa_sizeof_glsl_type().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:28:14 -07:00
Eric Anholt
9d921b168b gtest: Don't actually install a library.
The whole point of importing it was that you're not supposed to
install this library.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=411825
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 11:25:39 -07:00
Brian Paul
6f89f5a524 svga: add case for PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS 2012-04-16 10:35:36 -06:00
Dylan Noblesmith
a3d56734df autoconf: add AM_PROG_CC_C_O
Prevents this error with Automake 1.9:

src/gallium/drivers/Makefile.am: C objects in subdir but
`AM_PROG_CC_C_O' not in `configure.ac'
autoreconf: automake failed with exit status: 1

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-16 15:45:32 +00:00
Christoph Bumiller
847c898702 nvc0: fix nve4 linear copies 2012-04-16 00:38:17 +02:00
Christoph Bumiller
1ce9205f79 targets/xvmc-nouveau: fix accidental hardcoded include path
5b0cd37324 wasn't meant to be pushed.
2012-04-15 16:40:53 +02:00
Christoph Bumiller
e55c276255 nv50: use correct semantic map value for undefined PointSize output 2012-04-15 16:30:13 +02:00
Christoph Bumiller
5b0cd37324 targets/xvmc-nouveau: add libdrm include path 2012-04-15 16:26:21 +02:00
Ben Skeggs
d37f90f131 nv30: init sample_mask to some default value at context creation time
Fixes demos/lodbias.
2012-04-15 22:18:02 +10:00
Ben Skeggs
29128e5ee2 nv30: fix some sifm transfer issues 2012-04-15 21:56:20 +10:00
José Fonseca
abfe759172 scons: Fix egl-static build due to conflicting symbols.
radeonsi and r600 have duplicate symbols, so it's not possible to
statically link both.  Remove the newcomer, radeonsi, until duplicate
symbols are fixed.
2012-04-15 11:32:21 +01:00
Christoph Bumiller
e44089b2f7 nvc0: add initial support for nve4+ (Kepler) chipsets
Most things that work on Fermi should work on Kepler too.

There are a few performance optimizations left to do, like better
placement of texture barriers and adding scheduling data to the
shader instructions (without them, a thread group will be masked
for 32 cycles after each single instruction issue).
2012-04-15 00:08:51 +02:00
Tom Stellard
69a921892d radeonsi: s/DUAL_SOURCE_BLEND/MAX_DUAL_SOURCE_RENDER_TARGETS/
Fixes build broken by commit 0d29fb017b
2012-04-14 17:40:35 -04:00
Christoph Bumiller
a6fcf14c23 nv50/ir/opt: extend handleCVT for nv50's SET u32 to f32 chain 2012-04-14 21:54:04 +02:00
Christoph Bumiller
a9f22b91e5 nv50/ir: print interpolation mode 2012-04-14 21:54:04 +02:00
Christoph Bumiller
dcc91fc5d3 nv50: update FP linkage state on one/two-sided lighting switch 2012-04-14 21:54:04 +02:00
Christoph Bumiller
df982399cc nv50: delete old shader compiler files 2012-04-14 21:54:04 +02:00
Christoph Bumiller
0bbf1659df nv50: hook up to new shader code generator 2012-04-14 21:54:04 +02:00
Christoph Bumiller
322bc7ed68 nv50/ir: import nv50 target 2012-04-14 21:54:04 +02:00
Christoph Bumiller
15ce0f76e2 nv50/ir: fix off-by-ones in CSE and nvc0 insnCanLoad 2012-04-14 21:54:04 +02:00
Christoph Bumiller
ce04221081 nv50/ir/tgsi: generate UCPs with actual outputs instead of SVs
gl_ClipDistance is treated the same way, this is just nicer and
easier assign slots for them on nv50.
2012-04-14 21:54:04 +02:00
Francisco Jerez
d07e4421ab nv50/ir: Fix type of the instruction created by mkCmp() for dst in FILE_FLAGS. 2012-04-14 21:54:04 +02:00
Christoph Bumiller
f8c3212cbb nv50/ir: fix Instruction::isCommutationLegal for WAW 2012-04-14 21:54:03 +02:00
Francisco Jerez
93508b5b0d nv50/ir/opt: Add isOptSupported() check in logical arith optimization. 2012-04-14 21:54:03 +02:00
Francisco Jerez
f4dbdcbfcf nv50/ir/ra: Fix live set propagation in the secondary passes of buildLiveSets(). 2012-04-14 21:54:03 +02:00
Christoph Bumiller
2fc014f8c0 nv50/ir/opt: don't regard OP_WRSV as dead code 2012-04-14 21:54:03 +02:00
Christoph Bumiller
a765d7880f nv50/ir: add isUniform query to Values 2012-04-14 21:54:03 +02:00
Christoph Bumiller
e43a3a66a9 nv50/ir: rewrite the register allocator as GCRA, with spilling
This is more flexible than the linear scan, and we don't need the
separate allocation pass for constrained values anymore.
2012-04-14 21:54:03 +02:00
Christoph Bumiller
99319328d4 nv50/ir/tgsi: only export x-component of PSIZE 2012-04-14 21:54:03 +02:00
Christoph Bumiller
12a2f5121d nvc0: fix emission of 3rd src in SET_AND,OR,XOR 2012-04-14 21:54:03 +02:00
Francisco Jerez
f01efba60a nv50/ir: Fix BuildUtil::mkSelect and mkClobber 2012-04-14 21:54:03 +02:00
Christoph Bumiller
054fab5b48 nv50/ir: fix reg file conflicts with undefined-value placeholders 2012-04-14 21:54:03 +02:00
Christoph Bumiller
51327a2df2 nv50/ir/opt: silence warning (int < Elements() signedness) 2012-04-14 21:54:03 +02:00
Christoph Bumiller
ef7f9f68cf nv50/ir/opt: fix combineSt access to wrong instruction 2012-04-14 21:54:03 +02:00
Christoph Bumiller
bb9c15bac4 nv50/ir/opt: another insn NULL check in phi elimination 2012-04-14 21:54:03 +02:00
Francisco Jerez
4ece0dbd2f nv50/ir/ssa: Take into account function inputs and outputs. 2012-04-14 21:54:02 +02:00
Francisco Jerez
4a44f94caf nv50/ir: Clean up before calculating instruction ordering for a new function. 2012-04-14 21:54:02 +02:00
Francisco Jerez
a539785187 nv50/ir/ra: Allocate registers for function arguments. 2012-04-14 21:54:02 +02:00
Francisco Jerez
530ff61ba7 nv50/ir: Take into account function args in the live range calculation code. 2012-04-14 21:54:02 +02:00
Francisco Jerez
ed255dbae2 nv50/ir/ra: Use matching physical regs for function args in caller and callee. 2012-04-14 21:54:02 +02:00
Francisco Jerez
a3dd45e1c2 nv50/ir/tgsi: Infer function inputs/outputs.
Edit: Don't do it for the main function of (graphics) shaders,
its inputs and outputs always go through TGSI_FILE_INPUT/OUTPUT.
This prevents all TEMPs from counting as live out and reduces
register pressure.
2012-04-14 21:54:02 +02:00
Francisco Jerez
9bb36d54a2 nv50/ir/tgsi: Replace the inlining logic with proper function calls. 2012-04-14 21:54:02 +02:00
Francisco Jerez
56d40aa51b nv50/ir: Decouple DataArray from the dictionary that maps locations to values.
The point is to keep an independent dictionary for each function.

The array that was being used as dictionary has been converted into a
"bimap" for two different reasons: first, because having an almost
empty instance of an array with as many entries as registers there are
in the program, once for every function, would be wasteful, and
second, because we want to be able to map Value pointers back to
locations at some point.
2012-04-14 21:54:02 +02:00
Christoph Bumiller
d41f293bf0 nv50/ir/opt: don't delete instruction in removeFlow before its last use 2012-04-14 21:54:02 +02:00
Christoph Bumiller
be161e66d6 nv50/ir/opt: check BB equality before instruction ordering in CSE 2012-04-14 21:54:02 +02:00
Christoph Bumiller
44e84d6f16 nv50/ir/opt: don't copy-propagate cond MOVs or MOVs to other reg files
We've never encountered the latter on nvc0, but on nv50 we have moves
between GPRs and address regs.
2012-04-14 21:54:02 +02:00
Christoph Bumiller
ca1fc2b864 nv50/ir/opt: don't replace conditional definitions in CSE 2012-04-14 21:54:02 +02:00
Francisco Jerez
90f0fac655 nv50/ir/opt: Update the symbol size when combining loads and stores. 2012-04-14 21:54:02 +02:00
Christoph Bumiller
5df92c81c3 nv50/ir: initialize FlowInstruction::builtin 2012-04-14 21:54:01 +02:00
Francisco Jerez
1e95794173 nv50/ir/opt: Fix for function calls. 2012-04-14 21:54:01 +02:00
Francisco Jerez
98116cc3dc nv50/ir: Build a "symbol" table with the binary offsets of each function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
5e4b2a1a47 nv50/ir: Add support for removing functions from a program. 2012-04-14 21:54:01 +02:00
Francisco Jerez
d32ebb8c30 nv50/ir: Scan program functions in DFS-postorder.
The reason is that several passes (regalloc, function argument
binding, inlining) are going to require the callees of a function to
be processed before the caller.
2012-04-14 21:54:01 +02:00
Francisco Jerez
78de8c8ab5 nv50/ir: Deal with graph iterators using RAII. 2012-04-14 21:54:01 +02:00
Francisco Jerez
898b0981b6 nv50/ir: Add convenience method for calculating the live sets of a function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
3e9150cd96 nv50/ir: Add support code for calculating the clobber set of a BB or function. 2012-04-14 21:54:01 +02:00
Francisco Jerez
d6d1f0e4a2 nv50/ir/opt: Don't lose modifiers during constant folding. 2012-04-14 21:54:01 +02:00
Francisco Jerez
14d5f975a6 nv50/ir/opt: Improve modifier handling. 2012-04-14 21:54:01 +02:00
Francisco Jerez
784848a94d nv50/ir: Add support for cloning FlowInsns, ImmediateVals and BBs. 2012-04-14 21:54:01 +02:00
Francisco Jerez
a05e6a3fa2 nv50/ir: Decouple object cloning logic from the sub-object recursion policy. 2012-04-14 21:54:01 +02:00
Francisco Jerez
da28ba00d8 nv50/ir: Make sure that several IR objects are destroyed on takedown. 2012-04-14 21:54:01 +02:00
Christoph Bumiller
9362d4bc0a nv50/ir: make Instruction::src/def container private 2012-04-14 21:54:00 +02:00
Francisco Jerez
8cc2eca5df nv50/ir: Add support for unlimited instruction arguments. 2012-04-14 21:54:00 +02:00
Christoph Bumiller
15d224f7a7 nv50/ir: temporarily exclude nv50 code emitter from build
It's not used yet and shouldn't have been included in the first
place.
2012-04-14 21:54:00 +02:00
Christoph Bumiller
f113b6f959 nv50/ir: copy value size in SSA-rename pass 2012-04-14 21:54:00 +02:00
Christoph Bumiller
55f9bdb64e nv50/ir/opt: improve post-multiply and check target for support 2012-04-14 21:54:00 +02:00
Christoph Bumiller
56cf2da022 nv50/ir: add setFlagsDef/Src helper
Will be used by nv50 target.
2012-04-14 21:54:00 +02:00
Christoph Bumiller
286abcb51e nv50/ir: add isAccessSupported check for memory access coalescing 2012-04-14 21:54:00 +02:00
Christoph Bumiller
c04d6d95e0 nv50/ir: add function for splitting a BasicBlock
Fixes to initial implementation by Francisco Jerez.
2012-04-14 21:54:00 +02:00
Francisco Jerez
0056e1b988 nv50/ir: Allow attaching two nodes when either one is already inside the graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez
099b81396e nv50/ir: Allow inserting isolated nodes to a graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez
1829484458 nv50/ir: Fix memory corruption in Function::orderInstructions().
"iter" doesn't reference a BasicBlock directly, but a Node::Graph,
i.e. BasicBlock::get() is casting to the wrong pointer type.
2012-04-14 21:54:00 +02:00
Francisco Jerez
ab382fbc35 nv50/ir: Fix up insertion of PHI instructions using bb->insertHead(). 2012-04-14 21:54:00 +02:00
Christoph Bumiller
fc740e7924 nv50/ir: fix insertHead and remove for BBs with PHI ops only 2012-04-14 21:54:00 +02:00
Francisco Jerez
349cb60ed5 nv50/ir: Don't crash on zero sized BitSets. 2012-04-14 21:54:00 +02:00
Francisco Jerez
f0a7ec9a2f nv50/ir: Fix Interval::clear(). 2012-04-14 21:53:59 +02:00
Christoph Bumiller
cd6d63fa60 nv50/ir/tgsi: handle inferSrcType(NOT) to be u32 2012-04-14 21:53:59 +02:00
Francisco Jerez
658c0bee71 nv50/ir/opt: Fix OP_NOT to modifier conversion. 2012-04-14 21:53:59 +02:00
Dave Airlie
f8741ff21e r600g: disable dual-src hangs evergreen for some reason.
This did work previously, so I've broken something.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-14 20:25:59 +01:00
Tom Stellard
0b59909e78 r300/compiler: Exit immediately from rc_vert_fc() if there is an error
This way we correctly report "Too many temporaries" errors.

https://bugs.freedesktop.org/show_bug.cgi?id=48680

Note: This is a candidate for the stable branches.
2012-04-14 12:11:29 -04:00
Tom Stellard
73249239cf r300/compiler: Copy all instruction attributes during local transfoms
Instruction attributes like WriteALUResult and ALUResultCompare
were being discarded during the some of the local transformations.

This fixes the following piglit tests:

glsl1-inequality (vec2, pass)
loopfunc
fs-any-bvec2-using-if
fs-op-ne-bvec2-bvec2-using-if
fs-op-ne-ivec2-ivec2-using-if
fs-op-ne-mat2-mat2-using-if
fs-op-ne-vec2-vec2-using-if
fs-op-ne-mat2x3-mat2x3-using-if
fs-op-ne-mat2x4-mat2x4-using-if

https://bugs.freedesktop.org/show_bug.cgi?id=45921

NOTE: This is a candidate for the stable branches.
2012-04-14 10:02:19 -04:00
Tom Stellard
b2df031a95 r300/compiler: Fix nested flow control in r500 vertex shaders 2012-04-13 22:24:16 -04:00
Tom Stellard
4a269a8dc0 r300/compiler: Clear loop registers in vertex shaders w/o loops
The loop registers weren't being cleared, so any shader that was
executed after a shader containing loops was at risk of having a loop
randomly inserted into it.

This fixes over one hundred piglit tests, although these test
only failed during full piglit runs and would pass if
run individually.  The exact number of piglit tests that this patch
fixes will vary depending on the version of piglit and the order the
tests are run.

NOTE: This is a candidate for the stable branches.
2012-04-13 22:23:46 -04:00
Eric Anholt
3f349d4e18 glsl: If an "if" has no "then" or "else" code left, remove it.
Cuts 8/1068 instructions from glyphy's fragment shaders on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-13 17:13:23 -07:00
Eric Anholt
8bb0091e68 glsl: Add a helper for generating temporary variables in ir_builder.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:20 -07:00
Eric Anholt
d32780d504 glsl: Add a helper for ir_builder to make dereferences for assignments.
v2: Fix writemask setup for non-vec4 assignments.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:17 -07:00
Eric Anholt
7e88f8ce8f glsl: Make a little tracking class for emitting IR lists.
This lets us significantly shorten p->instructions->push_tail(ir), and
will be used in a few more places.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:14 -07:00
Eric Anholt
b782352745 glsl: Add common swizzles to ir_builder.
Now we can fold a bunch of our expression setup in ff_fragment_shader
into single-line, parseable commits.

v2: Make it actually work.  I wasn't setting num_components in the
    mask structure, and not setting up a mask structure is way easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:10 -07:00
Eric Anholt
d6e6566206 glsl: Let ir_builder expressions take un-dereferenced variables.
Having to explicitly dereference is irritating and bloats the code,
when the compiler can detect and do the right thing.

v2: Use a little shim class to produce the automatic dereference
    generation at compile time as opposed to runtime, while also
    allowing compile-time type checking.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 17:01:03 -07:00
Eric Anholt
599aac95ff glsl: Create an ir_builder helper for hand-generating IR.
The C++ constructors with placement new, while functional, are
extremely verbose, leading to generation of simple GLSL IR expressions
like (a * b + c * d) expanding to many lines of code and using lots of
temporary variables.  By creating a new ir_builder.h that puts simple
generators in our namespace and taking advantage of ralloc_parent(),
we can generate much more compact code, at a minor runtime cost.

v2: Replace ir_instruction usage with just ir_rvalue.
v3: Drop remaining missed as_rvalue() in v2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-13 16:59:45 -07:00
Christoph Bumiller
0e8ad4cc74 nv50,nvc0: fix handling of user vbufs with stride < access size 2012-04-14 06:14:21 +02:00
Christoph Bumiller
7a40ae4a31 nvc0: prefix all macro methods with MACRO
Some of them have non-macro counterparts.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
ce713cd520 nvc0: replace VERTEX_DATA push mode with translate to buffer
While pushing vertices through the FIFO is relatively fast on nv50,
it's horribly slow on nvc0.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
edbfeed56f nvc0: improve vertex state validation
Now updating vertex attribute format only when necessary.
2012-04-14 06:14:21 +02:00
Christoph Bumiller
784f49e696 nvc0: track texture dirty state individually 2012-04-14 06:14:21 +02:00
Christoph Bumiller
2206a7f513 nv50,nvc0: use new scratch buffers code 2012-04-14 06:14:21 +02:00
Christoph Bumiller
680f20351e nouveau: add new shared scratch buffers 2012-04-14 06:14:21 +02:00
Christoph Bumiller
36158c1994 nvc0: only force early fragment tests if requested by shader 2012-04-14 06:14:21 +02:00
Christoph Bumiller
2d06ee8bf7 nv50,nvc0: hold references to the framebuffer surfaces 2012-04-14 06:14:21 +02:00
Marek Olšák
687c05661f r300g: align vertex buffer suballocations to 4 2012-04-13 23:18:04 +02:00
Marek Olšák
7864933acd u_blitter: align vertex buffer suballocations to 4 2012-04-13 23:18:04 +02:00
Brian Paul
286e50a87d docs: document another viewperf bug in Maya-03 2012-04-13 14:31:33 -06:00
Marcin Slusarz
f2509df95c xorg/nouveau: switch to libdrm_nouveau-2.0 2012-04-13 21:55:56 +02:00
Martin Peres
3dd12ccc06 targets/{egl-static,gbm}: further clean-up the nvfx remains 2012-04-14 03:12:39 +02:00
Christoph Bumiller
21b50ce63b nvc0: remove include of old libdrm_nouveau's nouveau_reloc.h 2012-04-14 03:05:02 +02:00
Christoph Bumiller
802d02c453 nv50,nvc0: handle PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS 2012-04-14 02:40:30 +02:00
Christoph Bumiller
42ec248eb7 nv30: s/DUAL_SOURCE_BLEND/MAX_DUAL_SOURCE_RENDER_TARGETS
Merge accident.
2012-04-14 02:40:09 +02:00
Ben Skeggs
a2fc42b899 nv30: import new driver for GeForce FX/6/7 chipsets, and Quadro variants
The primary motivation for this rewrite was to have a maintainable driver
going forward, as nvfx was quite horrible in a lot of ways.

The driver is heavily based on the design of the nv50/nvc0 3d drivers we
already have, and uses the same common buffer/fence code.  It also passes
a HEAP more piglit tests than nvfx did, supports a couple more features,
and a few more to come still probably.

The CPU footprint of this driver is far far less than nvfx, and translates
into far greater framerates in a lot of applications (unless you're using
a CPU that's way way newer than the GPUs of these generations....)

Basically, we once again have a maintained driver for these chipsets \o/

Feel free to report bugs now!
2012-04-14 02:56:34 +10:00
Christoph Bumiller
6d1cdec3ba nouveau: switch to libdrm_nouveau-2.0 2012-04-14 02:56:33 +10:00
Christoph Bumiller
3c7872f35f nvc0: remove obsolete nvc0_push2.c
Slower version of nvc0_push.c, was only used to ascertain that
bugs were not the new version's fault.
2012-04-14 02:56:33 +10:00
Christoph Bumiller
a3fee8fc86 nouveau: remove automatic buffer migration heuristics 2012-04-14 02:56:32 +10:00
Ben Skeggs
66c7dc5688 nvfx: completely remove this driver (GeForce FX/6/7)
This driver hasn't been maintained properly for a very long time, and for
many very good reasons.  It's horrible.

A new driver supporting these chipsets will appear with the commits that
port vieux/nv50/nvc0 to libdrm_nouveau-2.0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-14 02:56:30 +10:00
Ben Skeggs
f3d8bd3f7b nouveau: rework and simplify nv04/nv05 driver a bit
TEXTURED_TRIANGLE and MULTITEX_TRIANGLE are both a bit special in that if
you use any other graph object in the meantime they'll forget their state
and spew a lovely METHOD_CNT error at you when you try to draw.

The pre-newlib driver has a flush_notify() hook which does this state
re-emit, and a number of random workarounds like extra flushes and state
dirtying after various operations to solve this issue.

I'm taking a slightly different approach to things instead, which has the
nice side-effect of removing the divergent code-paths for ttri/mtri, the
flush/dirty workarounds and the need for flush_notify.  Also gives a few
FPS boost in OA, yay.
2012-04-14 02:56:12 +10:00
Ben Skeggs
2e47d01c9e nouveau/vieux: switch to libdrm_nouveau-2.0 2012-04-14 02:56:12 +10:00
Dave Airlie
7308b6e75f docs: update GL3.txt for ARB_blend_func_extended
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
1f2b539451 gallium: document dual source blending restrictions on gallium
As per Brian's suggestion, document the restrictions on dual src blending.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
d1cc87c0b6 r600g: initial r600 dual src blending support
survives piglit with no regressions on rv610/evergreen

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
4b1c3b920e softpipe: add dual source blending support
This adds support for a single dual source blending MRT to softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:03 +01:00
Dave Airlie
c59d32d1ce util: add dual blend helper function (v2)
This is just a function to tell if a certain blend mode requires dual sources.

v2: move to inlines as per Brian's suggestion

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
a21df96507 st/mesa: add ARB_blend_func_extended support to state tracker.
This adds the blend mode mapping, it also uses the var->index in the
glsl to tgsi convertor - this is the other half of my using 4 in the GLSL
compiler.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
0d29fb017b gallium: rename DUAL_SOURCE_BLEND cap to MAX_DUAL_SOURCE_RENDER_TARGETS
Though I don't think we'll ever expose > 1.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:02 +01:00
Dave Airlie
1256a5dcc8 glsl: add support for ARB_blend_func_extended (v3)
This adds index support to the GLSL compiler.

I'm not 100% sure of my approach here, esp without how output ordering
happens wrt location, index pairs, in the "mark" function.

Since current hw doesn't ever have a location > 0 with an index > 0,
we don't have to work out if the output ordering the hw requires is
location, index, location, index or location, location, index, index.
But we have no hw to know, so punt on it for now.

v2: index requires layout - catch and error
    setup explicit index properly.

v3: drop idx_offset stuff, assume index follow location

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:19:01 +01:00
Dave Airlie
f8cf79936b mesa: add support for ARB_blend_func_extended (v4)
Add implementations of the two API functions,
Add a new strings to uint mapping for index bindings
Add the blending mode validation for SRC1 + SRC_ALPHA_SATURATE
Add get for MAX_DUAL_SOURCE_DRAW_BUFFERS

v2:
Add check in valid_to_render to address case in spec ERRORS.

v3:
Add index to ir.h so this patch compiles on its own
fixup comment

v4: fixup Brian's comments

The GLSL patch will setup the indices.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-04-13 17:18:55 +01:00
Tom Stellard
a75c6163e6 radeonsi: initial WIP SI code
This commit adds initial support for acceleration
on SI chips.  egltri is starting to work.

The SI/R600 llvm backend is currently included in mesa
but that may change in the future.

The plan is to write a single gallium driver and
use gallium to support X acceleration.

This commit contains patches from:
Tom Stellard <thomas.stellard@amd.com>
Michel Dänzer <michel.daenzer@amd.com>
Alex Deucher <alexander.deucher@amd.com>
Vadim Girlin <vadimgirlin@gmail.com>

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

The following commits were squashed in:

======================================================================

radeonsi: Remove unused winsys pointer

This was removed from r600g in commit:

commit 96d882939d
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Feb 17 01:49:49 2012 +0100

    gallium: remove unused winsys pointers in pipe_screen and pipe_context

    A winsys is already a private object of a driver.

======================================================================

radeonsi: Copy color clamping CAPs from r600

Not sure if the values of these CAPS are correct for radeonsi, but the
same changed were made to r600g in commit:

commit bc1c836938
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Jan 23 03:11:17 2012 +0100

    st/mesa: do vertex and fragment color clamping in shaders

    For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
    the perfect place for a fallback.
    The exceptions are:
    - r500 (vertex clamp only)
    - nv50 (both)
    - nvc0 (both)
    - softpipe (both)

    We also have to take into account that r300 can do CLAMPED vertex colors only,
    while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
    with the two new CAPs.

======================================================================

radeonsi: Remove PIPE_CAP_OUTPUT_READ

This CAP was dropped in commit:

commit 04e3240087
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Feb 23 23:44:36 2012 +0100

    gallium: remove PIPE_SHADER_CAP_OUTPUT_READ

    r600g is the only driver which has made use of it. The reason the CAP was
    added was to fix some piglit tests when the GLSL pass lower_output_reads
    didn't exist.

    However, not removing output reads breaks the fallback for glClampColorARB,
    which assumes outputs are not readable. The fix would be non-trivial
    and my personal preference is to remove the CAP, considering that reading
    outputs is uncommon and that we can now use lower_output_reads to fix
    the issue that the CAP was supposed to workaround in the first place.

======================================================================

radeonsi: Add missing parameters to rws->buffer_get_tiling() call

This was changed in commit:

commit c0c979eebc
Author: Jerome Glisse <jglisse@redhat.com>
Date:   Mon Jan 30 17:22:13 2012 -0500

    r600g: add support for common surface allocator for tiling v13

    Tiled surface have all kind of alignment constraint that needs to
    be met. Instead of having all this code duplicated btw ddx and
    mesa use common code in libdrm_radeon this also ensure that both
    ddx and mesa compute those alignment in the same way.

    v2 fix evergreen
    v3 fix compressed texture and workaround cube texture issue by
       disabling 2D array mode for cubemap (need to check if r7xx and
       newer are also affected by the issue)
    v4 fix texture array
    v5 fix evergreen and newer, split surface values computation from
       mipmap tree generation so that we can get them directly from the
       ddx
    v6 final fix to evergreen tile split value
    v7 fix mipmap offset to avoid to use random value, use color view
       depth view to address different layer as hardware is doing some
       magic rotation depending on the layer
    v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
       evergreen, align bytes per pixel to a multiple of a dword
    v9 fix handling of stencil on evergreen, half fix for compressed
       texture
    v10 fix evergreen compressed texture proper support for stencil
        tile split. Fix stencil issue when array mode was clear by
        the kernel, always program stencil bo. On evergreen depth
        buffer bo need to be big enough to hold depth buffer + stencil
        buffer as even with stencil disabled things get written there.
    v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
        old ddx overestimate those. Fix linear case when pitch*height < 64.
        Fix r300g.
    v12 Fix linear case when pitch*height < 64 for old path, adapt to
        libdrm API change
    v13 add libdrm check

    Signed-off-by: Jerome Glisse <jglisse@redhat.com>

======================================================================

radeonsi: Remove PIPE_TRANSFER_MAP_PERMANENTLY

This was removed in commit:

commit 62f44f670b
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Mar 5 13:45:00 2012 +0100

    Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"

    This reverts commit 0950086376.

    It was decided to refactor the transfer API instead of adding workarounds
    to address the performance issues.

======================================================================

radeonsi: Handle PIPE_VIDEO_CAP_PREFERED_FORMAT.

Reintroduced in commit 9d9afcb5ba.

======================================================================

radeonsi: nuke the fallback for vertex and fragment color clamping

Ported from r600g commit c2b800cf38.

======================================================================

radeonsi: don't expose transform_feedback2 without kernel support

Ported from r600g commit 15146fd1bc.

======================================================================

radeonsi: Handle PIPE_CAP_GLSL_FEATURE_LEVEL.

Ported from r600g part of commit 171be75522.

======================================================================

radeonsi: set minimum point size to 1.0 for non-sprite non-aa points.

Ported from r600g commit f183cc9ce3.

======================================================================

radeonsi: rework and consolidate stencilref state setting.

Ported from r600g commit a2361946e7.

======================================================================

radeonsi: cleanup setting DB_SHADER_CONTROL.

Ported from r600g commit 3d061caaed.

======================================================================

radeonsi: Get rid of register masks.

Ported from r600g commits
3d061caaed13b646ff40754f8ebe73f3d4983c5b..9344ab382a1765c1a7c2560e771485edf4954fe2.

======================================================================

radeonsi: get rid of r600_context_reg.

Ported from r600g commits
9344ab382a1765c1a7c2560e771485edf4954fe2..bed20f02a771f43e1c5092254705701c228cfa7f.

======================================================================

radeonsi: Fix regression from 'Get rid of register masks'.

======================================================================

radeonsi: optimize r600_resource_va.

Ported from r600g commit 669d8766ff.

======================================================================

radeonsi: remove u8,u16,u32,u64 types.

Ported from r600g commit 78293b99b2.

======================================================================

radeonsi: merge r600_context with r600_pipe_context.

Ported from r600g commit e4340c1908.

======================================================================

radeonsi: Miscellaneous context cleanups.

Ported from r600g commits
e4340c1908a6a3b09e1a15d5195f6da7d00494d0..621e0db71c5ddcb379171064a4f720c9cf01e888.

======================================================================

radeonsi: add a new simple API for state emission.

Ported from r600g commits
621e0db71c5ddcb379171064a4f720c9cf01e888..f661405637bba32c2cfbeecf6e2e56e414e9521e.

======================================================================

radeonsi: Also remove sbu_flags member of struct r600_reg.

Requires using sid.h instead of r600d.h for the new CP_COHER_CNTL definitions,
so some code needs to be disabled for now.

======================================================================

radeonsi: Miscellaneous simplifications.

Ported from r600g commits 38bf276348 and
b0337b679a.

======================================================================

radeonsi: Handle PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION.

Ported from commit 8b4f7b0672.

======================================================================

radeonsi: Use a fake reloc to sleep for fences.

Ported from r600g commit 8cd03b933c.

======================================================================

radeonsi: adapt to get_query_result interface change.

Ported from r600g commit 4445e170be.
2012-04-13 10:32:06 -04:00
Dylan Noblesmith
e55cf4854d st/vega: silence enum cast warnings
clang warns on these:

stroker.c:626:19: warning: implicit conversion from enumeration
type 'VGPathCommand' to different enumeration type 'VGPathSegment'
[-Wconversion]

No change in the underlying value.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:27:11 +00:00
Dylan Noblesmith
dd32df3829 i965: fix typo
Noticed by clang:

brw_wm_surface_state.c:330:30: warning: initializer overrides prior
initialization of this subobject [-Winitializer-overrides]
      [MESA_FORMAT_Z24_S8] = 0,
                             ^
brw_wm_surface_state.c:326:30: note: previous initialization is here
      [MESA_FORMAT_Z24_S8] = 0,
                             ^

No functionality change, since the array is declared static so
it was zero-initialized by default.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-13 14:25:12 +00:00
Dylan Noblesmith
52d021d4d7 mesa: fix truncated value warning
Silences a clang warning:

format_pack.c:2546:30: warning: implicit conversion from 'int' to
'GLubyte' (aka 'unsigned char') changes value from 65535 to 255
[-Wconstant-conversion]
               d[i] = d[i] ? 0xffff : 0x0;
                           ~ ^~~~~~

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
75fe7d1995 mesa: don't cast away const
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
2bb91274e2 egl-static: fix printf warning
Noticed by clang:

egl_st.c:57:50: warning: field precision should have type 'int',
but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
      ret = util_snprintf(path, sizeof(path), "%.*s/%s" UTIL_DL_EXT,
                                               ~~^~

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
6a491b5728 st/vega: fix uninitialized values
C still treats array arguments exactly like pointer arguments.
By sheer coincidence, this still worked fine on 64-bit
machines where 2 * sizeof(float) == sizeof(void*), but not
on 32-bit.

Noticed by clang:

text.c:76:51: warning: sizeof on array function parameter will
return size of 'const VGfloat *' (aka 'const float *') instead of
'const VGfloat [2]' [-Wsizeof-array-argument]
   memcpy(glyph->glyph_origin, glyphOrigin, sizeof(glyphOrigin));

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
071501a681 egl: fix uninitialized values
Noticed by clang:

eglimage.c:48:28: warning: argument to 'sizeof' in 'memset' call is
the same expression as the destination; did you mean to dereference
it? [-Wsizeof-pointer-memaccess]
   memset(attrs, 0, sizeof(attrs));
          ~~~~~            ^~~~~

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:08 +00:00
Dylan Noblesmith
520521e380 util: fix uninitialized table
Most of the 256 values in the 'generic_to_slot' table were supposed to
be initialized with the default value 0xff, but were left at zero
(from CALLOC_STRUCT()) instead.

Noticed by clang:

u_linkage.h:60:31: warning: argument to 'sizeof' in 'memset' call is the same expression as the destination;
      did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
   memset(table, 0xff, sizeof(table));
          ~~~~~               ^~~~~

Also fix a signed/unsigned comparison and a comment typo here.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-13 14:25:07 +00:00
Dylan Noblesmith
ccff749712 util: fix undefined behavior
container_of() can legally return anything, even invalid addresses
that cause segfaults, when 'sample' is an uninitialized pointer.

Bug exposed by clang.

NOTE: This is a candidate for the 8.0 branch.
2012-04-13 14:25:07 +00:00
Vinson Lee
10ec14865a ir_to_mesa: Fix uninitialized member in add_uniform_to_shader.
Fix uninitialized scalar field defect reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-12 22:43:23 -07:00
Neil Roberts
4f2eafe4dc wayland-drm: Implement wl_buffer.damage in old versions of Wayland
Commit 272bc48976 removed the damage implementation for the
wl_buffer_interface because that has been removed from git master of
Wayland. However this breaks building with the 0.85 branch of Wayland
because it would end up initialising the struct incorrectly.

For the time being it's quite convenient for some compositors to track
the 0.85 branch of Wayland because the protocol is stable but they
will also want to track the master branch of Mesa so that they can use
the gbm surface changes.

This patch adds a compile-time check for the version of Wayland so
that it can work with either Wayland master or the 0.85 branch.

krh: Edited to also account for API changes in 6802eaa68, which
removes the timestamp argument from wl_resource_destroy().
2012-04-12 23:14:22 -04:00
Stéphane Marchesin
368878cc5f Revert "i915g: Implement stipple with draw."
This reverts commit 3cff45fdb1.
2012-04-12 18:31:10 -07:00
Stéphane Marchesin
05265bee85 Revert "i915g: Remove unused poly stipple state."
This reverts commit be6a02266d.
2012-04-12 18:30:59 -07:00
Ian Romanick
0d2bc18e4d tests/glx: Point at the imported copy of gtest
This is just in case there's one installed on the system.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-04-12 17:19:19 -07:00
Eric Anholt
94726d263e glx: Hook up the unit tests again using the internal gtest.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-12 17:18:00 -07:00
Ian Romanick
3d000e7dd1 gtest: Fix up import of gtest 1.6.0
The include files were all missing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
2012-04-12 17:17:52 -07:00
Eric Anholt
19a4c0646b gtest: Build as a convenience library.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-12 17:17:43 -07:00
Eric Anholt
fe358c0ffa gtest: Import sources from gtest 1.6.0.
The upstream of gtest has decided that the intended usage model is for
projects to import the source and use it, which is reflected in their
recent removal of the gtest-config tool.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-12 17:17:10 -07:00
Marek Olšák
6f03692775 cso: unreference saved vertex buffers when restoring
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-12 19:17:47 +02:00
Eric Anholt
249fc70561 i965: When the kernel lacks the LLC check, assume it's present on gen >= 6.
The param wasn't added until drm-intel-next for 3.4, so we were
missing our various LLC fast-paths.
2012-04-11 18:12:12 -07:00
Eric Anholt
e3df28337b intel: Drop backwards compat code for not having libdrm with the LLC check. 2012-04-11 18:12:12 -07:00
Eric Anholt
80ecb8f15b i965/fs: Avoid generating extra AND instructions on bool logic ops.
By making a bool fs_reg only have a defined low bit (matching CMP
output), instead of being a full 0 or 1 value, we reduce the ANDs
generated in logic chains like:

   if (v_texcoord.x < 0.0 || v_texcoord.x > texwidth ||
       v_texcoord.y < 0.0 || v_texcoord.y > 1.0)
      discard;

My concern originally when writing this code was that we would end up
generating unnecessary ANDs on bool uniforms, so I put the ANDs right
at the point of doing the CMPs that otherwise set only the low bit.
However, in order to use a bool, we're generating some instruction
anyway (e.g. moving it so as to produce a condition code update), and
those instructions can often be turned into an AND at that point.  It
turns out in the shaders I have on hand, none of them regress in
instruction count:

Total instructions: 262649 -> 262545
39/2148 programs affected (1.8%)
14253 -> 14149 instructions in affected programs (0.7% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
32ae8d3b32 i965/fs: Try to avoid generating extra MOVs to do saturates.
This change (before the previous two) produced a .23% +/- .11%
performance improvement in Unigine Tropics at 1024x768 on IVB.

Total instructions: 269270 -> 262649
614/2148 programs affected (28.6%)
179386 -> 172765 instructions in affected programs (3.7% reduction)

v2: Move some of the logic of finding the instruction that produced
    the result of an expression tree to a helper.
2012-04-11 18:08:21 -07:00
Eric Anholt
3bdccbc3e0 glsl: Extend the array splitting optimization pass to matrices.
This should fit in well with our lower_mat_op_to_vec code: now, in
addition to having expressions on each column of a matrix, we also
split the columns to separate variables so they can be tracked
individually by the copy propagation, dead code, and other passes.

This optimizes out some more code generation in unigine and gstreamer
shaders.

Total instructions: 269342 -> 269270
14/2148 programs affected (0.7%)
2226 -> 2154 instructions in affected programs (3.2% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
60177d5e2a glsl: Add an array splitting pass.
I've had this code laying around almost done for a long time.  The
idea is like opt_structure_splitting, that we've got a bunch of
transforms at the GLSL IR level that only understand scalars and
vectors, which just skip complicated dereferences.  While driver
backends may manage some optimization after they split matrices up
themselves, it would be better to bring all of our optimization to
bear on the problem.

While I wasn't expecting changes quite yet, a few programs end up
winning: a gstreamer convolution shader, and the Humus dynamic
branching demo:
Total instructions: 269430 -> 269342
3/2148 programs affected (0.1%)
1498 -> 1410 instructions in affected programs (5.9% reduction)
2012-04-11 18:08:21 -07:00
Eric Anholt
fda662f4df glsl: Don't apply optimization passes to builtins.
The builtins we have are generally optimized, having been
hand-written.  This avoids generating bad code when an optimization
pass prints debug output.
2012-04-11 18:08:21 -07:00
Brian Paul
0fd4165261 docs: document yet another viewperf bug 2012-04-11 12:02:11 -06:00
Brian Paul
71d69161ab mesa: add _mesa_total_texture_memory() debug function
This function can be called in gdb to find out how much memory is used
by all texture objects.
2012-04-11 07:00:01 -06:00
Brian Paul
223654b81d mesa: new _mesa_total_buffer_object_memory() debug function
This function can be called in gdb to find out how much memory is used
by buffer objects.
2012-04-11 07:00:01 -06:00
Chad Versace
5154b45217 mapi: Fix Android build
The Android build was broken by
    commit ca760181b4
    Author: Kristian Høgsberg <krh@bitplanet.net>
    Date:   Fri Mar 16 12:55:40 2012 -0400

    shared-glapi: Convert to automake

The offending change was that it redefined the filepaths in sources.mak
like this:
    - FOO_FILES := bar.c
    + FOO_FILES := $(TOP)/src/mapi/mapi/bar.c
This broke the build because source filepaths in Android makefiles must be
relative to the makefile.

Ideally, this could be fixed by reverting the change in sources.mak and
making shared-glapi's Makefile.am use $(addprefix $(TOP)/src/mapi/mapi,
$(FOO_FILES)). However, automake doesn't understand builtin GNU make
functions, such as addprefix. So, it seems that automake and Android can
no longer share sources.mak.

Fix the build by duplicating the source lists from sources.mak into
Android.mk.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-10 21:07:12 -07:00
Mandeep Singh Baines
0695cf68f5 egl_dri2: fix aux buffer leak in drm platform
Keep a reference to any newly allocated aux buffers to avoid
re-allocating for every st_framebuffer_validate() (i.e. leaking).

Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2012-04-10 19:08:12 -04:00
Paul Berry
a27c7d80af i965: Stop lying about cpp and height of a stencil buffer.
When using a separate stencil buffer, i965 requires that the pitch of
the buffer (in the 3DSTATE_STENCIL_BUFFER command) be specified as 2x
the actual pitch.

Previously this was accomplished by doubling the "cpp" and "pitch"
values stored in the intel_region data structure, and halving the
height.  However, this was confusing, and it led to a subtle (but
benign) bug: since a stencil buffer is W-tiled, its true height must
be aligned to a multiple of 64; we were accidentally aligning its faux
height to a multiple of 64, causing memory to be wasted.

Note that for window system stencil buffers, the DDX also doubles the
cpp and pitch values.  To facilitate fixing this DDX server bug in the
future, we fix the cpp and pitch values we receive from the X server
only if cpp has the "incorrect" value of 2.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>

v2: Clarify comments about the DDX.
2012-04-10 11:19:05 -07:00
Pekka Paalanen
272bc48976 wayland-drm: remove wl_buffer.damage
This is a related fix for the Wayland change:

commit 83685c506e76212ae4e5cb722205d98d3b0603b9
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Mar 26 16:33:24 2012 -0400

    Remove wl_buffer.damage and simplify shm implementation

Apparently, this should also fix a memory leak. When wl_buffer.damage
was removed from Wayland and Mesa was not fixed, wl_buffer.destroy ended
up in the (empty) damage function instead of calling
wl_resource_destroy().

Spotted during build as:
  CC     wayland-drm-protocol.lo
wayland-drm.c:80:2: warning: initialization from incompatible pointer type
wayland-drm.c:82:1: warning: excess elements in struct initializer
wayland-drm.c:82:1: warning: (near initialization for 'drm_buffer_interface')

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-10 13:06:56 -04:00
Vinson Lee
70d038e46e st/mesa: Fix uninitialized members in glsl_to_tgsi_visitor constructor.
Fixes uninitialized member defects reported by Coverity.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-09 22:32:23 -07:00
Chad Versace
36fef005b1 main: Fix memory leak in _mesa_make_extension_string()
I forgot to free the string returned by strdup().

Note: This is a candidate for the stable branches.
CC: Johannes Obermayr <johannesobermayr@gmx.de>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-04-09 17:31:51 -07:00
Vadim Girlin
783e4da72a r600g: check gpr count limit
This should help to prevent gpu lockups.
See https://bugs.freedesktop.org/show_bug.cgi?id=48472

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-09 18:05:57 -04:00
Vadim Girlin
4b06280ea3 glsl: fix variable ordering in the output_read_remover
Use the hash of the variable name instead of the pointer value.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-09 18:04:00 -04:00
Eric Anholt
a07cf3397e i965: Add support for sampling texture buffer objects on gen7+.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:27 -07:00
Eric Anholt
0b3729c987 i965: Add real support for texturing/rendering with MESA_FORMAT_RGBA8888_REV.
This was hacked in in one place for EGL image stuff, but the right
thing to do was just to provide the mapping from the mesa format to
the native hardware format, which includes render target support.

This turns out to be required for GL_ARB_texture_buffer_object, which
sees data in this layout.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:15 -07:00
Eric Anholt
aa8ce1be4a i965/gen7: Fix the /* ignored */ comment on constant surface setup.
It turns out this field *is* used, and it's the stride between samples
from the buffer.  Discovered during TBO debugging.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:35:12 -07:00
Eric Anholt
bf82ce3c66 mesa: Add support for the GL 3.1 R/RG formats in texture buffer objects.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:49 -07:00
Eric Anholt
664355f05b mesa: Track a gl_format for the texture buffer format.
There was a function full of unused mappings from the GLenum to
datatype/comps, but that wasn't all the information a driver would
want, which includes the other fields that a gl_format has.  Given
that all the texture buffer formats were represented in gl_format,
just use that as our description.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:44 -07:00
Eric Anholt
dcf42dbd06 mesa: Handle updating texture state for buffer textures.
We have to skip some work that wants to look at texture images, since
buffer textures don't have any of that complexity.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:33 -07:00
Eric Anholt
18c2ee0df5 mesa: Create the default (name==0) buffer texture.
All that should be needed is that it exists.  Fixes segfaults on first
_mesa_update_context() with a samplerBuffer-using shader active but
without a particular buffer texture enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:30 -07:00
Eric Anholt
bb430ced7f glsl: Add texelFetch(*samplerBuffer) entrypoints to GLSL 1.40.
Fix texelFetch(sampler2DRect) and textureSize(samplerBuffer)
generation to not reference a LOD at the same time because it's easier
than not fixing it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:27 -07:00
Eric Anholt
6598552521 glsl: Add support for parsing [iu]samplerBuffer types in GLSL 1.40.
The samplerBuffer type will be undefined in !glsl 1.40, and the
keyword is marked as reserved.  The [iu]samplerBuffer types are not
marked as reserved pre-1.40, so they don't have separate tokens and
fall through to normal type handling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:06 -07:00
Eric Anholt
6d0f5684c1 mesa: Set the correct initial value of the texture buffer object format.
Fixes piglit GL_ARB_texture_buffer_object/get

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:34:03 -07:00
Eric Anholt
44f2cee0fd mesa: Set up glTexBuffer{,ARB} for display list compile.
We're supposed to just immediately call it.  Fixes piglit
GL_ARB_texture_buffer_object/dlist

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:33:57 -07:00
Eric Anholt
62bdb187f8 glapi: regen for TBO change. 2012-04-09 14:33:53 -07:00
Eric Anholt
0be44a3541 glapi: Mark TexBuffer as an alias of TexBufferARB.
This is set correctly in gl.spec, but was missed in Mesa.  As a
result, only one of the two was hooked up in Mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:33:41 -07:00
Eric Anholt
eb7a71dea7 glsl: Drop the round-trip through ast_type_specifier for many builtin types.
We have lexer recognition of a bunch of our types based on the
handling.  This code was mapping those recognized tokens to an enum
and then to a string of their name.  Just drop the enums and provide
the string directly in the parser.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-04-09 14:30:46 -07:00
Kenneth Graunke
b2c0df2b60 glsl: Use (const char *) in AST nodes rather than plain (char *).
Nothing actually relied on them being mutable, and there was at least
one cast which discarded const qualifiers.  The next patch would have
introduced many more.

Casting away const qualifiers should be avoided if at all possible.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-09 14:30:34 -07:00
Eric Anholt
68b99be409 ff_fragment_shader: Remove some dead fields.
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-09 14:09:21 -07:00
Kenneth Graunke
430562a980 x86-64: Don't print "Initializing x86-64 optimizations" in debug builds.
In "release" builds, Mesa would print this message if the MESA_DEBUG
variable was set.  Make it so for debug builds as well.

I build debug builds all the time, but I'm not debugging this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:39 -07:00
Kenneth Graunke
781e2d5cfa ir_to_mesa: Remove pretense of support for function calls.
While ir_to_mesa contains code that attempts to support functions, I
honestly doubt it's been tested and have little confidence that it
works.

The comment in visit(ir_function *ir) doesn't inspire confidence:
/* Ignore function bodies other than main() -- we shouldn't see calls to
 * them since they should all be inlined before we get to ir_to_mesa.
 */

Furthermore, hardware drivers such as i915, i965, and (AFAICT) r200
don't support the BGNSUB/ENDSUB/CAL opcodes anyway.  Only swrast does.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:37 -07:00
Kenneth Graunke
f78f48b6d2 i965: Remove vestiges of function call support from the old VS backend.
This never worked.  brwProgramStringNotify also explicitly rejects
programs that use CAL and RET.  So there's no need for this to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-04-09 10:17:27 -07:00
Yuanhan Liu
c653287549 i915: set SPRITE_POINT_ENABLE bit correctly
When SPRITE_POINT_ENABLE bit is set, the texture coord would be
replaced, and this is only needed when we called something like
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE).

And more,  we currently handle varying inputs as texture coord,
we would be careful when setting this bit and set it just when
needed, or you will find the value of varying input is not right
and changed.

Thus we do set SPRITE_POINT_ENABLE bit only when all enabled tex
coord units need do CoordReplace. Or fallback is needed to make
sure the rendering is right.

With handling the bit setup at i915_update_sprite_point_enable(),
we don't need the relative code at i915Enable then.

This patch would _really_ fix the webglc point-size.html test case and
of course, not regress piglit point-sprite and glean-pointSprite
testcase.

NOTE: This is a candidate for stable release branches.

v2: fallback just when all enabled tex coord units need do
    CoordReplace (Eric)
v3: move the sprite point validate code at I915InvalidateState (Eric)
v4: sprite point enable bit update based on _NEW_PROGRAM, too
    add relative _NEW-state comments to show what state is being used(Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-04-09 09:59:17 +08:00
Yuanhan Liu
8b5b3b93d7 glx: fix compile warnings
Fix 'set but not used' warnings; gl_version, gl_versions_profiles and
glx_extensions variables are used just only HAVE_XCB_GLX_CREATE_CONTEXT
is defined. Thus those warnings are shown when that macro isn't defined.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-04-09 09:59:10 +08:00
Johannes Obermayr
7bb1c784a3 st/xa: Link with -Wl,-r instead of -r.
This is required to link with clang:
  /usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400160.
2012-04-07 20:33:44 +02:00
Johannes Obermayr
a50d695ac2 tgsi: Fix conflict with fortify printf redirect in glibc.
Fixes clang error:

   tgsi/tgsi_dump.c:72:12: error: no member named '__printf_chk' in 'struct dump_ctx'
         ctx->printf( ctx, "%u", e );
         ~~~  ^
   /usr/include/bits/stdio2.h:109:3: note: expanded from macro 'printf'
     __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
     ^

 Idea stolen from:
   http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg210998.html

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-07 20:33:37 +02:00
Brian Paul
299c9052e8 st/mesa: fix max_offset computation for base vertex
Add the maximum base vertex offset to max_index for computing the
buffer size.  Fixes a failed assertion in the u_upload_mgr.c code with
the VMware svga driver.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48141

v2: incorporate Marek's suggestions.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-04-06 14:18:53 -06:00
Brian Paul
ecc480524b svga: add missing cases for PIPE_CAP_x queries
Return 0 for features we don't support.  Added debug_printf()
warnings when we fail to handle a new PIPE_CAP_x case.  That will
alert us to interfaces changes in the future.  We don't want to
just ignore new PIPE_CAPs and possibly miss something important.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-06 14:10:50 -06:00
Brian Paul
d7707ef5a5 svga: return 1 for PIPE_CAP_VERTEX_COLOR_UNCLAMPED query
Before, we weren't clamping the vertex colors produced by ARB vertex
programs.  This could result in some rendering being too bright (in
ETQW, for example).

Also add cases for PIPE_CAP_VERTEX_COLOR_CLAMPED and
PIPE_CAP_FRAGMENT_COLOR_CLAMPED with comments to be complete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-04-06 14:10:50 -06:00
Brian Paul
0adc5d9cfd svga: handle TGSI_SEMANTIC_CLIPDIST/VERTEX semantics
We can't support these vertex attributes, but don't die in an assertion.
Issue a warning instead.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=48142
2012-04-06 14:10:50 -06:00
Brian Paul
0cd68001f8 gallium/docs: fix typos 2012-04-06 14:10:50 -06:00
Kenneth Graunke
2a80a1e2a7 i965: Actually upload sampler state pointers for the VS unit on Gen6.
We already program all the sampler state correctly, we just didn't give
the GPU a pointer to it for the VS stage.  Thus, any texturing other
than texelFetch() wouldn't work.

Fixes piglit test vs-textureLod-miplevels and 99 of oglconform's
glsl-bif-tex subtests.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-04-05 18:37:34 -07:00
James Benton
cf68959f99 gallivm: Updated lp_build_log2_approx to use a more accurate polynomial.
Tested with lp_test_arit with 100% passes and piglit tests with 100%
pass for log but some tests still fail for pow.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-05 20:34:11 +01:00
James Benton
7c639feb2f gallivm: Updated lp_build_polynomial to compute odd and even terms separately to decrease data dependency for faster runtime.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-05 20:32:54 +01:00
Alexandre Demers
129d5138d6 xatracker: fix the build of a 32bit lib on a 64bit os
we were missing cflags.

Signed-off-by: Zack Rusin <zackr@vmware.com>
2012-04-05 00:18:25 -04:00
Marek Olšák
34e53adc51 r600g: inline r600_upload_index_buffer 2012-04-04 13:09:47 +02:00
Marek Olšák
e9abb2cd6e r600g: inline r600_upload_const_buffer 2012-04-04 13:09:47 +02:00
Marek Olšák
82a7fe6f5c r600g: handle DISCARD_WHOLE_RESOURCE for buffers
This should prevent stalls and therefore increase perfomance in some cases.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
c7d0e9ec32 r600g: invalidate caches at the beginning of CS
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
a633d82ce3 r600g: remove dead code after the rework
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
68bbfc1afe r600g: rework state emission of constant buffers
Framerate in ipers:
  before: 43.6 FPS
  after:  46.6 FPS

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
c76462b45f r600g: rework state emission of vertex buffers
This reduces a little of CPU overhead.
The idea is to translate pipe vertex buffers directly into the CS
and not using any intermediate representations.

Framerate in Torcs:
  before: 32.2
  after:  34.6

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák
5c03d1fa0f r600g: kill off the fallback for crazy src_offset values
st/mesa doesn't allow src_offset to be greater than stride and the maximum
stride r600 supports is 2047.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Alexandre Demers
3ea3695b04 st/xvmc: fix library installation dir
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47878

v2: some reordering and while at it also fix the
    comment in Makefile.xvmc

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-04-04 10:57:50 +02:00
Marek Olšák
75f8990547 r300g/swtcl: fix crash when back color is present in vertex shader
The shader transformation code sometimes produced invalid TGSI.
2012-04-04 04:28:41 +02:00
Marek Olšák
ba86e03167 r300g/swtcl: initialize some Draw options 2012-04-04 04:28:41 +02:00
Marek Olšák
c3481f3410 r300g/swtcl: fix polygon offset 2012-04-04 04:28:41 +02:00
Marek Olšák
3b8fe06eb6 r300g/swtcl: don't expose shader subroutine support
RET in the main function doesn't work. This should be fixed in Draw, but meh.
2012-04-04 04:28:41 +02:00
Marek Olšák
6bede55241 r300g: initialize state & render functions before creating u_vbuf & u_blitter 2012-04-04 04:28:40 +02:00
Marek Olšák
da2123051c r300g/swtcl: don't enter u_vbuf_mgr 2012-04-04 04:28:40 +02:00
Marek Olšák
5ce0598a03 r300g/swtcl: don't print an error when getting ClipVertex
Draw can do it just fine.
2012-04-04 04:28:40 +02:00
Benjamin Franzke
9ba3cecaa0 st/egl: Update to the new wl_shm_pool interface 2012-04-03 20:28:20 +02:00
Marek Olšák
900be21e09 u_blitter: don't use user buffers 2012-04-03 20:05:53 +02:00
Vinson Lee
4f513002f6 gallivm: Pass in a MCInstrInfo to createMCInstPrinter on llvm-3.1.
llvm-3.1svn r153860 makes MCInstrInfo available to the MCInstPrinter.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-03 10:55:45 -07:00
Christian König
24ca588ce6 st/vdpau: fix deadlock in PresentationQueueQuerySurfaceStatus
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-04-03 17:33:26 +02:00
Marek Olšák
7f2156c9bd r600g: remove dead code in r600_update_derived_state 2012-04-03 17:09:47 +02:00
James Benton
5db9d76a6a gallivm: Maximum loop iterations
Limits maximum loop iterations in a TGSI shader to prevent infinite
loops from occurring, any iteration in any loop counts towards this
limit

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-04-03 10:11:27 +01:00
José Fonseca
d312b224b6 gallivm: Simplify/reorder minimax helper. 2012-04-03 09:12:47 +01:00
Vinson Lee
431b458f24 swrast: Fix memory leaks in blit_linear.
Fixes Coverity resource leak defects.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-04-02 21:47:41 -07:00
Kenneth Graunke
f75c2d5314 glsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.
Variables have types, expression trees have types, but statements don't.
Rather than have a nonsensical field that stays NULL in the base class,
just move it to where it makes sense.

Fix up a few places that lazily used ir_instruction even though they
actually knew the particular subclass.

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:46 -07:00
Kenneth Graunke
82065fa20e glsl: Remove ir_call::get_callee() and set_callee().
Previously, set_callee() performed some assertions about the type of the
ir_call; protecting the bare pointer ensured these checks would be run.

However, ir_call no longer has a type, so the getter and setter methods
don't actually do anything useful.  Remove them in favor of accessing
callee directly, as is done with most other fields in our IR.

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:43 -07:00
Kenneth Graunke
d884f60861 glsl: Convert ir_call to be a statement rather than a value.
Aside from ir_call, our IR is cleanly split into two classes:
- Statements (typeless; used for side effects, control flow)
- Values (deeply nestable, pure, typed expression trees)

Unfortunately, ir_call confused all this:
- For void functions, we placed ir_call directly in the instruction
  stream, treating it as an untyped statement.  Yet, it was a subclass
  of ir_rvalue, and no other ir_rvalue could be used in this way.
- For functions with a return value, ir_call could be placed in
  arbitrary expression trees.  While this fit naturally with the source
  language, it meant that expressions might not be pure, making it
  difficult to transform and optimize them.  To combat this, we always
  emitted ir_call directly in the RHS of an ir_assignment, only using
  a temporary variable in expression trees.  Many passes relied on this
  assumption; the acos and atan built-ins violated it.

This patch makes ir_call a statement (ir_instruction) rather than a
value (ir_rvalue).  Non-void calls now take a ir_dereference of a
variable, and store the return value there---effectively a call and
assignment rolled into one.  They cannot be embedded in expressions.

All expression trees are now pure, without exception.

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:41 -07:00
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
Dylan Noblesmith
50fa821854 glapi: add GL_ARB_depth_buffer_float
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 21:35:04 +00:00
Dylan Noblesmith
faf954f151 glapi: add GL_ARB_texture_compression_rgtc
Noticed this was missing when writing the "glapi: sort ARB extensions
by number" commit, which at least shows it was effective.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:28:25 +00:00
Dylan Noblesmith
bae4cd6882 glapi: add ARB_texture_rg
Noticed it was missing based on the lack of a descriptive enum
name from this bug's error message:

https://bugs.freedesktop.org/show_bug.cgi?id=44039

This moves two enums out of GL3x.xml. Though since this and
GL_ARB_texture_compression_rgtc are both strict subsets of GL3,
both extensions should have had all their enums in that file
to begin with, not just two of them.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:28:25 +00:00
Dylan Noblesmith
a419595a87 regen for "glapi: sort ARB extensions by number" 2012-03-26 21:28:10 +00:00
Dylan Noblesmith
1ae2e39d01 glapi: sort ARB extensions by number
And add comments to fill in for extensions that aren't there.

Noticed the comment about "ARB extensions sorted by extension number"
didn't extend to the <xi:include> directives when it became clear
GL_ARB_texture_rg was missing, going by the error message seen here:

https://bugs.freedesktop.org/show_bug.cgi?id=44039

This makes it easier to notice in the future if an extension is missing
when it shouldn't be.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-26 21:27:15 +00:00
Vinson Lee
b688700edc mesa: Fix memory leak in generate_mipmap_compressed.
Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-26 14:08:11 -07:00
Dave Airlie
7449ae4597 glsl: fix linker error message context for frag shader output.
A later error prints this properly, fix this case to do the same.

v2: remove attribute as per Ian's suggestion
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-03-26 18:48:46 +01:00
Dave Airlie
a83c1d61c2 glapi: ARB_blend_func_extended support + regen. (v2)
This adds the xml file covering ARB_blend_func_extended.

v2: fix SRC1_ALPHA

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-26 18:42:41 +01:00
Kenneth Graunke
7a348b91ce glsl: Make ir_dereference_variable ctor assert the variable exists.
This also seems like a bad idea.  There were too many instances for me
to thoroughly scan the code as I did with the last two patches, but a
quick scan indicated that most callers newly allocate a variable,
dereference it, or NULL-check.  In some cases, it wasn't clear that the
value would be non-NULL, but they didn't check for error_type either.

At any rate, not checking for this is a bug, and assertions will trigger
it earlier and more reliably than returning error_type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:57 -07:00
Kenneth Graunke
dca19a7711 glsl: Explicitly NULL-check variables before making a dereference.
The constructor currently returns a ir_dereference_variable of error
type when provided NULL, but that's about to change in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:55 -07:00
Kenneth Graunke
2cd652f810 glsl: Make ir_dereference_record constructor assert the variable exists.
Providing a NULL pointer to the ir_dereference_record() constructor
seems like a bad idea.  Currently, if provided NULL, it returns a
partially constructed value of error type.  However, none of the callers
are prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:53 -07:00
Kenneth Graunke
25b0d45d03 glsl: Make ir_dereference_array constructor assert the variable exists.
Providing a NULL pointer to the ir_dereference_array() constructor seems
like a bad idea.  Currently, if provided NULL, it returns a partially
constructed value of error type.  However, none of the callers are
prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:51 -07:00
Kenneth Graunke
ced54dcf9b glsl: Comment that expression flattening is used for matrix operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-26 10:21:44 -07:00
Christian König
7f6af49092 st/vdpau: clear video surface at least once
So if anything goes wrong we won't display a random image.

v2: flush before using the surface with the decoder.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-26 12:39:40 +02:00
Christian König
9f777699ed st/vdpau: invert interlaced buffer checks
That wasn't working as supposed.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-26 12:39:40 +02:00
Dave Airlie
7b6424143d intel: fix TFP at 16-bpp
don't ask why I had to debug this.

tested to fix g-s and kwin at 16-bpp on Ironlake.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:15:52 +01:00
Dave Airlie
d6c5ad52b2 drisw: fix image stride calculation for 16-bit.
If you ran g-s in 16-bpp we'd do a bunch of memory corruption.

now it just misrenders for some other reasons.

applies to stable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-25 17:15:23 +01:00
Dave Airlie
ba3a4d79a7 glsl: fix compiling warning from gcc 4.7
ir_validate.cpp: In member function ‘virtual ir_visitor_status ir_validate::visit_leave(ir_swizzle*)’:
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::x’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::y’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::z’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::w’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-25 17:12:24 +01:00
Dave Airlie
b78a77f979 glsl: initialise const force glsl extension warning in fake ctx
valgrind complained about an uninitialised value being used in
glsl_parser_extras.cpp, and this was the one it was giving out about.

Just initialise the value in the fakectx.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:12:24 +01:00
Dave Airlie
989e013b80 makefile: add phony am--refresh target
for some reason when I configure --with-dri-drivers="" the src/mesa/drivers/dri
Makefile tries to call the am--refresh target in the toplevel Makefile,
we don't have one, and I'm not sure what it should look like.

This makes things continue on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-25 17:09:35 +01:00
Dave Airlie
ea663d56e2 docs/GL3.txt: document ARB_blend_func_extended state
I've written softpipe version in my tree, + gallium/mesa/glsl changes,
however r600 currently hangs the GPU.
2012-03-24 16:35:46 +00:00
Dave Airlie
2c778375a1 glx/drisw: avoid segfaults when we fail to get visual
piglit glx-tfp segfaults on llvmpipe when run vs a 16-bit radeon screen,

it now fails instead of segfaulting, much prettier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-24 13:05:19 +00:00
Vinson Lee
0f3aa9f4bd mesa: Fix memory leak in _mesa_get_uniform_location.
Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-23 22:52:57 -07:00
Brian Paul
318669f196 st/mesa: fix mipmap image size computation w.r.t. texture arrays
The image height or depth is the array_size for array textures.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-03-23 10:08:49 -06:00
Brian Paul
281d0fd3a9 mesa: set numFaces=6 for cube maps in _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-23 10:08:49 -06:00
Dylan Noblesmith
8d9decb75f intel: fix null dereference processing HiZ buffer
Or technically, a near-null dereference.

https://bugs.freedesktop.org/show_bug.cgi?id=46303
https://bugs.freedesktop.org/show_bug.cgi?id=46739

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-22 20:51:38 +00:00
Christopher Yeleighton
0c406afab0 docs: fix html in bugs.html
https://bugs.freedesktop.org/show_bug.cgi?id=47310
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-22 08:15:11 -06:00
Christian König
f23a2cb5d2 st/vdpau: improve frame dumping functionality a bit
Just a workaround until we get a real unit-
testing tool for VDPAU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-22 09:47:04 +01:00
Christian König
fa66fda5b0 st/vdpau: add VC-1 startcode if none is found in the stream
v2: only advanced profile needs that.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-22 09:47:04 +01:00
Eric Anholt
e07b1603e2 glx: Fix glXGetProcAddress() of global glX symbols post-automake conversion.
When a GL LD_PRELOAD library like apitrace was used,
glXGetProcAddress() would return the preload's symbols instead of
libGL's symbol, leading to infinite recursion when the returned
function was called.  This didn't hit apitrace on most apps because
who calls glXGetProcAddress() on the global functions.

The -Bsymbolic, which was present in mklib before automake conversion,
causes the glxcmds.c:GLX_functions table to be resolved at link time,
so that LD_PRELOADs don't affect it any more.

Fixes crashes when running wine under apitrace.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
2012-03-21 13:55:41 -07:00
Brian Paul
20836c8185 st/mesa: set MaxUnrollIterations = 255
The default was 32 for the EmitNoLoops=0 case.  This allows the oZone3D
soft shadows test to work properly with the vmware driver.  Jose reported
that SM3 supports up to 255 loop iterations.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-21 13:46:44 -06:00
Brian Paul
7feabfe23d glsl: propagate MaxUnrollIterations to the optimizer's loop unroller
Instead of the hard-coded value of 32.  Note that MaxUnrollIterations
defaults to 32 so there's no net change.  But the gallium state tracker
can override this.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 13:46:36 -06:00
Eric Anholt
9bd38f3c67 intel: Make use of the new GPU-unsynchronized map functionality in libdrm.
Improves Unigine Tropics performance at 1024x768 by 2.06236% +/-
0.50272% (n=11).

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
8308869311 intel: Drop the tracking of bo_map vs bo_map_gtt for unmapping.
drm_intel_bo_unmap() supports both in the current libdrm version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
f97da4ed71 i965: Avoid flushing the batch for busy BOs for ARB_mbr with INVALIDATE_BUFFER.
Unigine Tropics uses INVALIDATE_BUFFER and not UNSYNCHRONIZED to reset
the buffer object when its streaming wraps.  Don't penalize it by
flushing the batch at the wrap point, just allocate a new BO and get
to using it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
2222aa06e1 intel: Handle devid overrides using libdrm.
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:06 -07:00
Eric Anholt
0247d89183 intel: Ask libdrm to dump an AUB file if INTEL_DEBUG=aub.
It also asks for BMPs in the aub file at SwapBuffers time.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:05 -07:00
Eric Anholt
218f3a5663 intel: Bump libdrm requirement to 2.4.32.
We'll need this for AUB dumping and unsynchronized maps.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:45:05 -07:00
Jakob Bornecrantz
3a4ded6d1f docs: Add 8.0.2 md5sums
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 0bf0ba44de)
2012-03-21 19:23:20 +00:00
Jakob Bornecrantz
7bb7e5ffbb docs: Add 8.0.2 release notes
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 5f7204c3bb)
2012-03-21 19:23:20 +00:00
Jakob Bornecrantz
56d05a8d3a mesa: Include mesa ES mapi generated files
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 770f785a6f)
2012-03-21 19:23:20 +00:00
Eric Anholt
f1c1c9eabe glsl: Don't require gl_Position to be written in GLSL 1.40.
Fixes piglit glsl-1.40/execution/tf-no-position.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 12:07:54 -07:00
Jon TURNEY
0bc4407744 mapi: Use -no-undefined libtool flag in src/mapi/shared-glapi/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-21 11:31:45 -07:00
Eric Anholt
668ed95993 drirc: Add missing XML attributes that made the driconf application whine.
These are used for pretty presentation of the application name in the
UI.

Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-21 09:47:57 -07:00
Alex Deucher
b4082f492b r600g: add support for TN (trinity) APUs
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-03-20 19:43:59 -04:00
Eric Anholt
d09fce51f0 i965: Change the hiz-override env var to a driconf option.
The force-enable option is dropped, now that the hardware we were
concerned about has HiZ on by default.  Now, instead of doing
INTEL_HIZ=0 to test disabling hiz, you can set hiz=false.

v2: Disable separate stencil on gen6 when HIZ is turned off.
    (previously, this had to be done manually in addition).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-03-20 15:47:48 -07:00
Eric Anholt
447aff5b02 i965: Drop the INTEL_FORCE_GS environment variable.
This was a debug option during gen6 transform feedback bringup (and a
similar one existed during gen4 bringup).  However, it looks like
we're done with that, and we don't anticipate it being used again,
either for geometry shaders or transform feedback.

Suggested by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:31:44 -07:00
Eric Anholt
7e6221f2e3 intel: Drop the INTEL_NO_BLIT debug environment variable.
This was added in the i915/i965 merge from the i915 driver, but I
don't recall it ever being used since then.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:27:46 -07:00
Eric Anholt
67d3ff760a intel: Drop the INTEL_STRICT_CONFORMANCE environment variable.
If you want to test the graphics driver, you want to test it under the
conditions that users will see, not some set of additional fallbacks.
If you want to test swrast, run the swrast driver (or no_rast=true)
instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 15:27:46 -07:00
Anuj Phogat
cdcfd5d1d6 intel: Fix a case when mapping large texture fails
This patch handles a case when mapping a large texture fails
in drm_intel_gem_bo_map_gtt(). These changes avoid assertion
failure later in the driver as reported in following bugs:

https://bugs.freedesktop.org/show_bug.cgi?id=44970
https://bugs.freedesktop.org/show_bug.cgi?id=46303

Testing: No regressions in piglit quick.tests

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-20 15:11:39 -07:00
Kenneth Graunke
2097af9728 Add Makefile to shared-glapi .gitignore 2012-03-20 11:50:51 -07:00
Kenneth Graunke
dfce56ba4d Add Makefile.in to toplevel .gitignore
To avoid redundancies, this patch also removes Makefile.in from the
other .gitignore files.

Acked-by: Eric Anholt <eric@anholt.net>
2012-03-20 11:50:50 -07:00
Paul Berry
b41ab3b42c Add .deps/, .libs/, and *.la to toplevel .gitignore
To avoid redundancies, this patch also removes .deps, .libs, and *.la
from .gitignore files in subdirectories.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 11:50:50 -07:00
Brian Paul
75f82b5d58 mesa: only test cube face widths in _mesa_test_texobj_completeness()
As Eric pointed out, we know the cube faces are square at this point
so we only need to test the texture widths for consistency.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-20 09:43:10 -06:00
Brian Paul
2cbccfdcb0 softpipe: set max cube texture size to 4Kx4K
The max size was 16Kx16K so a 4 byte/pixel, six-sided cube would require
6 GBytes of memory.  If mipmapped, 8 GB.  Reduce the max size to 4K to
make the total size more reasonable.

Fixes a crash with the new piglit max-texture-size test.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-20 08:23:32 -06:00
Brian Paul
73fd269d2f mesa: add integer texture completeness check
Per the spec, only nearest filtering is supported for integer textures.
Otherwise, the texture is incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
f4a93e0665 mesa: rework texture completeness testing
Instead of gl_texture_object::_Complete there are now two fields:
_BaseComplete and _MipmapComplete.  The former indicates whether the base
texture level is valid.  The later indicates whether the whole mipmap is
valid.

With sampler objects, a single texture can appear to be both complete and
incomplete at the same time.  See the GL_ARB_sampler_objects spec for more
details.  To implement this we now check if the texture is complete with
respect to a sampler state.

Another benefit of this is we no longer need to invalidate a texture's
completeness state when we change the minification/magnification filters
with glTexParameter().

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
b219b2c310 mesa: add _mesa_is_mipmap_filter() helper
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
ff005bdb7c mesa: use _mesa_dirty_texobj() in glTexParameter code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
878c69fe54 mesa: use _mesa_dirty_texobj() function
To mark the texture object as incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
d335e69b9a mesa: rewrite/consolidate code in _mesa_test_texobj_completeness()
Merge the mipmap level checking code that was separate cases for 1D,
2D, 3D and CUBE before.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
e86d0dea8e mesa: use new baseImage var to simplify _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
fbbbb98fc4 mesa: add comments in _mesa_test_texobj_completeness() related to the spec
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
085d2bb97e mesa: better debug message in _mesa_test_texobj_completeness()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
4c9537f7d0 mesa: move some code in _mesa_test_texobj_completeness()
Move the simple MaxLevel < BaseLevel test earlier to be closer to where
we error-check BaseLevel.  Also, use the local baseLevel var in more places.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
4c385d382f mesa: use switch(target) in _mesa_test_texobj_completeness()
and add missing case for GL_TEXTURE_BUFFER.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
cfd5b14dac mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Brian Paul
3f7509beff mesa: make _mesa_reference_sampler_object() an inline function
To make the no-change case faster, as we do for the other object-reference
functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-20 08:23:32 -06:00
Eric Anholt
0225a15b69 glsl: Don't include the deprecated structure types in GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-19 22:14:02 -07:00
Eric Anholt
56118ef929 mesa: Validate the drawing primitive against the transform feedback mode.
Fixes piglit GL_EXT_transform_feedback/negative-prims.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-19 22:01:53 -07:00
Eric Anholt
7ca4f07b5b mesa: Fold error generation into _mesa_valid_prim_mode().
We want to start emitting an INVALID_OPERATION from here for transform
feedback.  Note that this forced dlist.c to almost not use this
function, since it wants different behavior during dlist compile.
Just pull the non-TF, non-GS test out for compile, because:

1) TF doesn't matter in that case because there's no drawing.
2) I don't think we're going to see GSes and display lists in the same
   context, if we don't do GL_ARB_compatibility.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-19 22:01:22 -07:00
Kristian Høgsberg
ca760181b4 shared-glapi: Convert to automake
This fixes a build problem where EGL links to libgbm.la, which encodes
a relative path to it's libglapi.so dependency.  The relative path
breaks when the linker tries to resolve it from src/egl/main instead
of src/gbm.  Typically we silently fall back to the system
libglapi.so, which is wrong and breaks when there isn't one.

Morale of the story: don't mix mklib and libtool.
2012-03-19 11:13:06 -04:00
Alex Deucher
91ddfa72b4 r600g: fix r600_get_backend_mask() for virtual addresses
I don't think we should hit this path for virtual addresses,
but just in case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-03-19 10:52:46 -04:00
Yuanhan Liu
40c995c1fd i915: fallback for NPOT cubemap texture
Although some hardware support NPOT cubemap, but it seems we don't know
the right layout for NPOT cubemap. Thus seems we need do fallback for
other platforms as well.

See comments inline the code for more detailed info.

v2: give a more detailed info about why we need fallback for other
    platfroms as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46666

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-03-19 10:06:48 +08:00
Marek Olšák
a2e7629e68 r600g: fix point rendering
Accidentally broken in c7eaf274a9.
2012-03-19 03:00:04 +01:00
Brian Paul
03f8a97d71 st/mesa: add null pointer check in st_texture_image_map()
If we failed to allocate a memory resource for the texture we'd crash
when we tried to map it.  Now we propogate the NULL back up to the
texstore code and generate GL_OUT_OF_MEMORY.

Fixes a crash with the upcoming piglit max-texture-size test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-17 16:15:59 -06:00
Alex Hultman
c3fe44c5f9 docs: add info for installing dependencies on fedora
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-17 16:15:28 -06:00
Brian Paul
aec47e7d42 dri_util: add copyright/license blurb 2012-03-17 16:15:28 -06:00
Jeremy Huddleston
90a51753c4 darwin: Link against libxcb
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:09:22 -07:00
Jeremy Huddleston
f9e1295cff darwin: Build create_context.c
Fixes a build regression from: 588042a8ec

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:09:22 -07:00
Jeremy Huddleston
61f6aff5d9 darwin: config file cleanups
Set our default compiler based on what our installed XCode prefers

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-16 17:01:46 -07:00
Eric Anholt
31866308fc i965/fs: Jump from discard statements to the end of the program when done.
From the GLSL 1.30 spec:

     The discard keyword is only allowed within fragment shaders. It
     can be used within a fragment shader to abandon the operation on
     the current fragment. This keyword causes the fragment to be
     discarded and no updates to any buffers will occur. Control flow
     exits the shader, and subsequent implicit or explicit derivatives
     are undefined when this control flow is non-uniform (meaning
     different fragments within the primitive take different control
     paths).

v2: Don't emit the final HALT if no other HALTs were emitted.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-03-16 11:55:38 -07:00
Eric Anholt
bddb2edab6 i965: Add disasm for gen6+ UIP/JIP on BREAK/CONT/HALT.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-16 11:55:35 -07:00
Eric Anholt
c0795742a3 glsl: Add GLSL 1.40 textureSize() implementations for sampler2DRect.
By setting lod to 0 in the builtin function implementation, we avoid
needing to update all the visitors to ignore LOD in this case, when
the hardware drivers actually want to ask for LOD 0 for rectangular
textures.

Fixes piglit spec/GLSL-1.40/textureSize-*Rect.

v2: Change style of looking for substrings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
e06ab8c363 glsl: Set up generated builtin functions handling for GLSL 1.40.
Otherwise, when we go to use ir_reader on the generated code, we won't
have the types present.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
3645b77b71 glsl: Add support for integer sampler2DRect variants in GLSL 1.40.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
c72840630b glsl: Drop ftransform() from GLSL 1.40 profile.
This is the one builtin function claimed to be dropped due to the
ARB_compatibility split.

Fixes piglit spec/GLSL-1.40/compiler/ftransform.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
590ad64fc8 glsl: Copy GLSL 1.30 builtin profile to GLSL 1.40.
All that's changed is the #version changing to 140.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
25c729bf9f glsl: When failing to compile some builtins, print the error.
This makes the process slightly more debuggable, though it would be
nice if the build just failed immediately instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:50 -07:00
Eric Anholt
497aab39f0 glsl: Let the builtin compiler process GLSL 1.40 shaders.
This is required to put the new 1.40 builtins in place, since they
require new types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 16:24:49 -07:00
Eric Anholt
177ccd246f glsl: Update builtin variables for GLSL 1.40.
Mostly this is a matter of removing variables that have been moved to
the compatibility profile.  There's one addition: gl_InstanceID is
present in the core now.

This fixes the new piglit tests for GLSL 1.40 builtin variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Eric Anholt
c5ff9a8b9e glsl: Hook up the current GLSL 1.30 types and builtins for 1.40.
This gets a basic #version 140 shader compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Eric Anholt
ac5a5b3243 glsl: Add support for parsing #version 140.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-15 08:33:54 -07:00
Kenneth Graunke
99cd475cc9 i965: Enable SIMD16 mode for shaders with loops on Gen6+.
The hardware supports it; there's no reason not to.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-14 15:02:48 -07:00
Vinson Lee
fe34006908 gallivm: Fix createOProfileJITEventListener namespace with llvm-3.1.
llvm-3.1svn r152620 refactored the OProfile profiling code.
createOProfileJITEventListener was moved from the llvm namespace to the
llvm::JITEventListener namespace.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-14 09:30:40 -07:00
Tom Stellard
dc382e5c35 noop: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
3f3f10f78c identity: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
26ab747284 galahad: Use non-recursive automake 2012-03-14 10:25:59 -04:00
Tom Stellard
fe3f98ed70 gallium/drivers: Use automake to generate makefile 2012-03-14 10:25:59 -04:00
Christopher Yeleighton
ea738548e5 docs: fix html in banner.html
https://bugs.freedesktop.org/show_bug.cgi?id=47304

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-14 08:06:37 -06:00
Eric Anholt
ead3589aa2 glsl: Avoid extra if statements for logic and/or with no side effects.
This avoids extra if statements in the common case of just comparing
two expressions that don't involve assignments or function calls,
along with simplifying the handling of constant expressions.  Reduces
i965 instructions generated in unigine tropics and sanctuary,
yofrankie, warsow, gstreamer shaders, and the weston compositor.

shader-db results:
Total instructions: 213052 -> 212752
38/1246 programs affected (3.0%)
14309 -> 14009 instructions in affected programs (2.1% reduction)
2012-03-13 13:50:08 -07:00
Dylan Noblesmith
b536ac6b2b mesa: add back glGetnUniform*v() overflow error reporting
The error was removed in:

commit 719909698c
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Oct 18 16:01:49 2011 -0700

    mesa: Rewrite the way uniforms are tracked and handled

The GL_ARB_robustness spec doesn't say the implementation
should truncate the output, so just return after setting
the required error like it did before the above commit.

Also fixup an old comment and add an assert.

NOTE: This is a candidate for the 8.0 branch.
2012-03-13 15:59:24 +00:00
Anuj Phogat
cc5b0ffae0 mesa: Fix the cause of piglit test fbo-array failure
Handle the special case of glFramebufferTextureLayer() for which we pass
teximage = 0 internally in framebuffer_texture(). This patch makes failing
piglit test fbo-array, fbo-depth-array to pass.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47126

V4: Removed the duplicated code.
Note: This is a candidate for the stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-12 11:58:12 -07:00
Brian Paul
6830e6515c mesa: fix _mesa_DebugMessageCallbackARB() to silence warnings
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-12 12:54:25 -06:00
Brian Paul
82195815ec radeon: remove use of DD_FLATSHADE
This got missed earlier <sigh>.
2012-03-12 12:47:03 -06:00
Christopher Yeleighton
7f94d9819d docs: fix up html tags in autoconf.html
http://bugs.freedesktop.org/show_bug.cgi?id=47241

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-03-12 12:22:34 -06:00
Brian Paul
534cbbe658 mesa: add more comments about textarget in framebuffer_texture() 2012-03-12 11:40:44 -06:00
Brian Paul
92c42d8170 mesa: renumber remaining DD_ constants
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
741bfef26c mesa: remove unused DD_TRI_CULL_FRONT_BACK
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d710bbcd74 mesa: remove unused DD_FLATSHADE
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d269b1f310 mesa: remove unused DD_TRI_TWOSTENCIL
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
291e4104ae mesa: remove _DD_NEW_x flags
They're no longer used anywhere.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
d2b849a227 tnl: stop using _DD_NEW_x flags
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
938aaec981 swrast: s/_DD_NEW_SEPARATE_SPECULAR/_MESA_NEW_SEPARATE_SPECULAR/
Another step toward removing the _DD_NEW_x flags

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
5edd7b8c46 mesa: define _MESA_NEW_SEPARATE_SPECULAR
This will replace the soon-to-be-removed _DD_NEW_SEPARATE_SPECULAR flag.
Note: there's a similar composite _MESA_NEW_NEED_EYE_COORDS flag set already.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
22d6268df7 i915: remove occurances of _DD_NEW_x flags
Just use the corresponding _NEW_x flags intead.  The _DD_NEW_x flags
will be removed in a following patch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-12 11:40:43 -06:00
Brian Paul
f21dfa9d4b mesa: remove ctx->Driver.ClearColor() hook
The driver Clear() function should just grab the clear color out of the
context.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
9c53fc593e mesa/gdi: remove clear_color() function
Setup the clearing color in the clear() function.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
fdbb717b24 xlib: remove clear_color() function
Just setup the clearing color in clear_buffers().

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
c90ae6b501 radeon/r200: remove ClearColor driver functions
The state.color.clear value was never used anywhere.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
5f80218884 mesa: remove ctx->Driver.ClearDepth(), ClearStencil() driver hooks
Not used by any drivers.  Drivers can easily access the values
from the Mesa context at glClear() time.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
e0ed951e13 radeon/r200: remove ClearDepth() and ClearStencil() driver hooks
The computed stencil.clear and depth.clear values aren't used anywhere.
Those fields have been removed too.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Brian Paul
5bb2059be7 radeon/r200: remove hyperz/fast clear testing code
The flags which were computed were never actually used.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-03-12 11:40:43 -06:00
Kenneth Graunke
5ac910c014 docs: Fix unclosed anchor tag in xlibdriver.html.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47205
2012-03-11 23:39:54 -07:00
José Fonseca
901a118327 egl/drm: Include errno.h
Fixes scons build.
2012-03-11 19:51:00 +00:00
David Fries
b60120608f Set close on exec flag FD_CLOEXEC
Set the close on exec flag when opening dri character devices, so they
will be closed and free any resouces allocated in exec.

Signed-off-by: David Fries <David@Fries.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 19:05:50 +00:00
José Fonseca
5ea18503e7 mapi/glapi: Fix glDebugMessageCallbackARB arg type to GLDEBUGPROCARB
Necessary to prevent type mismatches on MinGW.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:30 +00:00
José Fonseca
10d3b6500b glapi/gen: Add support for pointer types.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:29 +00:00
José Fonseca
7221f52389 mesa: Prevent collision of ERROR define on Windows.
This issue might recur on other OSes. If so then it might be better
to remove the C-preprocessor magic, and use fully qualified defines
instead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:50:29 +00:00
José Fonseca
fa476782fd include: Fix glDebugMessageCallbackARB's prototype.
Seems to be a bug in Khronos headers, as

http://www.opengl.org/registry/specs/ARB/debug_output.txt states userParam
is not a const pointer.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-11 16:23:45 +00:00
Marek Olšák
bb1d126b23 mesa: expose ARB_debug_output 2012-03-10 21:42:06 +01:00
Marek Olšák
d7d0d2890a mesa: display list dispatch for ARB_debug_output 2012-03-10 21:42:06 +01:00
Marek Olšák
0e4508e077 mesa: print GL errors via debug_output 2012-03-10 21:42:06 +01:00
nobled
ae4a8a59b7 mesa: implement the last of GL_ARB_debug_output
Store client-defined message IDs in a hash table,
and sort them by severity into three linked lists
so they can be selected by severity level later.
2012-03-10 21:42:06 +01:00
nobled
41308d9699 mesa: add struct for managing client debug namespaces
The final piece of the puzzle for GL_ARB_debug_output.
2012-03-10 21:42:06 +01:00
nobled
f6f3093940 mesa: add control for categories of application-provided messages
This state is needed for deciding whether or not to log
application messages with IDs that haven't been specifically
passed to glDebugMessageControlARB yet.

State for each individual ID number ever passed to
glDebugMessageControlARB (per-context) still needs to be added.
2012-03-10 21:42:06 +01:00
nobled
4667cb2162 mesa: add yet more context fields for GL_ARB_debug_output 2012-03-10 21:42:06 +01:00
nobled
c68f0b8cab mesa: add glDebugMessageControlARB
Controlling the output of client-provided messages
isn't done yet.
2012-03-10 21:42:05 +01:00
nobled
76414cded8 mesa: add message-toggle booleans for GL_ARB_debug_output 2012-03-10 21:42:05 +01:00
nobled
5dd750d685 mesa: add some GL_ARB_debug_output functions 2012-03-10 21:42:05 +01:00
nobled
ed087ee498 mesa: add infrastructure for GL_ARB_debug_output
Marek v2: don't add the extension to extensions.c yet
2012-03-10 21:42:05 +01:00
Marek Olšák
3917503b9a glapi: regenerate files 2012-03-10 21:42:05 +01:00
nobled
a0d6732182 glapi: add ARB_debug_output.xml
Marek v2: replace GLDEBUGPROCARB with void*
2012-03-10 21:42:04 +01:00
nobled
5ab088c7e2 mesa: split error handling into its own file
Also add _mesa_vsnprintf.
2012-03-10 21:42:04 +01:00
Kenneth Graunke
60218b604a drirc: Add force_glsl_extensions_warn workaround for Unigine Heaven.
Unfortunately, Unigine Heaven 3.0 still needs this.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-09 15:21:10 -08:00
José Fonseca
105ef87842 svga: Disable bogus assertions concerning min_index/max_index.
min_index/max_index are merely conservative guesses, so we can't
make buffer overflow detection based on their values.

Tested-by: Jakob Bornecrantz <jakob@vmware.com>
2012-03-09 18:57:17 +00:00
Brian Paul
f5d0ced242 mesa: fix GL_LUMINANCE handling in glGetTexImage
There are several cases in which we need to explicity "rebase" colors
(ex: set G=B=0) when getting GL_LUMINANCE textures:
1. If the luminance texture is actually stored as rgba
2. If getting a luminance texture, but returning rgba
3. If getting an rgba texture, but returning luminance

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=46679

Also fixes the new piglit getteximage-luminance test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-09 08:45:33 -07:00
Brian Paul
9917988223 svga: add null vs pointer check in update_need_pipeline()
Based on a patch submitted by Vic Lee.  The other part of his patch
which checked the fs pointer wasn't needed.

This fixes a crash when clear() is called before any VS or FS is set.
But this can only happen when the driver is used without the Mesa
state tracker.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-09 08:25:18 -07:00
Christoph Bumiller
fb3cb5c2dd nv50: add support for R8G8_R8B8 and G8R8_B8R8 formats 2012-03-09 15:21:01 +01:00
Christoph Bumiller
95df2d0ca7 nv50,nvc0: share the format table code 2012-03-09 15:19:28 +01:00
Christian König
63d53063f7 vl: handle DRI2GetBuffers reply with multiple buffers
This fixes a crash in XBMC, but we still doesn't see a picture.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:45:09 +01:00
Christian König
85dbb22796 vl/mpeg12: make bitstream decoder more robust
Just another xine workaround.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:51 +01:00
Christian König
9a3c2776ac st/vdpau: fix two small memory leaks
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:34 +01:00
Christian König
2e5f3cdca5 st/vdpau: add xine workaround
For reasons I don't understand xine tries to set
the surface format by using a zero pitch.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:20 +01:00
Christian König
7236f170e4 vl/video_buffer: add YUYV and UYVY support
This gets xine working with VDPAU.

v2: some minor bugfixes.
v3: create the resource with the subsampled
    format to avoid tilling problems

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:44:04 +01:00
Christian König
fb016854bc r600g: add support for subsampled rgb formats
v2: r600 formats are msb first!

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:43:49 +01:00
Christian König
461c34c0cb gallivm: add support for R8G8_R8B8 and G8R8_B8R8 formats
Just to keep lp_test_format happy.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:43:27 +01:00
Christian König
4f41f8edb3 gallium: add R8G8_R8B8 and G8R8_B8R8 formats
v2: simplify implementation by using correct swizzle
v3: fix mix with successor patch

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:40:54 +01:00
Christian König
5c8040aee6 u_format: fix a comment about subsampled formats
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-09 12:36:34 +01:00
Brian Paul
5beba3d0ba mesa: use _mesa_rebase_rgba_float/uint() in glGetTexImage code
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:58 -07:00
Brian Paul
ad897fff77 mesa: use _mesa_rebase_rgba_float/uint() in glReadPixels code
See the comments for _mesa_rebase_rgba_float() for details.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=46679

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:53 -07:00
Brian Paul
774c402765 mesa: add _mesa_rebase_rgba_float/uint() functions
These will be used by glReadPixels() and glGetTexImage() to fix issues
with reading GL_LUMINANCE and other formats.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-03-08 20:10:36 -07:00
Eric Anholt
be5f27a84d glsl: Refine the loop instruction counting.
Before, we were only counting top-level instructions.  But if we have
an assignment of a giant expression tree (such as the ones eventually
generated by glsl-fs-unroll), we were counting the same as an
assignment of a variable deref.

glsl-fs-unroll-explosion now fails in a reasonable amount of time on
i965 because the unrolling didn't go ridiculously far.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-08 11:19:12 -08:00
Marek Olšák
7f1cbf12bc r600g: enable ARB_draw_instanced 2012-03-08 12:21:47 +01:00
Christian König
ac1dd440b8 vl/video_buffer: add YUVA and VUYA support
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
d6119ac9fa gallium: remove format aliases
They are incomplete and don't make to much sense.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
d5fc3746fe st/vdpau: cleanup YCBCR matching functions
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Christian König
5d5b414a7b st/vdpau: fix chroma_format handling in VideoSurfaceQueryGetPutBitsYCbCrCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-08 11:37:02 +01:00
Marek Olšák
f6546535c9 r600g: use SX_MISC to implement rasterizer discard
Yeah I am reworking it again. This is way simpler than the other methods.
2012-03-08 11:23:24 +01:00
Marek Olšák
c7eaf274a9 Revert "r600g: fix and improve rasterizer discard for r600-r700"
I will use SX_MISC instead.

This reverts commit 597fd6dc8c.
2012-03-08 11:23:24 +01:00
Marek Olšák
80e4d18f84 Revert "r600g: rework rasterizer discard for evergreen"
I will use SX_MISC instead.

This reverts commit 734792e83f.

Conflicts:

	src/gallium/drivers/r600/evergreen_hw_context.c
	src/gallium/drivers/r600/evergreen_state.c
	src/gallium/drivers/r600/r600_hw_context.c
	src/gallium/drivers/r600/r600_pipe.h
2012-03-08 11:23:24 +01:00
Zack Rusin
831de96db8 svga: fix the rasterizer state resets
draw module calls back into the driver and sets certain parts
of the state to whatever it needs, unfortunately unless you
get the ordering of calls to draw just right you'll end up
reseting your own driver state. That's what was happening to us
draw module would under certain conditions reset our own driver
state.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-07 19:17:27 -05:00
Johannes Obermayr
d249bd9cbd glx: Also put a symlink from libGL.so in lib/ for now.
This fixes the libGLU.so.* build when a system libGL.so is not present
since it is relying on the lib/ to build against until it gets
converted to automake.

Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
2012-03-07 09:37:46 -08:00
Benjamin Franzke
ab6e081914 gbm_dri: Fix DRIimage lookup callback
That is by making the dri extension variables static in gbm_dri.c.

The image_lookup_extension is provided by egl_dri2 when using x11 or wayland
platforms, when using the drm platform, gbm_dri has a wrapper for it.
Both use the same variables name image_lookup_extension.

Since -fvisibility=hidden was (probably by mistake) removed when converting to
automake, the "image_lookup_extension" symbol from egl_dri2.c became exported
in libEGL.so, so "image_lookup_extension" from gbm_dri.c was ignored.
This resulted in calling incorrect callbacks.

We cant make the image_lookup_extension static in egl_dri2.c right now,
since its used across multiple files.

Bugzilla: https://bugs.freedesktop.org/attachment.cgi?id=58099
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-03-07 18:17:56 +01:00
Brian Paul
6c1dea5445 mesa: handle array textures in strip_texture_border()
If the texture is a 1D array, don't remove the border pixel from the
height.  Similarly for 2D array textures and the depth direction.
Simplify the function by assuming the border is always one pixel.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-03-07 08:17:20 -07:00
Brian Paul
4f869e9cb5 docs: add more MinGW prerequisite tips
Provided by Charles Huber on the mesa-users list.
2012-03-07 08:08:36 -07:00
Marek Olšák
d0f8561574 r600g: only emit SX_SURFACE_SYNC on r700 if there's CS checker support
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47039
2012-03-07 13:52:58 +01:00
Yuanhan Liu
43af02ac73 i965: handle gl_PointCoord for Gen4 and Gen5 platforms
This patch add the support of gl_PointCoord gl builtin variable for
platform gen4 and gen5(ILK).

Unlike gen6+, we don't have a hardware support of gl_PointCoord, means
hardware will not calculate the interpolation coefficient for you.
Instead, you should handle it yourself in sf shader stage.

But badly, gl_PointCoord is a FS instead of VS builtin variable, thus
it's not included in c.vue_map generated in VS stage. Thus the current
code doesn't aware of this attribute. And to handle it correctly, we
need add it to c.vue_map manually to let SF shader generate the needed
interpolation coefficient for FS shader. SF stage has it's own copy of
vue_map, thus I think it's safe to do it manually.

Since handling gl_PointCoord for gen4 and gen5 platforms is somehow a
little special, I added a lot of comments and hope I didn't overdo it ;)

v2: add a /* _NEW_BUFFERS */ comment to note the state flag dependency
    and also add the _NEW_BUFFERS dirty mask (Eric).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45975
Piglit: glsl-fs-pointcoord and fbo-gl_pointcoord

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-07 13:30:01 +08:00
Yuanhan Liu
cf2f9ef015 i915: move the FALLBACK_DRAW_OFFSET check outside the drawing rect check
We have to do fallback when the 'Clipped Drawing Rectangle X/Y Max'
exceed the hardware's limit no matter the drawing rectangle offset
changed or not.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46665

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-07 13:20:20 +08:00
nobled
4aa1ac5fe9 dri/nouveau: don't use nested functions
It's a GNU extension that isn't supported by clang right now:
http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Nested-Functions.html
http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc

With this, clang now compiles the nouveau classic driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44061

(Types changed from e.g. 'unsigned char' to 'GLubyte' so that the types can
be concatenated to form a unique function name without any whitespace
interfering.)

[ Francisco Jerez: give meaningful names to the dispatch functions. ]
2012-03-06 21:26:21 +01:00
Vinson Lee
1633dcd890 gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.
llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
MCRegisterInfo argument.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 10:31:12 -08:00
Dave Airlie
ef3e26c2e4 draw/llvm: add clip distance support
This add clipdistance support like the non-llvm draw paths,
if we have a clip distance we compare with it instead of doing
the dot4.

We also have to put the have_clipvertex bit into the emitted
vertex header.

Fixes vs-clip-distance-all-planes-enabled, vs-clip-distance-const-reject,
vs-clip-distance-enables, vs-clip-distance-implicitly-sized,
vs-clip-distance-in-param, vs-clip-distance-uint-index.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:37:33 +00:00
Dave Airlie
9c465a95ac draw/llvm: fix storing of clipvertex and positions into pre_clip_pos (v2)
This fixes the rest of the piglit clipvertex tests.

v2: fixup comments.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:37:02 +00:00
Dave Airlie
cb4bcbcb1d draw/llvm: fix clipvertex setting up clipmask. (v2)
We incorrectly setup clipmask for gl_ClipVertex, this fixes the clipmask
setup.

v2: fix comment

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

fix comment
2012-03-06 09:34:52 +00:00
Dave Airlie
357afb68e4 gallium: add llvm-related TODOs. (v2)
This is just a simple text file containing a list of goals for gallivm/llvmpipe
and some info on what is required to get there along with some info on who
is looking at things.

v2: add EXT_texture_array.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-06 09:23:57 +00:00
Anuj Phogat
a9523af0e8 mesa: Fix valid texture target test in _mesa_GetTexLevelParameteriv()
_mesa_max_texture_levels() is also used to test valid texture target
in _mesa_GetTexLevelParameteriv(). GL_TEXTURE_CUBE_MAP is not allowed
as texture target in glGetTexLevelParameter(). So, this should throw
GL_INVALID_ENUM error.

Few other functions which use _mesa_max_texture_levels() like
getcompressedteximage_error_check() and getteximage_error_check()
also don't accept GL_TEXTURE_CUBE_MAP.

Above fix makes piglit fbo-cubemap test to fail. This is because of
incorrect texture target passed to _mesa_max_texture_levels() in
framebuffer_texture(). Fixing that as well

Note: This is a candidate for the stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-05 19:02:08 -08:00
Jon TURNEY
71f4a960f8 egl: Use -no-undefined libtool flag
"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 require that all symbols are resolved when the
library is linked."

If I had a dollar for every time I wrote this patch, I'd have about
$10 :-)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-05 18:39:29 -08:00
Daniel Vetter
f172eae8b2 i965: fixup W-tile offset computation to take swizzling into account
There's even a comment in the code containing the right swizzling
computations!

Previously this has not been noticed because we need to manually
enabled swizzling on snb/ivb (kernel 3.4 will do that) and we
don't use the separate stencil on ilk (where the bios enables
swizzling). This fixes

piglit ./bin/fbo-stencil  readpixels GL_DEPTH32F_STENCIL8 -auto

on recent drm-intel-next kernels.

Also remove the comment about ivb, it's stale now.

Swizzling detection is done by allocating a temporary x-tiled
buffer object. Unfortunately kernels before v3.2 lie on snb/ivb
because they claim that swizzling is enable, but it isn't. The
kernel commit that fixes this for backport to pre-v3.2 is

commit acc83eb5a1e0ae7dbbf89ca2a1a943ade224bb84
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Sep 12 20:49:16 2011 +0200

    drm/i915: fix swizzling on gen6+

But if the kernel doesn't lie, this now works on swizzling and
not swizzling machines.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-03-05 12:02:47 -08:00
Benjamin Franzke
3ff04ea236 meta: Fix compilation without FEATURE_EXT_transform_feedback
That is when building with --disable-opengl.
Fix for commit cb045880b1.

CC: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-05 20:35:23 +01:00
Benjamin Franzke
84f107d287 meta: Fix compilation without FEATURE_feedback
That is when building with --disable-opengl.
Fix for commit c5f4024a79.

CC: Chad Versace <chad@chad-versace.us>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-03-05 20:35:23 +01:00
Benjamin Franzke
e6aa32ac7f wayland: Use new wl_display_disconnect
This replaces the previously used wl_display_destroy.
wl_display_destroy was povided by wayland-client.so and
wayland-server.so, to resolve that conflict its renamed client-side.
2012-03-05 20:34:42 +01:00
Roland Scheidegger
da5e9fce47 gallivm: fix floating type in lp_build_mod helper
untested, but cannot have worked before.
2012-03-05 19:09:56 +01:00
Christian König
05579339c0 st/vdpau: make the interface thread save
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:32 +01:00
Christian König
1d0c357a97 st/vdpau: implement support for high-precision output timing
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:25 +01:00
Christian König
4f5469f8d6 st/vdpau: implement support for extra mixer layers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-05 16:51:16 +01:00
Marek Olšák
e363dd5c7d r600g: replace atom_ prefix with _state and _cmd suffixes 2012-03-05 16:22:28 +01:00
Marek Olšák
330b6c85c9 r600g: cleanup includes 2012-03-05 15:57:32 +01:00
Marek Olšák
6f50d3d19d winsys/radeon: cleanup includes 2012-03-05 15:31:35 +01:00
Marek Olšák
6ed5855009 r600g: move r600_context_bo_reloc to r600_pipe.h
so that we don't have to include r600_hw_context_priv.h outside of
the *hw_context* files.
2012-03-05 15:31:35 +01:00
Marek Olšák
45d731fdf9 r600g: remove unused function r600_context_reg_bo 2012-03-05 15:31:35 +01:00
Marek Olšák
8a56ed8d6d r600g: remove unused definitions 2012-03-05 15:14:40 +01:00
Marek Olšák
0d91ddf1d4 r600g: don't enable tiling for STAGING and STREAM usage cases
Reviewed by: Christian König <christian.koenig@amd.com>
2012-03-05 14:55:46 +01:00
Marek Olšák
29e55bc5f1 winsys/radeon: add usage parameter to cs_is_buffer_referenced
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
96ef4ddc3d r600g: initialize DB_DEPTH_CONTROL at beginning of CS
Otherwise streamout with rasterizer discard will make the kernel upset
if the state tracker doesn't set a depth-stencil-alpha state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
428146c14f r600g: initialize VS_GS_OUT_PRIM_TYPE
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
6187503f95 r600g: initialize SX_SURFACE_SYNC
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
f71f5edf78 r600g: if pixel shader is NULL, bind a dummy one
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
914b4bb80c r600g: add support for missing colorbuffer formats
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
c60d789b3b r600g: remove support for SCALED colorbuffer formats
Unused by the current stack and APIs, therefore untestable.
It was used to facilitate the transition to integers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:25 +01:00
Marek Olšák
515a64a28c r600g: permit blitting between textures with STREAM and STAGING usage
Eventually I'd like to make every format blittable, so that the function
can go away.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
597fd6dc8c r600g: fix and improve rasterizer discard for r600-r700
For polygons, we have been using face culling with success, but that doesn't
work for points and lines.

Setting the point size and line width to 0 fixes it.

Also improve it even more by setting SCREEN_SCISSOR to a zero area.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
734792e83f r600g: rework rasterizer discard for evergreen
Implement it right using STRMOUT_CONFIG.RAST_STREAM. This fixes rasterizer
discard with points and lines.

This also adds another derived state. It's a combination of rasterizer discard
and streamout enable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
ca78a47b05 r600g: make some scissor regs invariant on r600-r700
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
cd5d02bf51 r600g: make some scissor regs invariant on evergreen
We only need one scissor for the framebuffer.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:20 +01:00
Marek Olšák
aacd653834 r600g: rework scissor for r600-r700
We must use VPORT_SCISSOR, because that's the only one we can use for multiple
scissor rectangles in ARB_viewport_array.

R700 can use the VPORT_SCISSOR_ENABLE bit, but R600 doesn't have that and must
emit a 8192x8192 rectangle if scissor is disabled.

This commit also cleanups magic numbers in create_rs_state.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
2881d456a5 r600g: rework scissor for evergreen
VPORT_SCISSOR is the OpenGL scissor. How do I know? Because there are
16 of them just like GL4.1 has multiple scissor rectangles.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
370c8b5ee7 r600g: remove obsolete todo comments
Also use XXX in the other ones, because it's the most used word for that
purpose in Mesa.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
0018db1126 r600g: correctly handle queries which don't need begin_query
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
09ec30f028 r600g: don't suspend timer queries for u_blitter
Timer queries should be able to measure the time spent in u_blitter as well.

Queries are split into two groups: the timer ones and the others (streamout,
occlusion), because we should only suspend non-timer queries for u_blitter,
and later if the non-timer queries are suspended, the context flush should
only suspend and resume the timer queries.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
eabcecc26b r600g: release query buffers in destroy_query
This fixes a memory leak introduced with the rework.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák
83667acfd9 r600g: move all query code into r600_query.c
And rename or inline functions where appropriate.
There is no reason to keep this stuff in r600_hw_context.c.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:14 +01:00
Marek Olšák
62f44f670b Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"
This reverts commit 0950086376.

It was decided to refactor the transfer API instead of adding workarounds
to address the performance issues.
2012-03-05 13:47:49 +01:00
Yuanhan Liu
058fc6521e i915: fix wrong rendering of gl_PointSize on Pineview
The current code would ignore the point size specified by gl_PointSize
builtin variable in vertex shader on Pineview. This patch servers as
fixing that.

This patch fixes the following issues on Pineview:
webglc: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/rendering/point-size.html
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

v2: pick Eric's nice tip for fixing this issue in hardware rendering.
v3: the last arg of EMIT_ATTR specify the size in _byte_. (Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-03-05 10:42:58 +08:00
Yuanhan Liu
9962280c33 tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled
We may specify the point size in a glsl vertex shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-05 10:39:54 +08:00
Tom Stellard
befcce264c r300/compiler: Add support for inline literals
On R500 chips, shader instructions can take 7-bit (3-bit mantissa, 4-bit
exponent) floating point values as inputs in place of registers.
2012-03-04 19:36:27 -05:00
Christian König
95594bae47 vl: fix shader in/out numbering
Fix all the other wrong numberings.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-03 10:53:07 +01:00
Eric Anholt
31b044506e egl: Also put a symlink from libEGL.so in lib/ for now.
This fixes the egl_gallium.so driver build when no system libEGL.so is
present, since it's relying on the lib/ to build against until it gets
converted to automake.
2012-03-02 18:42:25 -08:00
Kurt Roeckx
489ac8e73a i915: Fix i830 polygon stipple from PBOs.
This is a direct port of the i915 patch in
a856da6324.

Fixes glean's pbo test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:32:15 -08:00
Kurt Roeckx
024ece7523 i915: Compute maximum number of verts using the actual batchbuffer size.
We were looking at the size of batch.map for how big the batchbuffer
was, but on 865 we just use a single-page batchbuffer due to hardware
limits.

v2: Removed check for sizeof map < bo->size, since that's always false.
    [change by anholt]
NOTE: This is a candidate for release branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
2012-03-02 17:16:13 -08:00
Chris Wilson
33b07893e9 i830: Compute initial number of vertices from remaining batch space
In order to prevent an overflow of the batch buffer when emitting
triangles, we need to limit the initial primitive to fit within the
current batch. To do we need to measure the remaining space and thence
compute the maximum number of vertices that fit into that space.

Reported-by: Kurt Roeckx <kurt@roeckx.be>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:12 -08:00
Alban Browaeys
7d13a6e64b dri/i915: Fix off-by-one in i830 clip region size.
The hardware, like i915, uses an inclusive bounds on min and max for
the drawing rectangle, but we were providing a number for exclusive.
The number of bits used by the hardware only covers this value going
up to the maximum size, so when we programmed 2048 as the maximum
inclusive X, it saw a maximum X of 0 and clipped all rendering.  This
caused rendering failures in gnome-shell.

Fixes piglit fbo-maxsize.

v2: dropped changes to the blitter, which does use an exclusive x2, y2.
    [change by anholt]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45558
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:12 -08:00
Eric Anholt
ae92180d72 intel: Don't enable GL_ARB_draw_instanced pre-gen4.
swtnl doesn't handle this extension.
2012-03-02 17:16:11 -08:00
Eric Anholt
4d4f2daefa i915: Fix piglit fbo-nodepth-test on i830.
This is a direct port of fc4fba52cf from
i915, and fixes GPU hangs when running piglit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
2012-03-02 17:16:11 -08:00
Christian König
a9073e3486 vl/compositor: fix shader in/out numbering
Michel pointed out that my assumption of a global
index namespace is incorrect and breaks r300g.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 16:07:18 +01:00
Christian König
54faecf607 st/vdpau: implement OutputSurfaceQueryPutBitsYCbCrCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:20 +01:00
Christian König
d14c879d82 st/vdpau: implement OutputSurfacePutBitsYCbCr
v2: the csc_matrix is optional

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:20 +01:00
Christian König
8d0808214a st/vdpau: implement VideoSurfaceGetBitsYCbCr
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:12 +01:00
Christian König
222600972c st/vdpau: implement OutputSurfaceQueryGetPutBitsNativeCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:38:06 +01:00
Christian König
507fd8026a st/vdpau: implement OutputSurfaceGetBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:37:59 +01:00
Christian König
494e0025d9 st/vdpau: implement OutputSurfacePutBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
a0571b135e st/vdpau: implement OutputSurfaceQueryPutBitsIndexedCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
379f46c8ac st/vdpau: fix default swizzle for Output/Bitmap samplers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
503cfbc7ba st/vdpau: add support for per vertex colors
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
bf19596870 st/vdpau: implement BitmapSurfaceQueryCapabilities
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
abf31e3822 st/vdpau: implement OutputSurfaceRenderBitmapSurface
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
2ec6af0c63 st/vdpau: implement BitmapSurfaceGetParameters
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:22 +01:00
Christian König
e44731265d st/vdpau: implement BitmapSurfacePutBitsNative
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
3aa087fa04 st/vdpau: implement BitmapSurfaceCreate/Destroy
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
f8ac7e0348 st/vdpau: avoid an unnessasary copy
Delay the actual mixer rendering until we really
know which surface is the real destination.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
14766f8200 vl/csc: simplify matrix handling
A csc matrix is only 4x3 not 4x4, also define a VDPAU compatible type for it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
74a4e90894 vl/compositor: add support for per layer dst areas
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
b90727bb24 vl/compositor: add per vertex color suport
Used in subtitles, for example.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
d645dc65b6 vl/compositor: replace pipe_video_rect with u_rect
So we support things like flipping also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:21 +01:00
Christian König
32c4381d4a vl/compositor: split shaders and state
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-02 13:14:20 +01:00
Vinson Lee
834f515988 Revert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."
This reverts commit d5a6c17254.

llvm-3.1svn r151687 makes MemoryObject accessor members const again.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-03-01 10:36:06 -08:00
Brian Paul
0605c6d861 Revert "st/mesa: don't unreference user attribs up front."
This reverts commit 72931ca4b9.

This commit caused a few piglit regressions (quad-invariance, draw-batch,
etc) with the vmware svga driver.
2012-03-01 08:55:24 -07:00
Christian König
c14c84f383 vl: move dirty area handling into winsys abstraction
Fixing uninitialized areas in SwapBuffers mode.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:55 +01:00
Christian König
91ac681113 vl: hide X latency by using asynchronous requests
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:51 +01:00
Christian König
66480c0f56 vl: use SwapBuffers instead of CopyBuffers
This should speed things up a bit, but also shows
some bugs with the kernel implementation.

v2: require xcb-dri2 version 1.8

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:46 +01:00
Christian König
f56784f9d0 st/xvmc: remove dst buffer texture workaround
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 15:06:39 +01:00
Christian König
80b40a4841 vl: rewrite vl DRI backend using XCB
v2: also set array_size of texture

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-03-01 14:37:44 +01:00
José Fonseca
6b024464e8 egl: Don't include strings.h on Windows.
strings.h is needed for the declaration of strcasecmp(), but only on
non-Windows platforms.
2012-03-01 06:37:30 +00:00
Yuanhan Liu
ffee498fb8 mesa: let GL3 buf obj queries not depend on opengl major version
While the ARB_map_buffer_range extension spec says nothing about these
queries -- they were added in GL 3.0 --, it seems like this could be an
error in the extension spec.  This is one of the extensions, like
ARB_framebuffer_object, that "back ports" OpenGL 3.0 functionality to
previous versions.  These extensions are supposed to provide identical
functionality to OpenGL 3.0.  The other cases of mismatches have been
determined to be bugs in the extension specs.

And tools like apitrace rely on such queries to function properly.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2012-03-01 06:17:48 +00:00
José Fonseca
8c34a41278 gallivm: Update comments and prototype of vector-selects.
No runtime behavior change. As vector selects are still not very well
supported by LLVM.
2012-03-01 06:00:48 +00:00
Brian Paul
b5653880f6 docs: remove mention of components no longer in main Mesa tree 2012-02-29 20:54:33 -07:00
Brian Paul
3b744cb61a st/mesa: remove old assertion 2012-02-29 20:53:47 -07:00
Brian Paul
dab5f98404 r300g: init chan=0 to silence warning 2012-02-29 20:53:46 -07:00
Kenneth Graunke
c59bdee12e i965: Disable PrimitiveID upload.
We currently don't support gl_PrimitiveID, and I believe asking the
hardware to generate it results in vertex cache invalidations.

This could result in slowdowns for applications that use gl_InstanceID,
which would be counter-productive.  Just turn it off for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Kenneth Graunke
e9bcdc2c37 i965: Enable the GL_ARB_draw_instanced extension.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Kenneth Graunke
e568b00562 i965: Fix swizzles for system values such as gl_InstanceID.
visit(ir_variable *) sets dst_reg::writemask to the appropriate channel
for system values.  Unfortunately, visit(ir_dereference_variable *) then
calls swizzle_for_size, which for a float, sets the swizzle to .x.

This works for gl_VertexID, since we store it in the .x component (see
brw_draw_upload.c:732 - VID), but fails for gl_InstanceID (IID) since we
store it in the .y channel.

To fix this, avoid calling swizzle_for_size on ir_var_system_values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-29 14:57:26 -08:00
Ian Romanick
1e6a2c1059 glsl: Make gl_InstanceID available with GL_ARB_draw_instanced extension
Originally ARB_draw_instanced only specified that ARB decorated name.
Since no vendor actually implemented that behavior and some apps use
the undecorated name, the extension now specifies that both names are
available.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-02-29 14:57:15 -08:00
Eric Anholt
767ba60831 mesa: Add missing error check for first < 0 in glDrawArraysInstanced().
Fixes piglit GL_ARB_draw_instanced/negative-arrays-first-negative.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
871518dbf8 mesa: Fix display lists for draw_elements_base_vertex with draw_instanced.
Fixes piglit GL_ARB_draw_elements_base_vertex/dlist-arb_draw_instanced

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
3c69a18b6a mesa: Fix display list handling for GL_ARB_draw_instanced.
When you called them in a display list compile before, you would just
end up calling through NULL.

Fixes piglit GL_ARB_draw_instanced/dlist.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:12 -08:00
Eric Anholt
d534b68404 mesa: Fix typo in comment.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 13:21:11 -08:00
Kenneth Graunke
b2ace06cbb i965: Fix Gen6+ dynamic state upper bound on older kernels.
Kernels prior to 271d81b84171d84723357ae6d172ec16b0d8139c (March 2011)
don't support relocations outside of the target buffer object.  Rather
than guarding this with a I915_PARAM_HAS_RELAXED_DELTA check, just
smash the bound to 0xfffff001 like we do on Ironlake.

This effectively gives us no upper bound check, just like we did prior
to commit 271d81b84171d84723357ae6d172ec16b0d8139c.

Daniel Vetter would also like to mention that this relies on the guard
page at the end of the GTT.

NOTE: This is a candidate for release branches.
Fixes a regression since 271d81b84171d84723357ae6d172ec16b0d8139c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46766
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-02-29 12:59:54 -08:00
Eric Anholt
e5f895485e egl/drivers: Convert to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:41 -08:00
Eric Anholt
88612029f6 egl/main: Convert to automake.
The drivers/ walk-through-subdirs makefile is converted as well so I
didn't need to keep EGL_DRIVERS_DIRS along with the per-driver
HAVE_EGL_DRIVER_WHATEVER.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
28d92eff73 egl: Clean up some flow of EGL platform handling.
The default case code was set up in a separate way, while this makes
it more normal.  I wanted to add code to the explicit x11 platform and
default x11 platform cases in the next commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
d019cf9124 egl: Drop the non-builtin-drivers support.
The two drivers both did builtin mode, so drop the non-builtin build
system.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
9f0f00c319 egl: Drop _EGL_MAIN entrypoint obfuscation.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Eric Anholt
8ffb098234 glx: Convert to automake.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-29 11:52:40 -08:00
Mathias Fröhlich
ba1d921bdf mesa: Push the shine table into the tnl module.
All users of the shine table outside of the tnl module
are gone. Move the implementation into the tnl module and
prefix the public functions with _tnl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:28 +01:00
Mathias Fröhlich
8e5bc6dd1d mesa: Do not invalidate shine tables in compute light positions.
Since the shine tables are now only used in the tnl lighting stage, where
they are validated through the tnl driver function NotifyMaterialChange
called in tnl/t_vb_light.c, we can not omit calling
_mesa_validate_all_lighting_tables (which only validates the shine tables)
in main/light.c.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:24 +01:00
Mathias Fröhlich
7793a63d3d mesa: Avoid revalidating shine tables in _tnl_RasterPos.
Now that _tnl_RasterPos no longer uses the shine tables, avoid
revalidating them.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:20 +01:00
Mathias Fröhlich
a1b1f8ff86 mesa: Avoid using the shine table for _tnl_RasterPos
Use direct computation of pow for computing the shininess
in _tnl_RasterPos. Since the _tnl_RasterPos function is still
used by plenty drivers that do only need the shine table for
_tnl_RasterPos but do not make use of swtnl computations, this
enables pushing down the shine table computation and validation
into the tnl module, which will happen in a followup change.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:16 +01:00
Mathias Fröhlich
703ada1e45 mesa: Avoid explicit invalidation of shine tables.
Since the shine tables are implicitly invalidated by having
a different shininess value than the current one, we can
omit the explicit invalidation of the shine table.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:37:07 +01:00
Mathias Fröhlich
619baeae3c mesa: Remove gl_light_attrib::_Flags.
This variable is only used locally in _mesa_update_lighting.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:36:44 +01:00
Mathias Fröhlich
6b48d7e83d mesa: Remove _CosCutoffNeg from light state.
It is only used as a temporary variable during computation of
_CosCutoff. So, don't store it.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2012-02-29 20:35:37 +01:00
Brian Paul
7f9692b97d util: replace format equality test with compatibility test in blit code
This lets us use the resource_copy_region() path when blitting from
R8G8B8A8 to R8G8B8x8, for example.

v2: be smarter when src_format==dst_format

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:40:37 -07:00
Brian Paul
ce671c7ace util: better comment for util_is_format_compatible() 2012-02-29 08:40:37 -07:00
Brian Paul
9b9c7da966 mesa: use arrayObj var in more places in client_state() 2012-02-29 08:39:20 -07:00
Brian Paul
6eba268ec6 mesa: asst. fixes for texture arrays and borders
For 1D array textures, there is no border on the height dimension.
For 2D array textures, there is no border on the depth dimension.
2012-02-29 08:39:20 -07:00
Brian Paul
738482eec9 mesa: check for no state change in VertexAttribDivisor()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:39:20 -07:00
Brian Paul
9e68a8fa72 util: fix assertions in u_blitter.c code
Assertions of the form assert(a && b) should be written as separate assertions
so that you can actually tell which part is false when there's a failure.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2012-02-29 08:39:20 -07:00
Brian Paul
84870e2156 mesa: reorder things in mtypes.h
Move structs, enums, etc so they're in more logical order.  In particular,
the shader and transform feedback-related structs/enums were pretty
scattered around.
2012-02-29 08:39:20 -07:00
Brian Paul
83fed5e130 svga: fix max_lod clamping in update_tss_binding()
After biasing we need to clamp to be sure we don't exceed the number of
levels in the mipmap.  This fixes an assertion at svga_sampler_view.c:70

v2: simplify the biasing, clamping code per Jose's suggestion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-29 08:34:37 -07:00
Christian König
fce888a706 st/vdpau: fix use of *.o in Makefile.vdpau
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-29 00:02:30 +01:00
Christian König
acbc3c9678 st/xvmc: fix use of *.o in Makefile.xvmc
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-29 00:02:07 +01:00
Eric Anholt
0da5086443 i965: Avoid blocking on the GPU for setting the HiZ op vertex data.
We need to allocate new space every time to avoid blocking on the last
HiZ op completing.  There are two easy ways to do this:
brw_state_batch() and intel_upload_data().  brw_state_batch() is
simpler and avoids another buffer allocation.

Improves Unigine Tropics performance 0.376416% +/- 0.148722% (n=7).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-28 14:08:56 -08:00
Kenneth Graunke
b823b99ec0 glcpp: Don't strlen() the output for every token being printed.
The ralloc string appending functions were originally intended for
simple, non-hot-path uses like printing to an info log.

Cuts Unigine Tropics load time by around 20% (6 seconds).

v2: Avoid strlen() on every newline, too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
2012-02-28 13:07:12 -08:00
Kenneth Graunke
8292b7419d ralloc: Make rewrite_tail increase "start" by the new text's length.
Both callers of rewrite_tail immediately compute the new total string
length by adding the (known) length of the existing string plus the
length of the newly appended text.  Unfortunately, callers generally
won't know the length of the new text, as it's printf-formatted.

Since ralloc already computes this length, it makes sense to add it in
and save the caller the effort.  This simplifies both existing callers,
but more importantly, will allow for cheap-appending in the next commit.

v2: The link_uniforms code needs both the old and new length.
    Apply the obvious fix (which sadly makes it less of a cleanup).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
2012-02-28 13:07:12 -08:00
Dave Airlie
579ccae73d gallivm: add major integer opcodes to the tgsi action handler
This adds support for all the opcodes needed for native integer
support with GLSL 1.20 enabled, and some of the ones for GLSL1.30
support.

I've split them between non-cpu and cpu along the same lines
Tom's code did for the other ones I think, but I'm open to review
on which ones should go where.

With instance ids fixed I get no regressions on my box here
with LLVM 2.8, will test with later LLVMs as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:56:18 +00:00
Dave Airlie
e2a2b33544 gallivm: drop deprecated opcodes
These are integer opcodes not deprecated ones.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:53:16 +00:00
Dave Airlie
2a76609681 gallivm: only do rcp/mul for floating
rcp asserts on type.floating so don't go passing non-floating
things into it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 15:52:36 +00:00
José Fonseca
9773370eda svga: Advertise SVGA3D_DEVCAP_MAX_POINT_SIZE.
Backends usually advertise a SVGA3D_DEVCAP_MAX_POINT_SIZE between 63 and
256, so an hardcoded max point size of 80 is often incorrect.

This limitation does not apply for anti-aliased points (as they are done
via draw module) but we still advertise the same limit for both, because
all others pipe drivers do.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-28 15:38:53 +00:00
Neil Roberts
d9c4209777 mesa: Don't disable fast path for normalized types
Mesa has a fast path for the generic fallback when using glReadPixels
for RGBA data which uses memcpy.  However it was really difficult to
hit this case because it would not be used if any transferOps are
enabled.  Any type apart from floating point or non-normalized integer
types (so any of the common types) would force enabling clamping so
the fast path could not be used.  This patch makes it ignore clamping
when determining whether to use the fast path if the data type of the
buffer is an unsigned normalized type because in that case clamping
will not have any effect anyway.

https://bugs.freedesktop.org/show_bug.cgi?id=46631

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-28 07:56:21 -07:00
Brian Paul
c51264c379 gallium: remove trailing comma to silence warning 2012-02-28 07:56:21 -07:00
Brian Paul
1535794722 mesa: minor comment, whitespace fixes in teximage.c 2012-02-28 07:55:10 -07:00
Dave Airlie
a46548e0ef gallivm: add frem support to the lp_build_mod helper.
for completeness.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:43:14 +00:00
Dave Airlie
aec11e4daa gallivm: add bitarit xor and not ops.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:42:17 +00:00
Dave Airlie
72931ca4b9 st/mesa: don't unreference user attribs up front.
postpone unreferences until end of function, as the ones in use will
get naturally dereferenced.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:33:06 +00:00
Dave Airlie
fd4a3d463c mesa/vbo: inline vbo_sizeof_ib_type.
Can't see any reason this wouldn't be better off as an inline.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:32:26 +00:00
Dave Airlie
4ffc8b9ae4 gallivm: add integer and unsigned mod arit functions. (v2)
use a single entry point, as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-28 10:31:49 +00:00
Brian Paul
c3e3df9b18 tgsi: remove trailing comma to silence warning 2012-02-27 20:28:37 -07:00
Brian Paul
2aeadabc7e xlib: silence unused var warning 2012-02-27 20:28:37 -07:00
José Fonseca
67e501ad29 svga: Remove unused SVGA_TEX_UNITS constant. 2012-02-27 19:24:43 +00:00
José Fonseca
e567b34f0d svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.
Some backends may advertise more temps than SVGA3D_TEMPREG_MAX, but the
driver is hardwired to only support up to the value defined by
SVGA3D_TEMPREG_MAX, so clamp to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-27 19:24:42 +00:00
Marek Olšák
bf4fedcef3 r600g: use u_default_transfer_flush_region for all resource types 2012-02-27 16:22:40 +01:00
Marek Olšák
ab13288821 r600g: use u_default_transfer_inline_write for all resource types 2012-02-27 16:22:34 +01:00
Marek Olšák
335facb502 gallium/util: add fast path for buffers in u_default_transfer_inline_write
v2: fix indentation, add assertions
2012-02-27 16:22:26 +01:00
Marek Olšák
615baedc77 gallium/util: set correct usage flags in u_default_transfer_inline_write
The DISCARD flags should improve performance in drivers which handle them.
2012-02-27 16:22:13 +01:00
Marek Olšák
4c02baade9 r600g: fix streamout cache flush for r600
Figured out by trial and error.
2012-02-27 16:21:45 +01:00
Christian König
15e60d9976 vl: fix a douple free in xsp winsys backend
There are a couple of more bugs, but it is only
useful for debugging anyway.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-27 12:57:24 +01:00
Christian König
20be286709 vl: adjust matrix and median filter to removal of PIPE_SHADER_CAP_OUTPUT_READ
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-27 12:53:49 +01:00
Marek Olšák
897af1d499 r600g: cleanup r600_transfer_struct
Especially rename staging_texture to staging and change its type
to r600_resource. I will reuse it for buffers later.
2012-02-27 02:03:24 +01:00
Marek Olšák
622b65d33b r600g: check for R600_STREAMOUT env var in winsys 2012-02-27 02:03:24 +01:00
Marek Olšák
b85fc0ac7e r600g: move initialization of use_surface flag into screen_create
Also change the type to bool and give it a less ambiguous name.
2012-02-27 02:03:23 +01:00
Marek Olšák
81c0484862 r600g: properly check whether texture is busy in get_transfer 2012-02-27 02:03:23 +01:00
Marek Olšák
d334d591a7 r600g: rename r600_resource_texture::depth to bool is_depth
It's used as a boolean.
2012-02-27 02:03:23 +01:00
Marek Olšák
04e3240087 gallium: remove PIPE_SHADER_CAP_OUTPUT_READ
r600g is the only driver which has made use of it. The reason the CAP was
added was to fix some piglit tests when the GLSL pass lower_output_reads
didn't exist.

However, not removing output reads breaks the fallback for glClampColorARB,
which assumes outputs are not readable. The fix would be non-trivial
and my personal preference is to remove the CAP, considering that reading
outputs is uncommon and that we can now use lower_output_reads to fix
the issue that the CAP was supposed to workaround in the first place.
2012-02-27 02:03:23 +01:00
Marek Olšák
74d303521e gallium/rtasm: properly detect SSE and SSE2
This should fix crashes on ancient processors.
2012-02-27 02:03:23 +01:00
Tom Stellard
e6fa2d89e1 r300g: Use automake to generate Makefile v3
v2:
  - s/$(top_builddir)/$(top_srcdir)/
  - Always generate Makefile.in

v3:
  - Fixes from Matt Turner
  - Use Mesa CFLAGS
2012-02-26 15:13:47 -05:00
Tom Stellard
edf3307977 r300g: Reorganize the compiler unit tests 2012-02-26 15:13:47 -05:00
Tom Stellard
7acbbc0704 r300/compiler: Schedule KIL instructions before output writes 2012-02-26 15:13:46 -05:00
Tom Stellard
134a0a5ff8 r300/compiler: Use the smart scheduler for r300 cards 2012-02-26 15:13:40 -05:00
Tom Stellard
342cac7166 r300/compiler: Fix bug when lowering KILP on r300 cards
KILP instruction inside IF blocks were being lowered to an unconditional
KIL.  Since r300 doesn't support branching, when the IF's were lowered
to conditional moves, the KIL would always be executed.  This is not a
problem with the mesa state tracker, because the GLSL compiler handles
lowering IF's, but this bug was appearing in the VDPAU state tracker,
which does not use the GLSL compiler.

Note: This is a candidate for the stable branches.
2012-02-26 09:18:41 -05:00
Christian König
2a97a00e28 vl/compositor: fix a simple typo
Otherwise the dirty area tracking won't work correctly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:58 +01:00
Christian König
dcf8ee7d6a st/xvmc: move xvmc state tracker out of xorg subdir
The xvmc state tracker is completely seperate and
doesn't shares code or anything else with the
xorg state tracker.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:26 +01:00
Christian König
1448e829e8 vl: rework winsys interface
Throw out all the old and now unneeded stuff.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:14 +01:00
Christian König
b34c35a524 vl: cleanup dri winsys abstraction
There was way to much dead code in it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:00 +01:00
Vinson Lee
c5e6460022 scons: Don't build the assembly sources on Mac OS X.
This patch allows the Mac OS X SCons build to complete. The assembly
sources contain psuedo-ops that not are supported on Mac OS X.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-25 00:25:43 -08:00
Stéphane Marchesin
6512bc4e67 i915g: Fix fallout from 8e4540ec2a
Fixes piglit regressions from that change.
2012-02-24 15:17:27 -08:00
Zack Rusin
5d9bfc4d3f svga: Fix stencil op mapping
We were inverting the meaning of the stencil op flags: in svga/d3d
the normal incr/decr wraps and the SAT ops clamp.
This fixes piglit failures (at least stencil-twoside and stencil-wrap).
We should backport this everywhere we can.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-24 14:55:56 -05:00
Brian Paul
e0095548c0 svga: fix use of SVGA3D_x vs. PIPE_FORMAT_x in svga_is_format_supported()
Two of the switch cases used PIPE_FORMAT_ tokens instead of SVGA3D_ tokens.
As it happens, the token values are equal for these formats so there's no
net change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-02-24 10:15:37 -07:00
Brian Paul
590321c39d mesa/gdi: include swrast.h to fix compilation 2012-02-24 09:27:35 -07:00
Brian Paul
d7d4a1955b st/mesa: initialize the MaxViewport, MaxRenderbufferSize constants
Use the max 2D/rect texture size as the limit.  If that's not true
for some devices we'll need new PIPE_CAP_ queries.
2012-02-24 08:03:15 -07:00
Brian Paul
2b0aa3fb21 mesa: move more swrast-related #defines out of core Mesa 2012-02-24 08:03:15 -07:00
Brian Paul
7ad880f49f mesa: remove STENCIL_BITS use 2012-02-24 08:03:14 -07:00
Brian Paul
074637bf99 xlib: remove STENCIL_BITS 2012-02-24 08:03:13 -07:00
Brian Paul
5f60a00743 st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS
Remove some Mesa/swrast stuff.
2012-02-24 08:03:13 -07:00
Brian Paul
630ab0d27b mesa: remove last of MAX_WIDTH, MAX_HEIGHT
Define new MAX_VIEWPORT_WIDTH/HEIGHT and MAX_RENDERBUFFER_SIZE values
instead.
2012-02-24 08:03:12 -07:00
Brian Paul
70d3363757 mesa: remove MAX_WIDTH from prog_execute.h
define a PROG_MAX_WIDTH var instead.  It has to match MAX_WIDTH in
swrast.  More elaborate refactoring could fix that (someday).
2012-02-24 08:03:12 -07:00
Brian Paul
0a543eb5c4 st/glx: remove MAX_WIDTH/HEIGHT usage 2012-02-24 08:03:11 -07:00
Brian Paul
3ff527fb68 intel: remove MAX_WIDTH usage in intelInitContext() 2012-02-24 08:03:11 -07:00
Brian Paul
cb49def3d6 swrast: check max renderbuffer size against SWRAST_MAX_WIDTH 2012-02-24 08:03:10 -07:00
Brian Paul
a3b2c3a421 osmesa: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:10 -07:00
Brian Paul
df22829b9c dri/swrast: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:09 -07:00
Brian Paul
3f8a61ffa2 xlib: use SWRAST_MAX_WIDTH/HEIGHT 2012-02-24 08:03:08 -07:00
Brian Paul
47d88ef204 swrast: define, use SWRAST_MAX_WIDTH/HEIGHT
We'll get rid of MAX_WIDTH, MAX_HEIGHT soon.
2012-02-24 08:03:08 -07:00
Brian Paul
b5d096ac1a mesa: remove some cruft from config.h 2012-02-24 08:03:07 -07:00
Brian Paul
cfecffeedc mesa: minor comment clean-ups in config.h 2012-02-24 08:03:07 -07:00
Brian Paul
99d22c4e38 mesa: remove WIN32 MAX_WIDTH work-around in config.h
There aren't any more stack-allocated arrays dimensioned by MAX_WIDTH
so there shouldn't be any more stack overflows.
2012-02-24 08:03:06 -07:00
Brian Paul
ed65c5ccc3 swrast: remove MAX_WIDTH array in s_span.c 2012-02-24 08:03:06 -07:00
Brian Paul
30ea34a8d9 swrast: simplify mask array code 2012-02-24 08:03:05 -07:00
Brian Paul
fb1650b202 swrast: stop using MAX_WIDTH arrays in triangle code 2012-02-24 08:03:05 -07:00
Brian Paul
32bf36106e swrast: remove MAX_WIDTH arrays in stencil code
Use some per-context temporary arrays instead.
2012-02-24 08:03:04 -07:00
Brian Paul
401810b658 swrast: remove MAX_WIDTH arrays in s_drawpix.c 2012-02-24 08:03:04 -07:00
Brian Paul
0c70d2c5bb swrast: remove MAX_WIDTH arrays in s_zoom.c 2012-02-24 08:03:03 -07:00
Brian Paul
237b2fca7a swrast: remove MAX_WIDTH arrays in s_depth.c 2012-02-24 08:03:03 -07:00
Brian Paul
837b55517e swrast: remove MAX_WIDTH arrays in s_copypix.c 2012-02-24 08:03:02 -07:00
Brian Paul
08687c7912 mesa: move/fix MAX_WIDTH/HEIGHT-related assertions
Max texture and viewport size is only limited by MAX_WIDTH/HEIGHT for swrast.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 08:02:54 -07:00
Brian Paul
3e88e43224 st/mesa: stop using MAX_WIDTH in st_cb_texture.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:59 -07:00
Brian Paul
62c69c340e st/mesa: stop using MAX_WIDTH in st_cb_drawpixels.c
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:58 -07:00
Brian Paul
531eaca41b mesa: stop using MAX_WIDTH in glReadPixels code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:58 -07:00
Brian Paul
2e09fe4b9c mesa: stop using MAX_WIDTH in texstore code
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-24 07:59:57 -07:00
Marek Olšák
a0a9e56cfe u_blitter: decrease minimum buffer range alignment to 4 for copy_buffer 2012-02-24 02:28:59 +01:00
Marek Olšák
59fbd8c6be u_blitter: check for invalid values in copy_buffer 2012-02-24 02:28:54 +01:00
Marek Olšák
df00dc3c81 r600g: rework queries
We always mapped the query buffer in begin_query, causing stalls
if the buffer was busy.

This commit reworks it such that the query buffer is only mapped
in get_query_result as it's supposed to be.

The query buffer is no longer treated as a ring buffer. Instead, the results
are just appended and when the buffer is full, we create a new one. One query
can have more than one query buffer, though that's a very rare case.
Begin_query releases all query buffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
5b84a8c3c3 r600g: cleanup magic numbers in set_xx_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
89293287b8 r600g: remove duplicated evergreen_context_ps_partial_flush
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
84db8f9a22 r600g: remove duplicated evergreen_context_pipe_state_set_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
edc0ce292b r600g: remove duplicated set_xx_resource functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
985bd5487e r600g: remove duplicated function r600_state_sampler_init
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
cf59ed3f23 r600g: fixup name of evergreen-specific function
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák
04d2828b03 r600g: simplify fail paths in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
99d5c1a13b gallium/u_slab: fix possible crash in util_slab_destroy
It may happen if util_slab_create has not been called.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
6a94c9dde0 r600g: fix possible crashes in destroy_context when failing in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
9670e72f6e r600g: consolidate common context init code
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák
f841b8a833 r600g: define GROUP_FORCE_NEW_BLOCK in common header
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Jakob Bornecrantz
bed7b4aa5f st/dri: Fix crash in st/dri from dri format commit
Introduced with 8de5c355fa, it would probably just crash.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jesse Barnes <jbarnes@virtousgeek.org>
2012-02-23 19:16:58 +01:00
Paul Berry
bc39de8c0b glapi: Fix incorrect enum value.
From http://www.opengl.org/registry/specs/ARB/seamless_cube_map.txt:

    Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
    and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
    and GetDoublev:

    TEXTURE_CUBE_MAP_SEAMLESS                   0x884F

This caused a change in enums.c, which is manually built from the .xml
files.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-23 09:35:44 -08:00
Brian Paul
4a72d859b4 util: add mutex lock in u_debug_memory.c code
The linked list of memory allocations was not protected by a mutex.
This lead to sporadic failures with multi-threaded apps.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:10 -07:00
Brian Paul
810584270d svga: no-op sampler view referencing if no change
Just to be safe with ref counting and avoid atomic operations.
2012-02-23 07:49:09 -07:00
Brian Paul
0fffaa512c svga: use pipe_sampler_view_release() to avoid segfault
This fixes another case of faulting when freeing a pipe_sampler_view
that belongs to a previously destroyed context.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:09 -07:00
Brian Paul
be05388ce9 st/wgl: check for hPbuffer=0 in wgl pbuffer functions
Per the GL_WGL_pbuffer spec, generate ERROR_INVALID_HANDLE and
return FALSE (and don't segfault).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:08 -07:00
José Fonseca
9ffc8ea8f4 st/wgl: Fix argument of stw_pixelformat_get_info().
stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.
2012-02-23 07:49:08 -07:00
Brian Paul
6835103878 st/mesa: use pipe_sampler_view_release()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:08 -07:00
Brian Paul
4fdf42883f gallium: added pipe_sampler_view_release() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
c68334ffc0 st/mesa: add floating point formats in st_new_renderbuffer_fb()
To allow creating floating point buffers / pbuffers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
09d0fa5be8 svga: re-enable deleted surface caching
Basically, instead of immediately freeing deleted surfaces, hang onto
them in a cache to do quick re-allocation.  This helps when surfaces
are frequently destroyed and then reallocated a bit later.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul
500e7c5860 svga: implement surface cache size limit
There was a SVGA_HOST_SURFACE_CACHE_BYTES symbol, but it was never
used.

Now when we go to add a newly deleted surface to the cache we check
if the cache size would be exceeded.  If so, try to free the least
recently "unused" surfaces until the cache is smaller.  If we can't
do that, simply don't cache the newly deleted surface.  The alternative
involves flushing and waiting and we don't want to do that.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
32f669e7fc svga: add svga_format_size() function
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
8a9cad6384 svga: use dummy shaders when translation fails
Before, if shader translation failed for any reason we'd keep trying
to translate the shader over and over again during state validation.
The dummy fragment shader emits solid red so that might be visual
clue that translation is failing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
4516fcc57f svga: move temp register index assertions
The assertion recently added in dst_register() was invalid because that
function is also (suprisingly) used to declare constant registers.

Move the assertion to the callers where we're really creating temp
registers and add some code to prevent emitting invalid temp register
indexes for release builds.

Also, update the comment for get_temp().  It didn't return -1 if it
ran out of registers and none of the callers checked for that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul
f12f67c00a svga: check that we don't exceed temp register limit
And assert on the register index in dst_register().  The dest can
only be an output or temp reg and there's more of the later.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:05 -07:00
José Fonseca
a1482b21cb scons: Update windows llvm libraries for version 3.0. 2012-02-23 12:29:29 +00:00
Alex Corscadden
1702d8bdd8 Add a test for the compare opcode.
This is a test for the compare opcode (CMP).  This should draw a green triangle
in the fs-test.
2012-02-23 12:29:29 +00:00
Satyajit Sarangi
132daa87fb r600g: Fix build when libdrm is installed to non-standard dir.
Signed-off-by: Satyajit Sarangi<kernel.saty@gmail.com>
Signed-off-by: Tom Stellard <tstellar@gmail.com>
2012-02-22 20:39:01 -05:00
Paul Berry
80513ec8b4 i915: Initialize swrast_texture_image structure fields.
Commit 980f6f1 (mesa: move gl_texture_image::Width/Height/DepthScale
fields to swrast) moved the initialization of the Width, Height, and
DepthScale fields to _swrast_alloc_texture_image_buffer().  However,
i915 doesn't call this function because it performs its own buffer
allocation.  As a result, the Width, Height, and DepthScale fields
weren't getting initialized properly, and some operations requiring
swrast would fail.

This patch ensures that Width, Height, and DepthScale are properly
initialized by separating the code that sets them into a new function,
_swrast_init_texture_image(), which is called by
intel_alloc_texture_image_buffer() as well as
_swrast_alloc_texture_image_buffer().  It also moves the
initialization of _IsPowerOfTwo into this function.

Fixes piglit test fbo/fbo-cubemap on i915.

Partially fixes https://bugs.freedesktop.org/show_bug.cgi?id=41216

This is a candidate for the 8.0 branch.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-22 13:33:20 -08:00
Jesse Barnes
0beed7f072 intel: bump DRI_IMAGE extension version to 3
To indicate support for the format query.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-02-22 09:55:06 -08:00
Jesse Barnes
8de5c355fa gbm: track buffer format through DRI drivers
GBM needs the buffer format in order to communicate with DRM and clients
for things like scanout.

So track the DRI format requested in the various back ends and use it to
return the DRI format back to GBM when requested.  GBM will then map
this into the GBM surface type (which is in turn based on the DRM fb
format list).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-02-22 09:41:40 -08:00
José Fonseca
d35d3d612a tests/graw: Add a bunch of tests.
These were rotting in an internal branch, but contain nothing confidential,
and would be much more useful if kept up-to-date with latest gallium
interface changes.

Several authors including Keith Whitwell, Zack Rusin, and Brian Paul.
2012-02-22 15:22:31 +00:00
Brian Paul
0df14f9a55 mesa: add special case in texstore.c for GL_LUMINANCE_ALPHA src image
About a 10% improvement over the swizzle-copy path.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-22 11:56:20 +00:00
José Fonseca
3dd7b53178 gallium/cso: Put the comment about shader in the code for future reference. 2012-02-22 08:41:19 +00:00
Eric Anholt
ab79d2be2e i965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:50 -08:00
Eric Anholt
6ca50f381c i965: Correct the size of the state batch space allocated for binding tables.
In the gen6 GS case, we were under-counting and so other state would
get smashed.  In the VS case, we were over-counting, so everything was
fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:48 -08:00
Eric Anholt
9fa6377a75 i965: Fix a bad comment in gen6 sol setup.
This was copy and paste from the VS where I had similar code.  We're
only looking at things derived from BRW_NEW_VERTEX_PROGRAM in this
block.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:46 -08:00
Eric Anholt
96ba94cad2 i965/gen6: Fix the size of the GS surface binding table.
I obviously didn't test on gen6 before pushing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 13:30:39 -08:00
Marek Olšák
5d2de9232d r600g: move invariant register updates into start_cs for evergreen and cayman 2012-02-21 21:42:27 +01:00
Marek Olšák
fbebd431ec r600g: move invariant register updates into start_cs for r6xx-r7xx 2012-02-21 21:42:27 +01:00
Marek Olšák
e2809849ec r600g: add a depth misc state which depends on occlusion queries
This is a state which is derived from other states and is actually the first
state which doesn't correspond to any gallium state.

There are two state flags:
  bool occlusion_query_enabled
  bool flush_depthstencil_enabled

Additional flags can be added later if needed, e.g. bool hiz_enabled.
The emit function will have to figure out the register values by itself.

It basically just emits the registers when the state changes.
This commit also adds a few helper functions for writing registers directly
into a command stream.
2012-02-21 21:42:27 +01:00
Marek Olšák
8f5c172c85 r600g: consolidate the main draw code
The code was almost the same for r600 and eg. What can't be consolidated is
in the *_prepare functions.
2012-02-21 21:42:27 +01:00
Marek Olšák
182fd4c544 r600g: move all invariant state from draw_vbo into start_cs 2012-02-21 21:42:27 +01:00
Marek Olšák
f126253040 r600g: turn init_config into a command buffer for starting a CS
This is the first pure command buffer. It contains CS initialization
packets and emits invariant state (i.e. the registers which never or rarely
change).

The affected registers are removed from *_hw_context.c, so that both ways
of emitting commands can co-exist.

v2: emit context_control in cayman's start_cs too
2012-02-21 21:42:27 +01:00
Kenneth Graunke
172bb92db1 i965: Only set Last Render Target Select on the last FB write.
Fixes GPU hangs in OilRush, Trine, and Amnesia: The Dark Descent,
which all use MRT (multiple render targets).

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38720
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40059
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45216
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 12:36:20 -08:00
Marek Olšák
32f833e5a5 gallium/cso: kill off non-functional shader caching
Suggested by José.

We don't provide shader caching in CSO. Most of the time the api provides
object semantics for shaders anyway, and the cases where it doesn't
(eg mesa's internall-generated texenv programs), it will be up to
the state tracker to implement their own specialized caching.
2012-02-21 21:09:16 +01:00
Marek Olšák
a6ef7f7ce4 gallium/util: remove u_simple_screen
Deprecated and unused.
2012-02-21 21:09:16 +01:00
Marek Olšák
96d882939d gallium: remove unused winsys pointers in pipe_screen and pipe_context
A winsys is already a private object of a driver.
2012-02-21 21:09:16 +01:00
Eric Anholt
f33d100fa7 intel: Silence valgrind warning for getparam ioctl argument.
It was concerned that the 4 pad bytes on LP64 were uninitialized.
2012-02-21 12:04:07 -08:00
Eric Anholt
5a7942c2f1 i965: Rename the original binding table to mention that it's the WM now.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:16 -08:00
Eric Anholt
f9c3ea32cd i965: Split the gen6 GS binding table to a separate table.
Improves VS state change microbenchmark performance by 7.08729% +/-
1.22289% (n=10) on gen7, because we don't upload the 64 dwords of
unused binding table any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:14 -08:00
Eric Anholt
07e00b3040 i965: Split the VS binding table to a separate table.
This is a step toward making the samplers/binding tables reflect
sampler uniform mappings instead of embedding those in the programs.
No significant performance difference on the microbenchmark (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:12 -08:00
Eric Anholt
8387156620 i965/gen6+: Avoid recomputing whether we use noperspective.
Improves VS state change microbenchmark performance 2.38246% +/-
1.15046% (n=20).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:10 -08:00
Eric Anholt
e9cfaed1a5 i965/gen7: Skip checking if we need a GS program for now.
We always say no.  Improves VS state change microbenchmark performance
7.68747% +/- 1.40826% (n=10).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:08 -08:00
Eric Anholt
71d71d5e89 i965: Compute required barycentric interp modes once at FS compile time.
Improves VS state change microbenchmark performance 1.78817% +/-
0.556878% (n=25).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:06 -08:00
Eric Anholt
f0cecd43d6 i965: Move VUE map computation to once at VS compile time.
With this and the previous patch, 640x480 nexuiz is running 0.169118%
+/- 0.0863696% faster (n=121).  On a VS state change microbenchmark,
performance is increased 8.28645% +/- 0.460478% (n=52).

v2: Fix CACHE_NEW_VS comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:54:02 -08:00
Eric Anholt
9f3d3216cf i965: Make the userclip flag for the VUE map come from VS prog data.
This reduces recomputation of state based on non-clipping-related
transform changes, and is a step toward removing VUE map
recomputation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-21 11:53:37 -08:00
Anuj Phogat
b5c409363c mesa: fix issues with texture border and array textures
For a 1D texture array, the border only applies to the width.  For a 2D
texture array the border applies to the width and height but not the depth.
Sucha cases were  not handled correctly in _mesa_init_teximage_fields().

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-21 10:46:55 -08:00
Jerome Glisse
e372e53ee0 radeon/r600g: fix virtual address space allocation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-21 12:34:54 -05:00
José Fonseca
6fd62c998a llvmpipe: Remove lp_test_sincos.
Completely replaced by lp_test_arit.
2012-02-21 16:04:54 +00:00
Christian König
37f97e1753 vl: add support for bob deinterlacing
v2: return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE
    for unknown picture structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:27 +01:00
Christian König
0f194fc9e4 st/vdpau: Use transfer_inline_write to upload ycbcr data
Uses less code and looks at least a bit cleaner than mapping manually.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:20 +01:00
Christian König
736dda82ca st/vdpau: remove unnecessary tracing and adjust tracing levels a bit
Tracing function entry/exits is a bit pointless
when VDPAU_TRACE=1 does the same thing.

v2: use WARN instead of ERR for application problems

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:11 +01:00
José Fonseca
a206c4cd69 gallivm: Fix TGSI_OPCODE_ARR's translation.
Like TGSI_OPCODE_ARL, destination should be an integer.

This fixes invalid LLVM IR on an internal state tracker (currently Mesa
never emits this opcode).

In the future consider making ADDR register also a integer-as-float array,
like all other register kinds, or simply replace ADDR & ARR/ARL with
integer temp and instructions.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-02-21 08:23:20 +00:00
Vinson Lee
d394bc5853 st/egl: Move drm_display_authenticate into HAVE_WAYLAND_BACKEND section.
Fixes this GCC warning.
native_drm.c:153:1: warning: ‘drm_display_authenticate’ defined but not
used [-Wunused-function]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 13:17:23 -08:00
José Fonseca
dbadd39508 llvmpipe: Don't assume vector is 4 wide in lp_build_sin()/lp_build_cos()
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-02-20 17:07:22 +00:00
Brian Paul
d2003ee7b7 mesa: check for no state change in glPrimitiveRestartIndex()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:34 -07:00
Brian Paul
45453d8f69 mesa: check for no state change in Enable/DisableVertexAttribArray()
Avoid setting dirty state flags when enabling or disabling a vertex
attribute arrays when there's no change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:33 -07:00
Brian Paul
e14b357367 mesa: add missing return after _mesa_error() in update_array()
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-20 08:04:33 -07:00
Tom Stellard
e1044b4082 r300g: Fix build when libdrm is installed to non-standard dir 2012-02-19 19:40:32 -05:00
Kenneth Graunke
df5963c256 i965: Make the dummy fragment shader work in SIMD16 mode.
If you're resorting to the dummy shader, you've probably already turned
off SIMD16 mode.  But if you didn't, it would die in a fire.

We could either fail to compile in SIMD16 mode...or just fix it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-18 20:12:46 -08:00
Kenneth Graunke
393b42240f i965: Fix GPU hangs in the dummy fragment shader.
The dummy FB write failed to specify EOT and a message length, causing
the GPU to hang.  Now we can enjoy "everyone's favorite color" again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-18 20:12:38 -08:00
Vinson Lee
0342ffba1f st/vega: Remove unused variable.
Fixes this GCC warning.
mask.c: In function ‘mask_layer_fill’:
mask.c:387:12: warning: variable ‘alpha_color’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-18 11:09:27 -08:00
Vinson Lee
e77e88740d st/glx: Remove unused variables.
Fixes these GCC warnings.
glx_api.c: In function ‘choose_visual’:
glx_api.c:678:8: warning: variable ‘trans_value’ set but not used
[-Wunused-but-set-variable]
glx_api.c:677:8: warning: variable ‘trans_type’ set but not used
[-Wunused-but-set-variable]
glx_api.c:663:8: warning: variable ‘min_ci’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-18 11:02:01 -08:00
Dave Airlie
c67a1f1d53 draw: add missing streamout state setup for draw/llvm.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-18 12:44:10 +00:00
Kenneth Graunke
6e738d35c5 vbo: Eliminate short-circuiting in invalid-start case.
Now that we have a index_range_invalid flag, we can just use that rather
than calling vbo_validated_drawrangeelements directly and returning.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-17 14:57:11 -08:00
Kenneth Graunke
112b02c324 vbo: Rework checking of 'end' against _MaxElement.
This failed to take basevertex into account:

If basevertex < 0:
   (end + basevertex) might actually be in-bounds while 'end' is not.
   We would have clamped in this case when we probably shouldn't.
   This could break application drawing.

If basevertex > 0:
   'end' might be in-bounds while (end + basevertex) might not.
   We would have failed to clamp in this place.  There's a comment
   indicating the TNL module depends on max_index being in-bounds;
   if so, it would likely break horribly.

Rather than trying to clamp correctly in the face of basevertex, simply
delete the clamping code and indicate that we don't have a valid range.
This causes _tnl_vbo_draw_prims to use vbo_get_minmax_indices() to
compute the actual bounds, which is much safer.

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:55 -08:00
Kenneth Graunke
f00c97b23f vbo: Ignore invalid element ranges which are outside VBO bounds.
Some applications, such as Regnum Online, appear to pass invalid
start/end values to glDrawRangeElements.  In particular, the 'start'
index sometimes exceeds the maximum array element.  This is clearly
invalid behavior, and although the spec isn't clear, seems to result
in undefined, implementation-specific behavior.

This patch takes the conservative approach and simply ignores the range,
while issuing a warning indicating that the application is broken and
should be fixed.

NOTE: This is a candidate for release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45214
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44701
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41152
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40361
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:44 -08:00
Kenneth Graunke
f9be8543aa vbo: Remove pedantic warning about 'end' beind out of bounds.
The application supplied [start, end] range is merely a conservative
hint of the ranges of index values inside the index buffer.  There is no
requirement that all vertices in the range [start, end] be referenced.

Passing an 'end' value larger than the maximum legal index is perfectly
acceptible; applications can legally pass 0xffffffff when they don't
have a tighter bound readily available.

Thus, the warning doesn't indicate a correctness issue; it could only
indicate a performance issue.  However, it does not even do that.

glDrawRangeElements is designed to optimize non-VBO vertex data uploads
by providing an upper bound on the size of buffers a driver would need
to allocate.  With VBOs, the data is already in an uploaded buffer, so
the range doesn't help.

The clincher is: we only know _MaxElement for VBOs.  For user-space
arrays, we just set it to 2,000,000,000 (see mesa/main/varray.h:63.)
So we can only check this in the case where it is not useful.

Many applications, including the Unigine demos, currently trigger this
warning, which suggests the applications are buggy when they're actually
fine.  Eliminating the warning should confuse users less while not
actually losing any benefit to application developers.

NOTE: This is a candidate for release branches.

Suggested-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-02-17 14:56:24 -08:00
Eric Anholt
e2dce7f7ee intel: Fix rendering from textures after RenderTexture().
There's a serious trap for drivers: RenderTexture() does not indicate
that the texture is currently bound to the draw buffer, despite
FinishRenderTexture() signaling that the texture is just now being
unbound from the draw buffer.

We were acting as if RenderTexture() *was* the start of rendering and
that we could make texturing incoherent with the current contents of
the renderbuffer.  This caused intel oglconform sRGB
Mipmap.1D_textures to fail, because we got a call to TexImage() and
thus RenderTexture() on a texture bound to a framebuffer that wasn't
the draw buffer, so we skipped validating the new image into the
texture object used for rendering.

We can't (easily) make RenderTexture() indicate the start of drawing,
because both our driver and gallium are using it as the moment to set
up the renderbuffer wrapper used for things like MapRenderbuffer().
Instead, postpone the setup of the workaround render target miptree
until update_renderbuffer time, so that we no longer need to skip
validation of miptrees used as render targets.  As a bonus, this
should make GL_NV_texture_barrier possible.

(This also fixes a regression in the gen4 small-mipmap rendering since
3b38b33c16, which switched
set_draw_offset from image->mt to irb->mt but didn't move the irb->mt
replacement up before set_draw_offset).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44961
NOTE: This is a candidate for the 8.0 branch.
2012-02-17 13:31:27 -08:00
Eric Anholt
308c6be802 intel: Improve the fallback debug for framebuffer status checks. 2012-02-17 13:31:27 -08:00
Eric Anholt
a1fd13fff1 mesa: Only end render-to-texture at bind time for drawbuffers.
If we're only starting for new draw buffers, why would we end for old
read buffers along with draw buffers?
2012-02-17 13:31:27 -08:00
Dave Airlie
7199b0b681 gallivm: fetch immediates to correct type (v2)
Fetch float/uint/int immediates.

v2: bitcast to uint/int to floats as per Jose's suggestions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
117a0e91af gallivm: enable stores of integer types. (v2) + fix ARL
Infer from the operand the type of value to store.
MOV is untyped but we use the float store path.

v2: make MOV use float store path.

I've had to squash merge the ARL fix to be stored
as an integer in here to avoid regressions in a number
of piglit tests.

From now on ARL stores to an integer just like HW does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
141f2c2fc9 gallivm: enable fetch for integer opcodes. (v2)
The infers the type of data required using the opcode,
and casts the input to the appropriate type.

So far this only handles non-indirect constant and temporaries.

v2: as per Jose suggestion, fetch immediates via floats

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
66461aa249 gallivm: add uint/int bld to the base builder. (v2)
These are used inside the action handlers for the integer opcodes.

v2: use uint_bld/int_bld, drop higher level uint_bld.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:02 +00:00
Dave Airlie
f667a6f3ce gallivm: fix build gather to take a bld context
Then pass the correct build context to it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
Dave Airlie
639fbe2e75 gallivm: pass build context to exec_mask_store.
For now just pass the current context, but when we want to
store int or unsigned we need to pass those later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
Dave Airlie
13e2e51f70 tgsi: add source/destination type from opcodes. (v2)
These two functions produce the src/dst types for an opcode.

MOV is special since it can be used to mov float->float and int->int,
so just return VOID.

v2: use a new enum for the opcode type as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-17 17:39:01 +00:00
José Fonseca
9be0f9b0e4 gallivm: Initialize x86 disassembler on x86_64 too. 2012-02-17 17:22:23 +00:00
José Fonseca
e648f5e197 llvmpipe: Test lp_test_arit with LP_NATIVE_VECTOR_WIDTH.
Instead of assuming 4 wide vectors.
2012-02-17 16:17:28 +00:00
José Fonseca
b5941e33d0 llvmpipe: Specify lp_test_arit's target precision per function. 2012-02-17 16:10:22 +00:00
José Fonseca
fc79c4fbd4 llvmpipe: Add a negation test to lp_test_arit. 2012-02-17 15:57:54 +00:00
Ian Romanick
f767ee5404 docs: News and release notes link for 8.0.1
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-16 23:31:50 -08:00
Ian Romanick
578dc605b6 docs: Add 8.0.1 release md5sums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d38a295289)
2012-02-16 23:31:50 -08:00
Ian Romanick
61cf89c002 docs: Add 8.0.1 release notes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fe77fd3983)
2012-02-16 23:31:50 -08:00
Marek Olšák
e05bc52b9c r300g: don't use pipe_screen::winsys 2012-02-17 01:39:48 +01:00
Marek Olšák
c9e9cfbf60 r300g: don't use pipe_context::winsys 2012-02-17 01:26:56 +01:00
Ian Romanick
f16c40d2f6 mesa: Update the version string to 8.1-devel
The numeric version was updated in 46883e0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-16 15:29:26 -08:00
Brian Paul
ca1b2da300 docs: replace gitweb link with cgit link 2012-02-16 13:35:02 -07:00
Brian Paul
6f3d918409 mesa: add missing texture integer test in glTexSubImage()
If the texture format is integer, the incoming user data must also be
integer (and similarly for non-integer textures).

NOTE: This is a candidate for the stable branches.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-16 09:37:11 -07:00
Marek Olšák
b0b8121813 r600g: remove the workaround for quads and provoking vertex 2012-02-16 17:15:50 +01:00
Marek Olšák
73191026b4 r600g: remove redundant r600_context::vs_so_stride_in_dw 2012-02-16 15:56:59 +01:00
Kenneth Graunke
709f50928e i965: Emit Ivybridge VS workaround flushes.
I recently discovered this text in the BSpec.  It seems wise to comply,
though I haven't observed it to fix anything yet.

Fixes a regression in glean/fbo since 28cfa1fa21.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45221
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-15 22:17:39 -08:00
Eric Anholt
b631b471d8 mesa: Include the multisample enables under GL_MULTISAMPLE_BIT attrib as well.
Fixes (with the previous commit) piglit GL_ARB_multisample/pushpop.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 15:31:33 -08:00
Eric Anholt
4b6e45c7d6 mesa: Fix push/pop of multisample coverage invert.
In the table of of push/pop attributes, this one doesn't fall under
the enable group.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 15:31:24 -08:00
Ian Romanick
3e22d4e5fc swrast: Only avoid empty _TexEnvPrograms
If the generated shader for _TexEnvProgram is empty, force the use of
the fixed-function code.  Otherwise, go ahead and use the shader.
This works around a mysterious issue on i915 where fixed-function
software fallbacks are not working correctly.

This isn't really the fix we want, but it works around the issue.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45872
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45876
2012-02-15 14:50:40 -08:00
Ian Romanick
8f3be33985 glapi: Include GLES2 headers for ES2 extension functions
This fixes build errors like

In file included from glapi_dispatch.c:91:
../../../src/mapi/glapi/glapitemp.h:4641: error: no previous prototype for
'glDrawBuffersNV'

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lucas Stach <dev@lynxeye.de>
2012-02-15 14:50:00 -08:00
Brian Paul
7539a0d677 st/mesa: fix typo: s/patent/parent/ 2012-02-15 14:37:07 -07:00
Brian Paul
456a02b0c7 st/mesa: remove unused st_equal_formats() function
It was incomplete and didn't take byte swapping into account either.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
c9d0526084 st/mesa: use _mesa_format_matches_format_and_type() in decompress_with_blit()
st_equal_formats() is no longer used now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
b549fd138e st/mesa: remove INLINE qualifiers
from st_get/create_texture_sampler_view_from stobj() functions.
No real value in these cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
9600b0762b st/mesa: simplify st_create_texture_sampler_view()
Implement in terms of st_create_texture_sampler_view_format().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
91ec17835f st/mesa: remove unused st_get_texture_sampler_view()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
0315cb9f8f st/mesa: use private pipe_sampler_view in decompress_with_blit()
Similar to the previous commit.  Also fix incorrect setting of the
sampler view's state after it's created.  We need to specify the
first/last_level fields in the template instead.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
c5ba6a7807 st/mesa: use private pipe_sampler_view in st_render_mipmap()
Rather than the one in st_texture_object.  This sampler view really has
no connection to the one used for rendering.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:09:01 -07:00
Brian Paul
0bda900743 mesa: use z32f_x24s8 struct in format pack/unpack code
And remove needless & 0xff in _mesa_pack_uint_24_8_depth_stencil_row().
As suggested by José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-15 14:08:50 -07:00
Brian Paul
dba7ad0ca9 st/mesa: assorted clean-ups in st_cb_fbo.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
418306397f st/mesa: remove st_framebuffer_renderbuffer()
Just use _mesa_framebuffer_renderbuffer().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
ea2aca036c st/mesa: remove st_get_default_texture()
Just use _mesa_get_fallback_texture() instead.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
c04db7f7fa mesa: fix _mesa_get_fallback_texture() to handle all texture targets
Previously, this function only handled 2D textures.

The fallback texture is used when we try to sample from an incomplete
texture object.  GLSL says sampling an incomplete texture should return
(0,0,0,1).

v2: use a 1-texel texture image, per José.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
447071cfb0 st/mesa: improve assertion/check for stencil format 2012-02-15 14:07:43 -07:00
Brian Paul
f1334f232f gallium: fix some comments in p_state.h
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
82ddd1129e mesa: add MESA_FORMAT_Z32_FLOAT_X24S8 case in format unpack code
Added in _mesa_pack_uint_24_8_depth_stencil_row().  This could be hit
by something like glDrawPixels(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8)
into a MESA_FORMAT_Z32_FLOAT_X24S8 buffer.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
5e81d3b853 st/mesa: use _mesa_pack_ubyte_stencil_row() in draw_stencil_pixels()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
5a70e12fc0 st/mesa: don't set PIPE_BIND_DISPLAY_TARGET for user-created renderbuffers
The st_renderbuffer_alloc_storage() function is used to allocate both
window-system buffers and user-created renderbuffers.  The later kind
are never directly displayed so don't set PIPE_BIND_DISPLAY_TARGET for
those surfaces.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
fc855f85d0 st/mesa: use u_surface_default_template() helper
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
d9ae5db6e3 st/mesa: remove redundant memset(surface_template,0)
The subsequent u_surface_default_template() call does that for us.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
2e12b4cfef st/mesa: remove st_renderbuffer::stride
It was only used for software buffers and easily computed.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
d765c8ee8c st/mesa: remove st_renderbuffer::format
We only used it in a few places that can implemented differently.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-15 14:07:43 -07:00
Brian Paul
dbe88515c5 mesa: fix comment typos in fbobject.c 2012-02-15 14:07:43 -07:00
Kenneth Graunke
4b27406820 i965/fs: Take # of components into account in try_rewrite_rhs_to_dst.
Commit dc7f449d1a introduced a new method
for avoiding MOVs: try to rewrite the destination of the instruction
that produced the RHS so it writes into the LHS.

Unfortunately, this is not safe for swizzled texturing operations, as
they return a set of four contiguous registers.  Consider the following:

(assign (x)
        (var_ref vec_ctor_x)
        (swiz x (tex vec4 (var_ref m_sampY) (var_ref m_cordY) 0 1 ())))

In this case, the source and destination registers are equal, since
reg_offset is 0 for both.  Yet, this is only a partial move: the texture
operation generates four registers, and the LHS only covers one.

Fixes color distortion in XBMC when using GLSL shaders.

NOTE: This is a candidate for the 8.0 branch (with the previous commit).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44333
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-15 11:44:37 -08:00
Kenneth Graunke
8ab02b5118 i965/fs: Add a new fs_inst::regs_written function.
Certain instructions write more than one register.  Texturing, for
example, returns 4 registers.  (We set rlen to 4 even for TXS and float
shadow sampling.)  Some math functions return 2.  Most return 1.

The next commit introduces a use of this function.

NOTE: This is a candidate for the 8.0 branch (dependency of a fix).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-15 11:44:05 -08:00
Dave Airlie
c89b471f8c llvmpipe: fix fogcoord writing (v2)
this fixes the fogcoord related piglit tests, like I fixed them in softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-15 19:25:27 +00:00
Anuj Phogat
66bf25f1a2 meta: Avoid FBO resizing/reallocating in decompress_texture_image
Reallocate/resize decompress FBO only if texture image width/height is
greater than existing decompress FBO width/height.

This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-15 09:23:13 -08:00
Christian König
78734e375a st/vdpau: fix a small memory leak
The matrix filter wasn't freed on mixer destruction.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-14 22:32:08 +01:00
Christian König
553e820387 vl: fix low strength denoise filter
A filter strength of zero or one doesn't make any
sense. Thanks to Andy Furniss for pointing this out.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-14 22:31:29 +01:00
Jerome Glisse
356eb0aadb r600g: fix tiling with cayman and virtual memory
The virtual address but follow the alignment requirement of the
tiled surface. The bo from handle case is not properly fix. Need
bigger change for a proper fix. Work around that by enforcing 1M
alignment for those bo.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-14 15:56:09 -05:00
Paul Berry
6b0a07f9ce i915: Fix type of "specoffset" variable.
Commit 2e5a1a2 (intel: Convert from GLboolean to 'bool' from
stdbool.h.) converted the "specoffset" local variable (in
intel_tris.c) from a GLboolean to a bool.  However, GLboolean was the
wrong type for specoffset--it should have been a GLuint (to match the
declaration of specoffset in struct intel_context).

This patch changes specoffset to the proper type.

Fixes piglit test general/two-sided-lighting-separate-specular.

This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45917
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 11:40:02 -08:00
Eric Anholt
93831a54c7 i965/fs: Enable register spilling on gen7 too.
It turns out the same messages work on gen7, we were just being paranoid.

Fixes the penumbra shadows mode of Lightsmark since the register
allocation fix.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 10:19:04 -08:00
Eric Anholt
a7f46eadea i965: Report the failure message when failing to compile the fragment shader.
We just abort later, but at least this should result in more
informative bug reports.

NOTE: This is a candidate for release branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-14 10:19:04 -08:00
Simon Farnsworth
8cd03b933c r600g: Use a fake reloc to sleep for fences
r300g is able to sleep until a fence completes rather than busywait because
it creates a special buffer object and relocation that stays busy until the
CS containing the fence is finished.

Copy the idea into r600g, and use it to sleep if the user asked for an
infinite wait, falling back to busywaiting if the user provided a timeout.

Note: this is a candidate for the stable branches.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-14 09:56:23 -05:00
Marek Olšák
014198ec88 r600g: consolidate set_blend_color code 2012-02-14 15:51:59 +01:00
Marek Olšák
5cc9aa0e02 r600g: consolidate more translate functions 2012-02-14 15:49:24 +01:00
Marek Olšák
d214275ace r600g: inline r600_translate_ds_func 2012-02-14 15:49:24 +01:00
Marek Olšák
85571ed53c r600g: remove unused variable 2012-02-14 15:49:24 +01:00
Marek Olšák
9a20130e5f r600g: consolidate some translate functions 2012-02-14 15:49:23 +01:00
Marek Olšák
39b0da9f8d Revert "r600g: don't advertise integer textures without GLSL 1.3"
This reverts commit 2c06bcb909.

It breaks u_blitter trying to blit compressed textures as uint.
2012-02-14 15:48:37 +01:00
Marek Olšák
2c06bcb909 r600g: don't advertise integer textures without GLSL 1.3 2012-02-14 15:04:51 +01:00
Anuj Phogat
4042702591 meta: Add pixel store/pack operations in decompress_texture_image
This patch adds the pixel store operations in decompress_texture_image().
decompress_texture_image() is used in glGetTexImage() for compressed
textures with unsigned, normalized values.

It also fixes the failures in intel oglconform pxstore-gettex due to
following sub test cases:

 - Test all mipmaps with byte swapping enabled
 - Test all small mipmaps with all allowable alignment values
 - Test subimage packing for all mipmap levels

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40864

Note: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-13 11:07:48 -08:00
Brian Paul
df1cd55ebf mesa: add missing GL_UNSIGNED_INT_10F_11F_11F_REV case
in _mesa_error_check_format_and_type().

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=45967
2012-02-13 08:47:59 -07:00
Stéphane Marchesin
d2c54fb522 gallivm: Replace architecture test with PIPE_ARCH_*
X86Target is a variable, and therefore isn't defined at compile time. So
 LLVM_NATIVE_ARCH == X86Target
is translated into
 0 == 0
and since X86 is first, we always pick it.

Therefore we replace the logic with PIPE_ARCH_*.

https://bugs.freedesktop.org/show_bug.cgi?id=45420
2012-02-12 16:32:15 -08:00
Stéphane Marchesin
a2caf952a1 i915g: Remove useless draw calls. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
633f21652a i915g: Add a way to profile the contents of command buffers. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
8b3e0b2715 i915g: Fix comments. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
c1896cdc91 i915g: Don't emit state when it's already bound. 2012-02-12 16:32:15 -08:00
Stéphane Marchesin
be6a02266d i915g: Remove unused poly stipple state. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
3cff45fdb1 i915g: Implement stipple with draw. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
175adf0776 i915g: Fix comment. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
4dc0425261 i915g: Move ureg defines to the header so we can share them. 2012-02-12 16:32:14 -08:00
Stéphane Marchesin
8e4540ec2a i915g: Separate declarations and program in the fragment program struct.
We need this later to fixup fragment programs properly.
2012-02-12 16:32:14 -08:00
Dave Airlie
094eeff199 st/mesa: only resolve if number of samples is > 1
Marek: this fixes a firefox crash and maybe even:
https://bugs.freedesktop.org/show_bug.cgi?id=45943

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2012-02-12 21:35:27 +01:00
Brian Paul
bd1ae51b13 swrast: fix span color type selection
Fixes a regression from commit 660ed923de.
The basic idea is to look at the format of the dest renderbuffer and
choose either GLubyte or GLfloat for colors.  The previous code used
_mesa_format_to_type_and_comps() which could return a bunch types other
than ubyte/float.

Determine the datatype at renderbuffer mapping time to avoid frequent
calls to the format query functions.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45578
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45577
2012-02-12 11:22:31 -07:00
Dave Airlie
b72d5767e3 extensions: remove unused code.
Comparing an unsigned to < 0 is pointless.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-12 16:09:50 +00:00
Dave Airlie
449cae141e mesa/texparam: drop double semicolons
no idea where these came from, drop them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-12 16:09:50 +00:00
Marek Olšák
6cd9159cea r300g: always fail to create a multisample resource
Just to be safe.
2012-02-12 13:07:51 +01:00
Marek Olšák
6d89a795a5 r300g: assert-fail when calling resource_resolve
And reset the dest pointer to NULL after it.
2012-02-12 13:07:51 +01:00
Alex Deucher
c565ff60d6 gallium/xvmc: r300 and r600 now depend on libdrm_radeon
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=45907

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-11 10:57:24 -05:00
Vinson Lee
d5a6c17254 gallivm: Change getExtent and readByte to non-const with llvm-3.1.
Fix build with llvm-3.1svn.

llvm-3.1svn r149918 changed BufferMemoryObject::getExtent and
BufferMemoryObject::readByte from const member functions to non-const
member functions in include/llvm/Support/MemoryObject.h.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-10 23:24:48 -08:00
Kenneth Graunke
3340b47c22 i965: Fix border color on Ironlake.
Ironlake appears to check our pointer against the General State Base
Address upper bound, rather than ignoring the zero bound as it ought.

Unfortunately, since we leave GSBA set to zero, there is no logical
upper bound.  Set it to the maximum possible value, which should work
since our virtual addresses only go up to 2GB.

+94 piglits.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-10 20:47:49 -08:00
Eric Anholt
7d55f37b0e i965/fs: Add support for generating MADs.
Improves nexuiz performance 0.65% +/- .10% (n=5) on my gen6, and .39%
+/- .11% (n=10) on gen7.  No statistically significant performance
difference on warsow (n=5, but only one shader has MADs).

v2: Add support for MADs in 16-wide by using compression control.
v3: Don't generate MADs when it will force an immediate to be moved to a temp.
    (it's not clear whether this is a win or not, but it should result in less
     questionable change to codegen compared to v2).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2012-02-10 18:18:52 -08:00
Eric Anholt
a1bfafc5a9 i965/fs: Add missing register allocation for 3rd sources.
Our only instruction with a 3rd source so far was linterp, and that
value was never register-allocated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-10 17:08:04 -08:00
Eric Anholt
2b28fd6ca6 i965: Add support for the MAD opcode on gen6+.
v2: Fix MRF handling on gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2012-02-10 17:08:03 -08:00
Ian Romanick
46883e01ba Bump version to 8.1 (devel)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-10 15:34:44 -08:00
Alex Deucher
a8cc228edd radeon: build fix after 9d9111108e
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-10 11:31:23 -05:00
Alex Deucher
5e1495b2d9 r600g: 128 bit formats require tile_type = 1 on cayman
Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-02-10 11:31:23 -05:00
Alex Deucher
acca690c25 r600g: fix tex tile_type offset for cayman
Noticed by taiu on IRC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-02-10 11:31:23 -05:00
Brian Paul
ad9455314d st/wgl: refactor stw_pixelformat_init()
Replace duplicated code with add_color_format_variants() helper.
2012-02-10 16:23:27 +00:00
José Fonseca
9646762261 st/wgl: Properly support non-displayble pixel formats, and implement float pixelformats as as one.
WGL_ARB_pixel_format establishes the existence of pixel formats which
are invisible to GDI.

However we still need to pass a valid pixelformat to GDI, so that
context creation/binding works.

The actual WGL_TYPE_RGBA_FLOAT_ARB implementation is from Brian Paul.
2012-02-10 16:23:27 +00:00
José Fonseca
90a95f4d2c st/wgl: Invoke SetPixelFormat twice for pbuffers. 2012-02-10 16:23:27 +00:00
José Fonseca
0cf554fa9b st/wgl: Just pass pPixelFormat to stw_pixelformat_get_info().
Avoids the likely error of forgetting to subtract one.
2012-02-10 16:23:27 +00:00
José Fonseca
6beed86ab8 st/wgl: Fix argument of stw_pixelformat_get_info().
stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.
2012-02-10 16:23:27 +00:00
Brian Paul
5ee8969b11 mesa: remove unused gl_shared_state::DriverData field 2012-02-10 08:26:31 -07:00
Brian Paul
9e0931e355 docs: remove link to the GLSL compiler page
The page is terribly out of date.
(cherry picked from commit 65526d54aa)
2012-02-10 08:08:39 -07:00
Brian Paul
7028e6dc46 docs: add VMware link
(cherry picked from commit 6aa9ce2687)
2012-02-10 08:08:39 -07:00
Brian Paul
d01de08c4c docs: update info about supported systems, GPUs, APIs
Add link to Intel's Linux graphics page, etc.
(cherry picked from commit 14cf3dd826)
2012-02-10 08:08:39 -07:00
Brian Paul
ad8eec9eec docs: add news item for 8.0 release
(cherry picked from commit 7aef839760)
2012-02-10 08:08:39 -07:00
Ian Romanick
94846f8cd1 docs: Add 8.0 MD5 checksums
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit fb56b0972d)
2012-02-10 08:08:39 -07:00
Brian Paul
d925b0d4a7 mesa: fix proxy texture target initialization
The mapping from TEXTURE_x_INDEX to GL_TEXTURE_x was broken in
alloc_proxy_textures() because the elements in the targets[] array
were in the wrong order.

This didn't actually cause any failures since we never really use the
proxy texture's Target field.  But let's get it right.

NOTE: This is a candidate for the 8.0 branch.
2012-02-10 08:08:39 -07:00
Brian Paul
3e59fb570a mesa: remove unused gl_pixelmap::Map8[] array
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
80fd3d2ca8 st/mesa: stop using Map8[] tables in load_color_map_texture()
Use the float tables instead.  Pixel maps are seldom used so this
shouldn't be a big deal.  Next, we can get rid of the gl_pixelmap::Map8
array.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
0d6ef4e299 mesa: remove unused _mesa_map_ci8_to_rgba8()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:57 -07:00
Brian Paul
fcca8f0b7a mesa: fix error handling in get_tex_rgba_compressed() 2012-02-10 08:06:57 -07:00
Brian Paul
1a4f398a63 mesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy() 2012-02-10 08:06:57 -07:00
Brian Paul
07459ba509 mesa: push row stride adjustment down into _mesa_decompress_image()
There's a mismatch in row strides for compressed textures between
what Driver.MapTextureImage() returns and what the software fetch-texel
functions use.  Move it down a layer.  The next step would be to fix
this in the fetch-texel functions.
2012-02-10 08:06:57 -07:00
Brian Paul
9d9111108e mesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function 2012-02-10 08:06:57 -07:00
Brian Paul
d1b7967242 mesa: make _mesa_invalidate_shine_table() static 2012-02-10 08:06:57 -07:00
Brian Paul
ae509f88a5 mesa: remove gl_light::_SpotExpTable field
Just use pow() instead.  Spot lights aren't too common and fixed-function
lighting isn't as important as it used to me.

This saves 32KB per context.  Each table was 4KB and there's 8 lights.
2012-02-10 08:06:56 -07:00
Brian Paul
4dacf793c8 meta: replace abort() with _mesa_problem()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-10 08:06:56 -07:00
Brian Paul
068b9dc268 mesa: fix comment typo 2012-02-10 08:06:56 -07:00
Christian König
36cd50152c st/vdpau: use matrix filter to blur/sharpen video
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:10:05 +01:00
Christian König
d7db6343dd vl: add a matrix/convolution filter
Can be used for gaussian, mean, laplacian, emboss, sharpness...

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:09:27 +01:00
Christian König
bbb48e983d st/vdpau: use median filter for noise reduction
And while at it implement the rest of the feature
querying also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:06:07 +01:00
Christian König
a9ffcceee9 vl: add a median filter for noise reduction
This is a shader based median filter, generally
used for noise reduction, it could still need some
improvements, but should usually work out of the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-10 12:06:00 +01:00
Eric Anholt
a7750c9fb5 i965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-09 19:03:19 -08:00
Eric Anholt
cdcfaa64e3 i965/gen7: Fix the length of the DS state packet in the HiZ op.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-09 19:03:18 -08:00
Eric Anholt
e5b225afbd i965/gen7: Fix GPU hangs from the HiZ op.
The wm max threads is in the same dword as the dispatch enable.  The
hardware gets super angry if you set max threads to 0, even if you
aren't dispatching threads.
2012-02-09 19:03:18 -08:00
Mathias Fröhlich
67007080b7 glsl: Avoid excessive loop unrolling.
Avoid unrollong loops that are either nested loops or
where the loop body times the unroll count is huge.

The change is far from being perfect but it extends the
loop unrolling decision heuristic by some additional
safeguard. In particular this cuts down compilation of
a shader precomputing atmospheric scattering integral
tables containing two nesting levels in a loop from
something way beyond some minutes (I never waited for
it to finish) to some fractions of a second.

This fixes piglit tests glsl-fs-unroll-explosion and
glsl-vs-unroll-explosion on r600g.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-02-09 21:23:16 +01:00
Anuj Phogat
ea228d97f8 mesa: fix maximum allowed proxy texture size condition
width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type + 2 * border.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case:
max_values negative.textureSize.textureCube
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-09 11:59:38 -08:00
Dave Airlie
23c52caafb st/mesa: exit the update fragment samplers/textures loops early.
If we have no more enabled samplers and we've reset all the previously
used ones, no need to keep going around this loop.

(just moved some stuff around to clean it up a bit).

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-09 19:39:30 +00:00
Dave Airlie
86163b81a4 st/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.
From what I can see we were taking the debug path all the time,
when we probably only want it for enable debug path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-09 19:39:30 +00:00
Chia-I Wu
50683d2aa6 mesa: enable remap table when --enable-shared-glapi
As libGL will use libglapi for function lookups, we need to enable the remap
table.

Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45660
2012-02-09 10:39:50 -05:00
Brian Paul
781f84a3c2 vbo: unmap vertex store before executing lists
We don't want our VBOs mapped when we're drawing.  This change checks
if the vertex store VBO is mapped before we execute a list, unmaps it,
then remaps it after drawing.  This situation pops up when building a
nested display list in GL_COMPILE_AND_EXECUTE mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-02-09 08:18:50 -07:00
Christoph Bumiller
8b4f7b0672 gallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Just let the hardware do it if it can and avoid drivers having to
check for the special case on each draw call.

v2: update the draw module
2012-02-09 15:01:34 +01:00
Carl Worth
26de5273ac dri: Emit a critical error if the swrast driver fails to load.
Something has gone wrong if swrast is requested but cannot be
loaded. The user really should be made aware of this, (and instructed
to set LIBGL_DEBUG for more details).

The wording of this error message is updated from "reverting to
indirect rendering" to the more objectively descriptive "failed to
load driver: swrast". The former wording makes assumptions about what
the calling code will decide to do next, rather than simply describing
what went wrong within the current function. The new wording is
consistent with the critical errors recently added for hardware
drivers that fail to load.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
6c9af97740 dri: Emit a critical error if a named driver fails to load.
Something has gone wrong if we were asked to load a driver of a
specific name, but it failed to load for some reason. The user really
should be made aware of this, (and instructed to set LIBGL_DEBUG for
more details).

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
92bef0bfa1 dri: Add a CriticalErrorMessageF macro.
Sometimes an error is so sever that we want to print it even when the
user hasn't specifically requested debugging by setting LIBGL_DEBUG.

Add a CriticalErrorMessageF macro to be used for this case. (The error
message can still be slienced with the existing LIBGL_DEBUG=quiet).

For critical error messages we also direct the user to set the
LIBGL_DEBUG environment variable for more details.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Carl Worth
c09504c343 dri: Clarify comments on InfoMessageF and ErrorMessageF macros.
The description of ErrorMessageF was misleading in the case of
LIBGL_DEBUG being unset, (the previous comment could be understood to
mean the error should be printed, but the code does not print in this
case).

InfoMessageF previously had no comment at all.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-08 17:07:53 -08:00
Chad Versace
5497cc428f glsl: Fix Android build
The build was broken by the line below, added in commit 4f82fed4.
  s_expression.cpp:26: #include <limits>

Mesa's half of the fix is to add 'external/astl/include' to the include
path. The other half of the fix requires implementing
numeric_limits<float>::infinity() in astl, for which I have patches
submitted upstream for review.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-08 15:17:12 -08:00
Christian König
192467108b r600g: fix handling of outputs as TEX addr sources
Outputs should be treated in the same way as
inputs and temporaries here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2012-02-08 19:25:18 +01:00
Chad Versace
b44c459cc3 i965: Remove file i965/junk, accidentally added in 7b36c68 2012-02-08 09:19:56 -08:00
Dave Airlie
833a33bf6e st/mesa: avoid vertex texture and sampler updates for 0 case
If we had no vertex textures or samplers previously and we have none now,
don't bother doing the enables dance.

I was profiling nexuiz on noop and noticed these two functions in the
profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03%
for texture and samplers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-08 12:12:10 +00:00
Kenneth Graunke
33f4461ec9 i965: Remove broken symlink to intel_decode.c.
Eric removed intel_decode.c in 61b9ccd9e2.
2012-02-07 18:15:44 -08:00
Eric Anholt
7c857a6b15 i965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.
We were doing saturate-based clamping on the [0,width] or [0,height]
coordinate, which meant only the first pixel was addressable.

Fixes piglit ARB_texture_rectangle/texwrap-RECT-bordercolor

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-07 16:03:30 -08:00
Eric Anholt
07e621c523 i965/fs: Move GL_CLAMP handling to coordinate setup.
We should be able to merge self-move instruction into the MRF move
anyway, and this simplifies things for the next commit.

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-07 16:03:30 -08:00
Eric Anholt
94866ffbb8 i965: Fix HiZ change compiler warning. 2012-02-07 16:03:30 -08:00
Chad Versace
7b36c68ba6 i965: Rewrite the HiZ op
The HiZ op was implemented as a meta-op. This patch reimplements it by
emitting a special HiZ batch. This fixes several known bugs, and likely
a lot of undiscovered ones too.

==== Why the HiZ meta-op needed to die ====

The HiZ op was implemented as a meta-op, which caused lots of trouble. All
other meta-ops occur as a result of some GL call (for example, glClear and
glGenerateMipmap), but the HiZ meta-op was special. It was called in
places that Mesa (in particular, the vbo and swrast modules) did not
expect---and were not prepared for---state changes to occur (for example:
glDraw; glCallList; within glBegin/End blocks; and within
swrast_prepare_render as a result of intel_miptree_map).

In an attempt to work around these unexpected state changes, I added two
hooks in i965:
  - A hook for glDraw, located in brw_predraw_resolve_buffers (which is
    called in the glDraw path). This hook detected if a predraw resolve
    meta-op had occurred, and would hackishly repropagate some GL state
    if necessary. This ensured that the meta-op state changes would not
    intefere with the vbo module's subsequent execution of glDraw.
  - A hook for glBegin, implemented by brwPrepareExecBegin. This hook
    resolved all buffers before entering
    a glBegin/End block, thus preventing an infinitely recurring call to
    vbo_exec_FlushVertices. The vbo module calls vbo_exec_FlushVertices to
    flush its vertex queue in response to GL state changes.

Unfortunately, these hooks were not sufficient. The meta-op state changes
still interacted badly with glPopAttrib (as discovered in bug 44927) and
with swrast rendering (as discovered by debugging gen6's swrast fallback
for glBitmap). I expect there are more undiscovered bugs. Rather than play
whack-a-mole in a minefield, the sane approach is to replace the HiZ
meta-op with something safer.

==== How it was killed ====

This patch consists of several logical components:
  1. Rewrite the HiZ op by replacing function gen6_resolve_slice with
     gen6_hiz_exec and gen7_hiz_exec. The new functions do not call
     a meta-op, but instead manually construct and emit a batch to "draw"
     the HiZ op's rectangle primitive. The new functions alter no GL
     state.
  2. Add fields to brw_context::hiz for the new HiZ op.
  3. Emit a workaround flush when toggling 3DSTATE_VS.VsFunctionEnable.
  4. Kill all dead HiZ code:
     - the function gen6_resolve_slice
     - the dirty flag BRW_NEW_HIZ
     - the dead fields in brw_context::hiz
     - the state packet manipulation triggered by the now removed
       brw_context::hiz::op
     - the meta-op workaround in brw_predraw_resolve_buffers (discussed
       above)
     - the meta-op workaround brwPrepareExecBegin (discussed above)

Note: This is a candidate for the 8.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reported-by: xunx.fang@intel.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44927
Reported-by: chao.a.chen@intel.com
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-07 15:15:03 -08:00
Ian Romanick
d59466279e intel: Avoid divide by zero for very small linear blits
If size is small (such as 1),

   pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);

makes pitch = 0.  Then

   height = size / pitch;

causes a division-by-zero exception.  If pitch is zero, set height to
1 and avoid the division.

This fixes piglit's bin/getteximage-formats test and glean's
bufferObject test.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44971
2012-02-07 10:00:32 -08:00
Ian Romanick
65b096aedd intel: Remove num_mapped_regions assertion from _intel_batchbuffer_flush
There are cases where a buffer can be mapped while another buffer is
flushed.  This can happen in the CopyPixels meta-op path for piglit's
fbo-mipmap-copypix.  After some discussion with Eric, it seems this
assertion is no longer necessary, and it has always been too strict.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43328
Cc: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-02-07 10:00:31 -08:00
Tobias Droste
d048ab5558 gallium/gbm: r300 and r600 now depend on libdrm
fixes undefined references in libradeonwinsys.a when linking

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2012-02-07 11:12:09 -05:00
Brian Paul
7335cf1c32 r600g: remove unused vars to silence warnings 2012-02-07 07:48:46 -07:00
Brian Paul
938671397f mesa: remove unused _mesa_error_check_format_type() function
This was only used by glReadPixels and glDrawPixels.  Now those
functions do the corresponding error checks.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:45:40 -07:00
Brian Paul
b8f7eef4ef mesa: stop using _mesa_error_check_format_type() in glReadPixels
Basically the same story as the previous commit.  But we were
already calling _mesa_source_buffer_exists() in ReadPixels().
Yeah, we were calling it twice.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:45:38 -07:00
Brian Paul
6bed7a861d mesa: stop using _mesa_error_check_format_type() in glDrawPixels
The _mesa_error_check_format_type() function does two things: check
that format/type is legal and check that the destination (or source
buffer for glReadPixels) actually exists.  Just move the relevant
parts of that into _mesa_DrawPixels().

We'll do a similar change in glReadPixels then get rid of the function
altogether.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
675d44629c mesa: remove redundant format/type checks in glReadPixels()
These are done in _mesa_error_check_format_and_type().

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
8b3a517673 mesa: remove redundant format/type checks in glGetTexImage()
The _mesa_error_check_format_and_type() function will catch all those
cases now.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Brian Paul
627b435dfe mesa: new _mesa_error_check_format_and_type() function
This replaces the _mesa_is_legal_format_and_type() function.

According to the spec, some invalid format/type combinations to
glDrawPixels, ReadPixels and glTexImage should generate
GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION.

With the old function we didn't make that distinction and generated
GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION.  The new
function returns one of those errors or GL_NO_ERROR.

This will also let us remove some redundant format/type checks in
follow-on commit.

v2: add more checks for ARB_texture_rgb10_a2ui at the top of
_mesa_error_check_format_and_type() per Ian.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-02-07 07:42:33 -07:00
Dave Airlie
699e3b9821 scons: fix typo in package version
pointed out on irc by GArik_

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-07 14:26:48 +00:00
Dave Airlie
ff60bd8058 radeon: only init surface manage on r600
r300 fails to init the manager and then fails to init.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-07 14:20:09 +00:00
José Fonseca
2470e918cc scons: Require same pkg-config versions as configure. 2012-02-07 11:41:08 +00:00
José Fonseca
f763ad5130 scons: r300/r600 now depends on libdrm.
As they now indirectly include on libdrm/radeon_surface.h.
2012-02-07 11:40:58 +00:00
Brian Paul
aed51e3e6a mesa: support more format/type combos in _mesa_dump_image() 2012-02-06 17:56:43 -07:00
Brian Paul
4ab8403c25 util: fix typo in debug_printf_once comment 2012-02-06 17:56:43 -07:00
Jerome Glisse
c0c979eebc r600g: add support for common surface allocator for tiling v13
Tiled surface have all kind of alignment constraint that needs to
be met. Instead of having all this code duplicated btw ddx and
mesa use common code in libdrm_radeon this also ensure that both
ddx and mesa compute those alignment in the same way.

v2 fix evergreen
v3 fix compressed texture and workaround cube texture issue by
   disabling 2D array mode for cubemap (need to check if r7xx and
   newer are also affected by the issue)
v4 fix texture array
v5 fix evergreen and newer, split surface values computation from
   mipmap tree generation so that we can get them directly from the
   ddx
v6 final fix to evergreen tile split value
v7 fix mipmap offset to avoid to use random value, use color view
   depth view to address different layer as hardware is doing some
   magic rotation depending on the layer
v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
   evergreen, align bytes per pixel to a multiple of a dword
v9 fix handling of stencil on evergreen, half fix for compressed
   texture
v10 fix evergreen compressed texture proper support for stencil
    tile split. Fix stencil issue when array mode was clear by
    the kernel, always program stencil bo. On evergreen depth
    buffer bo need to be big enough to hold depth buffer + stencil
    buffer as even with stencil disabled things get written there.
v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
    old ddx overestimate those. Fix linear case when pitch*height < 64.
    Fix r300g.
v12 Fix linear case when pitch*height < 64 for old path, adapt to
    libdrm API change
v13 add libdrm check

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-06 18:36:37 -05:00
Jon TURNEY
8937c166ef Have __glImageSize handle format GL_DEPTH_STENCIL_NV the same way as the server does
There is a mismatch between the way the X server and GLX library
calculates the image size for format GL_DEPTH_STENCIL(|_NV|_EXT)

See https://bugs.freedesktop.org/show_bug.cgi?id=30102

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-02-06 23:00:44 +00:00
Christian König
814be043fa st/vdpau: use dst surface size if clip width/height is zero
Just another fix for gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 21:29:40 +01:00
Christian König
97349dfa79 st/vdpau: implement vlVdpOutputSurfaceQueryCapabilities
Fixing some problems with gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-02-06 21:26:49 +01:00
Christoph Bumiller
189e6c7e81 nv50: fix bad assertion on Elements(phi->src) in regalloc
The array is phi->src, phi->src[i] is just a pointer.
2012-02-06 12:19:57 +01:00
Jon TURNEY
ffc8494db5 dri: Don't build libdricommon.la if we don't need it
Refine 80aa78142d "dri: make sure to build libdricommon.la"
so we don't build libdricommon if we aren't building a dri driver which needs it (i.e.
if we are just building swrast)

In particular, this restores the ability to build the swrast dri driver without having to
have a xf86drm.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-02-06 11:10:51 +00:00
Christian König
9001682846 vl: add VL_MAX_SURFACES define
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
8abbdb8865 vl: rename VL_MAX_PLANES to VL_NUM_COMPONENTS
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
70a7695b4d vl: prefix size defines with VL_
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
3ac959492d vl: remove assert on unknown video profile
It's perfectly valid to ask for an unknown
profile and get unknown code as a result.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
14f47d164d st/xvmc: respect caps when creating video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König
8f54929c5d st/vdpau: use interlacing capabilities
Recreate video buffer if need arises.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
8bfadc802f st/vdpau: implement uploads to interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
f3f03c67e9 vl: add interlacing capabilities
Let the driver control interlaced or progressive
format of video buffers.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König
3841d3fd13 vl: add a simple weave deinterlacer
Well it's not so simple, since it does
deinterlacing and scaling at the same time.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:05 +01:00
Christian König
9f9628c72b vl/video_buffer: fix interlaced surface ordering
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Christian König
4ccae0dfaa vl/video_buffer: fix height of interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Roland Scheidegger
1f4a853b1e mesa: check_index_bounds off-by-one fix
in check_index_bounds the comparison needs to be "greater equal" since
contrary to the name _MaxElement is the count of the array (this matches
similar code in vbo_exec_DrawRangeElementsBaseVertex).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-06 01:04:28 +01:00
Eric Anholt
b3c84a80cd mesa: Fix xcb-dri2 link flags leaking into LIBS.
Fixes the build of builtin_compiler on my 32-bit build where xcb-dri2
is in a custom prefix but the custom prefix flags weren't available.
It shouldn't have been in LIBS anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-04 22:04:35 +01:00
Eugeni Dodonov
84e5f1c635 intel: check for LLC support when reading maps
This checks for advertised LLC support by the GPU instead of relying on
the GPU generation for detection.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-04 18:21:22 -02:00
Eugeni Dodonov
7def293204 intel: verify if hardware has LLC support
Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In
case the libdrm version does not supports this check, fallback to older
way of detecting it which assumed that GPUs newer than GEN6 have it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-04 18:21:22 -02:00
Dave Airlie
fa2a76a21c draw: fix fog coord export.
This does what we do in the hw drivers, and only export the X.

fixes the fogcoord.dp* tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-04 17:50:43 +00:00
Chih-Wei Huang
f8be4f33d3 vbo: fix a building error
Signed-off-by: Marek Olšák <maraeo@gmail.com>

NOTE: This is a candidate for the 8.0 branch.
2012-02-04 08:59:09 +01:00
José Fonseca
8184228e8b llvmpipe: Make more resilient to out-of-memory situations.
Most of the code was alright, but we were missing a few paths.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 18:51:14 +00:00
Keith Whitwell
9a1fd9a37c llvmpipe: clear storage for newly allocated resources
Was previously being done in a state-tracker, but in a way which was
difficult for some drivers to optimize.  Push down to this level and
make it the individual drivers responsibility.
2012-02-03 18:51:14 +00:00
Ian Romanick
87b4c9b322 intel: FBOs with texture border are unsupported
FBOs differ from textures in a significant way.  With textures, we can
strip the border and get correct rendering except when the application
fetches texels outside [0,1].

With an FBO, the pixel at (0,0) is in the border.  The
ARB_framebuffer_object spec says:

    "If the attached image is a texture image, then the window
    coordinates (x[w], y[w]) correspond to the texel (i, j, k), from
    figure 3.10 as follows:

                           i = (x[w] - b)

                           j = (y[w] - b)

                           k = (layer - b)

    where <b> is the texture image's border width..."

Since the border doesn't exist, we can never render any pixels in the
correct location.  Just mark these FBOs FRAMEBUFFER_UNSUPPORTED.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42336
2012-02-03 10:50:01 -07:00
Ville Syrjala
0fcc518964 gallium/dri: Handle xserver that doesn't send needless DRI2 invalidate events
Ever since xserver commit 531869448d07e00ae241120b59f3aaaa5709d59c,
the server no longer sends invalidate events to clients, unless they
have performed a GetBuffers request since the drawable was last
invalidated.

If the drawable gets invalidated immediately after the GetBuffers
request was processed by the X server, it's possible that Xlib
will process the invalidate event while waiting for the GetBuffers
reply. So the server, thinking the client knows that the buffers
are invalid, is waiting for another GetBuffers request before
sending any more invalidate events. The client, on the other hand,
believes the buffers to be valid, and thus is expecting to receive
another invalidate event before it has to send another GetBuffers
request. The end result is that the client never again sends
a GetBuffers request.

To avoid this problem, take a snapshot of the lastStamp before
doing GetBuffers, and retry if the snapshot and the current
lastStamp no longer match after the GetBuffers reply has been
processed.

Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-03 12:02:58 +00:00
Eric Anholt
57e44371a5 glsl: Add error case for switch() with two default cases.
Fixes piglit switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:07:04 +01:00
Eric Anholt
140632190c glsl: Throw an error when faced with a duplicated switch() case label.
The error message I chose matches gcc's error.  Fixes piglit
switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:07:02 +01:00
Eric Anholt
01a5a2c9d7 glsl: Add other missing error location information for switch statements.
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:59 +01:00
Eric Anholt
663dcbbffe glsl: Add missing location info to case labels.
Otherwise, the upcoming error messages said the location was 0:0(0).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:57 +01:00
Eric Anholt
2c3e10e719 glsl: Throw the required error when a case label is a non-constant.
It's not quite spelled out in the spec text, but the grammar indicates
that only constant values are allowed as switch() case labels (and
only constant values make sense, anyway).

Fixes piglit glsl-1.30/compiler/switch-statement/switch-case-uniform-int.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:54 +01:00
Eric Anholt
22d81f154f glsl: Save and restore the whole switch state for nesting.
This stuffs them all in a struct for sanity.  Fixes piglit
glsl-1.30/execution/switch/fs-uniform-nested.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-03 11:06:50 +01:00
Eric Anholt
b8c9252570 dri: Add Unigine Tropics as an app that requires the GLSL warn workaround.
I wasn't seeing it be needed because of the previous bug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-03 09:26:32 +01:00
Eric Anholt
4dd2743d45 dri: Fix typo in xml file that made all applications use the workaround.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-02-03 09:26:23 +01:00
Eric Anholt
27af00eac8 mesa: Fix the error message function names for glFlushMappedBufferRange().
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:05 +01:00
Eric Anholt
f20fb80a91 mesa: Fix bad-enum/no-buffer error handling for buffer object functions.
For all the extension entrypoints using the get_buffer() helper, they
wanted the same error handling.  In some cases, the error was doing
the same error return whether target was a bad enum, or a user buffer
wasn't bound.

(Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero
buffer being bound for MapBufferRange, though it does for
FlushMappedBufferRange.  This appears to be an oversight).

Fixes piglit GL_ARB_copy_buffer/negative-bound-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:02 +01:00
Brian Paul
84a1273e7f glsl: move array_sizing_visitor class outside of link_intrastage_shaders()
To silence warnings with gcc 4.4.x on Linux and llvm-g++ 4.2 on Mac.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 20:10:51 -07:00
Brian Paul
8cbe699c0d gallium/postprocess: move declarations before code
To fix MSVC build.
2012-02-02 15:14:10 -07:00
Lauri Kasanen
81938d2137 gallium/postprocess: Just to be safe, reference all buffers from outside
Even though it should be safe to use them for one frame, better be sure.
Suggested by Michael Dänzer.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:09 -05:00
Lauri Kasanen
c5976017e3 gallium/postprocess: Fix depth logic
This prevents a possible lapse of the depth buffer - the situation where
the app and pp have different depth buffers.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2012-02-02 16:42:06 -05:00
Carl Worth
cd2e2187cb glsl: Avoid ralloc_stealing a long-lived object to a short-lived parent
In commit 6ecee54a9a a call to
talloc_reference was replaced with a call to talloc_steal. This was in
preparation for moving to ralloc which doesn't support reference
counting.

The justification for talloc_steal within token_list_append in that
commit is that the tokens are being copied already. But the copies are
shallow, so this does not work.

Fortunately, the lifetime of these tokens is easy to understand. A
token list for "replacements" is created and stored in a hash table
when a function-like macro is defined. This list will live until the
macro is #undefed (if ever).

Meanwhile, a shallow copy of the list is created when the macro is
used and the list expanded. This copy is short-lived, so is unsuitable
as a new parent.

So we can just let the original, longer-lived owner continue to own
the underlying objects and things will work.

This fixes bug #45082:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth
64fd26a8a8 glsl: Add glcpp tests for a macro used twice
This test cases exposes a bug as described in this bug report:

	"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
	failed." when using a macro in GLSL
	https://bugs.freedesktop.org/show_bug.cgi?id=45082

Clearly, some memory is getting (incorrectly) freed on the first macro
invocation, leading to problems with the second macro invocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Carl Worth
7ab1c7f792 glcpp: Fix so that trailing punctuation does not prevent macro expansion
The trick here is that flex always chooses the rule that matches the most
text. So with a input text of "two:" which we want to be lexed as an
IDENTIFIER token "two" followed by an OTHER token ":" the previous OTHER
rule would match longer as a single token of "two:" which we don't want.

We prevent this by forcing the OTHER pattern to never match any
characters that appear in other constructs, (no letters, numbers, #,
_, whitespace, nor any punctuation that appear in CPP operators).

Fixes bug #44764:

	GLSL preprocessor doesn't replace defines ending with ":"
	https://bugs.freedesktop.org/show_bug.cgi?id=44764

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for stable release branches.
2012-02-02 12:05:21 -08:00
Carl Worth
e931b0e05b glcpp: Add new test showing bug where a trailing ':' prevents macro expansion
This demonstrates a bug that was recently triggered in piglit.

Here is the original bug report (containing a test case almost identical
to this one):

	https://bugs.freedesktop.org/show_bug.cgi?id=44764

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 12:05:21 -08:00
Ian Romanick
2e8f8cb383 mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float
GL_RG_INTEGER only has two components, not three.  I'll be surprised
if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER,
...).  This was found by inspection.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-02-02 10:07:14 -07:00
Ian Romanick
5c341b7df3 mesa: Fix copy-and-paste bug in do_row_3D
Several of the half-float cases used 4 as the texel size when it
should have been some smaller value.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43325
2012-02-02 10:07:14 -07:00
Ian Romanick
660ed923de mesa: Convert colors if span ChanType and renderbuffer data type don't match
This is a partial revert of f9874fe.  It turns out that the types
don't always match.  Specifically, this can happen when doing
glCopyPixels from a float FBO to a RGBA8 FBO.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45429
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:14 -07:00
Ian Romanick
e06b1c65bc mesa: Set the gl_array_object::ARBsemantics flag at the right time
With 0963990 the flag was only set when Bind created the object.  In
all cases where ::ARBsemantics could be true, this path never
happened.  Instead, add a _Used flag to track whether a VAO has ever
been bound.  On the first Bind, set the _Used flag, and set the
ARBsemantics flag to the correct value.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45423
2012-02-02 10:07:14 -07:00
Ian Romanick
af1477b088 mesa: Add unpack_uint_z_row support for floating-point depth buffers
This is a hack, and it will result in incorrect rendering.  However,
it does eliminate spurious warnings in several piglit CopyPixels tests
that involve floating-point depth buffers.

The real solution is to add a zf field to SWspan to store float Z
values.  When a float depth buffer is involved, swrast should also
populate the zf field.  I'll consider this post-8.0 work.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 10:07:01 -07:00
Brian Paul
e20e30b28c Revert "Fix underlinking in libOSMesa since commit adefee5 "Always build shared glapi""
This reverts commit 4e5a8937d1.
... to fix build with --enable-osmesa
2012-02-02 08:17:43 -07:00
José Fonseca
edb1970795 draw: Avoid NULL pointer dereference when binding NULL fragment shaders.
Now that the draw module avoids flushing, it may flush precisely when
binding a NULL shader, so care must be taken when restoring the original
fragment shader.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:30 +00:00
José Fonseca
efd73f72d8 mapi/glapi: Never use a generic no-op entry-point on Windows.
When GLAPIENTRY is __stdcall (ie Windows), the stack is popped by the
callee making the number/type of arguments significant, therefore
using a generic no-op causes stack corruption for many entry-points.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-02 14:45:24 +00:00
ojab
db312b62f2 gallivm: Fix LLVM-2.7 build.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2012-02-02 09:04:10 +00:00
José Fonseca
54fd495c41 gallivm: Remove MSVC RT hack.
The hack never worked reliably, and docs/llvmpipe.html is quite clear on
the requirement of matching CRT when building LLVM and Mesa already.
2012-02-02 09:04:10 +00:00
Anuj Phogat
15986d21eb mesa: fix maximum allowed proxy texture size condition
width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1)

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case: max_values
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-01 18:49:22 -08:00
Zack Rusin
cff0eac702 svga: fix a crash happening before setting fragment shaders.
In certain situations API's will call pipe->clear which doesn't
require fragment shader, but then we'd try to verify the pipeline
and assume fragment shader was always set. This was leading to
crash when API would just call simple clear's before anything else.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 16:34:57 -05:00
Brian Paul
3279561e9a st-api: fix typos, whitespace, line wrapping 2012-02-01 14:02:35 -07:00
Brian Paul
e53557996e vbo: fix node_attrsz[] usage in vbo_bind_vertex_list()
The node_attrsz[] array is initially copied from the node->attrsz[]
array but some values get rewritten.  Thereafter, we need to use the
node_attrsz[] values.

Fixes a bug when replaying a display list that uses generic vertex
array[16] (at least).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-02-01 13:45:09 -07:00
Brian Paul
f09910f399 nv50: add assertions missed in earlier nv50 commit 2012-02-01 08:22:16 -07:00
Colin Walters
0d736b2076 build: Note that we don't support srcdir != builddir
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-01 15:02:29 +00:00
Brian Paul
541bb2e33f nv50: use larger arrays to silence warnings and fix buffer overflows
The warnings were:
nv50_pc_regalloc.c: In function ‘pass_generate_phi_movs’:
nv50_pc_regalloc.c:423:41: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp: In member function ‘bool nv50_ir::MemoryOpt::replaceStFromSt(nv50_ir::Instruction*, nv50_ir::MemoryOpt::Record*)’:
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds
codegen/nv50_ir_peephole.cpp:1475:18: warning: array subscript is above array bounds

And add some assertions to catch this sooner in debug builds.
2012-02-01 07:19:54 -07:00
Brian Paul
a1471e4877 mesa: reference shared state in glPushAttrib(GL_TEXTURE_BIT)
This fixes a dangling texture object pointer bug hit via wglShareLists().
When we push the GL_TEXTURE_BIT state we may push references to the default
texture objects which are owned by the gl_shared_state object.  We don't
want to accidentally delete that shared state while the attribute stack
references shared objects.  So keep a reference to it.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:44 -07:00
Brian Paul
361cd53a77 mesa: use new _mesa_reference_shared_state() function
This cleans up the reference counting of shared context state.
The next patch will use this to fix an actual bug.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-01 07:11:40 -07:00
Brian Paul
133c5727b5 mesa: remove stray comment in PopAttrib() code 2012-02-01 06:52:30 -07:00
Matt Turner
7ef94c6a0b Revert "automake: src/mesa/drivers/osmesa"
This reverts commit 275ac7e5c1.
2012-01-31 21:34:42 -05:00
Matt Turner
a99164956f Revert "automake: src/glsl and src/glsl/glcpp"
This reverts commit 9947656168.
2012-01-31 21:33:59 -05:00
Matt Turner
70dd17152d Revert "src/glsl/glcpp: wire up glcpp-test to make check"
This reverts commit 2bb9f9e1fd.
2012-01-31 21:33:21 -05:00
Matt Turner
8c436b4ea6 Revert "Make sure libGL.so links with libglsl"
This reverts commit f53e7e981e.
2012-01-31 21:33:07 -05:00
Matt Turner
f6cc4347de Revert "glsl: Fix optimization tests after converting src/glsl to automake."
This reverts commit ffe376d5a7.
2012-01-31 21:32:33 -05:00
Marek Olšák
b0337b679a r600g: shorten expressions accessing family and chip_class 2012-01-31 23:28:55 +01:00
Marek Olšák
267bddaacb r300g: don't use pipe_context::winsys 2012-01-31 23:28:50 +01:00
Marek Olšák
38bf276348 r600g: remove unused variable num_dest_buffers 2012-01-31 23:28:42 +01:00
Marek Olšák
f661405637 r600g: use the new code for streamout flush as well 2012-01-31 23:12:31 +01:00
Marek Olšák
70d40fc675 r600g: rename r600_reg::flush_flags -> sbu_flags
There is no other use for that.
2012-01-31 23:12:30 +01:00
Marek Olšák
6d0a011acb r600g: fix computation of how many dwords is needed for a flush at the end of CS 2012-01-31 23:12:30 +01:00
Marek Olšák
1c5625cdb9 r600g: remove unused r600_reg::flush_mask 2012-01-31 23:12:30 +01:00
Marek Olšák
0671400dcc r600g: remove more dead code 2012-01-31 23:12:30 +01:00
Marek Olšák
74027a9ba2 r600g: remove dead code for tracking relocations 2012-01-31 23:12:30 +01:00
Marek Olšák
4fd97b46a0 r600g: remove unused flush code 2012-01-31 23:12:30 +01:00
Marek Olšák
0813e58a3e r600g: rework cache flushing
This also significantly improves the RV670 flush by using the CB1 flush
*always* and also DEST_BASE_0_ENA, which appears to magically fix some tests.
I am not entirely sure, but it's possible that RV670 flushing is fixed
completely.

v2: fix cayman by flushing texture cache instead of vertex cache

Thanks to Dave Airlie for testing Cayman.
2012-01-31 23:12:30 +01:00
Marek Olšák
2fe521fa41 r600g: add a new simple API for state emission 2012-01-31 23:12:30 +01:00
Marek Olšák
621e0db71c r600g: remove redundant pm4 and pm4_cdwords in r600_context
These only mirrored radeon_winsys_cs.
2012-01-31 23:12:30 +01:00
Marek Olšák
3b04671920 r600g: consolidate some context_draw code 2012-01-31 23:12:30 +01:00
Marek Olšák
302862defa r600g: remove the now-useless internal flush callback 2012-01-31 23:12:30 +01:00
Marek Olšák
bc70bcfc69 r600g: don't initialize the screen and winsys pointer twice 2012-01-31 23:12:30 +01:00
Marek Olšák
e4340c1908 r600g: merge r600_context with r600_pipe_context
The split made no sense.
2012-01-31 23:12:30 +01:00
Marek Olšák
78293b99b2 r600g: remove u8,u16,u32,u64 types 2012-01-31 23:12:30 +01:00
Paul Berry
ffe376d5a7 glsl: Fix optimization tests after converting src/glsl to automake.
Commit 99476561 (automake: src/glsl and src/glsl/glcpp) changed the
build system so that src/glsl/glsl_test is not built by default.  This
inadvertently broke "make check", since the tests in
src/glsl/tests/lower_jumps (which are run by "make check") rely on
glsl_test.

This patch ensures that "make check" builds glsl_test before running
any tests.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-31 10:15:08 -08:00
Matt Turner
f53e7e981e Make sure libGL.so links with libglsl
Can't link against *.la files if we're not using libtool to link.

Fixes undefined symbol: _ZN23ir_hierarchical_visitor5visitEP11ir_variable
2012-01-31 12:04:19 -05:00
Christian König
d36f89c8cf vl: fix some missing prototypes error
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45444
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-31 17:12:05 +01:00
Brian Paul
3fc6e4e025 osmesa: set RefCount = 1 in new_osmesa_renderbuffer()
This was lost during the renderbuffer overhaul work.  Fixes a failed
refcount assertion.
2012-01-31 07:44:55 -07:00
Vinson Lee
136791ebc1 osmesa: Fix osmesa_context.DataType type.
Fixes these GCC warnings.
osmesa.c: In function ‘osmesa_renderbuffer_storage’:
osmesa.c:417: warning: comparison is always false due to limited range of data type
osmesa.c:423: warning: comparison is always false due to limited range of data type
osmesa.c:431: warning: comparison is always false due to limited range of data type
osmesa.c:437: warning: comparison is always false due to limited range of data type
osmesa.c:447: warning: comparison is always false due to limited range of data type
osmesa.c:453: warning: comparison is always false due to limited range of data type
osmesa.c:463: warning: comparison is always false due to limited range of data type
osmesa.c:466: warning: comparison is always false due to limited range of data type
osmesa.c:476: warning: comparison is always false due to limited range of data type
osmesa.c:479: warning: comparison is always false due to limited range of data type

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-31 07:43:36 -07:00
Brian Paul
6386f80dbd vega: memset data array to zero to silence uninitialized var warnings 2012-01-31 07:01:29 -07:00
ojab
97329efc5f Initialize only native LLVM Disassembler.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-31 08:11:24 +00:00
Matt Turner
5920f18fae Remove autoreconf generated files
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:10:10 -05:00
Matt Turner
2bb9f9e1fd src/glsl/glcpp: wire up glcpp-test to make check
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:10:03 -05:00
Matt Turner
82060adcde glcpp-test: don't return failure if valgrind tests aren't run
Success was (tests-passed AND valgrind-tests-passed) but this meant that
if the valgrind tests weren't run it would be considered a failure.

The logic is now (tests-passed AND (!valgrind OR valgrind-tests-passed))
which lets us return success if the valgrind tests aren't run.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:57 -05:00
Matt Turner
9947656168 automake: src/glsl and src/glsl/glcpp
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:38 -05:00
Matt Turner
dfb6142548 autoconf: use AC_PROG_YACC/LEX
Needed for automake. Using AC_PROG_PATH(bison/flex) causes automake to
fail to build .y and .l files.

It is up to the builder to use bison/flex instead of yacc/lex.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:32 -05:00
Matt Turner
4ff8fd93e8 glsl: rename Makefile.sources' _SOURCES variables
automake uses variables named *_SOURCES.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-30 21:09:25 -05:00
Matt Turner
275ac7e5c1 automake: src/mesa/drivers/osmesa 2012-01-30 21:09:18 -05:00
Kenneth Graunke
e3b5200496 glsl: Rename class variable_entry to ir_variable_refcount_entry.
Exporting a publicly visible class with a generic name like
"variable_entry" via ir_variable_refcount.h is kind of mean.

Many IR transformers would like to define their own "variable_entry"
class.  If they accidentally include this header, the compiler/linker
may get confused and try to instantiate the wrong variable_entry class,
leading to bizarre runtime crashes.

The hope is that renaming this one will allow .cpp files to safely
declare and use their own file-scope "variable_entry" classes.

This avoids crashes caused by converting src/glsl to automake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 17:44:52 -08:00
Marek Olšák
bed20f02a7 r600g: get rid of r600_context_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:32 +01:00
Marek Olšák
85db520251 r600g: don't use r600_context_reg on r6xx-r7xx
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:30 +01:00
Marek Olšák
b1b969f670 r600g: don't use r600_context_reg on evergreen
Just getting rid of things which use the register mask.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:27 +01:00
Marek Olšák
9344ab382a r600g: get rid of the mask in r600_pipe_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:23 +01:00
Marek Olšák
4a058aebb2 r600g: get rid of the mask parameter in pipe_state_add_reg
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:18 +01:00
Marek Olšák
0569f13d2b r600g: don't use register mask for TA_CNTL_AUX
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:16 +01:00
Marek Olšák
a494301f7f r600g: don't use register mask for PA_CL_CLIP_CNTL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:13 +01:00
Marek Olšák
97acf2ca59 r600g: don't use register mask for PA_CL_VS_OUT_CNTL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:07 +01:00
Marek Olšák
121940ecc7 r600g: set full register mask for PA_CL_CLIP_CNTL
We don't set the other bits anywhere else.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:03 +01:00
Marek Olšák
a652cc40b9 r600g: don't use register mask for PA_SU_SC_MODE_CNTL
It's always emitted in draw_vbo.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:18:00 +01:00
Marek Olšák
2000086fcd r600g: don't add PA_SC_LINE_STIPPLE to rasterizer_state
It's always emitted in draw_vbo.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:56 +01:00
Marek Olšák
84b4b2a8aa r600g: don't use register mask for CB_COLOR_CONTROL on r6xx-r7xx
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:53 +01:00
Marek Olšák
9c0b50ca0b r600g: don't set CB_TARGET_MASK in set_framebuffer_state
It's emitted in draw_vbo, always.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:50 +01:00
Marek Olšák
2ffa8af9db r600g: set full register mask for CB_COLOR_CONTROL on evergreen
We don't set the other bits anywhere else.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:46 +01:00
Marek Olšák
e3032a0523 r600g: use a more clever way to disable per-vertex point size
This uses point size clamping to force point size to a particular value,
making the vertex shader output irrelevant.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:37 +01:00
Marek Olšák
b6233f4d2e r600g: don't use register mask for DB_RENDER_CONTROL
We don't set the other bits anywhere else except the other DSA states,
which are mutually-exclusive with this one.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:32 +01:00
Marek Olšák
3d061caaed r600g: cleanup setting DB_SHADER_CONTROL
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:29 +01:00
Marek Olšák
a2361946e7 r600g: rework and consolidate stencilref state setting
Stop using the register mask.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:17:25 +01:00
Marek Olšák
5345e3ea86 r600g: don't use register mask for SQ_GPR_RESOURCE_MGMT_1
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-31 02:15:51 +01:00
Marek Olšák
177845daa1 st/mesa: kill off point size clamping in vertex shaders
This fixes the gl_PointSize transform feedback test.
Point size clamping should happen at the rasterizer stage,
i.e. after the vertex and geometry shaders and transform feedback.

Drivers are expected to do this by themselves.
2012-01-31 00:54:34 +01:00
Marek Olšák
f183cc9ce3 r600g: set minimum point size to 1.0 for non-sprite non-aa points 2012-01-31 00:54:34 +01:00
Marek Olšák
ac3a765589 r300g: set minimum point size to 1.0 for non-sprite non-aa points 2012-01-31 00:54:34 +01:00
Marek Olšák
cb43954308 svga: set POINTSIZEMIN to 1.0 for non-sprite non-aa points
v2: add the helper function, improve the condition
2012-01-31 00:54:34 +01:00
Marek Olšák
b478fcb9a9 st/mesa: simplify initialization of light_twoside
Core Mesa does this for us, see update_two_size in state.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-31 00:54:34 +01:00
Brian Paul
6e9a1650e5 mesa: consolidate general ubyte texstore code
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Brian Paul
4c7e44e8e6 mesa: use _mesa_pack_ubyte_rgba_rect() in texstore code
Simplifies the general case code in the ubyte-valued texture format
functions.  More consolidation to come in subsequent commits.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Brian Paul
66940ad2d7 mesa: added _mesa_pack_ubyte_rgba_rect()
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-30 13:01:08 -07:00
Eric Anholt
ff2497dca3 dri: Add a default drirc to be installed to provide application workarounds.
Specifially, this being present works around a bug in Unigine
Sanctuary on i965 which previously resulted in bad rendering.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:44:24 -08:00
Eric Anholt
642247883f i965: Add a driconf option to force GLSL extension behavior to "warn".
This can be used to work around broken application behavior, like in
Unigine where it attempts to use texture arrays without declaring
either "#extension GL_EXT_texture_array : enable" or "#version 130".

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:44:11 -08:00
Eric Anholt
b9e27cc142 mesa: Add a flag for forcing all GLSL extensions to "warn".
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:41:49 -08:00
Eric Anholt
61b9ccd9e2 intel: Use libdrm's decode functionality instead of the gpu-tools copy.
While typing out the new decode, I added a fallback mode for dumping
when we fail to re-map the BO after execution.  This should get us a
minimal dump when trying to dump a batch that results in a GPU hang.
2012-01-30 11:32:55 -08:00
Eric Anholt
493faa010d i965: Fix segfault with INTEL_DEBUG=batch on gen7 with samplers present.
This was a leftover from the conversion of this file for state streaming.
2012-01-30 11:32:55 -08:00
Eric Anholt
9195191e50 i965/vs: Avoid allocating registers in to the gen7 MRF hack region.
This is the corresponding fix to the previous one for the FS, but I
don't have a particular test for it.

NOTE: This is a candidate for the 8.0 branch.
2012-01-30 11:32:55 -08:00
Eric Anholt
e910241e97 i965/fs: Fix rendering corruption in unigine tropics.
We were allocating registers into the MRF hack region, resulting in
sparkly renering in a few of the scenes.  We could do better
allocation by making an MRF class, having MRFs conflict with the
corresponding GRFs, and tracking the live intervals of the "MRF"s and
setting up the conflicts.  But this is way easier for the moment.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:32:55 -08:00
Eric Anholt
b9aab8b3b3 autoconf: Enable missing-prototypes errors when available.
After the removal of the dri driver link test, this should help avoid
the original problem that it was designed to catch: The warning about
a missing prototype due to typoing a function name scrolling by in the
Mesa build spew, and you not noticing until you try to run an
application and it falls back to swrast.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-30 11:32:54 -08:00
Matt Turner
ef3cec5804 Rename R300_NO_TCL envvar to RADEON_NO_TCL
The envvar works for R100 and R200 too, and the classic R300 driver
doesn't even exist anymore.

"RADEON_NO_TCL" is already mentioned in the code and is the same envvar
used for the R300g driver.
2012-01-30 14:24:03 -05:00
José Fonseca
647ca47cc3 gallivm: Don't use C99 member initializers. 2012-01-30 19:05:58 +00:00
José Fonseca
dde807b9dc gallivm: Move declaration before code. 2012-01-30 18:59:29 +00:00
ojab
25ee5a27f3 Use only native engine & bitwriter LLVM libraries for linking.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-30 18:51:59 +00:00
Tom Stellard
bc2875aa48 gallivm: Add a new interface for doing TGSI->LLVM conversions
lp_bld_tgsi_soa.c has been adapted to use this new interface, but
lp_bld_tgsi_aos.c has only been partially adapted, since nothing in
gallium currently uses it.

v2:
- Rename lp_bld_tgsi_action.[ch] => lp_bld_tgsi_action.[ch]
- Initialize tgsi_info in lp_bld_tgsi_aos.c
- Fix copyright dates
2012-01-30 13:37:01 -05:00
Tom Stellard
82b71db03d gallium: Move duplicated helper macros to tgsi_exec.h 2012-01-30 13:37:00 -05:00
Tom Stellard
6b63e25b3d gallium: Prefix #defines in tgsi_exec.h with TGSI_ 2012-01-30 13:37:00 -05:00
Tom Stellard
9ee1bcf7a5 gallium: Unify defines of CHAN_[XYZW] in tgsi_exec.h 2012-01-30 13:37:00 -05:00
Tom Stellard
5204974462 gallivm: Add function lp_bld_gather_values() 2012-01-30 13:37:00 -05:00
Tom Stellard
df16945790 tgsi: Add output_mode to struct tgsi_opcode_info v2
v2:
- Rename output_type to output_mode
- Add shorthand definitions for TGSI_OUTPUT_*
2012-01-30 13:37:00 -05:00
Benjamin Franzke
c72d7df168 st/dri: Support 24bit formats in dri2_allocate_buffer
Prior commit 576161289d,
the parameter format was bpp, thus both 24bit and 32bit formats were
requested with format set to 32. Handle 24bit seperately now.

Fixes RGBX formats in wayland platform for egl_dri2 (EGL_ALPHA_SIZE=0).

Note: This is a candidate for the 8.0 branch.
2012-01-30 17:15:44 +01:00
Dave Airlie
fef395c0c3 mesa/format_unpack: add LUMINANCE 8/16 UINT/INT
This just copies what the LUMINANCE_ALPHA bits do.

Fixes piglit tests on softpipe complaining about missing unpack.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 13:55:15 +00:00
Dave Airlie
29cf90b414 r600g: fix udiv/idiv/umod/imod on cayman
Cayman needs some of the MUL instructions spread across a full slot
of vectors.

It also no longer has RECIP_UINT, the recommendation is to replace it
with a U2F + RECIP_IEEE + MUL + F2U.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-30 13:53:15 +00:00
Dave Airlie
a33937d043 r600g: enable blend_bypass for uint/sint 2012-01-30 13:23:07 +00:00
Dave Airlie
cb40165974 r600g: fix fragcoord.w test on cayman 2012-01-30 13:23:07 +00:00
Marek Olšák
f9f8ce3ead r600g: remove unused streamout code 2012-01-30 01:27:25 +01:00
Marek Olšák
ce816dd831 r600g: disable printing debug info for streamout 2012-01-30 01:27:25 +01:00
Brian Paul
c946fc061a gallium: remove trailing comma to silence warning 2012-01-29 15:02:43 -07:00
Juan Zhao
03dae29472 add wayland cflags when building wayland-egl
to fix the header file missing when building wayland-egl
2012-01-29 16:51:27 +01:00
Christoph Bumiller
672ad90f54 nvfx,nv50,nvc0: handle PIPE_CAP_GLSL_FEATURE_LEVEL 2012-01-29 13:24:11 +01:00
Matt Turner
10c85526a2 dri: don't link with DRICORE_LIB_DEPS
DRI_LIB_DEPS is sufficient since it includes DRICORE_LIB_DEPS
2012-01-28 22:02:08 -05:00
Marek Olšák
335d49ef15 scons: don't add -Wmissing-field-initializers
The warning is absolutely useless. It doesn't actually say that there are
uninitialized variables. It points out the fact that there are missing
initializers and that variables are initialized to zero implicitly, which is
exactly what we want and what we commonly make use of.

C90 and C99 require all unspecified variables in the initializer list to be set
to zero.
2012-01-29 02:19:58 +01:00
Marek Olšák
41a4e274a4 st/mesa: use table-driven approach to exposing extensions for formats (v3)
The check for ctx->API was unnecessary, because OES extensions are not exposed
in desktop GL.

Also require renderbuffer support for ARB_texture_rgb10_a2ui,
as per the spec.

Tested by comparing old and new glxinfo with softpipe and r600g.

v2: fix bugs
v3: rename need_only_one -> need_at_least_one
    rename num_elements -> num_mappings
    add comments
    use const when appropriate

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-29 02:19:58 +01:00
Marek Olšák
c21d7b1e30 st/mesa: use table-driven approach to exposing extensions based on CAPs
This change is not exactly equivalent (sometimes we checked for non-zero,
sometimes if >0 or >1), but the behavior shouldn't change, because all drivers
report 0 for unsupported CAPs.

Exposing CAP_STREAM_OUTPUT_PAUSE_RESUME without CAP_MAX_STREAM_OUTPUT_BUFFERS
is a driver bug and st/mesa does no checking if the latter is supported as
well. Drivers must report CAPs consistently.

v2: make the array const
2012-01-29 02:19:57 +01:00
Marek Olšák
171be75522 st/mesa: add PIPE_CAP_GLSL_FEATURE_LEVEL, cleanup st_extensions.c
v2: handle the cap in r300 and r600 as well

Additional info for r600g:
   The env var R600_GLSL130=1 enables GLSL 1.3.
   Along with R600_STREAMOUT=1, it enables full GL 3.
2012-01-29 02:16:00 +01:00
Mathias Fröhlich
1d01429c6a state_stracker: Fix access to uninitialized memory.
Fix an access to uninitialized memory pointed out by valgrind in
glsl_to_tgsi_visitor::simplify_cmp(void).

Note: This is a candidate for the 8.0 branch.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2012-01-29 00:15:48 +01:00
Vinson Lee
743432039c draw: Remove unused variables.
Fix this GCC warning.
draw_pipe_clip.c: In function ‘interp’:
draw_pipe_clip.c:122:13: warning: variable ‘clip_dist’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-28 11:22:48 -08:00
Vadim Girlin
1a9d2b7642 r600g: fix linear and flat interpolation
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-28 16:20:37 +00:00
Yuanhan Liu
eaf360e5bf i965: fix inverted point sprite origin when rendering to FBO
When rendering to FBO, rendering is inverted. At the same time, we would
also make sure the point sprite origin is inverted. Or, we will get an
inverted result correspoinding to rendering to the default winsys FBO.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44613

NOTE: This is a candidate for stable release branches.

v2: add the simliar logic to ivb, too (comments from Ian)
    simplify the logic operation (comments from Brian)

v3: pick a better comment from Eric
    use != for the logic instead of ^ (comments from Ian)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-28 09:59:13 +08:00
Brian Paul
d250287d53 mesa: remove byteswap check in fast_read_rgba_pixels_memcpy()
It's handled by _mesa_format_matches_format_and_type() now.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
07ff5adc32 mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb9_e5, r11_g11_b10f, argb2101010_uint functions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
6f55ef3740 mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb332, signed rgba8888, signed rgba888_rev functions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:46 -07:00
Brian Paul
453d4b40bc mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgba5551, argb1555, argb2101010 formats.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
f6af4c511f mesa: more use of _mesa_format_matches_format_and_type() in texstore code
For rgb565, argb8888, rgb888, argb4444 functions.
2012-01-27 18:21:45 -07:00
Brian Paul
b27792335e mesa: use _mesa_format_matches_format_and_type() in texstore code
This simplifies the code quite a bit, consolidates some cases and
possibly catches more cases for the memcpy path.

More such changes will follow.  Do just a few at a time to help bisect
any possible regressions.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
94a0d38c24 mesa: implement more cases in _mesa_format_matches_format_and_type()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:45 -07:00
Brian Paul
51aab798a3 mesa: use swapBytes parameter in _mesa_format_matches_format_and_type()
This will let us use memcpy in more situations.  We can also remove
the checks for byte spapping that happen before the calls to
_mesa_format_matches_format_and_type().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
06aa607ba7 mesa: added swapBytes parameter to _mesa_format_matches_format_and_type()
Not actually used yet though.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
952ca07852 mesa: rewrite, simplify some of the logic in _mesa_format_matches_format_and_type()
In preparation for adding GL_PACK/UNPACK_SWAP_BYTES support.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:44 -07:00
Brian Paul
966720f507 mesa: add BGR888 code in _mesa_format_matches_format_and_type()
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
b019228d6b mesa: fix error in _mesa_format_matches_format_and_type() for RGB888
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
370e5d2106 mesa: remove redundant byte swap check
The outer conditional already did the test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Brian Paul
343100d1fc mesa: remove LSB-first pixel packing check in glReadPixels
GL_UNPACK_LSB_FIRST only applies to bitmap data, not glReadPixels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 18:21:43 -07:00
Chad Versace
ab1195cf11 swrast: Fix implicit declaration warnings
In a recent commit,
    commit 1c0f1dd42a
    Author: Chad Versace <chad.versace@linux.intel.com>
    swrast: Fix fixed-function fragment processing
I defined a new function,_swrast_fragment_program, but neglected
to #include s_fragprog.h for clients of that function.

Note: This is a candidate for the 8.0 branch.
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-27 16:53:51 -08:00
Alex Deucher
b8f7550a31 r600g: remove unsupported evergreen CB formats
The evergreen+ CB no longer supports the following formats
compared to 6xx/7xx:
- COLOR_4_4
- COLOR_3_3_2
- COLOR_6_5_5
- COLOR_8_24_FLOAT
- COLOR_24_8_FLOAT
- COLOR_11_11_10
- COLOR_11_11_10_FLOAT

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-27 18:46:03 -05:00
José Fonseca
3409118371 mesa: Avoid void * arithmetic.
Should fix MSVC build.
2012-01-27 21:54:12 +00:00
Chad Versace
1c0f1dd42a swrast: Fix fixed-function fragment processing
On i965, _mesa_ir_link_shader is never called. As a consequence, the
current fragment program (ctx->FragmentProgram->_Current) exists but is
invalid because it has no instructions. Yet swrast continued to attempt to
use the empty program.

To avoid using the empty program, this patch 1) defines a new function,
_swrast_use_fragment_program, which checks if the current fragment program
exists and differs from the fixed function fragment program, and, when
appropriate, 2) replaces checks of the form
    if (ctx->FragmentProgram->_Current == NULL)
with
    if (_swrast_use_fragment_program(ctx))

Fixes the following oglconform regressions on i965/gen6:
    api-fogcoord(basic.allCases.log)
    api-mtexcoord(basic.allCases.log)
    api-seccolor(basic.allCases.log)
    api-texcoord(basic.allCases.log)
    blend-separate(basic.allCases)
    colorsum(basic.allCases.log)

The tests were ran with the GLXFBConfig:
    visual  x   bf lv rg d st  colorbuffer  sr ax dp st accumbuffer ms  cav
  id dep cl sp  sz l  ci b ro  r  g  b  a F gb bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------------
0x021 24 tc  0  32  0 r  y .   8  8  8  8 .  .  0 24 8  0  0  0  0  0 0 None

(Note: I originally believed that the hunk in
_swrast_update_fragment_program was unnecessary. But it is required to fix
blend-separate.)

Note: This is a candidate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reveiwed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-27 13:34:26 -08:00
Anuj Phogat
5665b5cc31 mesa: set clamp bit in glGetTexImage for GL_UNSIGNED_NORMALIZED
Color clamping should be enabled in glGetTexImage if texture dataType is
GL_UNSIGNED_NORMALIZED and format is GL_LUMINANCE or GL_LUMINANCE_ALPHA

Fixes 2 Intel oglconform test cases: pxconv-gettex and pxtrans-gettex
https://bugs.freedesktop.org/show_bug.cgi?id=40864

NOTE: This is a candidate for the 8.0 branch

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 13:22:52 -08:00
Eric Anholt
5f65598cc7 mesa: Don't round-trip integer texture data through a floating point temp.
This was losing bits of precision.  Fixes (with the previous commits):
piglit EXT_texture_integer/getteximage-clamping
piglit EXT_texture_integer/getteximage-clamping GL_ARB_texture_rg
oglc advanced.mipmap.upload

Regresses oglc negative.typeFormatMismatch.teximage from fail to
abort, because it's been hitting texstore for a format/type combo that
shouldn't happen.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:13 -08:00
Eric Anholt
dadbec1e90 mesa: When unpacking signed integer pixel data, don't clamp to 0.
In the core, we always treat spans of int/uint data as uint, so this
extract function was truncating storage of integer pixel data to a n
int texture to (0, max_int) instead of (min_int, max_int).  There is
probably missing code for handling truncation on conversion between
pixel formats, still, but this does improve things.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:11 -08:00
Eric Anholt
8b97bb02fb mesa: Add clamping for packing of integer data.
Mostly fixes piglit EXT_texture_integer/getteximage-clamping.  The
remaining failure involves precision loss on storing of int32 texture
data (something I knew was an issue, but wasn't trying to test).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:01:08 -08:00
Eric Anholt
de24ccabd6 mesa: Add missing format unpack for some integer texture formats.
This cut and paste is pretty awful.  I'm tempted to do a lot of this
using preprocessor tricks for customizing the parameter type from a
template function, but that's just a different sort of hideous.

Fixes 8 Intel oglconform int-textures cases.

NOTE: This is a candidate for the 8.0 branch.
v2: Add alpha formats, too.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 12:00:46 -08:00
Eric Anholt
3a8cf3357a i965: Don't allow rendering to non-GL_RED/RG/RGBA integer textures.
Fixes piglit EXT_texture_integer/fbo-blending.
2012-01-27 11:46:10 -08:00
Eric Anholt
796f44d779 intel: Pass the gl_renderbuffer to render_target_supported() vtable method.
I'm going to want to go looking at it for an integer texture fix.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
7cac88679b intel: Make a renderbuffer wrapping a texture have the same _BaseFormat.
Otherwise, when you asked for the _BaseFormat of an rb wrapping a
GL_RGB texture, you got GL_RGBA because that's what we were storing
the texture data as.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
b73f5df648 intel: Simplify intel_renderbuffer_update_wrapper() by passing in the image.
NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:10 -08:00
Eric Anholt
74484c5d41 intel: Drop intel_wrap_miptree().
Most of this function was just calling
intel_renderbuffer_update_wrapper(), which was called immediately
afterwards in the only caller.

NOTE: This is a candidate for the 8.0 branch.
2012-01-27 11:46:09 -08:00
Eric Anholt
a4586d2e2e intel: Comment typo fix. 2012-01-27 11:46:09 -08:00
Eric Anholt
531e44415b mesa: Fix handling of glCopyBufferSubData() for src == dst.
Fixes piglit ARB_copy_buffer-overlap, on swrast, which previously
assertion failed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 11:44:31 -08:00
Eric Anholt
42e9936ce6 intel: Fix accum buffer mapping since the swrast rework.
A pure swrast-allocated buffer gets an irb of NULL, so we segfaulted
in the clear-accum test.  Just look at the swrast renderbuffer pointer
for handling swrast rbs.
2012-01-27 11:28:16 -08:00
Eric Anholt
3d8c27f882 mesa: Fix display list handling for GL_EXT_framebuffer_multisample.
From the extension spec:

    Added to section 5.4, as part of the discussion of which commands
    are not compiled into display lists:

    "Certain commands, when called while compiling a display list, are
    not compiled into the display list but are executed immediately.
    These are: ..., RenderbufferStorageMultisampleEXT..."

Fixes piglit EXT_framebuffer_multisample/dlist.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 11:28:15 -08:00
Eric Anholt
25dd80555d mesa: Fix display list handling for EXT_framebuffer_object.
Noticed when handling a similar problem in EXT_framebuffer_multisample.

From the EXT_framebuffer_object spec:

    Added to section 5.4, as part of the discussion of which commands
    are not compiled into display lists:

    "Certain commands, when called while compiling a display list, are
    not compiled into the display list but are executed immediately.
    These are: ..., GenFramebuffersEXT, BindFramebufferEXT,
    DeleteFramebuffersEXT, CheckFramebufferStatusEXT,
    GenRenderbuffersEXT, BindRenderbufferEXT, DeleteRenderbuffersEXT,
    RenderbufferStorageEXT, FramebufferTexture1DEXT,
    FramebufferTexture2DEXT, FramebufferTexture3DEXT,
    FramebufferRenderbufferEXT, GenerateMipmapEXT..."

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 11:28:15 -08:00
Brian Paul
8b3c99a5eb gallivm: Swizzle constants into the right AoS ordering.
Constants array is always assumed to be RGBA, which means we need to
swizzle the constant elements into place to match the AoS ordering
(e.g., BGRA) that was passed to lp_build_tgsi_aos().

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-27 18:25:32 +00:00
José Fonseca
07635a4799 draw: Ensure that prepare is always run after LLVM garbagge collection.
Should avoid dangling pointer derreference with

  glean --run results --overwrite --quick --tests texSwizzle

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-27 18:24:14 +00:00
Jeremy Huddleston
b728eefb06 configure.ac: Don't use $CLANG since it will collide with the static analyzer.
We just prefix the $CLANG environment variable in configure.ac with acv_mesa_

Found by: tinderbox
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-27 09:04:13 -08:00
Marek Olšák
3d993aff25 Revert "r600g: use S_028B20_BUFFER_0_EN macro for streamout buffer enable"
This reverts commit d6cd514edb.

It broke multiple streamout buffers, because it only enabled the first one.
2012-01-27 17:49:41 +01:00
Matt Turner
9895f77249 i965/automake: use $top_srcdir instead of relative links
Fixes out-of-tree builds.
2012-01-27 00:35:10 -05:00
Matt Turner
64afb575b0 dri common: add .gitignore 2012-01-27 00:16:33 -05:00
Matt Turner
0c17823167 configure.ac: remove shared/static options
now that libtool provides them.
2012-01-26 19:36:52 -05:00
Matt Turner
80aa78142d dri: make sure to build libdricommon.la 2012-01-26 19:32:16 -05:00
Eric Anholt
c885039442 i965: Drop the missing symbols link test.
This was horribly broken and has cost everyone more time than we were
ever going to save using it.  It might have been fixable, but the
problem it was originally trying to solve can be better solved with
-Werror=missing-prototypes and -Werror=implicit-function-declaration.

Also, it was always producing a big scary warning about how the link
test was non-portable.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44928
2012-01-26 16:14:55 -08:00
Eric Anholt
1237a56916 nouveau: Fix missing dri common symbols after automake conversion. 2012-01-26 16:14:35 -08:00
Eric Anholt
5fa27eafc8 radeon: Fix missing dri common symbols after automake conversion.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 16:14:32 -08:00
Eric Anholt
45389caf05 dri: Move the compile of the common files to a convenience library.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 16:14:22 -08:00
Eric Anholt
29ea1c4461 i915: Fix driver after automakeification. 2012-01-26 16:13:39 -08:00
Kenneth Graunke
259b65e2e7 i965/vs: Use the sampler for VS pull constant loading on Ivybridge.
Substantially increases performance in GLBenchmark PRO:
- 320x240   => 3.28x
- 1920x1080 => 1.47x
- 2560x1440 => 1.27x

The LD message ignores the sampler unit index and SAMPLER_STATE pointer,
instead relying on hard-wired default state.  Thus, there's no need to
worry about running out of sampler units or providing SAMPLER_STATE;
this small patch should be all that's required.

NOTE: This is a candidate for release branches.
      (It requires the preceding commit to compile.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-26 23:53:54 -08:00
Kenneth Graunke
5f4575d42f i965: Expose brw_set_sampler_message for use outside brw_eu_emit.c.
brw_SAMPLE is full of complex workarounds for original Broadwater
hardware, and I'd rather avoid all that for my next Ivybridge patch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-26 23:53:46 -08:00
Brian Paul
04341e51ce svga: reset vertex buffer offset in svga_release_user_upl_buffers()
This function releases the buffer that contains user-space vertex data.
The buffer_offset field points into that buffer.  So reset the
buffer_offset to zero when we release the buffer so that subsequent
draws don't inadvertantly get a bad offset.

Fixes error messages / failed assertions (in the draw module's bounds/size
checking code) when running piglit's polygon-mode test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-26 11:38:30 -07:00
José Fonseca
6549e721ad mapi: Make initMagic unsigned.
To avoid signed/unsigned comparison warnings against INIT_MAGIC
0xff8adc98, which doesn't fit on signed integers.
2012-01-26 17:33:33 +00:00
José Fonseca
1d1033926d scons: Remove references to u_thread.c
For future reference: always run "git grep" on refactorings.
2012-01-26 17:29:38 +00:00
Matt Turner
b7a81b6e51 Fix visibility of u_thread functions by inlining them
-fvisibility=hidden was preventing them from being exported, which
combined with shared-glapi was causing undefined symbol errors at
runtime.

We don't want to make these functions part of the ABI, and given
how simple they are, we simply inline them.
2012-01-26 12:05:33 -05:00
Brian Paul
0a966a686e nouveau: include s_context.h to silence missing prototype warnings 2012-01-26 08:16:54 -07:00
Brian Paul
88e7f56dd7 swrast: silence uninitialized var warnings 2012-01-26 08:16:33 -07:00
Lucas Stach
5ce7418739 nvfx: fix nv3x fallout from state validation changes
From c998f732d42da5e962fe5da294493132c3e8dc5f Mon Sep 17 00:00:00 2001
From: Lucas Stach <dev@lynxeye.de>
Date: Tue, 24 Jan 2012 09:46:32 +0100
Subject: [PATCH] nvfx: fix nv3x fallout from state validation changes

Apparently nv3x needs some curde hacks to work properly. This
is clearly not the right fix, but it's the behaviour of the old
code and fixes regressions seen by users.
2012-01-26 14:15:29 +01:00
Benjamin Franzke
1b417e1767 gbm: Add back link flags for udev, dl and glapi
They were left out when migrating to automake.
2012-01-26 13:23:25 +01:00
Benjamin Franzke
412042523e configure: Use WAYLAND_SCANNER_RULES only if available
This has the drawback that when creating configure for
distribution, wayland needs to be available for the packager.

Also the the macros has the wayland prefix hardcoded, so
we cant copy it in mesa right now.
2012-01-26 11:49:47 +01:00
Jakob Bornecrantz
b6d3a435a0 draw: Only run prepare when state, prim and opt changes
In bad applications like ipers which does a lot of draw calls with
no state changes this helps to greatly reduce time spent in prepare.
In ipers around 7% of CPU was spent in various prepare functions,
after this commit no prepare function show on the profile.

This commit also has the added benefit of now grouping all pipelined
drawing into a single draw call if the driver uses vbuf_render.

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:46 -08:00
Jakob Bornecrantz
eb65ccbc21 draw: Don't revalidate pipeline on backend flushes
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:40 -08:00
Jakob Bornecrantz
4a79545bdf draw: Remove reduced_prim
Conflicts:

	src/gallium/auxiliary/draw/draw_context.c

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
2012-01-26 01:38:36 -08:00
Benjamin Franzke
8b902056d5 automake: src/egl/wayland
So we can use the wayland scanner makro, which is way
better than our previous runtime-pkgconfig hack.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-26 10:07:11 +01:00
Paul Berry
dc435ae774 i965/gen6/GT1: Increase max_vs_entries to 256.
Previously, max_vs_entries was set to 128 for GT1, and 256 for GT2,
based on the PRM (see Vol2, part1, p28).  However, Bspec section 1.6.5
indicates that the maximum number of VS entries is 256 for GT1.

No piglit regressions on GT1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-25 09:43:14 -08:00
Paul Berry
6bc08ee569 i965/gen6: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.
When storing data in a buffer of type DYNAMIC_DRAW, we don't create a
drm_intel_bo for it; instead we store the data in system memory and
defer allocation of the GPU buffer until it is needed.  Therefore, in
brw_update_sol_surface(), we can't just consult the "buffer" field of
the intel_buffer_object structure; we need to call
intel_bufferobj_buffer() to ensure that the deferred allocation
occurs.

This parallels a similar fix for gen7 (see commit ba6f4c9).

Fixes piglit test EXT_transform_feedback/buffer-usage on gen6.

This is a candidate for the 8.0 release branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-25 09:42:49 -08:00
Ander Conselvan de Oliveira
33f8a3cfbe gbm: fix copy & paste error in gbm_bo_get_handle documentation 2012-01-25 12:21:37 -05:00
José Fonseca
4ac37b0b81 mesa/st: Assign inputsRead at right (previous) location.
Fixes the

  src/mesa/state_tracker/st_glsl_to_tgsi.cpp:4032:src_register: Assertion `t->inputMapping[index] < (sizeof(t->inputs)/sizeof(*(t->inputs)))' failed.

assertion failure introduced in 697b9945fb
2012-01-25 13:48:18 +00:00
Marek Olšák
69c8f468ba mesa: remove ctx->Const.sRGBCapable
It always had the same value as ctx->Extensions.EXT_framebuffer_sRGB.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-25 12:35:37 +01:00
Marek Olšák
8ec05f06cb r600g: handle start_component from stream_output_info when possible 2012-01-25 12:35:20 +01:00
Marek Olšák
15146fd1bc r600g: don't expose transform_feedback2 without kernel support 2012-01-25 12:35:19 +01:00
Marek Olšák
3363e87d7d mesa: allow exposing GL3 without EXT_texture_integer
Strictly speaking, it's not legal to expose EXT_texture_integer without
EXT_gpu_shader4. It might be even dangerous (apps can assume EXT_gpu_shader4
is available without checking for it).

The check in compute_version is removed as well, because that's already
covered by GLSLVersion >= 130.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
636802f615 mesa: add missing integer alpha formats to _mesa_base_fbo_format
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
0cf0418363 st/mesa: require all s3tc formats for EXT_texture_compression_s3tc
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
925fd2e1dd st/mesa: simplify enabling EXT_packed_depth_stencil and ARB_fbo
- use OR to combine bind flags
- combine both conditionals into one
- move the ARB_fbo enable where it belongs

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 12:35:19 +01:00
Marek Olšák
95dab55751 mesa: remove obsolete comment in version.c
Pointed out by Brian Paul.
2012-01-25 12:35:19 +01:00
Marek Olšák
fc878cf7a4 gallium/docs: document more CAPs 2012-01-25 12:35:19 +01:00
Marek Olšák
c2b800cf38 r600g: nuke the fallback for vertex and fragment color clamping 2012-01-25 12:35:19 +01:00
Marek Olšák
7023ed9e62 r300g: nuke the fallback for fragment color clamping 2012-01-25 12:35:19 +01:00
Marek Olšák
697b9945fb st/mesa: inline if(1) conditional
v2: fix typo
2012-01-25 12:35:18 +01:00
Marek Olšák
732f69c94e st/mesa: move fragment shader tgsi tokens into st_fp_variant
The TGSI code may vary depending on the clamp_color bit.
2012-01-25 12:35:18 +01:00
Marek Olšák
bc1c836938 st/mesa: do vertex and fragment color clamping in shaders
For ARB_color_buffer_float. Most hardware can't do it and st/mesa is
the perfect place for a fallback.
The exceptions are:
- r500 (vertex clamp only)
- nv50 (both)
- nvc0 (both)
- softpipe (both)

We also have to take into account that r300 can do CLAMPED vertex colors only,
while r600 can do UNCLAMPED vertex colors only. The difference can be expressed
with the two new CAPs.
2012-01-25 12:35:18 +01:00
Christian König
c2e2b58a58 st/xvmc: remove xorg-server dependency
Fixing a circular build dependency.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-25 10:34:26 +01:00
Benjamin Franzke
36fb83e4a8 st/mesa: Fix recurring surfaceless contexts
A current incomplete framebuffer was incorrectly used as a
st_framebuffer. When accessing st_framebuffer childs bad things happen:
e.g. st_framebuffer::iface was used to check whether its an incomplete
fb, instead we need to compare st_framebuffer::Base against
mesa_get_incomplete_framebuffer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44919
Note: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-25 10:12:09 +01:00
Eric Anholt
422b18794e mesa: Fix CopyTex{Sub,}Image error checks for integer vs non-integer.
Fixes Intel oglconform negative.typeFormatMismatch.copyteximage.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
ee9804af14 mesa: Add missing integer R/RG cases to _mesa_is_color_format().
This is part of fixing Intel oglconform
negative.typeFormatMismatch.copyteximage.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
6bf0f6ae86 meta: Detect currently-unsupported integer CopyTexSubImage and complain.
This code is unprepared for handling integer (particularly, the
baseFormat of the TexFormat comes out as GL_RGBA, not GL_RGBA_INTEGER,
so the direct call of Driver.ReadPixels crashes due to the int vs
non-int error checking not having happened).  I'm frankly tempted to
convert this code to MapRenderbuffer/MapTexImage rather than doing it
as meta ops, now that we have that support.

Improves the remaining crash in Intel oglconform for int-textures to
just a rendering failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:37:10 -08:00
Eric Anholt
d6c58545a1 mesa: Add the remaining from/to types for GL_EXT_texture_integer (and R/RG).
This aborts and crashes in intel oglconform's int-textures into being
just rendering failures.  Clamping isn't handled yet.

v2: Add missing "break".
v3: Drop the int/uint distinction, since they don't need different clamping.
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com> (v2)
2012-01-24 16:35:47 -08:00
Eric Anholt
08acd4bd61 mesa: Add support for glGetTexImage on GL_TEXTURE_1D_ARRAY
Similarly to how we handle this in texstore, we have to remap height
to depth so that we MapTextureImage each image layer individually.

Fixes part of Intel oglconform's int-textures advanced.fbo.rtt

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:34:02 -08:00
Eric Anholt
86ca4f9cb6 mesa: s/GLuint col/GLint col/ to avoid signed/unsigned comparison warnings.
Suggested-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:23:22 -08:00
Eric Anholt
9f1e64d085 mesa: Add support for glGetTexImage() from integer textures.
This is a step toward fixing Intel oglconform's
int-textures advanced.fbo.rtt.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 16:23:22 -08:00
Eric Anholt
f6e82cd2a1 i965/gen6+: Work around GPU hangs with logic ops on integer textures.
This doesn't result in correct rendering -- GL requires that logic ops
work, while the hardware specs say it doesn't do them.  I'm not sure
how we would want to handle this.

NOTE: This is a candidate for the 8.0 branch.
2012-01-24 16:20:21 -08:00
Eric Anholt
04b4880d7c i965/gen6+: Disable blending, alpha test, and dither on integer FBOs.
Fixes GPU hangs and some rendering failures in piglit
EXT_texture_integer/fbo-blending

NOTE: This is a candidate for the 8.0 branch.
2012-01-24 16:00:04 -08:00
Brian Paul
4a1c660599 mesa/gdi: remove wmesa_set_renderbuffer_funcs() function
The code is no longer relevant.
Note: this driver is probably broken now.  There's no implementation
of ctx->Driver.Map/UnmapRenderbuffer().
2012-01-24 15:13:20 -07:00
Brian Paul
a9bf149e7f dri/swrast: remove obsolete swrast_span.c file from source list 2012-01-24 15:08:20 -07:00
Brian Paul
ba151a333b swrast: fix uninitialized variable warning 2012-01-24 14:12:39 -07:00
Brian Paul
cf386f0a2b swrast: make rowStride variable signed in put_z32_values()
As with commit aed5c8299f
2012-01-24 14:12:38 -07:00
Brian Paul
89bb19adb0 intel: use swrast code to map/unmap renderbuffers for swrast rendering 2012-01-24 14:12:38 -07:00
Brian Paul
4baf90353d mesa: update comments, fix whitespace in dd.h 2012-01-24 14:12:38 -07:00
Brian Paul
9403cc3aba swrast: remove unused StoreTexel code
No longer needed since we do all rendering to texture with the buffer
mapping and pixel packing functions.
2012-01-24 14:12:37 -07:00
Brian Paul
1caf698191 swrast: use Map/UnmapTextureImage() in framebuffer map/unmap code
When we're actually rendering into a texture, map the texture image
instead of the corresponding renderbuffer.  Before, we just copied
a pointer from the texture image to the renderbuffer.  This change
will make the code usable by hardware drivers.
2012-01-24 14:12:37 -07:00
Brian Paul
56d83ac4bf mesa: remove ctx->Driver.Map/UnmapTexture() hooks
No longer used anywhere.
2012-01-24 14:12:37 -07:00
Brian Paul
8b8a54afd9 nouveau: stop calling ctx->Driver.Map/UnmapTexture()
And remove unused nouveau_texture_map/unmap()
2012-01-24 14:12:36 -07:00
Brian Paul
4bbab2275f tnl: remove ctx->Driver.Map/UnmapTexture() calls
ctx->Driver.MapTexture() always points to _swrast_map_texture().
We're already reaching into swrast from t_vb_program.c anyway.
This will let us remove the ctx->Driver.Map/UnmapTexture() functions.
2012-01-24 14:12:36 -07:00
Brian Paul
bde356a158 swrast: move some renderbuffer functions to s_renderbuffer.c 2012-01-24 14:12:35 -07:00
Brian Paul
1839a7fc9f intel: remove intel_span_supports_format()
It always returned True.
2012-01-24 14:12:34 -07:00
Brian Paul
6c1e27ba21 swrast: remove a few extra _mesa_get_format_bytes() calls 2012-01-24 14:12:34 -07:00
Brian Paul
1da7d6c919 mesa: update comments for gl_renderbuffer 2012-01-24 14:12:33 -07:00
Brian Paul
1888dd52a3 mesa/swrast/drivers: remove obsolete gl_renderbuffer fields
This removes the last of the legacy fields from gl_renderbuffer.
2012-01-24 14:12:33 -07:00
Brian Paul
becbb64313 dri/swrast: use swrast_renderbuffer type 2012-01-24 14:12:33 -07:00
Brian Paul
0c1862851f swrast: use swrast_renderbuffer instead of gl_renderbuffer 2012-01-24 14:12:32 -07:00
Brian Paul
797c18be1f osmesa: use swrast_renderbuffer 2012-01-24 14:12:32 -07:00
Brian Paul
c080202db5 radeon: derive radeon_renderbuffer from swrast_renderbuffer 2012-01-24 14:12:31 -07:00
Brian Paul
9f8ed9d662 intel: derive intel_renderbuffer from swrast_renderbuffer
Drivers that rely on swrast need to do this, as with swrast_texture_image.
2012-01-24 14:12:31 -07:00
Brian Paul
d16e71eeb4 xlib: derive xmesa_renderbuffer from swrast_renderbuffer 2012-01-24 14:12:31 -07:00
Brian Paul
f2479530b8 swrast: allocate swrast_renderbuffers instead of gl_renderbuffers 2012-01-24 14:12:30 -07:00
Brian Paul
34988272d9 swrast: new swrast_renderbuffer type
This will let us move the swrast-specific fields out of gl_renderbuffer.
2012-01-24 14:12:30 -07:00
Brian Paul
924de7dc96 intel: use intel_rb_format() to get renderbuffer format
This will make future changes cleaner and less invasive.
2012-01-24 14:12:29 -07:00
Brian Paul
1048d55d5f dri/swrast: rename swrast_renderbuffer to dri_swrast_renderbuffer
To prevent name collision with future swrast_renderbuffer in the swrast
module.
2012-01-24 14:12:29 -07:00
Brian Paul
c45771905f swrast: use stencil packing function in s_stencil.c 2012-01-24 14:12:28 -07:00
Brian Paul
881ef2a9db swrast: use color packing functions in s_span.c 2012-01-24 14:12:28 -07:00
Brian Paul
8696a52102 swrast: remove s_spantemp.h 2012-01-24 14:12:27 -07:00
Brian Paul
b0f0d7a811 xlib: remove xm_span.c and related code 2012-01-24 14:12:27 -07:00
Brian Paul
59a5b5a193 mesa: remove gl_renderbuffer::Wrapped
There's no such thing as renderbuffer wrappers anymore.
2012-01-24 14:12:27 -07:00
Brian Paul
ab331140c6 swrast: rewrite, simplify the the render-to-texture code 2012-01-24 14:12:26 -07:00
Brian Paul
7a36345f70 mesa: rename gl_renderbuffer::Data to Buffer
To better indicate that this pointer to the malloc'd memory.
2012-01-24 14:12:26 -07:00
Brian Paul
f6a3979a04 mesa: move freeing of software renderbuffers into swrast 2012-01-24 14:12:25 -07:00
Brian Paul
f9874feef4 mesa: remove gl_renderbuffer::DataType 2012-01-24 14:12:24 -07:00
Brian Paul
1e1b5cb01a mesa: remove gl_renderbuffer:RowStride field 2012-01-24 14:12:24 -07:00
Brian Paul
82846fea4d mesa: finally, remove the GetRow/PutRow/etc functions 2012-01-24 14:12:23 -07:00
Brian Paul
304f7a1327 dri: remove all the obsolete spantmp files 2012-01-24 14:12:23 -07:00
Brian Paul
a4c6dedb27 radeon: remove obsolete GetRow/PutRow code 2012-01-24 14:12:22 -07:00
Brian Paul
f892debdc2 nouveau: remove obsolete GetRow/PutRow code 2012-01-24 14:12:21 -07:00
Brian Paul
41869c4942 intel: remove most of the span Get/PutRow code 2012-01-24 14:12:21 -07:00
Brian Paul
cb5fa9ea62 dri/swrast: remove obsolete GetRow/PutRow code 2012-01-24 14:12:20 -07:00
Brian Paul
2873555a76 osmesa: remove obsolete GetRow/PutRow code 2012-01-24 14:12:19 -07:00
Brian Paul
2e80c7e5bf xlib: remove obsolete GetRow/PutRow code 2012-01-24 14:12:18 -07:00
Brian Paul
0d2f0c8bb8 mesa: remove obsolete PutRow, etc assignments 2012-01-24 14:12:17 -07:00
Brian Paul
d65bbfa947 swrast: remove Get/PutRow()-related code 2012-01-24 14:12:16 -07:00
Brian Paul
a4a566a610 st/mesa: remove gl_renderbuffer::GetPointer stuff 2012-01-24 14:12:16 -07:00
Brian Paul
0ff817f200 swrast: stop using Put/GetRow/Values() in swrast code
All color buffer rendering is now done by accessing mapped renderbuffer
memory.  We're now able to get rid of all the GetRow/PutRow stuff.
2012-01-24 14:12:15 -07:00
Brian Paul
b766d4bb43 swrast: use gl_renderbuffer::StrideInBytes in depth/stencil code 2012-01-24 14:12:15 -07:00
Brian Paul
7d1ddec921 mesa: use gl_renderbuffer::Map for all depth/stencil accesses
Instead of using the obsolete gl_renderbuffer::Data field.
Color buffer are still accessed through GetRow/PutRow().
2012-01-24 14:12:14 -07:00
Brian Paul
14da67d9b9 intel: make intel_renderbuffer_map/unmap() static 2012-01-24 14:12:13 -07:00
Brian Paul
827c1d66f6 mesa: add new gl_renderbuffer fields
These are temporary, actually, but they'll make follow-on work easier to
implement in a step-by-step manner.  Eventually the Map and RowStrideBytes
fields will go into a new swrast_renderbuffer type, but adding that type
now would involve touching a _lot_ of code that'll eventually be removed.

The fields marked as obsolete will go away completely at some point.
2012-01-24 14:12:12 -07:00
Brian Paul
fc9f74839d swrast: flush pending rendering before unmapping buffers 2012-01-24 14:12:12 -07:00
Brian Paul
33257803d9 swrast: new assertions in _swrast_pixel_address() 2012-01-24 14:12:11 -07:00
Brian Paul
e34a54ff45 swrast: use _swrast_pixel_address() in more places 2012-01-24 14:12:11 -07:00
Brian Paul
bd3c10c0f0 swrast: s/Data/Map/ in swrast_texture_image
To indicate that it points to mapped texture memory.
2012-01-24 14:12:10 -07:00
Brian Paul
ecb8594c18 swrast: remove gl_renderbuffer::DataType check in DrawPixels()
The field will be going away so update this code.
2012-01-24 14:12:09 -07:00
Brian Paul
7726be1c1b swrast: remove gl_renderbuffer::DataType assertions
This field will go away, so remove some uses of it.
2012-01-24 14:12:09 -07:00
Brian Paul
ca6d86d26b st/mesa: remove gl_renderbuffer:DataType assignments
That field is only used by swrast code so there's no reason to mess
with it in the gallium state tracker.

This also lets us remove the unused st_format_data() type function and
related code.
2012-01-24 14:12:08 -07:00
Brian Paul
ff57b0f037 swrast: make _swrast_get_values(), _swrast_get_row() static
They were only called from in s_span.c
2012-01-24 14:12:07 -07:00
Brian Paul
267fb17884 swrast: remove dstType param from _swrast_read_rgba_span()
It was always GL_FLOAT.
2012-01-24 14:12:06 -07:00
Brian Paul
64be85540f swrast: remove unused _swrast_put_row() 2012-01-24 14:12:05 -07:00
Ian Romanick
34c353ce46 mesa: Don't resurrect deleted ARB VAOs in glPopClientAttrib
When ARB VAOs are used, glPopClientAttrib does not resurrect a deleted
VAO or VBO.  This difference between the two spec is, unfortunately,
not very well spelled out in the specs.

Fixes oglc vao(advanced.pushPop.deleteVAO) and
vao(advanced.pushPop.deleteVBO) tests.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 12:31:04 -08:00
Ian Romanick
0963990153 mesa: Rename gl_array_object::VBOonly to ::ARBsemantics
There are more differences between Apple and ARB than just requiring
that all arrays be stored in VBOs.  Additional uses will be added in
following commits.

Also, set the flag at Bind time instead of Gen time.  The ARB_vao spec
specifies that behavior.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-24 12:31:04 -08:00
Ian Romanick
9be3be3c66 swrast: Use fixed-function processing instead _TexEnvProgram for DrawPixels
This is a hack to work around drivers such as i965 that:

    - Set _MaintainTexEnvProgram to generate GLSL IR for
      fixed-function fragment processing.
    - Don't call _mesa_ir_link_shader to generate Mesa IR from the
      GLSL IR.
    - May use swrast to handle glDrawPixels.

Since _mesa_ir_link_shader is never called, there is no Mesa IR to
execute.  Instead do regular fixed-function processing.

Even on platforms that don't need this, the software fixed-function
code is much faster than the software shader code.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44749
2012-01-24 12:30:57 -08:00
Ian Romanick
34db7a8c1e mesa: Make sure _TexEnvProgram points at the current ff fragment program
At least one place, the _mesa_need_secondary_color function in
state.h, uses this to make decisions.  The next patch in this series
will add another dependency.  Ideally, this field would go away and be
replace by a flag or something.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-24 12:30:52 -08:00
Brian Paul
3e01c3f3ba softpipe: move var initialization to silence warning 2012-01-24 11:15:43 -07:00
Brian Paul
64cb0cae55 r600g: remove unused variable 2012-01-24 11:15:23 -07:00
Alexander von Gluck
873f3ae92e glsl: Don't use newlocale on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:42 -07:00
Alexander von Gluck
02a1f9f14d mesa: Don't use newlocale on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:41 -07:00
Alexander von Gluck
32876a452f svga: fix typedef conflicts on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:41 -07:00
Alexander von Gluck
1550b0668e llvmpipe: fix symbol conflict on Haiku
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:40 -07:00
Alexander von Gluck
bca6cd2d71 scons: Remove Haiku one-offs for gallium drivers
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-24 11:00:40 -07:00
Michel Dänzer
7219af5ec1 gallium/postprocess: Proper reference counting of pp_jimenezmlaa depth buffer.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40776

NOTE: This is a candidate for the stable branches.
2012-01-24 17:57:56 +01:00
Matt Turner
027ce0c493 Revert "Always build shared glapi"
This reverts commit adefee50d9.

Shared glapi was never tested with --enable-xlib-glx and turns out
to cause a lot of problems.

Conflicts:

	configure.ac
2012-01-24 11:34:42 -05:00
Matt Turner
a208468e04 gbm: install libgbm.so into lib
This partially reverts commit 90e2568534.
2012-01-24 11:32:02 -05:00
Adam Jackson
fba8257f6a llvmpipe: Fix math error in LP_DEBUG=counters output
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-24 10:51:15 -05:00
Vadim Girlin
738334e80c r600g: fix inconsistency with INTERP* opcode definitions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:31 -05:00
Vadim Girlin
65c0f77bcc r600g: replace raw opcodes with names in the is_alu_trans/vector
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:28 -05:00
Vadim Girlin
315cf30607 r600g: add missing opcode definitions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:26 -05:00
Vadim Girlin
d89c96c75d r600g: fix loop break/continue operations
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-24 21:33:24 +10:00
Vadim Girlin
c4d644bac1 r600g: fix fragcoord.w
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-24 21:33:24 +10:00
Benjamin Franzke
468c7ea2ac targets/gbm: Fix install path
GBM_BACKEND_INSTALL_DIR was deleted by commit
06ad64ad29.
Since we dont need this configurable, use $(INSTALL_LIB_DIR)/gbm now.
2012-01-24 10:12:59 +01:00
Benjamin Franzke
ab52be6826 gbm/Makefile.template: Remove builtin-compile path
Builtins are handled by the main gbm Makefile since
06ad64ad29.
2012-01-24 10:00:52 +01:00
Benjamin Franzke
90e2568534 egl,gbm_gallium: Fix linkage against gbm from automake
Add src/gbm/.libs to ldflags.
The gbm lib is src/gbm/.libs/ instead of lib/
as of commit 06ad64ad29.
2012-01-24 10:00:52 +01:00
Vadim Girlin
5a84cc4ebc r600g: fix interpolation with clipvertex
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-24 08:24:58 +00:00
Chad Versace
aed5c8299f swrast: Fix unsigned promotion in pointer arithmetic
When rowstride was negatie, unsigned promotion caused a segfault here:

299│    if (rb->Format == MESA_FORMAT_S8) {
300│       const GLuint rowStride = rb->RowStride;
301│       for (i = 0; i < count; i++) {
302│          if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
303├>            stencil[i] = *(map + y[i] * rowStride + x[i]);
304│          }
305│       }
306│    }

Fixes segfault in oglconform
separatestencil-neu(NonPolygon.BothFacesBitmapCoreAPI),
though test still fails.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-23 17:44:52 -08:00
Ian Romanick
b48d4b64e9 meta: Fallback for glBlitFramebuffer from a multisample surface
NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44818
2012-01-23 15:17:45 -08:00
Paul Berry
e2274aa739 i965/vs: Fix bogus assertion in emit_block_move()
i965 processes assignments of whole structures using
vec4_visitor::emit_block_move, a recursive function which visits each
element of a structure or array (to arbitrary nesting depth) and
copies it from the source to the destination.  Then it increments the
source and destination register numbers so that further recursive
invocations will copy the rest of the structure.  In addition, it sets
the swizzle field for the source register to an appropriate value of
swizzle_for_size(...) for the size of each element being copied, so
that later optimization passes won't be fooled into thinking that
unused vector elements are live.

This all works fine.  However, emit_block_move also contains an
assertion to verify, before setting the swizzle field for the source
register, that the source register doesn't already contain a
nontrivial swizzle.  The intention is to make sure that the caller of
emit_block_move hasn't already done some swizzling of the data before
the call, which emit_block_move would then counteract when it
overwrites the swizzle field.  But the assertion is at the lowest
level of nesting of emit_block_move, which means that after the first
element is copied, instead of checking the swizzle field set by the
caller, it checks the swizzle field used when moving the previous
element.  That means that if the structure contains elements of
different vector sizes (which therefore require different swizzles),
the assertion will erroneously fire.

This patch moves the assertion from emit_block_move to the calling
function, vec4_visitor::visit(ir_assignment *).  Since the caller is
non-recursive, the assertion will only happen once, and won't be
fooled by emit_block_move's modification of the swizzle field.

This patch also reverts commit fe006a7 (i965/vs: Fix swizzle related
assertion), which attempted to fix the bug by making the assertion
more lenient, but only worked properly for structures, arrays, and
matrices in which each constituent vector is the same size.

This fixes the problem described in comment 9 of
https://bugs.freedesktop.org/show_bug.cgi?id=40865.  Unfortunately, it
doesn't fix the whole bug, since the test in question is also failing
due to lack of register spilling support in the VS.

Fixes piglit test vs-assign-varied-struct.  No piglit regressions on
Sandy Bridge.

This is a candidate for the 8.0 release branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40865#c9
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 14:45:08 -08:00
Alex Deucher
c9cd170f2e r600g: clean up register headers
- CP_INTERRUPT packet doesn't exist
- remove lots of r6xx copy/paste remnants from evergreen reg header
- fix some cayman specific registers

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-23 16:44:53 -05:00
Eric Anholt
3353626a6a i965/vs: Enable workaround-free math on gen7.
This is similar to a commit that did the same for the FS.

Shaves several more instructions off of the VS in Lightsmark, but no
statistically significant performance difference (n=5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 12:51:03 -08:00
Eric Anholt
1fde76b877 i965/vs: Use the embedded-comparison SEL on gen6+, like the FS does.
Shaves a few instructions off of the VS in Lightsmark, but no
statistically significant performance difference on gen7 (n=5).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 12:50:54 -08:00
Matt Turner
06ad64ad29 automake: src/gbm
libgbm.so.1.0.0 (instead of libgbm.so.1.0) is installed now
along with libgbm.so.1 (no change).
2012-01-23 15:18:12 -05:00
Eric Anholt
36473395f1 autoconf: Fix build of dri symbols test to not manually link expat.
AC_CHECK_LIB has this nasty behavior, like the cflags tests, of
automatically putting the tested value into the global LIBS on
success.  This caused -lexpat to end up in LIBS, but without the
--with-expat dir, so my 32-bit build on a 64 system using expat from a
custom prefix could only find the system expat and fail to link on the
one current consumer of the LIBS variable: the dri driver test link.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-23 11:34:05 -08:00
Kenneth Graunke
c25e5300cb i965: Fix border color on Sandybridge and Ivybridge.
While reading through the simulator, I found some interesting code that
looks like it checks the sampler default color pointer against the bound
set in STATE_BASE_ADDRESS.  On failure, it appears to program it to the
base address itself.

So I decided to try programming a legitimate bound, and lo and behold,
border color worked.

+92 piglits on Sandybridge.  Also fixes Lightsmark on Ivybridge.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28924
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-23 10:38:14 -08:00
Jon TURNEY
4e5a8937d1 Fix underlinking in libOSMesa since commit adefee5 "Always build shared glapi"
Since we now always build shared glapi, this exposes the fact that libOSMesa was
underlinked when glapi was built shared.

Fix this by doing the same thing as drivers/X11/Makefile already does, ensuring
that the library is linked with the shared glapi library.

(I'm not clear why we link with both glapi.a and glapi.so, so this may be all wrong)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-23 18:24:39 +00:00
Jon TURNEY
0fce6d3a77 Don't build shared dricore when unneeded
Refine "always build shared dricore" so we don't build it if we don't need
it because we aren't actually building any dri drivers because of --disable-driglx-direct

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-23 18:17:48 +00:00
Dave Airlie
d01e166391 r600g: cayman fix integer multiplies
Looks insane, but it does appear we need a full slot per input/output.

This fixes another 180 or so piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 13:59:57 +00:00
Dave Airlie
f01431d035 r600g: cayman initial integer support
Adds all the easier lowhanging opcodes.

Fixes ~3000 piglit tests with GLSL1.30 enabled on cayman.

This just leaves the mul/div/mod ops to fix up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 12:26:19 +00:00
Vadim Girlin
13daa059c0 r600g: fix VS fog export
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-23 10:01:35 +00:00
Matt Turner
4c84819a1b dri: install dri_interface.h
Broken in commit 129213e7.

Reported-by Kai Wasserbäch <kai@dev.carbon-project.org>
2012-01-22 17:16:02 -05:00
Dave Airlie
b9c706c8c5 r600g: shift integer ops are trans unit only on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:25:38 +00:00
Vadim Girlin
9733a89f6d r600g: replace trans/vector-only instruction lists with ranges (v2)
airlied : assert on cayman cases to keep compiler happy

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:13:00 +00:00
Dave Airlie
38ffc23e7b Revert "r600g: replace trans/vector-only instruction lists with ranges"
This reverts commit 946309067c.

Until we check the cayman bits out properly
2012-01-22 17:09:54 +00:00
Dave Airlie
a9d8809f16 r600g: srgb mode is only valid on certain format types.
"If set, forces degamma on XYZ if format is
FMT_8_8_8_8, FMT_BC1, FMT_BC2, or FMT_BC3"

Don't claim support for sRGB on any other formts.

This fixes glean texture_srgb.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 16:53:46 +00:00
Dave Airlie
9783bba9bd r600g: initial cube shadow sampling
It doesn't pass the piglit test, but it seems to be a lot closer
than it was before. I need to track down if there is another problem.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 16:17:47 +00:00
Vadim Girlin
840a342cd0 r600g: take into account kcache banks for bank swizzle check
Due to the changes for multiple kcache banks support, now we are assigning
final SRCx_SEL values for kcache access at the later stage, when building the
bytecode. So we need to take into account kcache banks to distinguish
the constants with the same address but different bank index.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:50 +00:00
Vadim Girlin
60bf0f05b4 r600g: set round_mode to truncate and get rid of tgsi_f2i on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:50 +00:00
Vadim Girlin
946309067c r600g: replace trans/vector-only instruction lists with ranges
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:49 +00:00
Vadim Girlin
cb15783364 r600g: fix some interpolation tests for evergreen
Same fix as previously done by Dave Airlie for r600/r700

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:49 +00:00
Matt Turner
fd827a8d3e configure.ac: use AC_PROG_MKDIR_P
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45057
2012-01-21 22:43:54 -05:00
Matt Turner
d387899388 Remove src/mesa/ppc
It didn't actually do anything except modify the GL_RENDERER string.
2012-01-21 22:43:54 -05:00
Andrei Slăvoiu
309ba0cfa2 Fix mistake in 349845f7b 2012-01-21 11:36:26 -05:00
Vadim Girlin
54e8dcaad6 r600g: implement clip vertex v2
Clip planes are uploaded as a constant buffer and used by the vertex
shader to produce corresponding clip distances for hw clipping.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 12:43:14 +00:00
Vadim Girlin
d649bf51ec r600g: improve kcache line sets handling v2
Add support for multiple kcache banks (constant buffers).
Lock the required lines only.
Allow up to 4 kcache line sets in the alu clause by using ALU_EXTENDED on eg+.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 12:43:14 +00:00
Dave Airlie
261dc72fe3 r600g: no need to do CUBE coordinate handling for TXQ.
Fixes texSize on cube.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 22:17:25 +10:00
Vadim Girlin
8b1471f8ca r600g: make INTERP_LOAD_P0 vector-only
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 11:07:22 +00:00
Vinson Lee
e9bcf4d56b glsl: Fix 'control reaches end of non-void function' warning.
Fix this GCC warning on non-debug builds.
glsl_types.cpp: In member function 'gl_texture_index
glsl_type::sampler_index() const':
glsl_types.cpp:157: warning: control reaches end of non-void function

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-20 23:53:59 -08:00
Alex Deucher
d6cd514edb r600g: use S_028B20_BUFFER_0_EN macro for streamout buffer enable
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 18:06:37 -05:00
Alex Deucher
90b36b50f5 r600g: update streamout support for virtual addresses
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 18:06:37 -05:00
Matt Turner
687a7302a5 Remove reference to now deleted dri/Makefile.targets 2012-01-20 16:54:12 -05:00
Matt Turner
129213e7a2 automake: src/mesa/drivers/dri 2012-01-20 15:54:08 -05:00
Matt Turner
349845f7b2 automake: src/mesa/drivers/dri/swrast 2012-01-20 15:54:08 -05:00
Matt Turner
3f96434f86 automake: src/mesa/drivers/dri/nouveau 2012-01-20 15:54:08 -05:00
Matt Turner
b38d7a0a24 automake: src/mesa/drivers/dri/r200 2012-01-20 15:54:08 -05:00
Matt Turner
e0ee818e2f automake: src/mesa/drivers/dri/radeon 2012-01-20 15:54:08 -05:00
Matt Turner
3c87dfce40 automake: src/mesa/drivers/dri/i915 2012-01-20 15:54:08 -05:00
Vadim Girlin
c60dcc49e4 r600g: fix streamout on evergreen
Enable it in the evergreen_context_draw if needed.
Same as already done in the r600_context_draw for r6xx/r7xx.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 15:10:39 -05:00
Vadim Girlin
c97632642a r600g: fix combined MEM_STREAM instructions
BURST_COUNT is clipped with ARRAY_SIZE, so set it to the max value
to avoid clipping.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-20 15:09:42 -05:00
Matt Turner
2b3a8cbc89 Always build shared dricore
Tested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:42 -05:00
Matt Turner
adefee50d9 Always build shared glapi
libglapi.so, libGL.so, libGLESv2.so, libGLESv1_CM.so must all
come from the same version of Mesa or bad things may happen.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:42 -05:00
Matt Turner
2fdbbeca43 Remove -ffast-math from default CFLAGS
Fixes glsl-const-folding-01. inversesqrt(1.0) != 1.0 was evaluating as
true.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-20 14:56:14 -05:00
Chad Versace
ba5252e590 intel/gen6: Some framebuffers having separate depthstencil should be unsupported
When the framebuffer has separate depth and stencil buffers, and HiZ is
not enabled on the depth buffer, mark the framebuffer as unsupported. This
happens when trying to create a framebuffer with Z16/S8 because we haven't
enabled HiZ on Z16 yet.

Fixes gles2conform test stencil8.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44948
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed--by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-20 10:37:19 -08:00
Chad Versace
f74d8aacbf mesa: Loosen glBlitFramebuffer restrictions on depthstencil buffers (v2)
This loosens the format validation in glBlitFramebuffer. When blitting
depth bits, don't require an exact match between the depth formats; only
require that the two formats have the same number of depth bits and the
same depth datatype (float vs uint). Ditto for stencil.

Between S8_Z24 buffers, the EXT_framebuffer_blit spec allows
glBlitFramebuffer to blit the depth and stencil bits separately. So I see
no reason to prevent blitting the depth bits between X8_Z24 and S8_Z24 or
the stencil bits between S8 and S8_Z24. However, we of course don't want
to allow blitting from Z32 to Z32_FLOAT.

Fixes Piglit fbo/fbo-blit-d24s8 on Intel drivers with separate stencil
enabled.

The problem was that, on Intel drivers with separate stencil, the default
framebuffer has separate depth and stencil buffers with formats X8_Z24 and
S8. The test attempts to blit the depth bits from a S8_Z24 buffer into the
default framebuffer.

v2: Check that depth datatypes match.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44665
Note: This is a candidate for the 8.0 branch.
Reported-by: Xunx Fang <xunx.fang@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-20 10:35:49 -08:00
Christoph Bumiller
ab69d584f9 nvc0: fix some limit cap values
NOTE: This is a candidate for the 8.0 branch.
2012-01-20 19:24:31 +01:00
Christoph Bumiller
0d27be3d79 nvc0: handle discontiguous outputs in stream_output_info 2012-01-20 19:24:31 +01:00
Christoph Bumiller
d540af554a mesa: allocate transform_feedback_info::Outputs array dynamically
The nvc0 gallium driver is advertising 128 MAX_INTERLEAVED_COMPS
which made it always assert in the linker when TFB was used since
the Outputs array was smaller than that maximum.

v2: added assertions

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-20 19:24:31 +01:00
Dave Airlie
c96b983403 r600g: fixup AR handling (v5)
So it appears R600s (except rv670) do AR handling different using a different
opcode. This patch fixes up r600g to work properly on r600.

This fixes ~100 piglit tests here (in GLSL1.30 mode) on rv610.

v3: add index_mode as per the docs.

This still fails any dst relative tests for some reason I can't quite see yet,
but it passes a lot more tests than without.

v4: add a nop after dst.rel this could be improved using a second pass,
where we only insert nops if two instructions are sure to collide.
The docs say r600, rv610, rv630 needs this, and not rv670, rs780, rs880,
need AMD to confirm rv620, rv635.

v5: add is_nop_inst.

NOTE: This is a candidate for stable branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-20 17:58:53 +00:00
Brian Paul
0e019cbd1c mesa: include arrayobj.h to silence implicit function declaration warning
Caused by commit 7a1e941ebe.
2012-01-20 10:55:18 -07:00
Mathias Fröhlich
7a1e941ebe mesa: Fix and speedup gl_array_object::_MaxElement computation.
Use a bitmask approach to compute gl_array_object::_MaxElement.
To make this work correctly depending on the shader type actually used,
make use of the newly introduced typed bitmask getters.
With this change I gain about 5% draw time on some osgviewer examples.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:20 +01:00
Mathias Froehlich
2a207c4bf9 mesa: Introduce enabled bitfield helper functions.
Depending on the installed shader type, different arrays are used
from gl_array_object. Provide helper functions that compute
the bitmask of these arrays that are finally enabled for a given
shader type. The will be used in a followup change.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:11 +01:00
Mathias Fröhlich
f60e892c50 mesa: Use BITFIELD64_RANGE for VERT_BIT_*_ALL.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-20 07:24:05 +01:00
Stéphane Marchesin
63dbd3fefb i915g: Fix indentation. 2012-01-19 19:27:34 -08:00
Stéphane Marchesin
2f9df215a2 i915g: Fix indentation and comment. 2012-01-19 19:27:34 -08:00
Paul Berry
4f82fed493 glsl: Fix isinf() for non-C99-compliant compilers.
Commit ede60bc467 (glsl: Add isinf() and
isnan() builtins) uses "+INF" in the .ir file to represent infinity.
This worked on C99-compliant compilers, since the s-expression reader
uses strtod() to read numbers, and C99 requires strtod() to understand
"+INF".  However, it didn't work on non-C99-compliant compilers such
as MSVC.

This patch modifies the s-expression reader to explicitly check for
"+INF" rather than relying on strtod() to support it.

This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44767
Tested-by: Morgan Armand <morgan.devel@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-19 18:45:22 -08:00
Alex Deucher
5e576efef2 r600g: fix typo in evergreen register
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-19 21:09:20 -05:00
Brian Paul
7f2e12812a svga: move svga_texture() casts/calls in svga_surface_copy()
To fix failed assertions when calling glCopyBufferSubData().

svga_texture() asserts that the resource is a texture.  Simply move the
calls to svga_texture() after the code that handles non-texture copies
so that we don't call it with non-texture resources.

Fixes glean bufferObject failure.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 16:23:12 -07:00
Brian Paul
fdae0eaf22 st/mesa: copy num_immediates field when copying the immediates array
Two assignments to num_immediates were missing in
get_pixel_transfer_visitor() and get_bitmap_visitor().
The uninitialized value led to valgrind errors and crashes in some
cases.

Added new assertions to catch future problems in this area.  Also
changed num_immediates to unsigned to avoid signed/unsigned
comparison warnings.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 15:12:14 -07:00
Ian Romanick
f0ea46790f mesa: Set default access flags based on the run-time API
The default access flags for OpenGL ES (via GL_OES_map_buffer) and
desktop OpenGL are different.  The code previously tried to handle
this, but the decision was made at compile time.  Since the same
driver binary can be used for both OpenGL ES and desktop OpenGL, the
decision must be made at run-time.

This should fix bug #44433.  It appears that the test case does
various map and unmap operations and inspects the state of the buffer
object around each.  When it sees that GL_BUFFER_ACCESS does not match
its expectations, it fails.

NOTE: This is a candidate for release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44433
2012-01-19 09:34:01 -08:00
Brian Paul
75f37ddba7 st/mesa: add fallback pipe formats for (compressed) R, RG formats
If we don't find an exact PIPE_FORMAT_x for a GL_(COMPRESSED)_RED/RG format,
try uncompressed formats.  We were already doing this for the RGB(A) formats.

Fixes piglit arb_texture_compression-internal-format-query test.

NOTE: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-19 09:41:30 -07:00
Stéphane Marchesin
32b07bb149 i915g: Don't avoid flushing when we have a pending fence.
Otherwise the fence will never arrive.
Also check for a NULL i915->batch.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 19:25:41 -08:00
Stéphane Marchesin
2b4afdba05 i915g: Don't invert signalled/unsignalled fences
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 19:25:41 -08:00
Kenneth Graunke
dcdfd1905c i965: Fix disassembly of data port writes on Ivybridge.
msg_type moved by a bit, so the message type was being disassembled
incorrectly.  In particular, render target writes were showing up as
"OWORD block write".

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 14:42:04 -08:00
Kenneth Graunke
a608be5d33 i965: Fix disassembly of sampler messages on Ivybridge.
Compared to sampler_gen5, simd_mode shifted by a bit and msg_type grew
by a bit.  So we were printing slightly incorrect numbers.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 14:42:04 -08:00
Kenneth Graunke
2e712e41db i965/vs: Take attributes into account when deciding urb_entry_size.
Both the VF and VS share space in the URB.  First, the VF stores
attributes (shader inputs) there.  The VS then reads the attributes,
executes, and reuses the space to store varyings (shader outputs).

Thus, we need to calculate the amount of URB space necessary for inputs,
outputs, and pick whichever is greater.

The old VS backend correctly did this (brw_vs_emit.c:408), but the new
VS backend only considered outputs.

Fixes vertex scrambling in GLBenchmark PRO on Ivybridge.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41318
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-18 14:42:04 -08:00
Stéphane Marchesin
81da773f84 st/dri: Remove useless flush front.
In the following scenario:
- CreateContext C1
- MakeCurrent C1
- DestroyContext C1 (does not actually destroy the first context, postponed
 until the next MakeCurrent)
 - CreateContext C2
 - MakeCurrent C2
MakeCurrent will call flush on a half destroyed context, leading to crashes.
Since the other paths (destroy and makecurrent) already flush the context,
there is no need to flush here, so we remove this useless flush front call.

This fixes GPU crashes with Chrome and gallium drivers.
2012-01-18 13:22:27 -08:00
Ian Romanick
8a47242755 intel: Set depth to 6 for cubemaps
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41216
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43212
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43250
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Jin Yang <jin.a.yang@intel.com>
2012-01-18 12:48:37 -08:00
Kristian Høgsberg
221c678329 gbm: Validate usage flags in gbm_bo_create_from_egl_image()
The entry point is supposed to validate that the EGLImage is suitable for
the passed in usage flags, but that was never implemented.
2012-01-18 15:32:51 -05:00
Eric Anholt
2f868f1ddd i965: Add support for Z16 depth formats.
v2: Don't flag the format as being HiZ ready (there's DRI2 handshake
    pain to go through).

Fixes piglit gl-3.0-required-sized-texture-formats

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:36 -08:00
Eric Anholt
f0d5c92a4c i965/gen7: Set up surface horizontal alignment field.
This is required for Z16 support for texturing, which is the first
thing to have a horizontal alignment of 8.  Renderbuffers don't need
it, since they're always set up as the only mip level, but do it for
completeness anyway.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:36 -08:00
Eric Anholt
fc767ff590 i965/gen7: Remove stale comment.
This field is actually set up above.

NOTE: This is a candidate for the 8.0 branch, to avoid conflicts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-18 10:25:21 -08:00
Eric Anholt
aad3a46ff4 glsl: Fix leak of linked uniform names at relink/free of the shader_program.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
5a0f395bcf glsl: Fix leak of LinkedTransformFeedback.Varyings.
I copy-and-pasted the thing I was allocating for as the context, so
the first time it would be NULL (root of a ralloc context) and they'd
chain off each other from then on.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
0f68d88034 mesa: Fix leak of uniform storage records on shader program link/free.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
cbd464a117 i965: Fix leak of the program cache BO on context destroy.
NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
7f278e15ad i965/vs: Fix leak of an empty hash_table structure per compile.
This statement got duplicated above, probably in a rebase resolution,
so we never freed the extra one.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
b2be486962 i965: Fix refcount leak of the gl_program structure.
Fixes a leak of almost 200kb on a minimal shader_runner program
(algebraic-add-add-1).

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:12 -08:00
Eric Anholt
b972744c78 mesa: Make the register allocator allocation take a ralloc context.
This fixes a memory leak on i965 context destruction.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 09:59:11 -08:00
Brian Paul
a9eda41539 svga: change PIPE_CAPF_MAX_TEXTURE_LOD_BIAS from 16.0 to 15.0
The legal range for the device is apparently [-16.0, +15.0].
Limiting the range to [-15, +15] fixes piglit's lodbias test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
fd890873b2 svga: fix min/max lod clamping
The interaction between the mipmap lod min/max limits and the texture
base/max level limits is kind of tricky.  Changing the base level
didn't work as expected before.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
5abcd198b8 svga: add 0.5 in float->int conversion of sample min/max lod
This makes lod clamping more consistent with other drivers.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
84c7c14697 st/mesa: pass GL_MAP_INVALIDATE_RANGE_BIT to gallium drivers
when mapping renderbuffers or texture images.

NOTE: This is a candidate for the 8.0 branch.
2012-01-18 10:44:05 -07:00
Brian Paul
64fdfefb9d mesa: use GL_MAP_INVALIDATE_RANGE_BIT in glTexImage paths
Update the dd.h docs to indicate that GL_MAP_INVALIDATE_RANGE_BIT
can be used with GL_MAP_WRITE_BIT when mapping renderbuffers and
texture images.

Pass the flag when mapping texture images for glTexImage, glTexSubImage,
etc.  It's up to drivers whether to actually make use of the flag.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-18 10:44:05 -07:00
Brian Paul
1d7048f12e mesa: try RGBA_FLOAT16 before RGBA_FLOAT32 when choosing A,L,LA,I formats
To try to use less tex memory and maybe get better performance.
Spotted by Roland Scheidegger.

NOTE: This is a candidate for the 8.0 and 7.11 branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
7628696004 mesa: fix tex format selection for GL_R32F and other R/G float formats
The i965 driver advertises GL_ARB_texture_float and GL_ARB_texture_rg
support but the ctx->TextureFormatSupported[] table entries for
MESA_FORMAT_R_FLOAT32 and MESA_FORMAT_RGBA_FLOAT32 are false on gen 4
hardware.  So the case for GL_R32F would fail and we'd print an
implementation error.

This patch adds more Mesa tex format options for GL_R32F and other R/G
formats so we fall back to 16-bit formats when 32-bit formats aren't
available.

Eric made the same fix in commit 6216a5b4 for the non R/G formats.

v2: try 16-bit formats before 32-bit formats and try RG formats before
RGBA where possible.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=44039

NOTE: This is a candidate for the 8.0 and 7.11 branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2012-01-18 10:44:05 -07:00
Brian Paul
481011ffcd docs: add more potential dependencies for vmware guest driver 2012-01-18 10:44:05 -07:00
Alexander von Gluck IV
5481b5adcf scons: Add more machine architectures to the machine map
* BePC, BeBox, BeMac for Haiku.
* Add sparc architecture as Mesa looks for it.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2012-01-18 16:46:16 +00:00
Dave Airlie
0196433ce5 r600g: fix ISLT on r600/700
This fixes ISLT like evergreen.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 22:14:49 +10:00
Dave Airlie
5893e686b6 r600g: make r600/700 use correct ineg.
Noticed by Vadim Girlin on irc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 21:54:07 +10:00
Dave Airlie
1fc001ea15 r600g: fix some of the interpolation tests.
This enables linear gradients if we need a linear,
it also sets the flat shade flag for color/constant interpolations.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 20:13:16 +10:00
Kenneth Graunke
5acc7f38d4 i965: Bump Ivybridge's fake MRF range to g112-127 instead of g111-126.
When I originally implemented the hack to use GRFs 111+ as fake MRFs, I
did so purely to avoid rewriting all the code that dealt with MRFs.
However, it turns out that a similar hack is actually required.

Newly discovered language in the BSpec indicates that SEND instructions
with EOT set "should" use g112-g127 as their source registers.  Based on
assertions in the simulator, this is actually a requirement on certain
platforms.

Since we're faking MRFs already, we may as well use the officially
sanctioned range.  My guess is that we avoided this issue because we
seldom use m0: URB writes in the new VS backend start at m1, and RT
writes in the new FS backend start at m2.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-18 00:45:01 -08:00
Kenneth Graunke
bdedd03b70 i965: Remove the INTEL_OLD_VS option.
Now that we no longer generate Mesa IR from GLSL IR, it's impossible to
use the old vertex shader backend for GLSL programs.  There's simply no
Mesa IR to codegen from.

Any attempt to do so would result in immediate GPU hangs, presumably due
to the driver uploading an empty program with no EOT message.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-18 00:45:00 -08:00
Kenneth Graunke
d56ad273c0 mesa: Support GL_VERTEX_ATTRIB_ARRAY_INTEGER in GL 3.0 contexts.
According to Table 6.8 (Page 348) in the OpenGL 3.0 specification,
glGetVertexAttribiv supports GL_VERTEX_ATTRIB_ARRAY_INTEGER.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-18 00:45:00 -08:00
Vadim Girlin
b69728cba5 r600g: fix UINT_TO_FLT on evergreen
It should be processed as trans-only.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 08:03:41 +00:00
Chad Versace
a6dd4bf5fc i965/gen5: Fix rendering of depth buffers without stencil [v2]
Fixes the following OGLConform tests on gen5:
    depth-stencil(misc.state_on.depth_int)
    fbo_db_ARBfp(basic.OnlyDepthBuffDrawBufferRender)

The problem was that, if the depth buffer's Mesa format was X8_Z24, then
we emitted the hardware format D24_UNORM_X8. But, on gen5, D24_UNORM_S8
must be emitted.

This bug was introduced by:
    commit d84a180417
    Author: Eric Anholt <eric@anholt.net>
    i965: Base HW depth format setup based on MESA_FORMAT, not bpp.

v2: Deref 'intel' directly. Move the branch for newer chipset to top.
    Quote the PRM. As requested by Ken.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43408
Note: This is a candidate for the 8.0 branch.
Reported-by: Xunx Fang <xunx.fang@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 17:26:45 -08:00
Anuj Phogat
ce1c949b16 intel: Return if pointer to intel_context is null
It is better to test if(intel == NULL) and simply return in that case.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 16:58:38 -08:00
Alex Deucher
46ce25722b r600g: add workaround for original R600 PS setup
The original R600 requires the UNCACHED_FIRST_INST bit
to be set in the PS.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is candidate for the stable branches.
2012-01-17 18:46:46 -05:00
Paul Berry
c03ad08e8d i965: Add .gitignore file to exclude automake build artifacts from git.
With the conversion to automake in commit
e326480e4e, several additional build
artifacts are created:

  src/mesa/drivers/dri/i965/.deps/
  src/mesa/drivers/dri/i965/.libs/
  src/mesa/drivers/dri/i965/Makefile
  src/mesa/drivers/dri/i965/Makefile.in
  src/mesa/drivers/dri/i965/i965_dri.la
  src/mesa/drivers/dri/i965/i965_symbols_test

This patch adds all of these files to .gitignore.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-17 15:44:26 -08:00
Anuj Phogat
f1a9a9bcd1 mesa: Add condition in glGetTexImage for zero size textures
TestMipMaps() function in src/OGLconform/textureNPOT.c calls glTexImage2D()
with width = 0. Texture with zero size skips miptree allocation due to a
condition in function _mesa_store_teximage3d(). While calling glGetTexImage()
it results in assertion failure in intel_map_texture_image() due to null mt
pointer.

This patch fixes the issue by detecting the zero size texture early in
glGetTexImage and glGetCompressedTexImage functions. In such a case function
simply returns doing nothing.
Verified that below mentioned bug is fixed by this patch.

https://bugs.freedesktop.org/show_bug.cgi?id=42334

NOTE: This is a candidate for stable branches

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-17 15:14:44 -08:00
Alex Deucher
94556f3594 radeon: share common fog code between radeon and r200
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-17 18:09:25 -05:00
Alex Deucher
e77c495d09 radeon: fix fog coordinate emit
Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-01-17 18:03:28 -05:00
Alex Deucher
afdd6f8c34 r200: fix fog coordinate emit
Noticed by dungeon on phoronix:
http://phoronix.com/forums/showthread.php?65408-Radeon-R100-R200-Mesa-Driver-Sees-Attention&p=247018#post247018

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Note: this is a candidate for the stable branches.
2012-01-17 18:03:28 -05:00
Dave Airlie
ba59a1a0d8 r600g: fix recip_uint on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 06:53:02 +10:00
Vadim Girlin
7383e754b7 r600g: fix USLT for r600-eg 2012-01-17 15:25:12 -05:00
Alexander von Gluck IV
183133271c scons: Don't set visibility to hidden on Haiku
The Haiku swrast driver is out of tree.
2012-01-17 20:02:41 +00:00
Alexander von Gluck IV
64ae209d50 scons: Add Haiku build support
Enables building stock Mesa under the Haiku operating system.
2012-01-17 20:01:14 +00:00
Vadim Girlin
4ba4853c0a r600g: rework IDIV/UDIV and implement MOD/UMOD (v2)
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-17 19:53:20 +00:00
Eric Anholt
7fa5c919b0 mesa: Enable silent automake rules when available.
Finally, a quiet build for the i965 driver, at least!  (Note, you can
still get verbose builds at build-time by saying "make V=1")

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-17 10:35:24 -08:00
Eric Anholt
e326480e4e i965: Convert the build to using automake.
This does introduce a warning by the automake build system, that the
missing-symbols test build is non-portable.  That's true -- Mac OS X
can't take something built as a loadable module and just link it as a
library.  Of course, we aren't building this on OS X at all, so it
would be nice to be able to suppress it, but I haven't found a way.

Still, the build is going to be much quieter than we have ever had
before, so I think this is a fair tradeoff until we find a way to shut
that warning up.

v2: Put a link in /lib to avoid transition pains for people.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
2012-01-17 10:35:24 -08:00
Eric Anholt
a14582d7e2 intel: Drop the version override code now that we don't have any left.
Fixes a compiler warning.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 10:35:24 -08:00
Eric Anholt
ccf0d31a21 intel: Fix warnings of undefined ffs().
For some reason these started showing up with the automake conversion.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-17 10:35:24 -08:00
Scott Moreau
e0897009f8 Complete ARGB8888 naming convention format renames missed 2012-01-17 10:36:12 -05:00
Chad Versace
7e08bf08d1 i965: Fix gen6,gen7 when used with a non-HiZ capable DDX
Nothing works if HiZ is enabled and the DDX is incapable of HiZ (that is,
the DDX version is < 2.16).

The problem is that the refactoring that eliminated
intel_renderbuffer::stencil_rb broke the recovery path in
intel_verify_dri2_has_hiz().  Specifically, it broke line
intel_context.c:1445, which allocates the region for
DRI_BUFFER_DEPTH_STENCIL. That allocation was creating a separate stencil
miptree, despite the buffer being a packed depthstencil buffer. Havoc
ensued.

This patch introduces a bool flag that prevents allocation of that stencil
miptree.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44103
Tested-by: Ian Romanick <idr@freedesktop.org>
Note: This is a candidate for the 8.0 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-16 16:38:36 -08:00
Vinson Lee
8e543cc098 softpipe: Silence unused variable warning on non-LLVM builds.
Fix this GCC warning with non-LLVM builds.
sp_screen.c: In function ‘softpipe_get_shader_param’:
sp_screen.c:141:28: warning: unused variable ‘sp_screen’ [-Wunused-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-16 16:13:51 -08:00
Anuj Phogat
dd7220652e intel: Fix segfault in glXSwapBuffers with no bound context
Calling glXSwapBuffers with no bound context causes segmentation
fault in function intelDRI2Flush. All the gl calls should be
ignored after setting the current context to null. So the contents
of framebuffer stay unchanged. But the driver should not seg fault.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44614

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Yi Sun <yi.sun@intel.com>
2012-01-16 15:07:17 -08:00
Vinson Lee
6fe133889c llvmpipe: Remove unused variable 'packed' from lp_test_round.
Fix this GCC warning.
lp_test_round.c: In function ‘test_round’:
lp_test_round.c:126:13: warning: variable ‘packed’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-16 12:44:06 -08:00
Vinson Lee
eeff1ee746 util: Silence GCC unused-but-set-variable warning.
Fix this GCC 4.6 warning with 64-bit builds.
u_debug_stack.c: In function ‘debug_backtrace_capture’:
u_debug_stack.c:45:17: warning: variable ‘frame_pointer’ set but not
used [-Wunused-but-set-variable]

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-16 12:41:55 -08:00
José Fonseca
455090c4c4 vl: Make array initialization portable.
Should fix MSVC build.
2012-01-16 12:21:40 +00:00
Stéphane Marchesin
23d4a0569d i915g: Fix the blending for the A8 destination buffer case.
The i915 GPU can't do A8 dst, so we abuse GREEN8 buffers for that
purpose. However, things get hairy as we start to do blending,
because then GL_DST_*_ALPHA should be replaced with GL_DST_*_COLOR.
This is what we do here.

Fixes piglt fbo-alpha.
2012-01-15 23:39:49 -08:00
Matt Turner
6e9478e382 r200: remove left-over EGL_SOURCES variable
Rest was removed in 2a928899e.

Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-15 12:09:52 -05:00
Dave Airlie
850021f225 r600g: fix mullo_uint trans slot only on r600/r700
This fixes 8 piglit tests that currently assert.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:53:41 +00:00
Vadim Girlin
91d4729696 r600g: implement clip distances
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:19:42 +00:00
Vadim Girlin
725a820b92 r600g: implement two-sided lighting (v3)
v2: select the colors in the pixel shader

v3: fix rs state creation for pre-evergreen

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 16:19:41 +00:00
Vadim Girlin
d84ab821c5 r600g: add support for ISHR/USHR/SHL on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:59 +00:00
Vadim Girlin
332e1d6d84 r600g: implement IDIV/UDIV on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:59 +00:00
Vadim Girlin
42539d569a r600g: implement ISSG on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
6b44470bb2 r600g: implement IABS on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
beb297f284 r600g: implement F2U on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:58 +00:00
Vadim Girlin
5d97c5033b r600g: add FLT_TO_UINT opcode for evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:57 +00:00
Vadim Girlin
a9302de4a3 r600g: fix F2I on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:57 +00:00
Christian König
2eabd05b75 vl: fix YV12 handling
We actually implemented YV21 instead of YV12, so fix the plane ordering.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
020a6f6cd8 st/vdpau: recreate video buffer if decode doesn't like it
Recreate the video buffer if the decoder can't handle it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
4a4811ea17 st/vdpau: recreate video buffer if format doesn't match
Recreate the video buffer in PutBitsYCbCr if the format doesn't match.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
9d9afcb5ba vl: reintroduce PIPE_VIDEO_CAP_PREFERED_FORMAT
Create the video buffers in the format the driver preffers.
This temporary creates problems with decoder less VDPAU video playback.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
d6aa0ad55d vl: add h264 infrastructure
No implementation so far, just the defines for
VDPAUs picture info structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
8ea416f35d vl: move away from state like parameters
Again based on Maartens work, but keep begin_frame
and end_frame functions for now.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
9af70c90db vl/video_buffer: add support for interlaced buffers
Add the infrastructure, but not the decode implementation.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
12b49ca2df vl/video_buffer: improve constructor
Add a second extened constructor that takes plane
textures for the video buffer. Also provide a
function for texture templates.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Christian König
e027759336 vl/video_buffer: use template style create params
Just like in the rest of gallium, this reduces the
number of parameters significantly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-15 12:40:44 +01:00
Dave Airlie
39491d1d31 r600g: vertex id support.
This requires GLSL 1.30 enabled, which requires integer types enabled,
so don't bother doing an INT to FLT conversion on it.

We should probably remove the instance id flt->int conversion when
turning on native integers.

this passes the three piglit tests with GLSL 1.30 forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 08:17:38 +00:00
Dave Airlie
9a401a2fd6 r600g: make u2f trans only
as per the r600 isa doc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-15 08:17:38 +00:00
Lucas Stach
c82879a071 nvfx: random cleanups of the state validation code
Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:39:47 +01:00
Lucas Stach
bf8daf1c0a nvfx: drop render temporaries code
This code is unneeded now, we don't use render temps any more.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:39:05 +01:00
Lucas Stach
f428ae6f72 nvfx: rework state_fb code to get rid of render temps
This commit rewrites a lot of the state_fb code to support
rendering to targets not aligned to 64 byte.

This allows us to drop the render temporaries as unaligned
targets are the only use-case where they are really needed. The
temporaries code was used for a lot of things more, but apparently
those also work without temps.

There is one regression in piglit fbo-clear-formats, but this will
be fixed with the use of real hardware clears and doesn't matter in
practice as no real application tries to scissor clear a 2x2 pixel
render target.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:37:41 +01:00
Lucas Stach
7f918683c4 nvfx: say no to stream output caps
nvfx doesn't support any kind of stream out, so silence the
unused cap warnings.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
2012-01-15 07:37:03 +01:00
Marek Olšák
5596db7411 mesa: update compute_version for GL3
only check ARB_fbo, add shader_texture_lod as a requirement

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-15 07:29:48 +01:00
Marek Olšák
2449695e82 gallium: improve the pipe_stream_output_info struct (v2)
There are 3 changes:

1) stride is specified for each buffer, not just one, so that drivers don't
   have to derive it from the outputs

2) new per-output property dst_offset, which specifies the offset
   into the buffer in dwords where the output should be stored,
   so that drivers don't have to compute the offsets manually;
   this will also be useful for gl_SkipComponents
   from ARB_transform_feedback3

3) register_mask is removed, instead, there is start_component
   and num_components; register_mask with non-consecutive 1s
   doesn't make much sense (some hardware cannot do packing of components)

Christoph Bumiller: fixed nvc0.

v2: resolve merge conflicts in Draw and clean it up
2012-01-15 07:28:35 +01:00
Dave Airlie
faa90abfe0 r600g: add r600 version of UINT_TO_FLT conversion.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 22:03:28 +00:00
Dave Airlie
bfcffd4d72 r600g: fix r600 f2i to be trans only emitted.
This fixes a lot of asserts about the trans unit being used already.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 19:59:51 +00:00
Dave Airlie
55bd1c8365 r600g: add missing case for uint->flt conversion.
fixes some piglits like vs-decrement-uint.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 18:50:43 +00:00
Dave Airlie
5250bd00c0 r600g: add missing r32 uint/sint fbo formats.
Fixes the GL3 required formats test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 18:42:42 +00:00
Jerome Glisse
bb1f0cf350 r600g: add support for virtual address space on cayman v11
Virtual address space put the userspace in charge of their GPU
address space. It's up to userspace to bind bo into the virtual
address space. Command stream can them be executed using the
IB_VM chunck.

This patch add support for this configuration. It doesn't remove
the 64K ib size limit thought this limit can be extanded up to
1M for IB_VM chunk.

v2: fix rendering
v3: fix rendering when using index buffer
v4: make vm conditional on kernel support add basic va management
v5: catch the case when we already have va for a bo
v6: agd5f: update on top of ioctl changes
v7: agd5f: further ioctl updates
v8: indentation cleanup + fix non cayman
v9: rebase against lastest mesa + improvement from Marek & Michel
v10: fix cut/paste bug
v11: don't rely on updated radeon_drm.h

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-13 18:00:53 -05:00
Roland Scheidegger
6c2c2c5a07 scons: Fix libGL.so build. 2012-01-13 22:39:14 +01:00
Brian Paul
548526f2e9 docs: add links to xf86-video-vmware wiki pages 2012-01-13 13:46:27 -07:00
Chad Versace
e13c99a004 i965: Comment gen6_hiz_get_framebuffer_enum()
Make the comments precise. Explain why each branch is needed and correct.
Document the potential pitfall in the true-branch.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-13 10:26:01 -08:00
Neil Roberts
9462b84478 gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLES
When using Mesa with a GLES API, calling _mesa_FramebufferRenderbuffer
with GL_DRAW_FRAMEBUFFER will report a 'user error' because
get_framebuffer_target validates that this enum from the framebuffer
blit extension is only used on GL. To work around it this patch makes
it use the GL_FRAMEBUFFER enum instead in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43418
Note: This is a candidate for the 8.0 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-13 10:06:30 -08:00
Brian Paul
27915708ed docs: new page describing how to build, install VMware SVGA3D guest driver 2012-01-13 10:54:58 -07:00
Brian Paul
b0af16abf1 mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()
The AL44 format occupies one byte, not two.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-13 09:51:28 -07:00
Brian Paul
540a8b2cfd osmesa: fix renderbuffer format selection
The gl_renderbuffer::Format field wasn't always set properly.  This
didn't matter much in the past but with the recent swrast/renderbuffer
mapping changes, core Mesa will be directly touching OSMesa colorbuffers
so using the right MESA_FORMAT_x value is important.

Unfortunately, there aren't MESA_FORMATs for all the possible OSmesa
format/type combinations, such as GL_FLOAT / OSMESA_ARGB.  If anyone
runs into these we can add new Mesa formats.

v2: add warnings for unsupported formats, fix ARGB_REV mix-up.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-13 09:50:33 -07:00
Brian Paul
0c14bbbc86 docs: freshen up the introduction page with Mesa 8.0 info, etc 2012-01-13 09:50:33 -07:00
Tom Stellard
9611237051 gallivm: Allow target specific intrinsics in lp_declare_intrinsic()
Target specific intrinsics are also prefixed with llvm, so this assert
was preventing us from using them.
2012-01-13 11:45:49 -05:00
Rob Bradford
baab68e1a6 gbm: Add documentation for the public facing API 2012-01-13 09:31:24 -05:00
Rob Bradford
d036354105 doxygen: Add link to the gbm documentation to the header 2012-01-13 09:31:24 -05:00
Rob Bradford
245341f406 doxygen: Add doxygen file and build infrastructure for gbm 2012-01-13 09:31:23 -05:00
Vinson Lee
3e18ad7fd7 i965: Fix Coverity wrong sizeof argument defect.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:19:34 -08:00
Paul Berry
fcd5af4a91 i965: Set pitch of pull constant buffers to 16.
We always access pull constant buffers using the message types "OWord
Block Read" or "OWord Dual Block Read".  According to the Sandy Bridge
PRM, Vol 4 Part 1, pages 214 and 218, when using these messages:

    "the surface pitch is ignored, the surface is treated as a
    1-dimensional surface.  An element size (pitch) of 16 bytes is
    used to determine the size of the buffer for out-of-bounds
    checking if using the surface state model."

Previously we were setting the pitch for pull constant buffers to the
size of the whole constant buffer--this made no sense and would have
led to incorrect behavior if it were not for the fact that the pitch
is ignored.

For clarity, this patch sets the pitch for pull constant buffers to 16
bytes, consistent with the hardware's behavior.

v2: Clarify the meaning of the ignored values by writing them as (16 - 1).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Paul Berry
f6f43bd5a2 i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()
Commit 9bdc44a528 (i965: Replace struct
with bit shifting for WM pull constant surfaces) accidentally
introduced off-by-one errors into the calculation of the surface
width, height, and depth.  This patch restores the correct
computation.

The reason this wasn't noticed by Piglit tests is that the size of our
constant surfaces is always less than 2^20, therefore the off-by-one
error was causing the "depth" field of the surface to be set to all
1's.  The hardware interpreted this as an extremely large surface, so
overflow checking was effectively disabled.

No Piglit regressions on Sandy Bridge.

NOTE: This is a candidate for the 7.11 and 8.0 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-12 15:12:10 -08:00
Christoph Bumiller
af0ce1dba8 nv50/ir: make use of TGSI_INTERPOLATE_COLOR
Flat SHADE_MODEL still overrides any non-flat interpolation
qualifier, but pulling that state out of the rasterizer cso
isn't really worth the effort, is it ?

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Christoph Bumiller
7b6881932a nvc0: fix submission of VertexID and EdgeFlag in push mode
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 22:38:01 +01:00
Brian Paul
cb254b75d7 osmesa: fix glReadPixels, etc
Needed to implement the Map/UnmapRenderbuffer() driver hooks.
This fixes glRead/Draw/CopyPixels, etc.

See https://bugs.freedesktop.org/show_bug.cgi?id=44723

Note: This is a candidate for the 8.0 branch.

Tested-by: Kevin Hobbs <hobbsk@ohiou.edu>
2012-01-12 13:49:15 -07:00
Brian Paul
062a4b601e intel: move declaration before code 2012-01-12 13:49:15 -07:00
Brian Paul
6dbdc03956 intel: fix mapping of malloc'd renderbuffers
This fixes accum buffer operations.  The accumulation buffer is the
only malloc-based renderbuffer for the intel drivers.

v2: apply x/y offset to returned pointer

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-12 13:49:15 -07:00
Eric Anholt
9be6654c1f mesa: Throw the required error for glCopyPixels from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copypixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:20 -08:00
Eric Anholt
6950a4faf6 mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.
Fixes piglit EXT_framebuffer_multisample/negative-copyteximage.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:18 -08:00
Eric Anholt
86b7c6707f mesa: Throw the required error for glReadPixels() from a multisampled FBO.
Fixes piglit EXT_framebuffer_multisample-negative-readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:15 -08:00
Eric Anholt
0e8d156c3c mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.
Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:13 -08:00
Eric Anholt
f83756f80f meta: Add GL_RED/GL_RG support to meta CopyTexImage.
Fixes some _mesa_problem()s in oglconform.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:34:10 -08:00
Eric Anholt
e6d6a10c5a i965/gen7: Fix depth buffer rendering to tile offsets.
Previously, we were saying that everything from the starting tile to
region width+height was part of the limits of our depthbuffer, even if
the tile was near the bottom of the depthbuffer.  This mean that our
range was not clipping to buffer buonds if the start tile was anything
but the start of the buffer.

In bebc91f0f3, this was changed to
saying that we're just rendering to a region of the size of the
renderbuffer.  This is great -- we get a range that should actually
match what we want.  However, the hardware's range checking occurs
after the X/Y offset addition, so we were clipping out rendering to
small depth mip levels when an X/Y offset was present.  Just add
tile_x/y to the width in that case -- the WM won't produce negative
x/y values pre-offset, so we just need to get the left/bottom sides of
the region to cover our buffer.

Fixes the following Piglit regressions on gen7:
    spec/ARB_depth_buffer_float/fbo-clear-formats
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 12:33:55 -08:00
Brian Paul
003dd8adf3 mesa: remove incorrect (float) cast in mipmap do_row()
The array holds GLuint values so remove the float cast.
Note, however, that to compute the average of four GLuints we really
want to do (a+b+c+d)/4 but that could overflow.  This change doesn't
address that for now.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:55 -07:00
Brian Paul
706400f0a7 swrast: use BITFIELD64_BIT() macro to fix MSVC warnings
NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:50 -07:00
Brian Paul
decd018b99 mesa: fix ir_variable declaration
ir_variable is a class, not a struct.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:44 -07:00
Brian Paul
a240c998ac mesa: fix incorrect float vs. int values in a few places
In the first case, the newImage[] array contains GLuint values.
In the second case, the parameter type is GLuint, but the maxDepth
value is never used in this case (GL_FLOAT_32_UNSIGNED_INT_24_8_REV).
Pass ~OU just to be safe.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:02:19 -07:00
Brian Paul
2f0fa456e3 meta: fix incorrect argument order in setup_texture_coords() call
And pass integer width, height values.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 13:01:59 -07:00
Brian Paul
36ede89687 mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions
Rather than testing the fbo's name against zero.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:58:45 -07:00
Brian Paul
185ee042ac mesa: whitespace, 80-column wrapping in buffers.c 2012-01-12 09:23:55 -07:00
Brian Paul
45a3b54063 mesa: remove obsolete comment on _mesa_dest_buffer_exists() 2012-01-12 09:23:55 -07:00
Brian Paul
50ad155d48 st/mesa: whitespace fixes, 80-column wrapping 2012-01-12 09:23:55 -07:00
Brian Paul
eab036a6ea mesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitions
We include both imports.h and u_math.h in the state tracker.  This
leads to multiple, conflicting definitions of ffs() with MSVC.
Use FFS_DEFINED to skip the ffs() in u_math.h.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-01-12 09:18:34 -07:00
Brian Paul
8cfaab59e0 st/mesa: re-order #includes in st_manager.c
include mesa headers before gallium headers to avoid problem with
ffs() being defined in u_math.h and then again in imports.h

The next commit will add some #ifdefs to prevent multiple definitions
of ffs().
2012-01-12 08:39:17 -07:00
Brian Paul
0c57323de8 sofpipe: remove extraneous semicolon 2012-01-12 08:30:52 -07:00
Brian Paul
9f2963b631 st/mesa: fix struct vs. class compilation warning
glsl_to_tgsi_visitor is earlier defined as a class, not a struct.
Fixes MSVC warning.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 08:29:16 -07:00
Dave Airlie
3e044bcc4b r600g: don't advertise integers yet on r600.
Still some work to be done before this is finished.

This is a candidate for 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 15:06:24 +00:00
Brian Paul
c7188ece0e configs: fix, simplify RADEON_LIBS, RADEON_CFLAGS
Fixes build problems with the r200, radeon drivers.

NOTE: This is a candidate for the 8.0 branch.
2012-01-12 07:54:19 -07:00
Brian Paul
9a548c27aa mesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms
Call ffs() and ffsll() everywhere.  Define our own ffs(), ffsll()
functions when the platform doesn't have them.

v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs()
implementation.  The #else clause was recursive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Alexander von Gluck <kallisti5@unixzen.com>
2012-01-12 07:30:58 -07:00
Thomas Hellstrom
87118d84ff configure: Add the svga gallium driver to the default gallium drivers
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
Thomas Hellstrom
8a4f7d1cdc st/xa: Bump version to 1.0.0 according to the README
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 13:31:34 +01:00
José Fonseca
ce2929dde0 svga: Fix user clip planes.
Dirty flags also need to be updated in face of recent interface change.

Fixes regression in compiz.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 12:05:31 +00:00
Dave Airlie
16b5fda032 softpipe: bump max texture array layers to 256.
This as per GL3 specification.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-12 11:17:07 +00:00
Thomas Hellstrom
4dac89d92c gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device
Some hardware versions rely on it to render correctly.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-12 11:20:16 +01:00
Brian Paul
90d654b09d vbo: fix breakage from previous commit
Don't know how that slipped by.
2012-01-11 20:23:12 -07:00
Brian Paul
bbc74ffad6 vbo: fix void * arithmetic compilation error on MSVC
Also, call vbo_sizeof_ib_type() once and fix argument cast in
MapBufferRange() call.
2012-01-11 20:05:02 -07:00
Marek Olšák
4c0d88c145 docs/GL3: consolidate FBO extensions into one ARB 2012-01-12 03:59:21 +01:00
Marek Olšák
571e1947d0 docs/GL3: document r300 extension support 2012-01-12 03:59:21 +01:00
Marek Olšák
272896b885 docs/GL3: document what's missing for GL3 2012-01-12 03:59:21 +01:00
Yuanhan Liu
42d4972bf0 vbo: introduce vbo_get_minmax_indices function
Introduce vbo_get_minmax_indices() function to handle the min/max index
computation for nr_prims(>= 1). The old code just compute the first
prim's min/max index; this would results an error rendering if user
called functions like glMultiDrawElements(). This patch servers as
fixing this issue.

As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made
vbo_get_minmax_index() static.

v2: per Roland's suggestion, put the indices address compuation into
    vbo_get_minmax_index() instead.

    Also do comination if possible to reduce map/unmap count

v3: per Brian's suggestion, use a pointer for start_prim to avoid
    structure copy per loop.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-12 10:47:41 +08:00
Brian Paul
459a44460e mesa: remove const qualifier from fProg to silence warning
The args to _mesa_reference_shader_program() can't be const.
2012-01-11 18:22:17 -07:00
Brian Paul
fe1b38960b mesa: include uniforms.h to silence warning, remove unused var 2012-01-11 18:22:17 -07:00
Jakob Bornecrantz
6fe42b603d mesa: Include glx tests Makefile.in in tarball
Fix suggested by Kenneth Graunke.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Kenneth Graunke <kenneth@whitescape.org>
2012-01-12 00:44:12 +01:00
Anuj Phogat
c979fe3e20 Enable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACK
glDrawBuffer(GL_FRONT_AND_BACK) results in to segmentation fault if
intel->is_front_buffer_rendering is not enabled with GL_FRONT_AND_BACK.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44153

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 14:25:11 -08:00
Jakob Bornecrantz
04e262ebe9 mesa: Remove unused opengl version macro
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-11 23:17:40 +01:00
Jakob Bornecrantz
c076882fbd rbug: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-11 21:53:23 +01:00
Ian Romanick
1c17745200 i965: Don't use _mesa_ir_link_shader to do our dirty work
Instead, do the uniform setting and input / output mapping directly in
brw_link_shader.  Hurray for not generating Mesa IR!  However, once
the i965 driver stops calling _mesa_ir_link_shader, UsesClipDistance
and UsesKill are no longer set.

Ideally gen6_upload_vs_push_constants should use the
gl_shader_program, but I don't see a way to propagate the information
there.  The other alternative, since this is the only usage, is to
move gl_vertex_program::UsesClipDistance to brw_vertex_program.

The compile (and precompile) stages use UsesKill to determine the
cache key for the shader.  This is then used to determine whether or
not to compile the shader.  Calculating this data during compilation
is too late.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2012-01-11 12:51:24 -08:00
Ian Romanick
efdc8bf189 i965: Don't calculate masks of used FS inputs
This previously enabled some optimizations in the fragment shader
(interpolation, etc.) if some input components were always 0.0 or
1.0.  However, this data was generated by analyzing Mesa IR.  The
next patch in this series removes generation of Mesa IR for GLSL
paths.  When we detect that case, just set the used mask to ~0 and
circumvent the optimizations.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
6c0df75803 linker: Calculate used samplers and shadow samplers in the linker
It used to be done in ir_to_mesa, and that was kind of a bad place.

I didn't change st_glsl_to_tgsi because there is some strange stuff
happening in the code that generates glDrawPixels shaders.  It looked
like this would break horribly if I touched anything.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
6a992c3288 linker: Calculate the sampler to texture target mapping during linking
Track the calculated data in gl_shader_program instead of the
individual assembly shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
32be81de39 glsl: Add glsl_type::sampler_index
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
195ee502c3 mesa: Validate sampler settings using uniform storage
Rather than looking at the settings in individual assembly programs,
look at the settings in the top-level uniform values.  The old code
was flawed because examining each shader stage in isolation could
allow inconsitent usage across stages (e.g., bind unit 0 to a
sampler2D in the vertex shader and sampler1DShadow in the fragment
shader).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
b527dd65c8 mesa: Track fixed-function fragment shader as a shader
Previously the fixed-function fragment shader was tracked as a
gl_program.  This means that it shows up in the driver as a Mesa IR
program instead of as a GLSL IR program.  If a driver doesn't generate
Mesa IR from the GLSL IR, that program is empty.  If the program is
empty there is either no rendering or a GPU hang.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
ca5b30bf81 mesa: Use static buffer for uniform name
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:24 -08:00
Ian Romanick
f409a710e3 mesa: Use uniform interfaces in fixed-function fragment shader code
Poking directly at the backing resources works only by luck.  Core
Mesa code should only know about the gl_uniform_storage structure.
Soon other code that looks at samplers will use the gl_uniform_storage
structures instead of the data in the gl_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:51:23 -08:00
Matt Turner
151b4f3369 Clean up GL3 status
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-11 15:49:56 -05:00
Matt Turner
3a343ef346 configure.ac: use AC_PROG_SED
It looks like AC_PROG_SED was added in 2.59b, and wasn't in the
original 2.59 in the original 2.59.  Presumably that's why, though
it could've been an oversight.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-11 15:49:56 -05:00
Matt Turner
198892c044 configure.ac: don't set HAVE_GTEST twice
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-11 15:49:56 -05:00
Kenneth Graunke
28cfa1fa21 i965: Don't reallocate push constant URB space on new VS programs.
The gen7_urb atom depends on CACHE_NEW_VS_PROG and CACHE_NEW_GS_PROG,
causing gen7_upload_urb() to be called when switching to a new VS
program.

In addition to partitioning the URB space between the VS and GS,
gen7_upload_urb() also allocated space for VS and PS push constants.
Unfortunately, this meant that whenever CACHE_NEW_VS was flagged, we'd
reallocate the space for the PS push constants.  According to the BSpec,
after sending 3DSTATE_PUSH_CONSTANT_ALLOC_PS, we must reprogram
3DSTATE_CONSTANT_PS prior to the next 3DPRIMITIVE.

Since our URB allocation for push constants is entirely static, it makes
sense to split it out into its own atom that only subscribes to
BRW_NEW_CONTEXT.  This avoids reallocating the space and trashing
constants.

Fixes a rendering artifact in Extreme Tuxracer, where instead of a snow
trail, you'd get a bright red streak (affectionately known as the
"bloody penguin bug").

This also explains why adding VS-related dirty bits to gen7_ps_state
made the problem disappear: it made 3DSTATE_CONSTANT_PS be emitted after
every 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-11 12:13:49 -08:00
Kenneth Graunke
10a6fde333 glx/dri: Initialize api even if num_attribs == 0.
Both dri2_create_context_attribs and drisw_create_context_attribs call
dri2_convert_glx_attribs, expecting it to fill in *api on success.

However, when num_attribs == 0, it was returning true without setting
*api, causing the caller to use an uninitialized value.

Tested-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 12:13:49 -08:00
Brian Paul
dce4c368b5 svga: don't reference count svga_sampler_view's texture
svga_sampler_view contains a pointer to a pipe_resource (base class of
svga_texture) and svga_texture contains a pointer to an svga_sampler_view.
This circular dependency prevented the objects from ever being freed when
they pointed to each other.  Make the svga_sampler_view::texture pointer
a "weak reference" (no reference counting) to break the dependency.

This is safe to do because the pipe_resource/texture always has a longer
lifespan than the sampler view so when svga_sampler_view stops referencing
the texture, the texture's refcount never hits zero.

Fixes a memory leak seen with google earth and other apps.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-11 13:10:43 -07:00
Eric Anholt
35cdd7b6db i965: Fix compiler warning from uninitialized "success" value.
This shouldn't happen, because the DDX should only load this driver if
IS_965.  But better to do something defined in that case.
2012-01-11 12:07:15 -08:00
Eric Anholt
ba6f4c9ee2 i965/gen7: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.
Fixes piglit EXT_transform_feedback/buffer-usage.
2012-01-11 12:06:34 -08:00
Eric Anholt
2c623c2be5 i965/vs: Try to emit more components of constant vectors at once.
We were naively emitting each component at a time, even if we were
emitting the same value to multiple channels.  Improves on a codegen
regression from the old VS to the new VS on some unigine shaders
(because we emit constant vecs/matrices as immediates instead of
loading them as push constants, so we had over 4x the instructions for
using them).

shader-db results:
Total instructions: 58594 -> 58540
11/870 programs affected (1.3%)
765 -> 711 instructions in affected programs (7.1% reduction)
2012-01-11 12:06:34 -08:00
Brian Paul
f1b33c74dc mesa: add _mesa_HashNumEntries() function
Useful when debugging to find the number of texture objects, shader
programs, etc.
2012-01-11 12:58:45 -07:00
José Fonseca
6811704830 st/wgl: Return NULL for NULL HDCs in wglGetExtensionsStringARB.
WGL_ARB_extensions_string states that wglGetExtensionsStringARB should
return NULL for invalid HDCs.  And some applications rely on it.

Reviewed-By: "Keith Whitwell" <keithw@vmware.com>
2012-01-11 12:51:40 -07:00
Dave Airlie
2d80cad16e llvmpipe: disable native integers
llvmpipe shouldn't be reporting native integer support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 19:48:56 +00:00
Brian Paul
0a20051e6d xlib: stop calling XShmQueryVersion()
It caused an X protocol error in some (rare) situations.
This is a follow-on to the previous commits which fixes a bug reported
by Wayne E. Robertz.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Brian Paul
7f6de60c58 st/glx/xlib: call register_with_display() in glXChooseFBConfig()
This is the same fix as the previous commit, except it's for the gallium
glx/xlib state tracker.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Brian Paul
ecbdb173bb xlib: call register_with_display() in Fake_glXChooseFBConfig()
as we do in Fake_glXChooseVisual().  This registers the MesaGLX
extension on the display so we can clean up buffers, etc. when
the display connection is closed.

Fixes a bug reported by Wayne E. Robertz.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-11 12:43:45 -07:00
Christoph Bumiller
b424bf69df nv50/ir: handle TGSI_OPCODE_ISSG 2012-01-11 20:26:58 +01:00
Christoph Bumiller
9d503992d7 nv50/ir: handle TGSI_TEXTURE_SHADOWCUBE 2012-01-11 20:26:52 +01:00
Christoph Bumiller
f6b994b305 nv50,nvc0: zero out program struct on program_destroy
Prevent any state from carrying over to a new translation in cases
where we assume that data is still zero from initial calloc (these
would require us to do individual zeroing before translation which
would be more code).
2012-01-11 20:26:47 +01:00
Kristian Høgsberg
58dc1b28d1 wayland-drm: Drop the non-premul formats, use format codes from drm_fourcc.h 2012-01-11 14:24:00 -05:00
José Fonseca
1306644a67 draw: Store the new pre_clip_pos member as well.
Again, not much testing nor peer review, but should be better than what's
now.
2012-01-11 18:11:28 +00:00
Kristian Høgsberg
513d1feee4 egl_dri2: Put the _eglError call in the case switch case
Log an error in case we get an unknown format, not in case for XRGB32.
I botched the edit of Roberts patch.
2012-01-11 12:44:58 -05:00
Dave Airlie
3f80b69b5f st/mesa: rename translate_texture_target, and make translate_opcode static.
As suggested by Brian.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
fffca9046c softpipe: route correct coordinates for shadow cube sampling.
This fixes the shadow cube map sampling on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
2f275466f7 glsl_to_tgsi: add support for shadow cube map sampling.
This along with the TGSI support lets the piglit sampler-cube-shadow
test pass on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
Dave Airlie
0ec30805a4 tgsi: add TGSI_TEXTURE_SHADOWCUBEMAP
This adds support for shadow cubemap texture sampling instructions.

This is required for GL 3.0.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 17:35:25 +00:00
José Fonseca
ec4d691474 llvmpipe: Update for TGSI_INTERPOLATE_COLOR.
Not thoroughly tested nor reviewed. But should at least prevent the
assertion failure.
2012-01-11 17:35:14 +00:00
Robert Bragg
670f182a1f egl_dri2/wayland: handle creating xrgb8888 images
When creating an EGLImage from a struct wl_buffer * this ensures
that we create an XRGB8888 image if the wayland buffer doesn't have an
alpha channel. To determine if a wl_buffer has a valid alpha channel
this patch adds an internal wayland_drm_buffer_has_alpha() function.

It's important to get the internal format for an EGLImage right so that
if a GL texture is later created from the image then the GL driver will
know if it should sample the alpha from the texture or flatten it to
a constant of 1.0.

This avoids needing fragment program workarounds in wayland compositors
to manually ignore the alpha component of textures created from wayland
buffers.

krh: Edited to use wl_buffer_get_format() instead of wl_buffer_has_alpha().

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2012-01-11 12:16:47 -05:00
Paul Berry
765ed3a6a9 glx: Suppress unused variable warning for cmdlen
No functional change.  In the function
__indirect_glAreTexturesResident(), the variable cmdlen is only used
if USE_XCB is not defined.  This patch avoids a compile warning in the
event that USE_XCB is defined.

v2: just move cmdlen declaration inside the #else part.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-11 07:57:56 -08:00
Paul Berry
d3150ebc8c mesa: Move transform feedback error check to reduce array overflow risk.
Previous to this patch, we didn't do the limit check for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS until the end of the
store_tfeedback_info() function, *after* storing all of the transform
feedback info in the gl_transform_feedback_info::Outputs array.  This
meant that the limit check wouldn't prevent us from overflowing the
array and corrupting memory.

This patch moves the limit check to the top of tfeedback_decl::store()
so that there is no risk of overflowing the array.  It also adds
assertions to verify that the checks for
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS are sufficient to avoid
array overflow.

Note: strictly speaking this patch isn't necessary, since the maximum
possible number of varyings is MAX_VARYING (16), whereas the size of
the Outputs array is MAX_PROGRAM_OUTPUTS (64), so it's impossible to
have enough varyings to overflow the array.  However it seems prudent
to do the limit check before the array access in case these limits
change in the future.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-11 07:57:56 -08:00
Paul Berry
642e5b413e mesa: Fix transform feedback of unsubscripted gl_ClipDistance array.
On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), we need to handle transform feedback of gl_ClipDistance
specially, to account for the fact that the hardware represents it as
an array of vec4's rather than an array of floats.

The previous way this was accounted for (translating the request for
gl_ClipDistance[n] to a request for a component of
gl_ClipDistanceMESA[n/4]) doesn't work when performing transform
feedback on the whole unsubscripted array, because we need to keep
track of the size of the gl_ClipDistance array prior to the lowering
pass.  So I replaced it with a boolean is_clip_distance_mesa, which
switches on the special logic that is needed to handle the lowered
version of gl_ClipDistance.

Fixes Piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]-no-subscript".

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:57:56 -08:00
Paul Berry
be4e9f7a0c mesa: Fix computation of transform feedback num_components.
The function tfeedback_decl::num_components() was not correctly
accounting for transform feedback of whole arrays and gl_ClipDistance.
The bug was hard to notice in tests, because it only affected the
checks for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS and
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS.

This patch fixes the computation, and adds an assertion to verify
num_components() even when MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
and MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS are not exceeded.

The assertion requires keeping track of components_so_far in
tfeedback_decl::store(); this will be useful in a future patch to fix
non-multiple-of-4-sized gl_ClipDistance.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:57:56 -08:00
Dave Airlie
c62e02000d st_extensions: fixup GLSL 1.30 related enables (v3)
This just fixes up the enables for native integers and EXT_texture_integer
support in st/mesa.

It also set the MaxClipPlanes to 8.

We should consider exposing caps for MCP vs MCD, but since core
mesa doesn't care yet maybe we can wait for now.

v2: use 32-bit formats as per Marek's mail.

v3: add calim's fix for INT_DIV_TO_MUL_RCP disabling.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
cc94f0541c st_glsl_to_tgsi: use ISSG and fixup IABS
It doesn't look like the GLSL compiler will produce sign op
for an unsigned anyways (seems insane anyways).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
b6cbc28533 tgsi: add ISSG support
This adds integer version of SSG that GLSL 1.30 can produce.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
0fe2b397bb softpipe: enable clamping control
This enables fragment clamping in softpipe, it passes more
tests than it did previously with no regressions, There are still
a couple of failures in the SNORM types to investigate.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Dave Airlie
e809b7a678 softpipe: fix texel fetch swizzles
This fixes a number of texelFetch swizzle tests, and consoldiates
the swizzle handling in a new function.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 13:49:02 +00:00
Stéphane Marchesin
3235435e80 i915g: Fix bugs in the shader optimizer. 2012-01-11 02:25:42 -08:00
Dave Airlie
5840ec2d41 softpipe: fix llvm build
Thanks to Wubbbi on #dri-devel for pointing it out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 10:16:56 +00:00
Dave Airlie
1865f341d8 draw: clipdistance support (v2)
Add support for using the clipdistance instead of clip plane.

Passes all piglit clipdistance tests.

v2: fixup some comments from Brian in review.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 08:20:11 +00:00
Dave Airlie
f7e3e46f72 tgsi_scan: add support to count number of output clip distances
Just add support to the scanner to count the number of clip distances.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 08:08:12 +00:00
Dave Airlie
40c5987ed8 draw/softpipe: add clip vertex support. (v2)
softpipe always clipped using the position vector, however for unclipped
vertices it stored the position in window coordinates, however when position
and clipping are separated, we need to store the clip-space position and
the clip-space vertex clip, so we can interpolate both separately.

This means we have to take the clip space position and store it to use later.

This allows softpipe to pass all the clip-vertex piglit tests.

v2: fix llvm draw regression, the structure being passed into llvm needed
updating, remove some hardcoded ints that should have been enums while there.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:35 +00:00
Dave Airlie
34a78b7ef6 tgsi/softpipe: add VertexID support.
This required changing the system value semantics, so we stored
a system value per vertex, instance id is the only other system
value we currently support, so I span it across the channels.

This passes the 3 vertexid-* piglit tests + lots of instanceid tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:35 +00:00
Dave Airlie
02932f37fa softpipe: allow softpipe to set shader params depending on runtime llvm (v3)
If draw isn't using llvm we can support vertex texture and integers,
These will be fixed up later, but for now allow this check to happen
at run-time.

v2: since 3e22c7a253 we can ask draw for a non-llvm
context. Just track if ask and set the vars accordingly. This probably isn't perfect but should cover the cases we care about.

v3: use debug option, restructure to store in screen, as suggested by Jakob.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:13:27 +00:00
Dave Airlie
092cf9a5b5 mesa/clear: fix crashes with illegal clear tests.
Mesa shouldn't call into the drivers if there are no renderbuffers
bound to the attachments for the buffers to be cleared.

Fixes a number of the clearbuffer-* tests on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-11 07:06:25 +00:00
Dave Airlie
863554168e mesa: fix cubemap depth completeness test
This fixes the test to allow cube/depth combinations on GL3
or EXT_gpu_shader4.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-11 07:02:32 +00:00
Eric Anholt
916e206ef0 glsl: Add error checking for applying interpolation qualifiers to other vars.
Fixes piglit
glsl-1.30/compiler/interpolation-qualifiers/local-smooth-01.frag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
be4e46b21a i965: Claim to support 4 multisamples on gen6+.
We're not quite ready to actually support it in the implementation,
but at least this allows GL 3.0 API-reliant applications to hopefully
run successfully, though they won't get multisampling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
3d4efc583c i965: Increase the number of array texture levels to the hardware limit.
The EXT_texture_array required only 64, but GL 3.0 required 256.
Since we're already exposing values that can get us way beyond our
ability to map the single object directly, go ahead and expose all the
way to hardware limits.

Tested with new piglit EXT_texture_array/maxlayers on gen7.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
057f9ae54b glsl: Fix copy_propagation_elements bug in handling self-copies.
We were doing the kill of the updated channels, then adding our copy
to the list of available stuff to copy.  But if the copy was updating
its own source channels, we didn't notice, breaking this code:

	R0.xyzw = arg0 + arg1;
	R0.xyzw = R0.wwwx;
	gl_FragColor.xyzw = clamp(R0.xyzw, 0.0, 1.0);

Fixes piglit glsl-copy-propagation-self-2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-10 16:44:16 -08:00
Eric Anholt
254b24f195 i965: Fix compiler warnings from hiz changes. 2012-01-10 16:44:16 -08:00
Chad Versace
f7cbd80028 i965/gen7: Fix batch length for 3DSTATE_HIER_DEPTH_BUFFER
Change from 5 to 3.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 16:31:52 -08:00
Chad Versace
06ad9adcb0 i965/gen7: Enable HiZ
This patch modifies all batches needed for HiZ. The batch length for
3DSTATE_HIER_DEPTH_BUFFER is also corrected from 4 to 3.

Performance +6.7% on Citybench.
    num-frames: 400
    resolution: 1918x1031
    avg-hiz-off: 127.90 fps
    avg-hiz-on: 136.50 fps
    kernel: git://people.freedesktop.org/~anholt/linux.git branch=gen7-reset-sol sha=23360e4

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:38 -08:00
Chad Versace
bebc91f0f3 i965: Replace references to stencil region size with buffer size
It is unwise to use a stencil region's size to determine its
renderbuffer's size, because at region creation we fudge the width and
height to accomodate interleaved rows. (See the comment for MESA_FORMAT_S8
in intel_miptree_create()). Most users of stencil_region->{width,height}
should be converted to use stencil_rb->{Width,Height}.

We have already done the replacement in several locations. This patch
continues the replacement in {brw,gen7}_emit_depthbuffer(). To make those
functions look consistent, I've also done the equivalent replacement for
the depth buffer.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:27 -08:00
Chad Versace
b755f5894c i965: Fix misnamed GEN7_WM_DEPTH_RESOLVE
It was named GEN6_WM_DEPTH_RESOLVE. Luckily, this caused no conflict,
because the value is identical for gen6 and gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-10 15:52:05 -08:00
Christoph Bumiller
bd38459fe9 nv50: fix clip state validation
Don't create clip outputs if no clip planes are enabled.

Move clip validation after program validation: we were calling
linkage validation in case the VP needed rebuilding before the
FP was validated.

The vertex program needs to be built first because when
ClipDistance is used we'll want to only enable those outputs that
are also written.
2012-01-10 21:45:31 +01:00
Brian Paul
8597c986d7 draw: remove unused 'so' variable in draw_pt_so_emit() 2012-01-10 12:40:10 -07:00
Brian Paul
991479ef51 mesa: fix > vs. >> typo in EXPAND_3_8() macro
Found by Eirik Byrkjeflot Anonsen.
2012-01-10 12:37:38 -07:00
Brian Paul
d6533df90d st/mesa: remove unnecessary memset()/zero call
The u_surface_default_template() function does the memset()/zero now.

Jakob Bornecrantz <jakob@vmware.com>
2012-01-10 12:37:38 -07:00
Brian Paul
2e87660ca6 util: use memset() to initialize surface, sampler_view templates
These initialization functions weren't initializing all the fields so
some had undefined values.  The callers of these functions sometimes use
a structure assignment to initialize new objects from these templates
so we'd just propagate the undefined values.  That made for some confusing
info when debugging, plus it could lead to bugs.

v2: fix surf pointer mix-up: "&surf" -> "surf"

Jakob Bornecrantz <jakob@vmware.com>
2012-01-10 12:37:38 -07:00
Brian Paul
6bf5daf331 mesa: use STATIC_ASSERT in a few more places 2012-01-10 12:37:37 -07:00
José Fonseca
f9b2d2fea5 scons: Fix libGL.so build. 2012-01-10 17:42:02 +00:00
Brian Paul
8fe6755ed5 mesa: move _mesa_clear_accum_buffer() inside FEATURE_accum test
Fixes _mesa_clear_accum_buffer() being multiply defined if
FEATURE_accum is false.

Tested-by: Chih-Wei Huang <cwhuang@android-x86.org>
2012-01-10 09:09:02 -07:00
Brian Paul
9b1117095a mesa: add missing color buffer datatype check for glBlitFramebuffer()
Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
2012-01-10 09:09:02 -07:00
Jakob Bornecrantz
ca21c85ab0 svga: Drop execbuf throttling
This code isn't used anymore in preference for DRI2 client side swap buffers
throttling or throttling done inside the xa or xorg driver.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:45 +01:00
Jakob Bornecrantz
1c9a46dbbe svga: Add somewhat sensible fallback and silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:45 +01:00
Jakob Bornecrantz
b5f31333a6 svga: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:44 +01:00
Jakob Bornecrantz
13c78e7786 svga: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:44 +01:00
Jakob Bornecrantz
f700370946 svga: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:44 +01:00
Jakob Bornecrantz
4a605293b2 svga: Ignores
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:59:43 +01:00
Jakob Bornecrantz
1ec4ae1930 mesa: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
Reviewed-by Ian Romanick <ian.d.romanick@intel.com>
2012-01-10 16:59:43 +01:00
Jakob Bornecrantz
230cc36611 mesa: Silence warning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
Reviewed-by Ian Romanick <ian.d.romanick@intel.com>
2012-01-10 16:59:43 +01:00
Jakob Bornecrantz
54f6b64e7e draw: Silence warning
This peice of code has been here since the inital commit (c5c5cd71) and the
code that used instance_id_index was removed in (caede752) by José.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 16:03:43 +01:00
Jakob Bornecrantz
9af9e12bc5 target-helpers: If neither softpipe or llvmpipe is used just return the screen
So the targets can drop the sw_wrapper winsys when no sw driver is being used.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>
2012-01-10 15:53:18 +01:00
Dave Airlie
ec8cbd79ac draw/softpipe: EXT_transform_feedback support (v2)
This replaces the current code with an implementation compatible with
the new gallium interface. I've left some of the remains of the interface
intact so llvmpipe keeps building correctly, and I'll take a look at fixing
llvmpipe up later.

v2: fixup as per Brian's review

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-10 12:07:51 +00:00
Dave Airlie
67e3cbf163 gallium: introduce GLSL based interpolation rules. (v2)
This introduces an unspecified interpolation paramter that is only allowed for
color semantics, so a specified GLSL interpolation will override the ShadeModel
specified interpolation, but not vice-versa.

This fixes a lot of the interpolation tests in piglit.

v2: rename from unspecified to color

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-10 11:54:44 +00:00
Christoph Bumiller
5a7c343352 nvc0: fix FP header clip distance mask 2012-01-10 00:39:47 +01:00
Christoph Bumiller
e4210a42bc nvc0/ir: TXF array index already is an integer 2012-01-10 00:39:41 +01:00
Christoph Bumiller
7fd802b96c nv50/ir: handle TGSI_SEMANTIC_VERTEXID 2012-01-10 00:39:35 +01:00
Christoph Bumiller
ca03372657 nv50/ir/tgsi: translate SNE as unordered comparison
Fixes isnan().
2012-01-10 00:39:29 +01:00
Christoph Bumiller
4021979182 nv50/ir/ra: don't coalesce contraint-moves
This could lead to incorrect code when fixed regs are involved.

Surprisingly, the increased freedom actually leads to lower
register usage in some cases. Still want to find a better way
to treat constraints though ...
2012-01-10 00:39:12 +01:00
Christoph Bumiller
601fb4b746 nvc0: enable shader watchdog timer
Prevent infinite loops in shaders from locking up the GPU.
2012-01-10 00:38:19 +01:00
Christoph Bumiller
be1ae976a4 nv50/ir/tgsi: handle TGSI_OPCODE_IABS 2012-01-10 00:37:47 +01:00
Christoph Bumiller
ae828413c4 nv50/ir/opt: optimize u32 MOD by power of 2 into AND 2012-01-10 00:37:37 +01:00
Christoph Bumiller
6ab6110133 nv50/ir/opt: s/SHL/SHR in optimization of u32 DIV 2012-01-10 00:37:32 +01:00
Christoph Bumiller
b85e93c0ca nv50/ir,nvc0: make ClipDistance and ClipVertex work 2012-01-10 00:37:19 +01:00
Christoph Bumiller
f37c3a3335 nv50,nvc0: handle new PIPE_CAPs 2012-01-10 00:37:03 +01:00
Christoph Bumiller
7c6ca0367b nvc0/ir/emit: fix modifiers of f32 add with long immediate 2012-01-10 00:36:59 +01:00
Christoph Bumiller
405bd00f3c nvc0/ir: fix default insertion position in pre-SSA lowering pass
Always set position to insert before the current instruction,
the previous behaviour led to confusion (bug in checkPredicate
for BBs with only a single conditional branch).
2012-01-10 00:36:46 +01:00
Marek Olšák
dc4c821f08 Squash-merge branch 'gallium-clip-state'
Conflicts:
	src/gallium/auxiliary/tgsi/tgsi_strings.c
	src/mesa/state_tracker/st_atom_clip.c

commit d919791f2742e913173d6b335128e7d4c63c0840
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 17:59:22 2012 +0100

    d3d1x: adapt to new clip state

commit cfec82bca3fefcdefafca3f4555285ec1d1ae421
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 14:16:51 2012 +0100

    gallium/docs: update for clip state changes

commit c02bfeb81ad9f62041a2285ea6373bbbd602912a
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 14:21:43 2012 +0100

    tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS

commit d4e0a785a6a23ad2f6819fd72e236acb9750028d
Author: Brian Paul <brianp@vmware.com>
Date:   Thu Jan 5 08:30:00 2012 -0700

    tgsi: consolidate TGSI string arrays in new tgsi_strings.h

    There was some duplication between the tgsi_dump.c and tgsi_text.c
    files.  Also use some static assertions to help catch errors when
    adding new TGSI values.

    v2: put strings in tgsi_strings.c file instead of the .h file.

    Reviewed-by: Dave Airlie <airlied@redhat.com>

commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Fri Jan 6 12:48:09 2012 +0100

    gallium: extend user_clip_plane_enable to apply to clip distances

commit f1d5016c07f786229ed057effbe55fbfd160b019
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Jan 6 02:39:09 2012 +0100

    nvfx: adapt to new clip state

commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Jan 6 01:41:39 2012 +0100

    st/mesa: fix DrawPixels with GL_DEPTH_CLAMP

commit c86ad730aa1c017788ae88a55f54071bf222be12
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Tue Jan 3 23:51:30 2012 +0100

    nv50: adapt to new clip state

commit 3a8ae6ac243bae5970729dc4057fe02d992543dc
Author: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Date:   Tue Jan 3 23:32:36 2012 +0100

    nvc0: adapt to new clip state

commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11
Author: Marek Olšák <maraeo@gmail.com>
Date:   Thu Dec 29 01:32:51 2011 +0100

    draw: initalize pt.user.planes in draw_init

    This fixes a crash in glean/fpexceptions.

commit e3056524b19b56d473f4faff84ffa0eb41497408
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Dec 26 06:26:55 2011 +0100

    svga: adapt to new clip state

commit c5bfa8b37d6d489271df457229081d6bbb51b4b7
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 14:11:51 2011 +0100

    r600g: adapt to new clip state

commit f11890905362f62627c4a28a8255b76eb7de7df2
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 14:10:26 2011 +0100

    r300g: adapt to new clip state

commit e37465327c79a01112f15f6278d9accc5bf3103f
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 12:39:16 2011 +0100

    draw: adapt to new clip state

    This adds a regression in the LLVM clipping path. Can anybody see anything
    wrong with the code? It works for every other case, just glean/fpexceptions
    crashes when doing the "Infinite clip plane test".

commit b474d2b18c72d965eefae4e427c269cba5ce6ba2
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 13:14:59 2011 +0100

    u_blitter: don't save/set/restore clip state

commit 9dd240ea91f523a677af45e8d0adb9e661e28602
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 13:11:56 2011 +0100

    gallium: don't cso_save/set/restore clip state

    The enable bits are in the rasterizer state.

commit a4f7031179f5f4ad524b34b394214b984ac950f6
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 12:58:55 2011 +0100

    gallium: default depth_clip to 1

    depth_clip = !depth_clamp

commit fe21147a00ab90e549d63fe12ee4625c9c2ffcc3
Author: Marek Olšák <maraeo@gmail.com>
Date:   Mon Dec 26 06:14:19 2011 +0100

    trace,util: update state logging to new clip state

    Also dump the other missing flags.

commit 2a3b96e84ac872dcc5bc1de049fe76bb58d64b23
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sun Dec 25 10:43:43 2011 +0100

    st/mesa: adapt to new clip state

commit b7b656a42fca19d7c85267f42649a206a85a2c72
Author: Marek Olšák <maraeo@gmail.com>
Date:   Sat Dec 17 15:45:19 2011 +0100

    gallium: move state enable bits from clip_state to rasterizer_state
2012-01-10 00:25:05 +01:00
Kenneth Graunke
a48cc138a8 i965: Fix zeroing of unused attributes in 3DSTATE_SBE.
This brings the code in sync with gen6_sf_state.c; presumably the
mistake was a botched rebase on initial Ivybridge bring-up patches.

Found by diffing batch buffer dumps and noticing the random values.
Thanks to Eric for catching the obvious mistake.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:11 -08:00
Kenneth Graunke
7cb40da7a5 i965: Re-sync outdated comments about Gen6+ push constants.
In f3e9ccb3b, I renamed gen6_upload_wm_constants to
gen6_upload_wm_push_constants, but neglected to update this comment.

I don't think there ever was a gen7_prepare_wm_constants function; it
was probably a search and replace error.  Of course, "prepare" functions
died a while back as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:10 -08:00
Kenneth Graunke
647b890e7d i965: Update dirty bit comments for the gen7_ps_state atom.
CACHE_NEW_SAMPLER doesn't cover max_wm_threads, but it does cover
brw->sampler.count.  BRW_NEW_PS_BINDING_TABLE is obvious, but it's
probably worth adding a comment anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
ef034f1094 i965: Annotate the use of _NEW_PROGRAM in Gen6+ SF state atoms.
The dirty bit was already correctly in place, but there was no comment.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
62ca17101c i965: Add missing _NEW_PROGRAM dirty bit to the brw_sf_state atom.
Also, annotate the use of _NEW_POINT as long as we're adding a comment.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
60343b67f7 i965: Add missing _NEW_PROGRAM dirty bit to the gen7_sbe_state atom.
According to a comment in gen6_sf_state, calls to get_attr_override need
both _NEW_PROGRAM and _NEW_LIGHT.  Since Gen7 reuses the same function,
the same dirty bits should apply.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:09 -08:00
Kenneth Graunke
f497906ec0 i965: Remove BRW_NEW_CURBE_OFFSETS dirty bit from Gen7 atoms.
The BRW_NEW_CURBE_OFFSETS dirty bit is only flagged by the
brw_curbe_offsets state atom which is only used on Gen4-5.

Since it's never flagged, there's no reason to depend on it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:08 -08:00
Kenneth Graunke
74d7ef0961 i965: Remove BRW_NEW_URB_FENCE dirty bit from Gen6+ atoms.
The BRW_NEW_URB_FENCE dirty bit is only flagged by the
brw_recalculate_urb_fence state atom which isn't used on Gen6+.

Since it's never flagged, there's no reason to depend on it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:08 -08:00
Kenneth Graunke
4874fcb028 i965: Add missing _NEW_BUFFERS dirty bit to Gen6+ DEPTH_STENCIL atoms.
This brings the dirty bits in line with the comments.

This does /not/ need to be cherry-picked to stable branches because the
access requiring _NEW_BUFFERS was added in master as part of HiZ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 21:45:08 -08:00
Andy Clayton
6c29452f38 glsl: fix glsl optimization infinite loop from copy_propagation_elements
The trick was to produce an assignment in the IR along the lines of:

      (assign  (xyzw) (var_ref R0)  (swiz wwww (var_ref R0) ))

which occurs only rarely even in code that looks like it should do
this, because of the assignment temporaries generated in ast_to_hir.

From the IR above, this optimization pass would then propagate
references of R0 into R0.wwww (seems reasonable), but without this
patch, a later reference of R0.wwww would see R0 first, turning that
into R0.wwww.wwww, which triggered opt_swizzle_swizzle, and then we
looped back to this code to do it again.  Avoid that by skipping over
the usual ir_rvalue visitor's ir_swizzle hook, so that we get
handle_rvalue() on the ir_swizzle itself, not its referenced value.
Looking at only the swizzle will always optimize away at least as much
as looking at the swizzle's refererenced value.

We now still claim to propagate r0.w into r0.w, but at least we don't
trigger the loop.

v2: Rewrite commit message (changes by anholt)

Fixes piglit glsl-copy-propagation-self-1
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=34006
2012-01-09 13:05:21 -08:00
Jakob Bornecrantz
6afa7cdf93 softpipe: Document new llvm flag
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
2012-01-09 21:39:32 +01:00
Jakob Bornecrantz
8783d4227f softpipe: Don't use llvm in draw
But add a option to force it on for testing.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-09 21:39:06 +01:00
Jakob Bornecrantz
f4863f3923 draw: Fail if we fail to enable llvm when asked for it
The r300 driver requires LLVM when building and other drivers that
depend on it for all TNL, like i915g will be a lot slower without it.

Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-09 21:39:03 +01:00
Jakob Bornecrantz
3e22c7a253 draw: Make it possible to create a llvm free context
Signed-off-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-09 21:38:52 +01:00
Kenneth Graunke
a53cb348ba mesa: Bump version to 8.0 (devel)
Also update the release notes to mention that Mesa 8.0 implements
OpenGL 3.0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 12:01:55 -08:00
Jerome Glisse
b82a2a848c radeon/winsys: fix get info ioctl error checking
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-01-09 14:59:56 -05:00
Eric Anholt
30f86aec01 i965/fs: Fix projector==1.0 optimization pre-gen6.
The optimization was supposed to turn an attribute component that was
always 1.0 into a mov of 1.0.  But by leaving loop this patch removes
out of that test, we applied the projection correction to the 1.0 and
got some other value, breaking openarena once it was converted to
using the new compiler backend.

Originally this hunk was separate from the former loop to make the
generated instructions slightly better pipelined.  We now have
automatic instruction scheduling to handle that, and the generated
instruction sequence looked the same to me after this change (except
for the bugfix).
2012-01-09 10:59:38 -08:00
Eric Anholt
83dc891b41 i965/fs: Fix GPU hangs with 16-wide integer div/mod on gen7.
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 10:47:09 -08:00
Paul Berry
108cba21de mesa: Fix bogus transform feedback error message when subscripting non-array.
Previous to this patch, if the client requested transform feedback
using a subscript, but the variable was not an array
(e.g. "gl_FrontColor[0]"), we would produce a bogus error message like
"Transform feedback varying gl_FrontColor[0] found, but it's an array
([] expected)".

Changed the error message to e.g. "Transfrorm feedback varying
gl_FrontColor[0] requested, but gl_FrontColor is not an array."

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-09 10:30:35 -08:00
Brian Paul
b87b857d90 mesa: fix error message in _mesa_BlitFramebufferEXT() 2012-01-09 08:11:33 -07:00
Brian Paul
3f1fab0684 mesa: check depth, stencil formats (not depths) in glBlitFramebuffer
We were only comparing the number of depth and stencil bits but the
extension spec actually says the formats must match:

    The error INVALID_OPERATION is generated if BlitFramebufferEXT is
    called and <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT
    and the source and destination depth or stencil buffer formats do
    not match.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 08:11:33 -07:00
Brian Paul
84c38c739e mesa: add missing error check for linear blit of integer colors
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-09 08:11:33 -07:00
Brian Paul
edca96547a swrast: convert blit_linear() to Map/UnmapRenderbuffer()
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 08:11:33 -07:00
Brian Paul
7274538da7 mesa: add _mesa_unpack_ubyte_rgba_row() function
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 08:11:33 -07:00
Brian Paul
301fba5445 mesa: rename _mesa_unpack_int_rgba_row() to _mesa_unpack_uint_rgba_row()
Since it returns uint values, not int.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-09 08:11:33 -07:00
Christian König
8c2bfa34a0 vl: replace decode_buffers with auxiliary data field
Based on patches from Maarten Lankhorst <m.b.lankhorst@gmail.com>

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-01-09 12:21:22 +01:00
Kenneth Graunke
37240d2132 i965: Actually enable SIMD16 dispatch on Ivybridge.
Commit acf82657f4 supposedly enabled
SIMD16 dispatch, but neglected to set the "16 Pixel Dispatch Enable"
bit, so nothing actually got enabled.

Furthermore, it neglected to set up the Dispatch GRF Start Register for
kernel 2, which is the SIMD16 program.

Increases performance in Nexuiz by ~15% at 800x600 (n=3).

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-08 14:38:03 -08:00
Marek Olšák
ed22f8ed2c nvfx: remove unused-but-set variables 2012-01-08 19:09:37 +01:00
Kenneth Graunke
a56a732c69 i965: Correct _NEW_TRANSOFORM typos.
Using the proper spelling, _NEW_TRANSFORM, makes searching work better.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-07 20:01:59 -08:00
Kenneth Graunke
6a26005c1e i965: Correct misspellings of "invariant".
$ dict invarient
No definitions found for "invarient", perhaps you mean:
gcide:  Invariant
wn:  invariant

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-07 20:01:59 -08:00
Bryan Cain
73b26e4d12 glsl_to_tgsi: emit IABS for absolute value of integers 2012-01-07 16:20:28 -06:00
Brian Paul
56b57aa360 mesa: rework ctx->Driver.CopyTexSubImage() parameters
Replace target, level parameters with gl_texture_image.
Add gl_renderbuffer parameter to indicate source buffer for the copy.

This removes some redundant code in the drivers to find the source
renderbuffer and the destination texture image (which we already had
in _mesa_CopyTexSubImage).

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-07 15:04:23 -07:00
Bryan Cain
4c0f1fb5ec gallium: add an IABS opcode to TGSI
This is a necessary operation that is missing from TGSI.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-07 15:37:32 -06:00
Brian Paul
291e374ea5 mesa: remove unused _mesa_unpack_uint_rgba_row() prototype 2012-01-07 14:34:44 -07:00
Bryan Cain
673535f607 glsl_to_tgsi: fix emission of boolean constants
We use 0xffffffff for true, but visit(ir_constant *) was emitting 1.
2012-01-07 15:33:36 -06:00
Bryan Cain
c4529d10be glsl_to_tgsi: remove bad assertion 2012-01-07 15:33:36 -06:00
Brian Paul
282292f24c swrast: fix Z testing of points/lines for 16-bit depth buffers
We were comparing 32-bit Z buffer values against 16-bit fragment values.
Need to do scaling like for the 24-bit case.

Triangle Z testing was OK since it didn't hit this code path.
2012-01-07 14:16:27 -07:00
Brian Paul
8dffb6bdab swrast: s/GLbitfield/GLbitfield64/ for sw_span::arrayAttribs
This is a bitfield of FRAG_BIT_x values so it should be 64-bits now.
2012-01-07 14:16:27 -07:00
Brian Paul
7d960a352f swrast: s/GLint/GLuint/ to silence MSVC signed/unsigned comparison warning 2012-01-07 14:16:27 -07:00
Brian Paul
5fc6db6708 meta: add some 'f' suffixes to silence MSVC warnings 2012-01-07 14:16:27 -07:00
Brian Paul
6bf7d40214 mesa: add some 'f' suffixes to silence MSVC warnings 2012-01-07 14:16:27 -07:00
Brian Paul
70754dd1fb util: silence some MSVC type conversion warnings 2012-01-07 14:16:27 -07:00
Brian Paul
f0f623a907 draw: replace assert(0) with debug_warn_once()
If the assertion was hit, it probably meant that we were unable to allocate
or map a vertex buffer.  Instead of dying in a debug build, issue a warning
and continue.
2012-01-07 14:16:27 -07:00
Brian Paul
94bf2d48e1 util: add debug_warn_once() macro
Emits a warning message, but only once to avoid tons of repeated warnings.
2012-01-07 14:16:27 -07:00
Brian Paul
994c33db87 draw: whitespace fixes, etc. 2012-01-07 14:16:27 -07:00
Brian Paul
488dd2c191 gallium: make vbuf_render::set_primitive() return void
All the implementations of this function always return TRUE.
2012-01-07 14:16:27 -07:00
Brian Paul
59d2c4f8e5 svga: fix assorted whitespace issues, add copyright comment 2012-01-07 14:16:27 -07:00
Brian Paul
78028dc2bd svga: add switch cases for PIPE_SHADER_CAP_OUTPUT_READ
Silences unhandled switch case warning.
Return 0 since we don't want to read from output regs.
2012-01-07 14:16:27 -07:00
Brian Paul
4c502e05e8 mesa: add/update comments in _mesa_copy_buffer_subdata() 2012-01-07 14:16:27 -07:00
Marek Olšák
2bdf93449a u_vbuf: don't unroll indices if mapping vertex buffers blocks 2012-01-07 20:48:28 +01:00
Dave Airlie
784026139c draw: fix missing include for u_format.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:57:12 +00:00
Dave Airlie
a103c61d27 st/mesa: add support for clip vertex.
We need to pass the pre-projection matrix clip planes into the driver,
instead of the post for the case we have a vertex shader that writes clip
vertex.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:36:25 +00:00
Dave Airlie
9cea86f501 gallium: add new semantic for clip vertex.
This is to match the gl_ClipVertex output from GLSL 1.20.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:36:24 +00:00
Dave Airlie
17707d89f4 draw: don't translate non-floats to float.
translate signed/unsigned integers to coresponding uint/sint r32g32b32a32 types.

This fixes a bunch of piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:31:43 +00:00
Dave Airlie
e1ff84371c st/mesa: fix default interpolation for colors.
Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.

this is the final version that fixes the reflect regression.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-07 08:30:23 +00:00
Kenneth Graunke
be21ded2ae glsl/builtins: Add missing mix(genType, genType, bvec) built-ins.
The IR for mix(float, float, bool) was missing a write mask, causing the
IR reader to die horribly.  Furthermore, I neglected to add any of the
new prototypes to the 1.30 profiles.

Fixes oglconform's glsl-bif-com advanced.mix test cases.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44477
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-06 18:18:15 -08:00
Kenneth Graunke
7ccf04ebcf i965/vs: Fix invalid array access in copy propagation.
Accessing virtual_grf_reg_map[inst->dst.reg] is invalid if
inst->dst.file != GRF.  Since is_direct_copy already implies a GRF
destination, we can just move the check earlier.

Fixes a regression in commit 07ee9f374f.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44302
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 18:17:46 -08:00
Kenneth Graunke
de88e00c94 configure.ac: Remove unused GLUT substitutions.
GLUT was removed from the main tree a while ago; nothing uses these
substitutions.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-01-06 18:16:10 -08:00
Ian Romanick
1f125374e7 glsl: Don't mark assignment temporaries as read-only
The various l-value errors this was designed to catch are now caught
by other means.  Marking the temporaries as read-only now just
prevents sensible error messages from being generated.  It's

0:0(0): error: function parameter 'out p' references the read-only variable '_post_incdec_tmp'

versus

0:13(5): error: function parameter 'out p' references a post-decrement operation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-06 14:32:50 -08:00
Ian Romanick
208b5b113f glsl: Emit extra errors for l-value violations in 'out' or 'inout' parameters
Somethings, like pre-increment operations, were not previously caught.
After the 8.0 release, this code needs some major refactoring and
clean-up.  It's a mess. :(

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
2012-01-06 14:32:50 -08:00
Ian Romanick
e9015e99d0 glsl: Emit errors for assignments to non-l-value expressions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
2012-01-06 14:32:50 -08:00
Ian Romanick
fa0a9ac5cd glsl: Track descriptions of some expressions that can't be l-values
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-06 14:32:50 -08:00
Brian Paul
c87247f6a8 mesa: remove gl_framebuffer:_DepthBuffer, _StencilBuffer fields
These were used by swrast to make a combined depth+stencil buffer look
like separate depth and stencil buffers.  But that's no longer needed
after rewriting the depth/stencil code in swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:34 -07:00
Brian Paul
21b28d520f swrast: remove s_depthstencil.[ch] files
The code is no longer used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:29 -07:00
Brian Paul
030e408181 swrast: remove calls to _swrast_update_depth/stencil_buffer()
These functions updated the gl_renderbuffer::_DepthBuffer and
_StencilBuffer fields.  But those fields are no longer used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-06 14:00:19 -07:00
Eric Anholt
deb6dd6b4d i965: Turn on ARB_depth_buffer_float by default.
Everything about this that we have tests for works except for the
deprecated metaops.  The conclusion we came to on IRC sounded like we
were OK with turning it on as long as core functionality works.  The
remaining failures (copypixels, drawpixels) should just be a matter of
finishing the MapRenderbuffer for them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:49:21 -08:00
Eric Anholt
3786a3e644 swrast: Convert the glBlitFramebuffer(GL_NEAREST) path to MapRenderbuffer().
Fixes on i965:
ARB_depth_buffer_float/fbo-depthstencil-GL_DEPTH32F_STENCIL8-blit
ARB_depth_buffer_float/fbo-stencil-GL_DEPTH32F_STENCIL8-blit

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:15 -08:00
Eric Anholt
61ea677bdd mesa: Fix packing of stencil bits to MESA_FORMAT_Z32_FLOAT_X24S8.
We were converting our ubyte stencil value to a float.  Just write it
as a uint, which overwrites the X24 part of X24S8 with 0 but shouldn't
matter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:08 -08:00
Eric Anholt
38c6f1e6ca swrast: Fix use of uninitialized value in rbmapping changes.
I'm so surprised that gcc didn't catch this that I feel like I must be
misreading.  srcMap is what we initialize (along with dstMap) from
this map value right after this check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:49:01 -08:00
Eric Anholt
fb5252a351 swrast: Use the fast copypixels code to implement fast glBlitFramebuffer().
They were meaning to do the same thing of memcpying rows, so just
write the code once.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:48:55 -08:00
Eric Anholt
cedbfc0050 swrast: Move the check for fast_copy_pixels() ability to caller.
I'm going to reuse this function from glBlitFramebuffer() handling,
which wants to do the same thing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-06 09:48:47 -08:00
Eric Anholt
60982976ee i965: Add sensible disasm for the JMPI instruction.
We care about the jump distance, not that the first src is always the
ip register.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:48:32 -08:00
Eric Anholt
cd2a24a4c2 i965/gen7: Enable transform feedback as long as kernel support is present.
The last major issue (intervening-read) is fixed, so let's turn this
on for real.  The only other known issue is a hardware limitation for
tesselation with flat shading.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2012-01-06 09:17:17 -08:00
Eric Anholt
6c0b70e774 i965/gen7: Fix up the transform feedback buffer pointers on later batches.
Fixes piglit EXT_transform_feedback/intervening-read

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:17:14 -08:00
Eric Anholt
7f91c8bf2b i965/gen7: Flush the batch between transform feedbacks.
We need the kernel to reset our pointers to 0 in between.  Note that
the initialization of function pointer had to move to after
InitContext since we didn't have intel->gen set up yet.

Fixes piglit EXT_transform_feedback/immediate-reuse

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:17:04 -08:00
Eric Anholt
c4089d444a i965/gen7: Use the updated interface for SO write pointer resetting.
The new kernel patch I submitted makes the interface opt-in, so all
batchbuffers aren't preceded by the 4 MI_LOAD_REGISTER_IMMs.  This
requires the updated i915_drm.h present in libdrm 2.4.30.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-06 09:16:32 -08:00
Alex Deucher
e60daf7e25 r600g: remove obsolete MULTIWRITE comment
fs writes all is implemented in the shader on eg+.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-06 10:15:37 -05:00
Kenneth Graunke
938490c3fe glsl_to_tgsi: Remove the obsolete remove_output_reads pass.
This is now handled by the GLSL compiler, so this code is dead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:37:02 +00:00
Vincent Lejeune
10937e6512 glsl_to_tgsi: Use the GLSL compiler's new remove-output-reads pass.
The existing glsl_to_tgsi::remove_output_read pass did not work properly
when indirect addressing was involved; this commit replaces it with a
lowering pass that occurs before TGSI code generation.

Fixes varying-array related piglit tests.

Signed-off-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:52 +00:00
Vincent Lejeune
6d4b35c036 glsl: Add a lowering pass to remove reads of shader output variables.
This is similar to Gallium's existing glsl_to_tgsi::remove_output_read
lowering pass, but done entirely inside the GLSL compiler.

Signed-off-by: Vincent Lejeune <vljn@ovi.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:44 +00:00
Dave Airlie
293a3916bd draw: fix piglit base vertex + user vertex array tests
This fixes
draw-elements-base-vertex user_varrays
draw-elements-instanced-base-vertex user_varrays
for softpipe with no llvm support (DRAW_USE_LLVM=false)

I'm not sure if this is the correct answer, but these tests were showing
a max_index of 7, then trying to fetch up to 43, maybe it should be fixing
max_index earlier somewhere to take care of this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-06 13:36:35 +00:00
ojab
2fe6c254f7 Strip LLVM svn rev from llvm-config --version output.
Reviewed-by: Vinson Lee <vlee@freedesktop.org>
2012-01-05 22:44:16 -08:00
Vinson Lee
44c089bd48 mesa: Remove 'texelBytes' declarations that are only used in assertions.
This patch silences these GCC warnings.
warning: unused variable 'texelBytes'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 22:37:06 -08:00
Paul Berry
33fe021116 mesa: Fix transform feedback of unsubscripted arrays.
It is not explicitly stated in the GL 3.0 spec that transform feedback
can be performed on a whole varying array (without supplying a
subscript).  However, it seems clear from context that this was the
intent.  Section 2.15 (TransformFeedback) says this:

    When writing varying variables that are arrays, individual array
    elements are written in order.

And section 2.20.3 (Shader Variables), says this, in the description
of GetTransformFeedbackVarying:

    For the selected varying variable, its type is returned into
    type. The size of the varying is returned into size. The value in
    size is in units of the type returned in type.

If it were not possible to perform transform feedback on an
unsubscripted array, the returned size would always be 1.

This patch fixes the linker so that transform feedback on an
unsubscripted array is supported.

Fixes piglit tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{4,8}]-no-subscript" and
"EXT_transform_feedback/output_type *[2]-no-subscript".

Note: on back-ends that set
gl_shader_compiler_options::LowerClipDistance (for example i965),
tests "EXT_transform_feedback/builtin-varyings
gl_ClipDistance[{1,2,3,5,6,7}]" still fail.  I hope to address this in
a later patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry
cab179a165 Add .gitignore files to exclude unit test build artifacts from git
With the addition of unit tests in commit
3ef3ba4d2e, several additional build
artifacts are created:

  bin/depcomp
  bin/missing
  tests/Makefile
  tests/Makefile.in
  tests/glx/Makefile
  tests/glx/Makefile.in
  tests/glx/.deps/
  tests/glx/.gitignore

This patch adds all of these files to .gitignore.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-05 13:27:12 -08:00
Paul Berry
4357f8b4dc mesa: Avoid segfault when getting an unbound transform feedback buffer name.
Previously we were using
gl_transform_feedback_object::Buffers[i]->Name to service an indexed
get request for GL_TRANSFORM_FEEDBACK_BUFFER_BINDING.  However, if no
buffer has been bound, gl_transform_feedback_object::Buffers[i] is
NULL, so this was causing a segfault.

This patch switches to using
gl_transform_feedback_object::BufferNames[i], which is equal to
gl_transform_feedback_object::Buffers[i]->Name if
gl_transform_feedback_object::Buffers[i] is not NULL, and 0 if it is
NULL.

Fixes piglit test "EXT_transform_feedback/get-buffer-state
indexed_binding".

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:12 -08:00
Paul Berry
456279bb33 mesa: Fix transform feedback of gl_ClipDistance.
On drivers that set gl_shader_compiler_options::LowerClipDistance (for
example i965), references to gl_ClipDistance (a float[8] array) will
be converted to references to gl_ClipDistanceMESA (a vec4[2] array).

This patch modifies the linker so that requests for transform feedback
of gl_ClipDistance are similarly converted.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipDistance".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
913a5c238b mesa: Make tfeedback_decl::var_name a const char *.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
367b83f890 gallium: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
e8357cb03d i965: Make use of gl_transform_feedback_info::ComponentOffset.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
2169331d40 mesa: Add gl_transform_feedback_info::ComponentOffset.
When using transform feedback, there are three circumstances in which
it is useful for Mesa to instruct a driver to stream out just a
portion of a varying slot (rather than the whole vec4):

(a) When a varying is smaller than a vec4, Mesa needs to instruct the
driver to stream out just the first one, two, or three components of
the varying slot.

(b) In the future, when we implement varying packing, some varyings
will be offset within the vec4, so Mesa will have to instruct the
driver to stream out an arbitrary contiguous subset of the components
of the varying slot (e.g. .yzw or .yz).

(c) On drivers that set gl_shader_compiler_options::LowerClipDistance,
if the client requests that an element of gl_ClipDistance be streamed
out using transform feedback, Mesa will have to instruct the driver to
stream out a single component of one of the gl_ClipDistance varying
slots.

Previous to this patch, only (a) was possible, since
gl_transform_feedback_info specified only the number of components of
the varying slot to stream out.  This patch adds
gl_transform_feedback_info::ComponentOffset, which indicates which
components should be streamed out.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
989b5722dc i965: Fix transform feedback of gl_ClipVertex.
Previously, on i965 Gen6 and above, we weren't allocating space for
gl_ClipVertex in the VUE, since the VS was automatically converting it
to clip distances.  This prevented transform feedback from being able
to capture gl_ClipVertex.

This patch goes aheads and allocates space for gl_ClipVertex in the
VUE on Gen6 and above.  The old behavior is retained on Gen5 and
below, since (a) transform feedback is not yet supported on those
platforms, and (b) those platforms don't currently support
gl_ClipVertex anyhow.

Note: this constitutes a slight waste of VUE space for shaders that
use gl_ClipVertex and don't use transform feedback to capture it.
However, that seems preferable to making the VUE map (and all of the
state that depends on it) dependent on transform feedback settings.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_ClipVertex".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
15f4bca2df i965: Fix transform feedback of gl_PointSize.
On i965 Gen6 and above, gl_PointSize is stored in component W of the
first VUE slot (which corresponds to VERT_RESULT_PSIZ in the VUE map).
Normally we store varying floats in component X of a VUE slot, so we
need special case logic for gl_PointSize.

For Gen6, we do this with a ".wwww" swizzle in the GS.  For Gen7, we
shift the component mask by 3 to select the W component.

Fixes Piglit test "EXT_transform_feedback/builtin-varyings
gl_PointSize".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-05 13:27:11 -08:00
Paul Berry
1be0fd8c86 mesa: Fix extra memset in store_tfeedback_info()
Commit 9d36c96d6e (mesa: Fix
glGetTransformFeedbackVarying()) accidentally added an extra memset()
call to the store_tfeedback_info() function, causing
prog->LinkedTransformFeedback.NumBuffers to be erased.

This patch removes the extra memset and rearranges the other
operations in store_tfeedback_info() to be in the correct order.

Fixes piglit tests "EXT_transform_feedback/api-errors *unbound*"

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-05 13:26:48 -08:00
Brian Paul
a44d715d2b swrast: use memmove() instead of memcpy() in the SHIFT_ARRAY macro
The src/dst arrays would overlap but dst was less than src so a simple
version of memcpy() would do the right thing.  But this isn't guaranteed
when memcpy() is optimized.

Fixes demos/copypix when the dest region was clipped by the left side of
the window.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2012-01-05 12:49:45 -07:00
Bryan Cain
59be691638 st/mesa: add support for gl_ClipDistance 2012-01-05 13:03:26 -06:00
Bryan Cain
6951870e57 gallium: add support for clip distances 2012-01-05 13:03:25 -06:00
Marek Olšák
f82d40d4b1 glx/dri2: print FPS when env var LIBGL_SHOW_FPS is 1 (v2)
This is useful for apps which don't print FPS.
Only enabled in SwapBuffers.

v2: track state per drawable, use libGL prefix

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2012-01-05 18:29:11 +01:00
Marek Olšák
c77efc6bb6 r300/compiler: fix buffer underflow when setting SEM_WAIT on last instruction
Do it after we check whether inst_end != -1.
Also move the code structure at the beginning of r300_fragment_shader_code
to detect underflows easily with valgrind.
2012-01-05 18:29:11 +01:00
Marek Olšák
c2cc630f28 u_vbuf: use cso_cache to cache vertex element states
Improves performance to 28 fps in Cogs.
2012-01-05 18:29:11 +01:00
Marek Olšák
ce44bae366 u_vbuf: implement another upload codepath which unrolls indices
Improves performance from cca 1 fps to 23 fps in Cogs.
This new codepath is not always used, instead, there is a heuristic which
determines whether to use it. Using translate for uploads is generally
slower than what we have had already, it's a win only in a few cases.
2012-01-05 18:29:11 +01:00
Marek Olšák
2b851526c1 u_vbuf: cleanup variable names to be consistent 2012-01-05 18:29:11 +01:00
Marek Olšák
64242b23c1 u_vbuf: cleanup the computation of how many vertices to upload/translate 2012-01-05 18:29:11 +01:00
Marek Olšák
c897b943f4 u_vbuf: convert min_index,max_index to start,count 2012-01-05 18:29:11 +01:00
Marek Olšák
1ae9e588fa util: add helper function util_dump_draw_info 2012-01-05 18:29:11 +01:00
Marek Olšák
345b1a31c9 trace: dump primitive restart info 2012-01-05 18:29:11 +01:00
Marek Olšák
d1f11ed3ef translate: implement translation of 10_10_10_2 types
This is for GL_ARB_vertex_type_2_10_10_10_rev.
I just took the code from u_format_table.c. It's based on pack_rgba_float.
I had no other choice. The u_format hooks are not exactly compatible
with translate. The cleanup of it is left for future work.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
0a8a7144a1 translate: implement translation of (pure) integer formats
The conversion is limited to only a few cases, because converting to any other
type shouldn't happen in any driver.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
1ba3240b28 u_format: implement fetch_rgba_uint and fetch_rgba_sint for integer formats
Fetching int as float and vice versa is not allowed.
Fetching unsigned int as signed int and vice versa is not allowed either.
Doing conversions like that isn't allowed for samplers in OpenGL.

The three hooks could be consolidated into one fetch hook, which would fetch
uint as uint32, sint as sint32, and everything else as float. The receiving
parameter would be void*. This would be useful for implementing vertex fetches
for shader model 4.0, which has untyped registers.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
0950086376 gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY
Please see the diff for further info.

This paves the way for moving user buffer uploads out of drivers and should
allow to clean up the mess in u_upload_mgr in the meantime.

For now only allowed for buffers on r300 and r600.

Acked-by: Christian König <deathsimple@vodafone.de>
2012-01-05 18:29:11 +01:00
Marek Olšák
7cd1c62b6b gallium: remove deprecated PIPE_TRANSFER_DISCARD
PIPE_TRANSFER_DISCARD_RANGE is defined the same.
2012-01-05 18:29:11 +01:00
Marek Olšák
5968e4068c u_vbuf: translate per-vertex, per-instance, and constant attribs separately
We don't wanna convert per-instance or constant (zero-stride) attribs into
ordinary vertex attribs.

More importantly, the translation of instance attribs now finally works.
2012-01-05 18:29:11 +01:00
Marek Olšák
dbd60d27e8 u_vbuf: take start_instance into account when uploading instanced attribs 2012-01-05 18:29:11 +01:00
Marek Olšák
f94d390213 u_upload_mgr: remove the 'flushed' parameter
Not used by anybody.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
c727cc175b u_vbuf: don't map user buffers, just obtain a pointer to them 2012-01-05 18:29:11 +01:00
Marek Olšák
f430f794ac u_vbuf: only map a subrange of buffers to translate 2012-01-05 18:29:11 +01:00
Marek Olšák
214b87aa04 gallium: fix behavior of pipe_buffer_map_range
To match what transfer_map returns. Really, subtracting the offset leads
to bugs if someone expects it to work exactly like transfer_map.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-01-05 18:29:11 +01:00
Marek Olšák
fb0aa34fab u_vbuf: remove the workaround for half floats and translate 2012-01-05 18:29:11 +01:00
Marek Olšák
1acef6a746 translate: implement translation of half floats in the generic codepath 2012-01-05 18:29:11 +01:00
Eric Anholt
501e2e3b6d mesa: Remove the dead Varyings list in the program.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-05 09:11:29 -08:00
Eric Anholt
9d36c96d6e mesa: Fix glGetTransformFeedbackVarying().
The current implementation was totally broken -- it was looking in an
unpopulated structure for varyings, and trying to do so using the
current list of varying names, not the list used at link time.

v2: Fix leaking of memory into the program per re-link.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-01-05 09:11:29 -08:00
Jakob Bornecrantz
cc1d8a466a svga: Trim the dri binary a bit on scons release builds
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-05 17:23:32 +01:00
Jakob Bornecrantz
2bb9c64489 svga: Fix texture cube param cap
Spotted by Thomas Hellstrom.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-01-05 17:23:32 +01:00
Brian Paul
85b5dac705 tgsi: consolidate TGSI string arrays in new tgsi_strings.h
There was some duplication between the tgsi_dump.c and tgsi_text.c
files.  Also use some static assertions to help catch errors when
adding new TGSI values.

v2: put strings in tgsi_strings.c file instead of the .h file.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2012-01-05 09:01:43 -07:00
Brian Paul
188aca3492 gallium: add STATIC_ASSERT macro 2012-01-05 08:19:23 -07:00
Brian Paul
6aed626c35 mesa: only map src/dest regions in _mesa_copy_buffer_subdata()
We were wastefully mapping the whole source/dest buffers before.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-01-05 08:14:32 -07:00
Brian Paul
b330f1f13c mesa: print more info in buffer_object_subdata_range_good() error message 2012-01-05 08:14:26 -07:00
Brian Paul
a61e164ae0 st/mesa: 80-column wrapping 2012-01-05 08:14:01 -07:00
Kenneth Graunke
9d21b5dd26 Revert "configure.ac: remove deprecated --with-driver="
This reverts commit 5a478976ae.

It broke the build.  DRI drivers were no longer being installed by
`make install` (and probably not being built at all).  It appears to be
due to a few small, subtle mistakes, and the fix isn't clear enough to
simply commit without going through review.  In the meantime, revert it.
2012-01-04 23:49:18 -08:00
Matt Turner
cb96b06130 glsl: rename VERSION to VERSION_TOK for automake
Signed-off-by: Matt Turner <mattst88@gmail.com>
2012-01-04 19:27:56 -08:00
Matt Turner
5172383de0 configure.ac: bump AC_PREREQ to 2.60
All other xorg modules require at least 2.60 (released in 2006), so we
may as well increase it to match.  It's also doubtful anyone tests the
build with 2.59 (from 2003), so it may not even work anyway.
2012-01-04 19:23:39 -08:00
Matt Turner
5a478976ae configure.ac: remove deprecated --with-driver=
See 9e7a4147.
2012-01-04 19:23:22 -08:00
Ian Romanick
f22ecaa14f i965: Enable EXT_texture_integer by default
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-with-reservations-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 16:54:21 -08:00
Ian Romanick
0e52be58f0 mesa: Add missing GL_RG_INTEGER cases
Adds two missing '|| srcFormat == GL_RG_INTEGER' in assertions and a
bunch of missing pixel converions cases.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 16:52:46 -08:00
Kenneth Graunke
a0a0a909f2 i965: Fix infinite loop regression in intel_miptree_all_slices_resolve.
Commit 0ed11e3331 fixed a "use after free"
bug by getting the next pointer before deleting the current node.

Unfortunately, it also made "next" never get updated if i->need != need.

Fixes infinite loops in piglit tests fbo-depth-array and fbo-depthtex.

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-01-04 15:51:51 -08:00
Kenneth Graunke
fbbbc8c04e i965/vs: Use the proper dimensionality for the sampler result register.
textureSize() returns an int, ivec2, or ivec3, but never an ivec4.
Creating the destination register as an ivec4 triggered later failures,
even though the register did hold the proper values.

For example, piglit test vs-textureSize-compare calls textureSize on a
2D texture and compares the result to an expected value.  Unfortunately,
our generated code also tried to compare the third and fourth components
which were undefined, and failed.

Fixes piglit test vs-textureSize-compare as well as 19 subcases of
oglconform's glsl-bif-tex-size test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44339
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 15:07:40 -08:00
Kenneth Graunke
207cbc68dc i965: Add missing _NEW_TEXTURE dirty bit to brw_vs_prog state atom.
Commit d45814c925 totally added a data
dependency on _NEW_TEXTURE, even including the comment, but didn't
actually add the dirty bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 15:07:40 -08:00
Paul Berry
86bb45ffc3 mesa: Additional error checks for transform feedback.
From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is also generated by BeginTransformFeedbackEXT
    if no binding points would be used, either because no program object is
    active or because the active program object has specified no varying
    variables to record.

    ...

    The error INVALID_VALUE is generated by BindBufferRangeEXT or
    BindBufferOffsetEXT if <offset> is not word-aligned.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors no_prog_active
- EXT_transform_feedback/api-errors interleaved_no_varyings
- EXT_transform_feedback/api-errors separate_no_varyings
- EXT_transform_feedback/api-errors bind_offset_offset_1
- EXT_transform_feedback/api-errors bind_offset_offset_2
- EXT_transform_feedback/api-errors bind_offset_offset_3
- EXT_transform_feedback/api-errors bind_offset_offset_5

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:53 -08:00
Paul Berry
ebfad9f6a1 mesa: Check that all buffers are bound in BeginTransformFeedback.
From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is generated by
    BeginTransformFeedbackEXT if any transform feedback buffer object
    binding point used in transform feedback mode does not have a
    buffer object bound.

This required adding a new NumBuffers field to the
gl_transform_feedback_info struct, to keep track of how many transform
feedback buffers are required by the current program.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors interleaved_unbound
- EXT_transform_feedback/api-errors separate_unbound_0_1
- EXT_transform_feedback/api-errors separate_unbound_0_2
- EXT_transform_feedback/api-errors separate_unbound_1_2

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:48 -08:00
Paul Berry
1979e22e13 mesa: Fix typos in transform feedback error messages.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-04 14:54:40 -08:00
Ian Romanick
3946448951 glsl: Don't use base type for bit-not when there's an error
Other parts of the compiler assume that expressions will have
well-formed types or the error type.  Just using the type of the thing
being operated on can cause expressions like ~3.14 or ~false to not
have a well-formed type.  This could then result in an assertion
failure in the context epxression handler.

If there is an error processing the expression, set the type of the IR
expression to error.

Fixes piglit's bit-not-0[789].frag tests.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
2012-01-04 12:43:10 -08:00
Ian Romanick
4becf676e0 glx: More hacking around versions of XCB that lack GLX_ARB_create_context support
Detect whether a new enough version of XCB is installed at configure
time.  If it is not, don't enable the extension and don't build the
unit tests.

v2: Move the AM_CONDIATION outside the case-statement so that it is
invoked even for non-GLX builds.  This prevents build failures with
osmesa, for example.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Robert Hooker <robert.hooker@canonical.com>
2012-01-04 12:43:10 -08:00
Brian Paul
c2e537fef2 gallium/util: fix argument cast in x32_s8_get_tile_rgba() call 2012-01-04 13:35:13 -07:00
Brian Paul
2a0c515b89 st/mesa: remove st_CompressedTexSubImage1D/2D/3D()
Just use the core Mesa functions instead.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:41 -07:00
Brian Paul
2972547047 st/mesa: fix indentation in st_copy_texsubimage() 2012-01-04 13:30:35 -07:00
Brian Paul
5d67d4fbeb st/mesa: remove st_TexImage(), use core Mesa code instead
The core Mesa code does the equivalent memory allocation, image mapping,
storing and unmapping.  We just need to call prep_teximage() first to
handle the 'surface_based' stuff.

The other change is to always use the level=0 mipmap image when accessing
individual mipmap level images that are stored in resources/buffers.
Apparently, we were always using malloc'd memory for individual mipmap
images, not resource buffers, before.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:35 -07:00
Brian Paul
19840c46f3 st/mesa: refactor gl_TexImage() code into prep_teximage()
Preparation for st_TexImage() removal/refactoring.

Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-04 13:30:35 -07:00
Ian Romanick
18f53efa01 intel: Re-enable GL_OES_standard_derivatives on GEN4+
This extension only needs to be disabled on GEN3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 10:31:16 -08:00
Eric Anholt
43f12e5eb8 intel: Re-allow blitting glCopyBufferSubData() on gen >= 6.
This was disabled a year ago due to not having a story for handling
the blitter at the time.  We're fine with using the blitter now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00
Eric Anholt
8aa7fa770c intel: Fix pitch handling for linear blits.
The new assert in intelEmitCopyBlit() gets angry if we don't align to
dwords.  Rather than make the assert have a special case for height ==
1 on the assumption that the hardware doesn't use it in that case,
just supply a correct pitch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43214
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00
Eric Anholt
15e309cf84 intel: Fix bad read/write flags on self-copies for glCopyBufferSubData().
We didn't consume these flags in any way that would produce a
functional difference, but we might have some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-04 09:51:17 -08:00
Adam Jackson
3bc4959b14 Remove xmesa_xf86.h
This was a leftover from libGLcore.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-04 11:32:38 -05:00
Adam Jackson
2af17433b5 drisw: Fix drawable creation against non-default screens
We don't want to match the visual against the default screen.  If the
drawable is on a non-default screen then the appropriate visual might not
exist on the default screen.  Conversely, if the same visual is
available on multiple screens then simply selecting for the right VID is
sufficient, since the server has promised that the same visual is
compatible with multiple screens.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-04 11:23:55 -05:00
Brian Paul
892a2542a3 mesa: remove unused _mesa_init_teximage_fields() target parameter
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2012-01-04 08:12:28 -07:00
Christian König
7b181d16c3 vl/mpeg2: simple fix to get xine running again
Otherwise xines xxmc plugin will just display green blocks.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-01-04 16:01:09 +01:00
Ian Romanick
4535874c1a ff_fragment_shader: Don't generate swizzles for scalar combiner inputs
There are a couple scenarios where the source could be zero and the
operand could be either SRC_ALPHA or ONE_MINUS_SRC_ALPHA.  For
example, if the source was ZERO.  This would result in something like
(0).w, and a later call to ir_validate would get angry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517
2012-01-03 19:21:19 -08:00
Anuj Phogat
0ed11e3331 Fix read from pointer after free
Coverity reported a read from pointer after free defect in
src/mesa/drivers/dri/intel/intel_mipmap_tree.c. Bug# 44205
In intel_miptree_all_slices_resolve() function, i = i->next was
executing after freeing i. I have defined a temporary variable
(next) to store the value of i->next before freeing i

Reported-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-01-03 19:04:03 -08:00
Matt Turner
2f1ab63fab configure.ac: fix typo from 3ef3ba4d2 2012-01-03 21:58:37 -05:00
Christoph Bumiller
7e291e922e st/mesa: use SINT/UINT formats for VertexAttribIPointer
Reviewed-by: Dave Airlie <airlied@redhat.com>

v2: added assertion that packed formats are not pure integer
2012-01-03 23:00:31 +01:00
Dave Airlie
69111847a2 tgsi/softpipe: disable FAST_MATH
In the interest of softpipe preferring correctness over speed and passing more
piglit tests, set this to off by default. For speed you really want llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 16:19:08 +00:00
Morgan Armand
e763b6e788 softpipe: remove the 32bits limitation on depth(-stencil) formats
This patch remove the 32bits limitation. As a side effect, it bring the support for the GL_ARB_depth_buffer_float extension.
No regression have been found on piglit, and all tests for GL_ARB_depth_buffer_float pass successfully.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 16:19:08 +00:00
Alexander von Gluck
2ae591bdf1 gallium: use Haiku provided debug_printf in OS.h
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-03 08:10:49 -07:00
Vadim Girlin
d4bf5cefb0 glsl_to_tgsi: v2 Invalidate and revalidate uniform backing storage
If glUniform1i and friends are going to dump data directly in
driver-allocated, the pointers have to be updated when the storage
moves.  This should fix the regressions seen with commit 7199096.

I'm not sure if this is the only place that needs this treatment.  I'm
a little uncertain about the various functions in st_glsl_to_tgsi that
modify the TGSI IR and try to propagate changes about that up to the
gl_program.  That seems sketchy to me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>

v2:

Revalidate when shader_program is not NULL.
Update the pointers for all _LinkedShaders.
Init glsl_to_tgsi_visitor::shader_program to NULL in the
get_pixel_transfer_visitor & get_bitmap_visitor.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-03 09:28:58 -05:00
Ian Romanick
f433fe015e glx: Hack around versions of XCB that lack GLX_ARB_create_context support
A lot of tests in 'make check' will fail under these circumstances,
but at least the build should work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 10:24:10 +00:00
Ian Romanick
b518dfb513 mesa: XCB is no longer optional for GLX or DRI
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-03 10:24:01 +00:00
Brian Paul
14aff23e1b intel: include version.h in intel_screen.c to silence warning
Signed-off-by: Brian Paul <brianp@vmware.com>
2012-01-02 15:20:15 -07:00
Ian Romanick
596d9f6dd1 dri_util: Fix order of error and data parameters to dri2CreateContextAttribs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 13:39:41 -08:00
Dave Airlie
77058335eb r600g: add missing colorswaps for r8 uint/sint.
fixes some warnings in GL3.0 tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-02 20:45:20 +00:00
Ian Romanick
3ef3ba4d2e tests/glx: Add unit tests for GLX_ARB_create_context GLX protocol
This adds a new tests directory at the top-level and some extra build
infrastructure.  The tests use the Google C++ Testing Framework, and
they will only be built if configure can detect its availability.  The
tests are automatically wired-in to run with 'make check'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
8a4b36de05 glx: Don't use 'new' as a function parameter name
Using 'new' as a function parameter name prevents including
glxclient.h the unit tests (future patch) that use the Google C++
Testing Framework.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
e6280c3ba9 glx: Enable GLX_EXT_create_context_es2_profile
This extension is only enabled if the underlying driver advertises
support for OpenGL ES 2.0.  This happens either through the getAPIMask
function in version 2 of the DRI2 extension or implicity through
version 2 of the DRISW extension.

Since there is no OpenGL ES 2.0 protocol, this extension is marked as
only available with direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
e532b6288f dri2: Add plumbing to get context version requirements and flags to drivers
This adds support for DRI_DRI2 version 3 to all of the DRI2 drivers.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
296fe21ae5 glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRISW contexts
This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRISW
version 3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
b45f77dc4c glx/dri: Add utility function dri2_convert_glx_attribs
This converts all of the GLX data from glXCreateContextAttribsARB to
the values expected by the DRI driver interfaces.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
4c7898cb13 st/mesa: Reject forward-looking contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
d9de33c304 dri_util: Mostly stub implementation of dri2CreateContextAttribs
This adds the function and modifies dri2CreateNewContextForAPI to call
it.  At this point only version 2 of the DRI2 API is advertised to the
loader.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
c9d25cf73f glx: Add extension strings for GLX_ARB_create_context and GLX_ARB_create_context_profile
Note that these extensions are not automatically enabled for screens
capable of direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
78aa71a3ce glx: Connect glXCreateContextAttribsARB to glXGetProcAddress
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:45 -08:00
Ian Romanick
588042a8ec glx: Initial implementation of glXCreateContextAttribsARB
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
48ffc6a155 glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contexts
This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRI2 version
3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
6a0640971f glx: Implement glx_screen_vtable::create_context_attribs for indirect contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
43409fa7b0 glx: Add glx_screen_vtable::create_context_attribs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
eacd61bfef glx: Use __glX_send_client_info with XCB
__glX_send_client_info only supports XCB, so use that instead of
__glXClientInfo when USE_XCB is defined.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Ian Romanick
6ccda72bf8 glx: Add __glX_send_client_info super function
This function picks the correct client-info protocol (based on the
server's GLX version and set of extensions) and sends it to the
server.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-01-02 12:41:44 -08:00
Christoph Bumiller
fc7ac4da7d glsl-to-tgsi: handle ir_unop_round_even 2012-01-02 21:16:03 +01:00
Bryan Cain
09497e020a glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced() 2012-01-02 14:09:45 -06:00
Paul Berry
7cbcce383c swrast: Remove dead code in _swrast_clear_depth_buffer()
This code was generating the gcc warning:

  variable ‘clearValue’ set but not used [-Wunused-but-set-variable]

Reviewed-by: Brian Paul <brianp@vmare.com>
2012-01-02 11:10:57 -08:00
Brian Paul
01a63f4bf5 radeon: move declarations before code 2012-01-02 11:55:40 -07:00
Brian Paul
5edc6fef4c radeon: add casts to silence warnings 2012-01-02 11:55:39 -07:00
Brian Paul
d939838267 radeon: remove unused tex image function prototypes 2012-01-02 11:55:39 -07:00
Brian Paul
d69d287068 mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions
The were always zero.  When doing a sub-texture replacement we account
for the dstX/Y/Zoffsets when we map the texture image.  So no need to
pass them into the texstore code anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Brian Paul
e833b98182 intel: pass xoffset, yoffset = 0 to _mesa_texstore()
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-01-02 11:55:39 -07:00
Eric Anholt
c82c24b18b i965: Silence gcc warning about uninitialized "inst" in assert() case. 2012-01-02 10:38:47 -08:00
Eric Anholt
bf2c7469fb i965: Silence gcc warning from resizing EU store changes. 2012-01-02 10:38:47 -08:00
Christian König
bce506ffc0 vl: seperate shader buffers from components
Buffers for shader based decoding can now be
released without its component still being around.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2012-01-02 12:47:15 +01:00
Marek Olšák
2cd7e5b737 r300g: inline r300_resource_set_properties 2012-01-01 11:47:06 +01:00
Marek Olšák
ce9d61fec6 r300g: rework resource_copy_region, not changing pipe_resource
Changing pipe_resource was wrong, because it can be used by other contexts
at the same time. This fixes the last possible race condition in r300g
that I know of.

This also fixes blitting NPOT compressed textures. Random pixels sometimes
appeared at the right-hand edge of the texture.

Finally, this removes r300_texture_desc::stride_in_pixels. It makes little
sense with sampler views and surfaces being able to override width0, height0,
and the format entirely.
2012-01-01 11:47:05 +01:00
Marek Olšák
ce31970af1 u_blitter: expose functions for setting default views and surfaces for copying
And more importantly, don't call u_sampler_view_default_template etc.
it was a source of bugs.
2012-01-01 11:47:05 +01:00
Dave Airlie
b5fd0e04a7 st_glsl_to_tgsi: translate interp mode for front/back color
this fixes a bunch of interpolation tests on softpipe at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:48:19 +00:00
Dave Airlie
c44f6e0489 softpipe: reorder LIT to fix fp-lit-src-equals-dst
This reorders the LIT operation like the r600 one to fix the
fp-lit-src-equals-dst piglit test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 13:17:23 +00:00
Dave Airlie
24668a38d1 llvmpipe: fix blending for intensity formats
This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-31 12:37:48 +00:00
Brian Paul
99fbf7ce34 st/mesa: remove stImage->base.Face/Level assignments in st_TexImage()
This fixes a regresssion (broken cube maps) caused by the
ctx->Driver.TexImage parameter simplification commit.  The target var
is always GL_TEXTURE_CUBE_MAP at this point so the Face field was always
getting set to zero.

These field assignments aren't needed anyway since core Mesa sets them.
2011-12-30 16:42:27 -07:00
Dave Airlie
bed4c7ea5e u_format: fix latc fetches.
This fixes the latc fetches for llvmpipe, fixes
fbo-generatemipmap-formats GL_ARB_texture_compression
fbo-generatemipmap-formats GL_ATI_texture_compression_3dc
fbo-generatemipmap-formats GL_EXT_texture_compression_latc

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
2011-12-30 21:20:18 +00:00
Dave Airlie
0c6ee788f2 u_format/rgtc: fix alpha values in returned texels.
This fixes fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc
on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 20:31:34 +00:00
Alexander von Gluck
141d961d84 glsl: fix usage of potentially undefined data_end union
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-30 08:48:51 -07:00
Brian Paul
797960dbec st/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=44234
2011-12-30 08:38:58 -07:00
Brian Paul
bec2ea8ef4 mesa: simplify Driver.GetCompressedTexImage() parameters
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
94a0c518dc mesa: simplify Driver.CompressedTex[Sub]Image function parameters
As with previous commits, the target, level and texObj info can be
obtained through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:56 -07:00
Brian Paul
92c64624cd mesa: simplify Driver.TexImage() parameters
As with TexSubImage(), the target, level and texObj values can be obtained
through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
da0cc82a09 mesa: simplify Driver.TexSubImage() parameters
There's no need to pass the target, level and texObj parameters since
they can be easily obtained from the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 08:24:55 -07:00
Brian Paul
c22a95c4f2 st/mesa: remove TexSubImage code, use core mesa routines instead.
Since the move to Map/UnmapTextureImage, the core mesa routines are
equivalent to what the state tracker was doing.

The TexImage functions can be replaced too, but there's a few differences
that will need to be handled.
2011-12-30 08:24:55 -07:00
Dave Airlie
4ca624f8e0 u_format: fix inv_swizzles generation
inv_swizzles is used in lp_tile_soa.py to create lp_tile_soa.c, we overwrite swizzles if they are already set.

This results in the i8 format getting alpha instead of red, and the l8 format
getting blue instead of red.

Fixes fbo-alphatest-formats, fbo-alphatest-formats ARB_texture_float,
and fbo-alphatest-formats EXT_texture_snorm on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-30 13:43:52 +00:00
Michel Dänzer
7dd2d29a56 r600g: Manage fences per screen rather than per context.
A fence is a screen object and can outlive the context it was created from.
The previous code would access freed memory in that case, resulting in
various problems.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=44151
       https://bugs.freedesktop.org/show_bug.cgi?id=44007

Probably fixes: https://bugs.freedesktop.org/show_bug.cgi?id=43993

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2011-12-30 10:45:31 +01:00
Stéphane Marchesin
0e57b66fa1 i915g: Allocate tmp for KILP
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=44297
2011-12-30 01:33:26 -08:00
Yuanhan Liu
efa1fac215 vbo: introduce vbo_sizeof_ib_type() function
introduce vbo_sizeof_ib_type() function to return the index data type
size. I see some place use switch(ib->type) to get the index data type,
which is sort of duplicate.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-30 13:53:40 +08:00
Stéphane Marchesin
ded02bd54b llvmpipe: Remove useless draw_install_pstipple_stage call.
It is #ifdef'd out, and is already called unconditionnaly a couple lines above.

Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
2011-12-29 12:28:44 -08:00
Chad Versace
747f030762 intel: Fix memory leak in intel_miptree_create()
On failure, intel_miptree_create() needs to *release* the miptree, not
just free it, so that the stencil_mt gets released too.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-29 10:47:44 -08:00
Eric Anholt
069901e2f5 i965/fs: Allow constant propagation into IF with embedded compare.
This saves a couple of instructions on most programs with control
flow.  More interestingly, 6 shaders from unigine sanctuary now fit
into 16-wide without register spilling.
2011-12-29 09:33:56 -08:00
Eric Anholt
6a1e19d0f6 intel: Drop the batchbuffer flush on glRenderbufferStorage().
There's nothing batchbuffer-related here.  State updates by the caller
will trigger re-emitting of any new hardware state.
2011-12-29 09:33:56 -08:00
Eric Anholt
2529fde36e intel: Drop the batchbuffer flush on glFramebufferRenderbuffer().
There should be nothing special about this call compared to other
callers of intel_draw_buffer().
2011-12-29 09:33:56 -08:00
Eric Anholt
b890f1090c intel: Make the batchbuffer flush debug more useful.
We were printing out the line triggering the flush, but a variety of
different causes just printed the line number for intel_flush()'s call
of intel_batchbuffer_flush().  Plumb the line numbers from the caller
of intel_flush() on through.
2011-12-29 09:33:56 -08:00
Eric Anholt
7f854a5028 intel: Fix performance regression in Lightsmark since HiZ changes.
Since the refactor in d7b33309fe, depth
in the miptree changed from 1 to 6, so we always decided it didn't
match, and we would relayout to something that would still not
"match".

Improves performance 23.8% (+/- 1.1%, n=4)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43329
2011-12-29 09:33:56 -08:00
Eric Anholt
ab7794cada intel: Don't consider miptrees for other texture targets to match.
We would have done a relayout at validate time, but it's senseless to
store into a miptree if it's going to force relayout.
2011-12-29 09:33:56 -08:00
Vinson Lee
0ddb759991 mesa: Use __builtin_ffsll on Mac OS X.
Fixes this GCC warning.
arrayobj.c: In function '_mesa_update_array_object_max_element':
arrayobj.c:310: warning: implicit declaration of function 'ffsll'

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-28 23:27:55 -08:00
Stéphane Marchesin
11cdf24d15 i915g: Add missing draw_flush call.
Fixes a bunch of corruption bugs, especially some missing clipped triangles.
2011-12-28 12:36:26 -08:00
José Fonseca
62e968d6da mesa: Re-add main/bitset.h to fix classic nouveau build failure.
bitset.h is still used by classic nouveau -- see `git grep '\<BITSET_'`
-- and the state stored is too big to fit in 64bit integers (it requires
approximately 87 bits), so there is no obvious alternative here.

This effecively reverts commit 196800d798.
2011-12-28 11:14:52 +00:00
Mathias Fröhlich
196800d798 mesa: Remove now unused main/bitset.h.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
1ef3a94536 mesa: Remove remaining FEATURE_ARB_vertex_buffer_object guards.
Since commit 82b9661894 and
34eae1c72a vbo support
is mandatory for all drivers. So, remove the remaining
FEATURE_ARB_vertex_buffer_object guards.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-28 11:05:13 +01:00
Mathias Fröhlich
ccbf192f59 mesa: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
45cd15bfae radeon: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:24 +01:00
Mathias Fröhlich
19c46d3d7b nouveau: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
b49b1e4642 i915: Convert to use GLbitfield64 directly.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Mathias Fröhlich
50e0091a9d mesa: Convert RENDERINPUTS* macros to GLbitfield64.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-28 07:35:23 +01:00
Stéphane Marchesin
b50d250e02 i915g: Only apply the optimization to output vars.
This is a bit overkill, but otherwise we need to rename subsequent uses, which is a future TODO.
Reported by CME.
2011-12-27 17:08:26 -08:00
Kenneth Graunke
07ee9f374f i965/vs: Properly clear cur_value when propagating direct copies.
Consider the following code:

MOV A.x, B.x
MOV B.x, C.x

After the first line, cur_value[A][0] == B, indicating that A.x's
current value came from register B.

When processing the second line, we update cur_value[B][0] to C.
However, for drect copies, we fail to reset cur_value[A][0] to NULL.
This is necessary because the value of A is no longer the value of B.

Fixes Counter-Strike: Source in Wine (where the menu rendered completely
black in DX9 mode), completely white textures in Civilization V, and the
new Piglit test glsl-vs-copy-propagation-1.shader_test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42032
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:38 -08:00
Kenneth Graunke
443c8d1ab7 i965/vs: Fix incorrect subscript when resetting copy propagation records.
In this code, 'i' loops over the number of virtual GRFs, while 'j' loops
over the number of vector components (0 <= j <= 3).

It can't possibly be correct to see if bit 'i' is set in the destination
writemask, as it will have values much larger than 3.  Clearly this is
supposed to be 'j'.

Found by inspection.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-27 14:33:37 -08:00
Chad Versace
7420c9dab4 i965: Create mock implementation of GL_OES_EGL_image_external
In Android IceCreamSandwich, SurfaceFlinger requires GL_OES_image_external
for basic compositing tasks. Without the extension, SurfaceFlinger fails
to start.

Despite the incompleteness of the extension's implementation introduced by
this patch, it is good enough to enable SurfaceFlinger and to unblock the
people who need to begin testing Mesa on IceCreamSandwich.

To enable the extension, set the environment variable
MESA_EXTENSION_OVERRIDE="+GL_OES_EGL_image_external". Ideally, Android
should set this in init.rc.

WARNING: This implementation of GL_OES_EGL_image_external is not complete.
Some of it is even incorrect. When we begin to really implement
GL_OES_EGL_image_external, much of the patch will need reverting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Chad Versace
7e5ffd9be2 meta: Disable GL_TEXTURE_EXTERNAL_OES in meta_begin()
If the meta flag MESA_META_TEXTURE is present, then disable the texture
target GL_TEXTURE_EXTERNAL_OES.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-27 10:20:25 -08:00
Alexander von Gluck
ac8a933aa8 mklib: tab cleanup, no functional change
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:18:25 -07:00
Alexander von Gluck
a3752fa63b mesa: fpclassify is available on Haiku
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:56 -07:00
Alexander von Gluck
2e60c955c2 glu: remove BeOS define as BeOS is not longer a target platform
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:51 -07:00
Alexander von Gluck
9e4c8ce3bc gallium: use Mesa pthread_barrier_t on Haiku, as it is incomplete under Haiku
Reviewed-by: Brian Paul <brianp@vmare.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-27 09:16:30 -07:00
Dave Airlie
157566860d gallium/u_pack: fix l8/i8 pack color ub
just noticed this in passing, not sure it actually fixes any issus.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-27 10:35:09 +00:00
Mathias Fröhlich
91d950bad1 vbo: Clean up recalculate_input_bindings.
Now the gl_array_object's layout matches the one used in
recalculate_input_bindings. Make use of this and remove the
bind_array_obj function.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmare.com>
2011-12-27 08:57:41 +01:00
Alexander von Gluck
a5608a5098 mklib: Add Haiku build support
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-26 16:23:03 -07:00
Johannes Obermayr
aa284042a3 Fix build with LLVM >= r145623.
This is a workaround for https://bugs.freedesktop.org/show_bug.cgi?id=43861.

Actually the issue which makes -pedantic failing should be solved.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-26 16:12:10 -07:00
Brian Paul
98dffd9764 swrast: assert _swrast_map_teximage() x, y is multiple of block size 2011-12-26 15:22:26 -07:00
Brian Paul
08a81c8697 swrast: replace assertion with conditional in _swrast_map_teximage()
Just in case we ran out of memory when trying to allocate the texture
memory.
2011-12-26 15:22:26 -07:00
Brian Paul
62f2d6ef03 mesa: fix signed/unsigned comparison warnings 2011-12-26 15:22:26 -07:00
Brian Paul
0a7602b938 vbo: signal _NEW_ARRAY when transitioning between glBegin/End, glDrawArrays
This fixes a regression seen with the isosurf demo when switching between
glBegin/End and glDrawArrays (do it several times).  The problem was the
driver wasn't getting _NEW_ARRAY when the arrays were subtly changed:
(vertex3f, normal3f) vs. (normal3f, vertex3f).

This patch fixes that by signaling _NEW_ARRAY whenever we transition
between glBegin/End and glDrawArrays mode and display lists.

The patch also fixes up the initialization of the map_vp_none[] array
to stop putting strange values in the last five elements of the array.

v2: remove DRAW_ELEMENTS, don't distinguish between glDrawArrays and
glDrawElements

v3: add DRAW_DISPLAY_LIST for the display list case, just to be safe.

Reviewed-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Tested-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 15:21:32 -07:00
Mathias Fröhlich
31bf243a92 mesa: remove leftovers from color indexed rendering.
Remove gl_light::_dli and gl_light::_sli.
Both are only used for a value previously used in
color indexed rendering. Also both variables are only used
and never written.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 21:47:06 +01:00
Mathias Fröhlich
5584a8eb19 mesa: remove unused _mesa_copy_materials.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
2011-12-26 21:46:56 +01:00
Christian König
7ac114f94a vl: call decode_bitstream only once
Submit all bitstreams at once to decode_bitstream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-26 16:37:47 +01:00
Yuanhan Liu
3aa3c3f758 i965: increase the brw eu instruction store size dynamically
Here is the final patch to enable dynamic eu instruction store size:
increase the brw eu instruction store size dynamically instead of just
allocating it statically with a constant limit. This would fix something
that 'GL_MAX_PROGRAM_INSTRUCTIONS_ARB was 16384 while the driver would
limit it to 10000'.

v2: comments from ken, do not hardcode the eu limit to (1024 * 1024)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:24:42 +08:00
Yuanhan Liu
8d1b378939 i965: call next_insn() before referencing a instruction by index
A single next_insn may change the base address of instruction store
memory(p->store), so call it first before referencing the instruction
store pointer from an index.

This the final prepare work to enable the dynamic store size.

v2: comments from Ken, define emit_endif as bool type

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:23:12 +08:00
Yuanhan Liu
328e6a5497 i965: get the jmp distance by instruction index
If dynamic instruction store size is enabled, while after the brw_JMPI()
and before the brw_land_fwd_jump() function, the eu instruction store
base address(p->store) may change. Thus, the safe way to reference the
jmp instruction is by index instead of by the instruction address.

v2: comments from Eric, don't change the prototype of brw_JMPI

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-26 11:21:56 +08:00
Yuanhan Liu
0a17093eaf i965: let the if_stack just store the instruction index
If dynamic instruction store size is enabled, while after
the brw_IF/ELSE() and before the brw_ENDIF() function, the
eu instruction store base address(p->store) may change.

Thus let if_stack just store the instruction index. This is
somehow more flexible and safe than store the instruction
memory address.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-26 11:19:17 +08:00
Marek Olšák
2175634e73 r600g: fix a warning that a variable may be uninitialized 2011-12-25 10:18:48 +01:00
Marek Olšák
1b9577b833 gallium: remove PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS
It's the same as PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-25 10:18:47 +01:00
Marek Olšák
ec9b154b8c st/mesa: use a cast wrapper function to get st_transform_feedback_object 2011-12-25 10:18:43 +01:00
Marek Olšák
7191298829 st/mesa: DrawTFB should use the vertex count from the last call of EndTFB
From ARB_transform_feedback2:
    ... the vertex count used for the rendering operation is
    set by the previous EndTransformFeedback command.
2011-12-25 09:24:51 +01:00
Marek Olšák
ec4851253b r300g: mapping buffers for read should be unsynchronized
The GPU never uses them for write.
2011-12-24 21:28:43 +01:00
Marek Olšák
93f4e3cb6c winsys/radeon: move managing GEM domains back to drivers
This partially reverts commit 363ff84475.

It caused severe performance drops in Nexuiz. Reported by Phoronix.

Tested by me on r300g and by IRC people on r600g.
2011-12-24 21:28:43 +01:00
Paul Berry
e6e9becd50 i965 gen6: Fix incorrect order of dwords in gen6_update_sol_indices()
When updating SOL indices, we were accidentally putting the starting
index in dword 1 and the SVBI number to increment in dword 2--these
should be reversed.  Usually both of these values are zero, so we
didn't see any problem.  However, if a transform feedback operation
spans multiple batch buffers, the starting index will be nonzero.

Fixes piglit test "EXT_transform_feedback/intervening-read output".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-24 09:12:27 -08:00
Paul Berry
b31f62c907 i965 gen6: Fix transform feedback of triangle strips.
When rendering triangle strips, vertices come down the pipeline in the
order specified, even though this causes alternate triangles to have
reversed winding order.  For example, if the vertices are ABCDE, then
the GS is invoked on triangles ABC, BCD, and CDE, even though this
means that triangle BCD is in the reverse of the normal winding order.
The hardware automatically flags the triangles with reversed winding
order as _3DPRIM_TRISTRIP_REVERSE, so that face culling and two-sided
coloring can be adjusted to account for the reversed order.

In order to ensure that winding order is correct when streaming
vertices out to a transform feedback buffer, we need to alter the
ordering of BCD to BDC when the first provoking vertex convention is
in use, and to CBD when the last provoking vertex convention is in
use.

To do this, we precompute an array of indices indicating where each
vertex will be placed in the transform feedback buffer; normally this
is SVBI[0] + (0, 1, 2), indicating that vertex order should be
preserved.  When the primitive type is _3DPRIM_TRISTRIP_REVERSE, we
change this order to either SVBI[0] + (0, 2, 1) or SVBI[0] + (1, 0,
2), depending on the provoking vertex convention.

Fixes piglit tests "EXT_transform_feedback/tessellation
triangle_strip" on Gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-24 09:12:27 -08:00
Brian Paul
5c818c6277 mesa: consolidate texstore functions
The code for storing 1D, 2D and 3D tex images (whole or sub-images) was
all pretty similar.  This consolidates those six paths.

v2: rework switch statement to catch unexpected targets

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 09:25:41 -07:00
Brian Paul
afebe13986 mesa: fix _mesa_store_texsubimage2d() for GL_TEXTURE_1D_ARRAY
For 1D arrays, map each slice separately.  Note that this was handled
correctly in _mesa_store_teximage2d() but not here.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 09:25:41 -07:00
Brian Paul
9b26aa4c7a mesa: update comment for MapTextureImage() 2011-12-24 09:25:41 -07:00
Brian Paul
c60ac7b179 swrast: rewrite glDrawPixels(GL_DEPTH) with zoom
This gets rid of another renderbuffer->PutRow() call and _DepthBuffer
usage.  We always work with 32-bit uint Z values now.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:41 -07:00
Brian Paul
bf0c0ccbc9 swrast: stop using _DepthBuffer in triangle code
The only consequence is we can only use the occlusion_zless_16_triangle()
function with MESA_FORMAT_Z16.
2011-12-24 09:25:40 -07:00
Brian Paul
7a7b521ff2 mesa: remove gl_renderbuffer::PutRowRGB()
No longer used anywhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:40 -07:00
Brian Paul
6e7bc79578 swrast: stop using PutRowRGB() in triangle code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:40 -07:00
Brian Paul
743c664c8c swrast: refactor/rewrite fast_draw_rgba_pixels()
Use Map/UnmapRenderbuffer() for the special, optimized cases we care about.

Note that we're dropping some seldom-used cases in the new fast-path
code: as CI->RGB conversion and zooming.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 09:25:36 -07:00
Brian Paul
e66858fb67 swrast: move swrast_render_start/finish() call in drawpixels code
We don't want to call these functions where we'll be using
Map/UnmapRenderbuffer().  So push them further down in the drawpixels
cases so that we can switch over to Map/UnmapRenderbuffer() step by step.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:54 -07:00
Brian Paul
d9d0d4198f swrast: new fast_draw_depth_stencil() for glDrawPixels(GL_DEPTH_STENCIL)
Stop using deprecated renderbuffer PutRow() function.  Note that we
aren't using Map/UnmapRenderbuffer() yet because this call is inside
a swrast_render_start/finish() pair.

v2: use _mesa_pack_uint_24_8_depth_stencil_row(), per Eric.
2011-12-24 08:59:54 -07:00
Brian Paul
826f36b1d8 swrast: remove the copy_depth_stencil_pixels() function
Hopefully glCopyPixels(GL_DEPTH_STENCIL) will be handled by the
fast copy function.  Otherwise, just do the copy with separate
depth + stencil copies.  That's effectively what the removed code
did anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:54 -07:00
Brian Paul
e6c6b1c147 swrast: stop using depth/stencil wrappers in CopyPixels code
The functions that read depth/stencil values understand all (packed)
depth/stencil buffer formats now so there's no reason to use the
wrappers.

Also, improve the format checks in fast_copy_pixels() to catch mismatched
depth/stencil cases.

v2: fix the test for combined depth+stencil buffers, per Eric.
2011-12-24 08:59:54 -07:00
Brian Paul
bd31fb3463 swrast: remove needless assignment in draw_depth_stencil_pixels()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:53 -07:00
Brian Paul
7cf2d75d4f swast: replace renderbuffer->GetPointer() with _swrast_pixel_address()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:53 -07:00
Brian Paul
242fd9df3b swrast: use _swrast_pixel_address() helper function
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:59:50 -07:00
Brian Paul
d00d39a016 swrast: rewrite stencil test code
Stop using the deprecated renderbuffer Get/Put Row/Values functions.
Consolidate code paths, etc.  The file is nearly half the size it used
to be!

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
8b913bda3a swrast: remove dead code in s_stencil.c
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
70df474941 swrast: rewrite _swrast_read_stencil_span()
Use format pack/unpack functions instead of deprecated renderbuffer
GetRow/PutRow functions.

v2: use get_stencil_address(), s/destVals/newVals/

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
4d6b0927ab swrast: rewrite _swrast_read_depth_span_float()
Stop using the deprecated renderbuffer GetRow() function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
82f28c0a12 mesa: rewrite _swrast_depth_bounds_test()
Stop using the deprecated renderbuffer functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
29a9983969 swrast: rewrite depth-testing code
Consolidate code, stop using the deprecateted renderbuffer Put/Get
Row/Values() functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
8e7c388b31 swrast: stop using _swrast_get_values() in z/depth code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
e23e8cbf39 swrast: stop using _swrast_get_values() in stencil code
That function will go a way in the future.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
89fb81d521 swrast: do fast_copy_pixels() with Map/UnmapRenderbuffer()
v2: use memmove() instead of memcpy() in case of overlap

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
95970677b9 swrast: replace GetRow() call with _mesa_unpack_ubyte_stencil_row()
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
fc41473b9f mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()
The former was only used for clearing buffers.  The later wasn't used
anywhere!  Remove them and all implementations of those functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-24 08:54:26 -07:00
Brian Paul
c4b5f0cadb swrast: rewrite color buffer clearing to use Map/UnmapRenderbuffer()
v2: use _mesa_pack_colormask() helper and fix incorrect masking arithmetic

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:26 -07:00
Brian Paul
f1a2aa5cb3 mesa: add _mesa_pack_colormask()
For generating bit-wise colormasks for arbitrary pixel formats.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:26 -07:00
Brian Paul
488d7fc67d mesa: add _mesa_get_format_max_bits()
Returns max bits per channel for the given format.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
fd104a8459 swrast: do depth/stencil clearing with Map/UnmapRenderbuffer()
Another step toward getting rid of the renderbuffer PutRow/etc functions.

v2: fix assorted depth/stencil clear bugs found by Eric

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
fb758aab27 mesa: split get_tex_rgba() into compressed/uncompressed versions
This just splits one big function into two smaller ones for better
readability.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 08:54:25 -07:00
Brian Paul
5e6a6e49e9 mesa: fix comments in getteximage_error_check() 2011-12-24 08:00:29 -07:00
Jian Zhao
26195c8417 mesa: move the format and type check before select_tex_image()
Move the format and type check before select_tex_image, or it will fail to
report the mismatch error if the teximage is null.

Reported-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Jian Zhao <jian.j.zhao@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-24 08:00:29 -07:00
Maarten Lankhorst
1fdecef886 vl: Fix inverted logic in vlc checks
Reported-by: Andy Furniss <andyqos@ukfsn.org>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-24 15:36:46 +01:00
Alexandre Demers
3258cd9e61 egl,glx,wgl: Fixes stapi->createContext usage
Fixed the build failure, fixed a warning where attributs and error arguments had
been
inverted and fixed another call that was missing an argument.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-12-24 11:11:33 +00:00
Eric Anholt
e71375d375 i965/gen7: Fix feedback for flat-shaded tristrips versus provoking vertex.
Fixes piglit tesselation triangle_strip flat_last.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:07:20 -08:00
Eric Anholt
c8223d8c8d i965/gen7: Add support for transform feedback.
Fixes almost all of the transform feedback piglit tests.  Remaining
are a few tests related to tesselation for
quads/trifans/tristrips/polygons with flat shading.

v2: Incorporate Paul's feedback (squash with previous, state flag note,
    static assert, update FINISHME)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:07:09 -08:00
Eric Anholt
8f0baace98 i965/gen7: Move SOL stage disable to gen7_sol_state.c
We'll be growing more code in here as we actually enable the unit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:02:25 -08:00
Eric Anholt
e1425a54b1 i965/gen7: Add register definitions for GL_EXT_transform_feedback.
v2: Make the buffer enable bitfield take an index argument.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:02:12 -08:00
Eric Anholt
43e0d77597 i965/gen7: Make primitives_written counting work.
The code was relying on gs.prog_data's copy of the
number-of-verts-per-prim, which segfaulted on gen7 since it doesn't
make a GS program.  We can easily calculate that value right here.

v2: Fix svbi_0_starting_index regression.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 22:02:09 -08:00
Eric Anholt
bf2a93db4d i965/gen7: Enable EXT_transform_feedback extension under 3.0 override.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-23 22:02:04 -08:00
Matt Turner
7a8f52e4b4 glsl: remove old autogen.sh
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 17:03:00 -08:00
Paul Berry
f2f14bc4a9 i965 Gen6+: Invalidate VF address-based cache on flush
Although there is not much documentation of this fact, there are in
fact two separate VF caches:

- an "index-based" cache (described in the Sandy Bridge PRM, vol 2
  part 1, section 2.1.2 "Vertex Cache").  This cache stores URB
  handles of vertex shader outputs; its purpose is to avoid redundant
  invocations of the vertex shader when drawing in random access mode
  (e.g. glDrawElements()), and the same vertex index is specified
  multiple times.  It is automatically invalidated between
  3D_PRIMITIVE commands and between instances within a single
  3D_PRIMITIVE command.

- an "address-based" cache (mentioned briefly in vol 2 part 1, section
  1.7.4 "PIPE_CONTROL Command").  This cache stores the data read from
  vertex buffers; its purpose is to avoid redundant memory accesses
  when doing instanced drawing or when multiple 3D_PRIMITIVE commands
  access the same vertex data.  It needs to be manually invalidated
  whenever new data is written to a buffer that is used for vertex
  data.

Previous to this patch, it was not necessary for Mesa to explicitly
invalidate the address-based cache, because there were no reasonable
use cases in which the GPU would write to a vertex data buffer during
a batch, and inter-batch flushing was taken care of by the kernel.

However, with transform feedback, there is now a reasonable use case:
vertex data is written to a buffer using transform feedback, and then
that data is immediately re-used as vertex input in the next drawing
operation.  To make this use case work, we need to flush the
address-based VF cache between transform feedback and the next draw
operation.  Since we are already calling
intel_batchbuffer_emit_mi_flush() when transform feedback completes,
and intel_batchbuffer_emit_mi_flush() is intended to invalidate all
caches, it seems reasonable to add VF cache invalidation to this
function.

As with commit 63cf7fad13 (i965: Flush
pipeline on EndTransformFeedback), this is not an ideal solution.  It
would be preferable to only invalidate the VF cache if the next draw
call was about to consume data generated by a previous draw call in
the same batch.  However, since we don't have the necessary dependency
tracking infrastructure to figure that out right now, we have to
overzealously invalidate the cache.

Fixes Piglit test "EXT_transform_feedback/immediate-reuse".

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 15:16:51 -08:00
Paul Berry
e25c4d0926 i965 gen6: Resend binding table pointer after updating SOL bindings.
After creating new binding table entries for transform feedback, we
need to set the dirty flag BRW_NEW_SURFACES, so that a new binding
table pointer will be sent to the hardware.  Otherwise the new binding
table entries will not take effect.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 15:16:51 -08:00
Paul Berry
9cfa8a74ce i965: Rename BRW_NEW_WM_SURFACES to BRW_NEW_SURFACES.
The surface states tracked by BRW_NEW_WM_SURFACES are no longer used
for just WM.  They are also used for vertex texturing and transform
feedback.  To avoid confusion, this patch renames BRW_NEW_WM_SURFACES
to BRW_NEW_SURFACES.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 15:16:51 -08:00
Kenneth Graunke
9df8662e28 i965: Don't use BRW_DEPTHFORMAT_D24_UNORM_X8_UINT on Gen4.
X8 depth formats weren't supported until Ironlake (Gen 5).

Fixes GPU hangs introduced in d84a180417.
One example test case was "fbo-missing-attachment-blit from".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-23 12:15:20 -08:00
Paul Berry
cb045880b1 mesa: Pause transform feedback during meta ops.
Fixes piglit tests "EXT_transform_feedback/generatemipmap buffer" and
"EXT_transform_feedback/generatemipmap prims_written" on i965 Gen6.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
772d4fef42 i965 gen6: Implement transform feedback pause/resume functionality.
Although i965 gen6 does not yet support ARB_transform_feedback2 or
NV_transform_feedback2, it needs to support pause/resume functionality
so that meta-ops will work correctly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
87c7e5fb87 mesa: Disable certain error checks when transform feedback is paused
When transform feedback is paused, it is legal to change programs or
to perform drawing operations using a drawing mode that doesn't match
the transform feedback mode.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
08ce48733d mesa: Ensure that Paused is reset to false on EndTransformFeedback.
If a client calls BeginTransformFeedback(), then
PauseTransformFeedback(), then EndTransformFeedback(), we need to make
sure that the transform feedback object is not left in a "paused"
state, otherwise the next call to BeginTransformFeedback() will leave
transform feedback paused.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Paul Berry
a3a4d01e41 mesa: Save and restore GL_RASTERIZER_DISCARD state during meta ops.
During meta-operations (such as _mesa_meta_GenerateMipmap()), we need
to be able to draw even if GL_RASTERIZER_DISCARD is enabled.  This
patch causes _mesa_meta_begin() to save the state of
GL_RASTERIZER_DISCARD and disable it (so that drawing can be done
during the meta-op), and causes _mesa_meta_end() to restore it.

Fixes piglit test "EXT_transform_feedback/generatemipmap discard" on
i965 Gen6.

Reviewed-by: Brian Paul <brianp@vmare.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-23 09:43:18 -08:00
Ian Romanick
b5b2081d75 dri2: Add createContextAttribs entry point for DRISW version 3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:49:53 -08:00
Ian Romanick
1ab545494a dri2: Add createContextAttribs entry point for DRI2 version 3
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:49:53 -08:00
Ian Romanick
d18152028e st-api: Have context_create explain why creation failed
This won't be used in the client-side libGL, but the xserver has to
generate a different protocol error depending on the reason context
creation failed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-12-23 08:49:50 -08:00
Ian Romanick
358ecff1ea st-api: Clean-up OpenGL profile handling
There seems to have been two different ways to communicate the
profile.  There were flags and there were profiles.  I've opted to
remove the profile flags and use ST_PROFILE_DEFAULT (compatibility
profile) and ST_PROFILE_OPENGL_CORE (core profile) consistently
instead.

Also change the values of the ST_CONTEXT_FLAG_DEBUG and
ST_CONTEXT_FLAG_FORWARD_COMPATIBLE flags to match the WGL and GLX
values.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-12-23 08:49:47 -08:00
Ian Romanick
ed4a65c3cf glx: Propagate the glXIsDirect protocol error back to the application
If the server returned BadContext, the error would just get droped on
the floor.

Fixes the piglit test glx-import-context-single-process

NOTE: This is a candidate for the 7.11 branch, but it also requires
the previous patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:40:30 -08:00
Ian Romanick
fba400072f glx: Deliver an xlib style error to the application from an XCB error
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-23 08:40:30 -08:00
Maarten Lankhorst
efa93ae449 vl: improve vlc functions and handling
Only initialize vlc in MPEG2 decoding once for all slices,
add more sanity checks to vlc decoding functions, support
multiple vlc input buffer, improve documentation of the
vlc functions.

v2: also implement multiple inputs for the vlc functions
v3: some bug fixes for buffer size and alignment corner cases
v4: rework of the patch, some more improvements

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-23 16:31:26 +01:00
Maarten Lankhorst
ebe7c687ce nouveau: Fix bugs in nouveau_video_buffer
Double free and array overflow, even if only 2 members are
used the last one needs to be set to NULL explicitly.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com
2011-12-23 16:21:25 +01:00
Lauri Kasanen
2eafd07323 gallivm: Close a memory leak
Hi all

This fixes a memory leak of 32 bytes on exit.

From 924f8fdccb41b011f372bc57252005bcdb096105 Mon Sep 17 00:00:00 2001
From: Lauri Kasanen <curaga@operamail.com>
Date: Thu, 22 Dec 2011 21:28:33 +0200
Subject: [PATCH] gallivm: Close a memory leak

As reported by "valgrind --leak-check=full glxgears".

Signed-off-by: Lauri Kasanen <curaga@operamail.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-12-22 23:03:18 +00:00
Dave Airlie
7fd8dc3aa9 softpipe: try and use back color for a slot if color fails.
In the case where a front and back output are specified, the draw code will
copy the back output into the front color slot and everything is happy.

However if no front is specified then the draw code will do a bad copy (separate patch), but also the frag shader won't pick up the color as there there is
no write to COLOR from the vertex shader just BCOLOR.

This patch fixes that problem so if it can't find a vertex shader output
for the front color slot, it will go and lookup and use one for the back color
slot.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-22 12:25:33 +00:00
Dave Airlie
d61d39922b format_unpack: add 8/16 rgba/rgb types.
fixing these makes piglit fbo-integer pass on softpipe.

modified to re-order things, haven't addressed Eric's concerns,
can't find anything in spec that mentions sign extensions, it does say
integers aren't clamped or modified.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-22 12:25:32 +00:00
Eric Anholt
f1d89638c0 i965: Don't make consumers of brw_CONT/brw_WHILE track if depth in loop.
The codegen backends all had this same tracking, so just do it at the
EU level.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Eric Anholt
ce6be334bb i965: Don't make consumers of brw_WHILE do pre-gen6 BREAK/CONT patching.
The EU code itself can just do this work, since all the consumers were
duplicating it.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Eric Anholt
32118cfe37 i965: Don't make consumers of brw_DO()/brw_WHILE() track loop start.
This is a similar cleanup to what we did for brw_IF(), brw_ELSE(),
brw_ENDIF() handling.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Eric Anholt
9f8814752f i965: Drop unused do_insn argument from gen6_CONT().
The branch distances get patched up later at the WHILE instruction.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-12-21 14:31:33 -08:00
Paul Berry
d44878e754 mesa: Add _NEW_RASTERIZER_DISCARD as synonym for _NEW_TRANSFORM.
This makes it easier to keep track of which dirty bits correspond to
which pieces of context, since it makes _NEW_RASTERIZER_DISCARD
correspond with ctx->RasterDiscard.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-21 13:33:35 -08:00
Paul Berry
aee96806f0 mesa: Move RasterDiscard to toplevel of gl_context.
Previously we were storing the RasterDiscard flag (for
GL_RASTERIZER_DISCARD) in gl_context::TransformFeedback.  This was
confusing, because we use the _NEW_TRANSFORM flag (not
_NEW_TRANSFORM_FEEDBACK) to track state updates to it, and because
rasterizer discard has effects even when transform feedback is not in
use.

This patch makes RasterDiscard a toplevel element in gl_context rather
than a subfield of gl_context::TransformFeedback.

Note: We can't put RasterDiscard inside gl_context::Transform, since
all items inside gl_context::Transform need to be pieces of state that
are saved and restored using PushAttrib and PopAttrib.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-21 13:33:31 -08:00
Kristian Høgsberg
636f2fc46c egl/x11: Merge the right version of Frederiks change
Argh, I merged an older broken version of the swapbuffer change instead of
Frederiks fixed version.  This diffs gets us back to the right version.
2011-12-21 10:29:30 -05:00
Fredrik Höglund
352c889c10 egl_dri2/x11: Add support for the DRI2 SwapBuffers request 2011-12-20 22:11:18 -05:00
Fredrik Höglund
655f2c1d65 egl_dri2/x11: Add support for eglSwapInterval 2011-12-20 22:11:17 -05:00
Paul Berry
3a2e71874b i965 gen6: Turn on transform feedback extension unconditionally.
Previously, we only enabled transform feedback when
MESA_GL_VERSION_OVERRIDE was 3.0 or greater, since transform feedback
support was not completely finished, so it didn't make sense to
advertise support for it unless absolutely necessary.

Now that transform feedback is fully implemented on gen6, we can
enable this extension unconditionally.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
c59393b706 i965 gen6: Implement transform feedback queries.
This patch adds software-based PRIMITIVES_GENERATED and
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries that work by keeping
track of the number of primitives that are sent down the pipeline, and
adjusting as necessary to account for the way each primitive type is
tessellated.

In the long run we'll want to replace this with a hardware-based
implementation, because the software approach won't work with geometry
shaders or primitive restart.  However, at the moment, we don't have
the necessary kernel support to implement a hardware-based query (we
would need the kernel to save GPU registers when context switching, so
that drawing performed by another process doesn't get counted).

Fixes Piglit tests EXT_transform_feedback/query-primitives_generated-*
and EXT_transform_feedback/query-primitives-written-*.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
c5e17a8498 i965: Convert if/else to switch statements in brw_queryobj.c
Previously, i965 only supported two query types: GL_TIME_ELAPSED_EXT
and GL_SAMPLES_PASSED_ARB, and it distinguished between the two using
if/else statements that compared query->Base.Target to
GL_TIME_ELAPSED_EXT.

This patch changes the if/else statements to switch statements so that
we can add more query types without having to have a chain of
else-ifs.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
f8328c998b i965 gen6: Ensure correct transform feedback indices on new batch.
We don't currently have kernel support for saving GPU registers on a
context switch, so if multiple processes are performing transform
feedback at the same time, their SVBI registers will interfere with
each other.  To avoid this situation, we keep a software shadow of the
state of the SVBI 0 register (which is the only register we use), and
re-upload it on every new batch.

The function that updates the shadow state of SVBI 0 is called
brw_update_primitive_count, since it will also be used to update the
counters for the PRIMITIVES_GENERATED and
TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
163611d7b2 mesa: Add a function to query whether a meta-op is in progress.
This is needed by i965 to ensure that transform feedback counters are
not incremented during meta-ops.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
dc7b6d7d6d mesa: Add count_tessellated_primitives() function.
This function computes the number of primitives that will be generated
when the given drawing operation is performed.  It accounts for the
tessellation that is performed on line strips, line loops, triangle
strips, triangle fans, quads, quad strips, and polygons, so it is
suitable for implementing the primitive counters needed by transform
feedback.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:28 -08:00
Paul Berry
291ae4e639 mesa: Remove unnecessary FLUSH_VERTICES in bind_buffer_range
It isn't necessary to call FLUSH_VERTICES from bind_buffer_range,
because transform feedback buffers are not allowed to be changed when
transform feedback is active.

Thanks to Marek Olšák for pointing out this bug.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-20 15:22:28 -08:00
Paul Berry
7d2ff0bf0b i965 gen6: Implement rasterizer discard.
This patch enables rasterizer discard functionality (a part of
transform feedback) in Gen6, by generating an alternate GS program
when rasterizer discard is active.  Instead of forwarding vertices
down the pipeline, the alternate GS program uses a URB Write message
to deallocate the URB entry that was allocated by FF sync and
terminate the thread.

Note: parts of the Sandy Bridge PRM seem to imply that we could do
this more efficiently, by clearing the GEN6_GS_RENDERING_ENABLE bit,
and not allocating a URB entry at all.  However, it's not clear how we
are supposed to terminate the thread if we do that.  Volume 2 part 1,
section 4.5.4, says "GS threads must terminate by sending a URB_WRITE
message with the EOT and Complete bits set.", and my experiments so
far confirm that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:22:08 -08:00
Kenneth Graunke
21504b462a i965: Implement bounds checking for transform feedback output.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-20 15:17:23 -08:00
Paul Berry
63cf7fad13 i965: Flush pipeline on EndTransformFeedback.
A common use case for transform feedback is to perform one draw
operation that writes transform feedback output to a buffer, followed
by a second draw operation that consumes that buffer as vertex input.
Since vertex input is consumed at an earlier pipeline stage than
writing transform feedback output, we need to flush the pipeline to
ensure that the transform feedback output is completely written before
the data is consumed.

In an ideal world, we would do some dependency tracking, so that we
would only flush the pipeline if the next draw call was about to
consume data generated by a previous draw call in the same batch.
However, since we don't have that sort of dependency tracking
infrastructure right now, we just unconditionally flush the buffer
every time glEndTransformFeedback() is called.  This will cause a
performance hit compared to the ideal case (since we will sometimes
flush the pipeline unnecessarily), but fortunately the performance hit
will be confined to circumstances where transform feedback is in use.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-20 15:00:29 -08:00
Paul Berry
c3161b629f i965 gen6+: Make intel_batchbuffer_emit_mi_flush() actually flush.
Previous to this patch, the function intel_batchbuffer_emit_mi_flush()
was a bit of a misnomer.  On Gen4+, when not using the blit engine, it
didn't actually flush the pipeline--it simply generated a PIPE_CONTROL
command with the necessary bits set to flush GPU caches.  This was
usually sufficient, since in most situations where
intel_batchbuffer_emit_mi_flush() was called, all we really care about
was ensuring cache coherency.

However, with the advent of OpenGL 3.0, there are two cases in which
data output by one stage of the pipeline might be consumed, in a later
draw operation, by an earlier stage of the pipeline:

(a) When using textures in the vertex shader.

(b) When using drawing with a vertex buffer that was previously
    generated using transform feedback.

This patch addresses case (a) by changing
intel_batchbuffer_emit_mi_flush() so that on Gen6+, it sets the
PIPE_CONTROL_CS_STALL bit (this forces the pipeline to actually
flush).  (Case (b) will be addressed by the next patch in the series).

This is not an ideal solution--in a perfect world, the driver would
have some buffer dependency tracking so that we would only have to
flush the pipeline in the two cases above.  Until that dependency
tracking is implemented, however, it seems prudent to have
intel_batchbuffer_emit_mi_flush() actually flush the pipeline, so that
we get correct rendering, at the expense of a (hopefully small)
performance hit.

The change is only applied to Gen6+, since at the moment only Gen6+
supports the OpenGL 3.0 features that make a full pipeline flush
necessary.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-20 15:00:28 -08:00
Paul Berry
6ca61441b5 i965 gen6: Turn on transform feedback extension.
This patch advertises support for EXT_transform_feedback on Intel
Gen6.

Since transform feedback support is not completely finished yet, for
now we only advertise support for it when MESA_GL_VERSION_OVERRIDE is
3.0 or greater (since transform feedback is required by GL version
3.0).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 15:00:28 -08:00
Paul Berry
9308f29830 i965 gen6: Initial implementation of transform feedback.
This patch adds basic transform feedback capability for Gen6 hardware.
This consists of several related pieces of functionality:

(1) In gen6_sol.c, we set up binding table entries for use by
transform feedback.  We use one binding table entry per transform
feedback varying (this allows us to avoid doing pointer arithmetic in
the shader, since we can set up the binding table entries with the
appropriate offsets and surface pitches to place each varying at the
correct address).

(2) In brw_context.c, we advertise the hardware capabilities, which
are as follows:

   MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 64
   MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS        4
   MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS    16

OpenGL 3.0 requires these values to be at least 64, 4, and 4,
respectively.  The reason we advertise a larger value than required
for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS is that we have already
set aside 64 binding table entries, so we might as well make them all
available in both separate attribs and interleaved modes.

(3) We set aside a single SVBI ("streamed vertex buffer index") for
use by transform feedback.  The hardware supports four independent
SVBI's, but we only need one, since vertices are added to all
transform feedback buffers at the same rate.  Note: at the moment this
index is reset to 0 only when the driver is initialized.  It needs to
be reset to 0 whenever BeginTransformFeedback() is called, and
otherwise preserved.

(4) In brw_gs_emit.c and brw_gs.c, we modify the geometry shader
program to output transform feedback data as a side effect.

(5) In gen6_gs_state.c, we configure the geometry shader stage to
handle the SVBI pointer correctly.

Note: ordering of vertices is not yet correct for triangle strips
(alternate triangles are improperly oriented).  This will be addressed
in a future patch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-20 15:00:23 -08:00
Paul Berry
1413f955eb i965 gs: Move vue_map to brw_gs_compile.
This patch stores the geometry shader VUE map from a local variable in
compile_gs_prog() to a field in the brw_gs_compile struct, so that it
will be available while compiling the geometry shader.  This is
necessary in order to support transform feedback on Gen6, because the
Gen6 geometry shader code that supports transform feedback needs to be
able to inspect the VUE map in order to find the correct vertex data
to output.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 14:32:16 -08:00
Paul Berry
fd5d0c8b12 i965 gen6+: Use 1-wide null operands for IF instructions
The Sandy Bridge PRM, volume 4, part 2, section 5.3.10 ("5.3.10
Register Region Restrictions") contains the following restriction on
the execution size and operand width of instructions:

   "3. ExecSize must be equal to or greater than Width."

When emitting an IF instruction in single program flow mode on Gen6+,
we use an ExecSize of 1, therefore the Width of each operand must also
be 1.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 14:32:16 -08:00
Paul Berry
38b118d49d mesa: Fix off-by-one error in transform feedback size check.
In _mesa_BindBufferRange(), we need to verify that the offset and size
specified by the client do not exceed the size of the underlying
buffer.  We were accidentally doing this check using ">=" rather than
">", so we were generating a bogus error if the client specified an
offset and size that fit exactly in the underlying buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-20 14:32:16 -08:00
Paul Berry
942d452047 mesa: Record transform feedback strides/offsets in linker output.
This patch adds two new fields to the gl_transform_feedback_info
struct:

- BufferStride records the total number of components (per vertex)
  that transform feedback is being instructed to store in each buffer.

- Outputs[i].DstOffset records the offset within the interleaved
  structure of each transform feedback output.

These values are needed by the i965 gen6 and r600g back-ends, so it
seems better to have the linker provide them rather than force each
back-end to compute them independently.

Also, DstOffset helps pave the way for supporting
ARB_transform_feedback3, which allows the transform feedback output to
contain holes between attributes by specifying
gl_SkipComponents{1,2,3,4} as the varying name.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-12-20 14:32:16 -08:00
Jon TURNEY
9f8573b7ae Fix compilation on cygwin after commit 762c9766c9
Fix compilation on cygwin after commit 762c9766c9
"Use VERT_ATTRIB_* indexed array in gl_array_object" added the first non-driver
use of ffsll(), which exposes the fact that this isn't provided on cygwin.

Found by tinderbox, see [1]

[1] http://tinderbox.freedesktop.org/builds/2011-11-30-0017/logs/libGL/#build

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-20 13:45:27 +00:00
Maarten Lankhorst
704d22dfc1 xvmc: Remove unused variable
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-20 13:12:54 +01:00
Maarten Lankhorst
68651c3243 vl: Remove unused declaration
csc is not used for rgba and gives a warning.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-20 13:12:39 +01:00
Maarten Lankhorst
72325ee6e3 vl: Use pipe clear_render_target instead of util_clear_render_target
Mapping to software and uploading again clearing is killing performance.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-20 13:05:49 +01:00
Pekka Paalanen
dae2fca705 mesa: fix a leak in _mesa_delete_texture_image()
Valgrind complains about a definitely lost block allocated in
intelNewTextureImage(). This leak was apparently created by
6e0f9001fe, "mesa: move
gl_texture_image::Data, RowStride, ImageOffsets to swrast", as it
removes the free() from _mesa_delete_texture_image().

Put the free() back, fixes a Valgrind error.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-20 11:58:23 +02:00
Chia-I Wu
249c6f1934 st/egl: error check and clamp coordinates in eglPostSubBufferNV
EGL_BAD_PARAMETER should be returned when any of the coordinates is negative.
2011-12-20 17:26:18 +08:00
Chia-I Wu
eb7d1b9474 egl_dri2/x11: error check coordinates in eglPostSubBufferNV
EGL_BAD_PARAMETER should be returned when any of the coordinates is negative.
2011-12-20 17:26:18 +08:00
Fredrik Höglund
7577284213 st/egl: Add support for EGL_NV_post_sub_buffer
Signed-off-by: Fredrik Höglund <fredrik@kde.org>

[olv: remove #ifdef checks]
2011-12-20 17:09:06 +08:00
Fredrik Höglund
71b8fc9872 egl_dri2/x11: Add support for EGL_NV_post_sub_buffer
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
2011-12-20 17:05:11 +08:00
Fredrik Höglund
7d46b45c5b egl: add EGL_NV_post_sub_buffer
v2: Handle EGL_POST_SUB_BUFFER_SUPPORTED_NV in
    _eglParseSurfaceAttribList()

Signed-off-by: Fredrik Höglund <fredrik@kde.org>

[olv: remove #ifdef checks]
2011-12-20 17:04:46 +08:00
Chia-I Wu
f63e129d5f egl: KHR_reusable_sync entrypoints are missing from eglGetProcAddress 2011-12-20 17:00:01 +08:00
Chia-I Wu
f957cac772 egl: remove #ifdef's for official extensions
There is no point in having them when we distribute eglext.h.

As for unofficial extensions, there is a chance that we might remove some of
them evetually.  Keeping the #ifdef's for now should make that easier.
2011-12-20 16:59:09 +08:00
Chia-I Wu
ed1ff2acec egl: remove EGL_ANDROID_swap_rectangle
We never support this unofficial extension, and it has been removed from
Android recently.  There is no point in keeping it.
2011-12-20 16:20:17 +08:00
Chia-I Wu
b7acfe7755 egl: update headers
Update to revision 15052.

EGL_MESA_drm_image is now official.  But apparently we have our own extension
to it and we need this in eglmesaext.h:

  #ifdef EGL_MESA_drm_image
  /* Mesa's extension to EGL_MESA_drm_image... */
  #ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA
  #define EGL_DRM_BUFFER_USE_CURSOR_MESA		0x0004
  #endif
  #endif

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-20 16:12:14 +08:00
Chia-I Wu
ab7bb10a2a egl: move unofficial extensions to eglmesaext.h
As suggested by Ian in

  http://lists.freedesktop.org/archives/mesa-dev/2011-December/016035.html

Note that eglext.h has to include eglmesaext.h at the end instead of the
beginning because some extensions in eglmesaext.h depend on the official
extensions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-20 16:11:41 +08:00
Stéphane Marchesin
67e6a40605 i915g: Add unsupported caps. 2011-12-19 18:33:03 -08:00
Stéphane Marchesin
1981042341 i915g: Turn an assert into a debug message, print more debug info for missing depth swz.
Also fix indentation a bit.
2011-12-19 18:28:26 -08:00
Stéphane Marchesin
a7534d8943 i915g: Make the pipe_sampler_state struct non const and get rid of useless memcpy. 2011-12-19 18:28:26 -08:00
Stéphane Marchesin
c661843ab6 i915g: Implement KILP. 2011-12-19 18:24:39 -08:00
Stéphane Marchesin
3c01aefe5f i915g: Add two unsupported caps. 2011-12-19 18:24:39 -08:00
Stéphane Marchesin
9c76ba04f8 i915g: Put the templates at the beggining of the structures.
Seriously. This fixes fragment-and-vertex-texturing in piglit and probably
a boatload of other stuff.
2011-12-19 18:24:39 -08:00
Kenneth Graunke
37d24a70da i965: Advertise our vertex shader texture units.
Previously, we advertised 0 VS texture units.  Now that we have proper
support for using the sampling engine in the VS, we can advertise 16,
which is conveniently the number required for OpenGL 3.0.

v2: Enable on Gen4.  I hacked up my tests to not use flat ivec varyings
    and they pass.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:11 -08:00
Kenneth Graunke
8e34021099 i965/vs: Implement EXT_texture_swizzle support for VS texturing.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:11 -08:00
Kenneth Graunke
d45814c925 i965/vs: Add texture related data to brw_vs_prog_key.
Now that this is all factored out, it's trivial to do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
387a3d43d1 i965/fs: Only set brw_wm_prog_key data for samplers used by the WM.
This should avoid state-dependent FS recompiles when samplers that are
only used by the VS change.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
1b05fc7cdd i965/fs: Factor out texturing related data from brw_wm_prog_key.
The idea is to reuse this for the VS and (in the future) GS as well.

v2: Include yuvtex data since we're not dropping GL_MESA_ycbycr.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> [v1]
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
328b693a19 i965/vs: Add support for texel offsets.
The visit() half computes the values to put in the header based on the
IR and simply stuffs that in the vec4_instruction; the emit() half uses
this to set up the message header.  This works out well since emit() can
use brw_reg directly and access individual DWords without kludgery.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
475d70d6ef i965/fs: Factor out texture offset bitfield computation.
We'll want to reuse this for the VS, and it's complex enough that I'd
rather not cut and paste it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
d93aa54d2d i965/vs: Implement vec4_visitor::visit(ir_texture *).
This translates the GLSL compiler's IR into vec4_instruction IR,
generating code to load coordinates, LOD info, shadow comparitors, and
so on into the appropriate message registers.

It turns out that the SIMD4x2 parameters are identical on Gen 5-7, and
the Gen4 code is similar enough that, unlike in the FS, it's easy enough
to support all generations in a single function.

v2: Load zeros for missing coordinates (fixing vs-texelFetch-sampler1D
and 2D on G45), and fix G45 message length for shadow comparisons.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
ca182cd0fa i965/vs: Implement vec4_visitor::generate_tex().
This is the part that takes the vec4_instruction IR and turns it into
actual Gen ISA.

v2: Add Gen4 messages, don't retype m0 to UW.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:10 -08:00
Kenneth Graunke
7ff68176f0 i965: Add missing SIMD4x2 sample_l_c message #defines.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-19 16:33:09 -08:00
Kenneth Graunke
79d981cd03 i965: Don't minify depth when setting up cube map miptrees on Gen4.
Prior to Ironlake, cube maps were stored as 3D textures.  In recent
refactoring, we removed a separate "layers" parameter in favor of using
depth.  Unfortunately, depth was getting minified, which is only correct
for actual 3D textures.

Fixes piglit tests:
- bugs/crash-cubemap-order
- fbo/fbo-cubemap
- texturing/cubemap

Also changes texturing/cubemap npot from abort to fail.

This hasn't seen a full test run since Piglit on Mesa master hangs
GM45 a lot.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 16:33:09 -08:00
Ian Romanick
c66242a6c6 glx: Remove GLX_USE_APPLEGL cruft in extension string handling
All of the extensions require that both libGL and either the server or
the direct rendering driver (or both) enable the extension before it's
advertised.  It seems safe to assume that none of the other components
on OS X will enable these extensions, so all the #ifdef blocks here
just clutter the code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19 14:55:31 -08:00
Ian Romanick
d3f7597bc9 glx: GLX 1.4 does not require GLX_INTEL_swap_event
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
8e5efbe62b glx: Remove some extensions that are not, and never will be, supported
There are a few unsupported extensions (e.g., the ATI and NV float
extensions) that are still in the list.  There is some small chance
that these may be supported some day.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
e4be406f09 glx: Explicitly reject servers that only support GLX 1.0
__glXInitialize calls AllocAndFetchScreenConfigs.
AllocAndFetchScreenConfigs unconditionally sends a glXQuerySeverString
request to the server.  This request is only supported with GLX 1.1 or
later, so we were already implicitly incompatible with GLX 1.0
servers.  How many more similar bugs lurk in the code that nobody has
noticed in years?

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
a832aa5ba0 glx: Initialize share_xid in CreateContext
Previously the share_xid was only set in the glXImportContextEXT path,
and it was left set to None in all of the other create-context paths.

Fixes the piglit test glx-query-context-info-ext.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
b1ffb3335f glx: Make parameter types for __glXSendError match protocol types
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19 14:55:31 -08:00
Ian Romanick
6f76efa922 glx: Make __glXSendError available in non-Apple builds
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
2011-12-19 14:55:31 -08:00
Ian Romanick
4dbd13cb3f glx: Send DestroyContext protocol at the correct times
Send the DestroyContext protocol immediately when glXDestroyContext is
called, and never call it when glXFreeContextEXT is called.  In both
cases, either destroy the client-side structures or, if the context is
current, set xid to None so that the client-side structures will be
destroyed later.

I believe this restores the behavior of the original SGI code.  See
src/glx/x11 around commit 5df82c8.  The spec doesn't say anything
about glXDestroyContext not really destroying imported contexts (it
acts like glXFreeContextEXT instead), but that's what the original
code did.  Note that glXFreeContextEXT on a non-imported context does
not destroy it either.

Fixes the piglit test glx-free-context.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:31 -08:00
Ian Romanick
3b9b42250c glx: Don't segfault if glXGetContextIDEXT is pased a NULL context
Fixes the piglit test glx-get-context-id.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:30 -08:00
Ian Romanick
5a849e864e glx: Fix handling of property list received from the server in glXImportContextEXT
The primary problem was that the number of reply bytes read is clamped
to sizeof(propList), but the loop that processes the properties tries
to examine all of the properties sent by the server.  If the server
sends 47,000 properties, we only read 3 but process all 47,000.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:30 -08:00
Ian Romanick
7c2f1160c2 glx: Don't segfault if xcb_glx_is_direct_reply returns NULL
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:30 -08:00
Ian Romanick
c4a8c54c3b glx: Don't create a shared context if the other context isn't the same kind
Each of the DRI, DRI2, and DRISW backends contain code like the
following in their create-context routine:

   if (shareList) {
      pcp_shared = (struct dri2_context *) shareList;
      shared = pcp_shared->driContext;
   }

This assumes that the glx_context *shareList is actually the correct
derived type.  However, if shareList was created as an
indirect-rendering context, it will not be the expected type.  As a
result, shared will contain garbage.  This garbage will be passed to
the driver, and the driver will probably segfault.  This can be
observed with the following GLX code:

    ctx0 = glXCreateContext(dpy, visinfo, NULL, False);
    ctx1 = glXCreateContext(dpy, visinfo, ctx0, True);

Create-context is the only case where this occurs.  All other cases
where a context is passed to the backend, it is the 'this' pointer
(i.e., we got to the backend by call something from ctx->vtable).

To work around this, check that the shareList->vtable->destroy method
is the same as the destroy method of the expected type.  We could also
check that shareList->vtable matches the vtable or by adding a "tag"
to glx_context to identify the derived type.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-19 14:55:30 -08:00
Eric Anholt
507e71e45a i965: Add support for GL_ARB_depth_buffer_float under 3.0 override.
This is not exposed generally yet because some of the swrast paths hit
in piglit (drawpixels, copypixels, blit) aren't yet converted to
MapRenderbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Eric Anholt
4790c4ae24 i965: Add separate stencil/HiZ setup for MESA_FORMAT_Z32_FLOAT_X24S8.
This is a little more unusual than the separate MESA_FORMAT_S8_Z24
support, because in addition to storing the real stencil data in a
MESA_FORMAT_S8 miptree, we also make the Z miptree be
MESA_FORMAT_Z32_FLOAT instead of the requested format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Eric Anholt
e71fc6a820 i965: Use the miptree format for texture surface format choice.
With separate stencil GL_DEPTH32F_STENCIL8, the miptree will have a
really different format (MESA_FORMAT_Z32_FLOAT) from the teximage
(MESA_FORMAT_Z32_FLOAT_X24S8).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Eric Anholt
353f7ba4ab i965: Add support for mapping Z32_FLOAT_X24S8 fake packed depth/stencil.
The format handling here is tricky, because we're not actually
generating a Z32_FLOAT_X24S8 miptree, so we're guessing the format
that GL wants based on seeing Z32_FLOAT with a separate stencil.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Eric Anholt
0c49846710 intel: Stop creating the wrapped depth irb.
All the operations were just trying to get at irb->wrapped_depth->mt,
which is the same as irb->mt now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Eric Anholt
fdf18b3231 i965: Properly demote the depth mt format for fake packed depth/stencil.
gen7 only supports the non-packed formats, even if you associate a
real separate stencil buffer -- otherwise it's as if the depth test
always fails.

This requires a little bit of care in the match_texture_image case,
since the miptree format no longer matches the texture image format.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Eric Anholt
7978fb4d9f intel: Reuse intel_miptree_match_image().
This little bit of logic was duplicated, which isn't much, but I was
going to need to duplicate a bit of additional logic in the next
commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Eric Anholt
0b8b6c7e97 intel: Stop creating the wrapped stencil irb.
There were only two places it was really used at this point, which was
in the batchbuffer emit of the separate stencil packets for gen6/7.
Just write in the ->stencil_mt reference in those two places and ditch
all this flailing around with allocation and refcounts.

v2: Fix separate stencil on gen7.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-19 13:20:11 -08:00
Dave Airlie
35db326de5 tgsi: update documents with some info on texture lookup
this mentions which channels are used for slice and depth comparison values.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19 20:45:13 +00:00
Dave Airlie
42696ba16f softpipe: fix shadow1d tests.
This fixes the piglit glsl-1.10 shadow1D related tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19 20:45:08 +00:00
Dave Airlie
97b778efe7 softpipe: fix shadow 2d texture array sampling
The 4th texcoord is used in this case for the comparison.

This fixes piglit glsl-fs-shadow2DArray* on softpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19 20:44:47 +00:00
Dave Airlie
f4ab1783b3 gallium/draw: fix two side handling
The code didn't handle the case where front wasn't specified in the vertex
shader outputs, but back was.

In that case we were doing a copy from back to non-existant front,
this code checks we have existant front/backs and only does the copy when
they both exist.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19 19:07:35 +00:00
Alex Galakhov
d334a0fb8c osmesa: fix RGB565 rendering
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-19 07:41:06 -07:00
Maarten Lankhorst
d6942f781f vdpau: Add background surface support
Sets rgba layer as zeroth layer if a custom background_surface is specified.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-19 13:46:51 +01:00
Maarten Lankhorst
e8e0756bd3 vdpau: Add support for mixer attributes
It's harmless to add support for attributes we don't support,
since they require a feature enabled for them to affect
something. As long as they aren't enabled, nothing happens.

This enables support for custom colorspaces and background colors.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-19 13:36:17 +01:00
Maarten Lankhorst
89b9863252 vdpau: Add support for parameters
Currently only validating, since nothing else can be done with it yet

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>

v2: removed check_video_surface

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-19 13:33:47 +01:00
Dave Airlie
417aad5a99 softpipe: fix depth sampling for linear vs nearest.
This sample compare was always doing linear, and this makes the
glsl-fs-shadow1DArray test render like the Intel driver.

fix wrong 0->j from initial patch

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19 11:53:07 +00:00
Dave Airlie
07eeb92abc softpipe: fix texture sampling from 1D texture array
This is the first part of a fix to piglit glsl-fs-shadow1DArray

also fix the passing of unused r[2] in the normal 1D case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-19 11:52:47 +00:00
Brian Paul
009ac0618c mesa: make _mesa_set_tex_image() static since it's not called anywhere else 2011-12-18 17:56:08 -07:00
Christoph Bumiller
f202610288 nvc0: add NVC0_RESOURCE_FLAG_VIDEO 2011-12-18 22:37:45 +01:00
Dave Airlie
3788b4b5c9 glsl_to_tgsi: make sure copied instructions don't lose texture target. (v2)
The piglit draw-pixel-with-texture was asserting in the glsl->tgsi code,
due to 0 texture target, this makes sure the texture target is copied over
correctly when we copy instructions around.

v2: drive-by fix bitmap on the way past.

This avoids the assertion, have to contemplate fixing things as per the spec
later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-18 20:54:50 +00:00
Kenneth Graunke
bdd76ebef1 i965/vs: Add a new dst_reg constructor for file, number, type, and mask.
This will be especially useful for loading texturing parameters, where I
need to (for example) reference m3.xz<D>.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-18 12:39:00 -08:00
Kenneth Graunke
7e7c40ff98 i965/vs: Add vec4_instruction::is_tex() query.
Copy and pasted from fs_inst::is_tex(), but without TXB.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-18 12:38:56 -08:00
Kenneth Graunke
febad1779a i965: Rename texturing ops from FS_OPCODE to SHADER_OPCODE, except TXB.
We'll be reusing most of these for the VS shortly.  The one exception is
TXB (texturing with LOD bias), which is explicitly forbidden in the VS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-18 12:38:42 -08:00
Kenneth Graunke
c592ebc581 i965/fs: Don't swizzle the results of textureSize().
Fixes a regression since d2235b0f46,
in my new textureSize sampler(1DArrayShadow|2DShadow|2DArrayShadow)
piglit tests, though I'm not honestly sure how this ever worked.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-18 11:59:52 -08:00
nobled
bb6fb7afd3 program: fix previous commit
Accidentally an old patch.
2011-12-18 17:17:10 +00:00
nobled
f71984ee5b program: fix out of bounds array accesses and other bad things
Noticed a "warning: array subscript is above array bounds" given at one of
the existing sanity-check asserts. Turns out all the arrays of strings
haven't matched the corresponding enum values in a while, if ever.

I didn't know the proper names for any of these and couldn't find
them in the base specs aside from "result.pointsize" in
ARB_vertex_program, so I just filled in the enum's value
as was done with other slots.

Also add four STATIC_ASSERT()s to be sure and catch future additions
or bumps to MAX_VARYING/etc again, and some more non-static asserts
where there weren't any before.

(Note, the fragment enum that corresponded to result.color(half) was removed in
8d475822e6e19fa79719c856a2db5b6a205db1b9.)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-18 17:12:25 +00:00
nobled
03bfdb2bad gen_matypes: eliminate printf warnings
The VERT_BIT_* defines are 64-bit values now, but the printf
was still expecting a simple int.
2011-12-18 17:08:31 +00:00
Marek Olšák
745d990b8d r600g: fix MAX_STREAM_OUTPUT_SEPARATE_ATTRIBS limit 2011-12-17 19:42:13 +01:00
Marek Olšák
211520450b mesa/x86: fix printf warning 2011-12-17 15:14:03 +01:00
Marek Olšák
5016b09f89 drisw: remove unused variable 2011-12-17 15:13:37 +01:00
Marek Olšák
a3bfbccd0a r600g: handle new caps 2011-12-17 15:13:23 +01:00
Marek Olšák
f47da7f580 r300g: handle new caps 2011-12-17 15:12:59 +01:00
Marek Olšák
06dcb17725 docs: update GL3 status 2011-12-17 14:56:21 +01:00
Marek Olšák
543b2331d7 r600g: implement transform feedback
r600: DONE.
r700: MOSTLY (done but locks up).
Evergreen: MOSTLY (done but doesn't work for an unknown reason).

The kernel support will come soon.
2011-12-17 14:56:21 +01:00
Marek Olšák
047363a07b st/mesa: expose conservative_depth if GLSL 1.3 is supported
It's not yet, but it can be enabled by the override environment variable.
2011-12-17 14:56:21 +01:00
Vinson Lee
95aa0e5d84 gallivm: Fix build with llvm-3.1svn.
llvm-3.1svn r145714 moved global variables into a new TargetOptions
class. TargetMachine constructor now needs a TargetOptions object as
well.

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-16 21:22:39 -08:00
Vinson Lee
5d32b00db9 mesa: Fix memory leak on error path.
Fixes Coverity resource leak defect.

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-16 21:21:01 -08:00
Vinson Lee
7b6b5f5102 st/mesa: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-16 17:51:41 -08:00
Brian Paul
cf79e22509 meta: use _mesa_prepare_mipmap_level() in the mipmap generation code
See previous commit for more information.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-16 12:14:32 -07:00
Brian Paul
d77b963245 mesa: new _mesa_prepare_mipmap_level() function for mipmap generation
This helper function is used during mipmap generation to prepare space
for the destination mipmap levels.

This improves/fixes two things:
1. If the texture object was created with glTexStorage2D, calling
   _mesa_TexImage2D() to allocate the new image would generate
   INVALID_OPERATION since the texture is marked as immutable.
2. _mesa_TexImage2D() always frees any existing texture image memory
   before allocating new memory.  That's inefficient if the existing
   image is the right size already.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-16 12:14:27 -07:00
Brian Paul
d842a118b2 mesa: make update_fbo_texture() non-static
We'll call this from the mipmap generation code.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-16 12:13:35 -07:00
Brian Paul
45bd5c43ca mesa: whitespace and comment fixes in fbobject.c 2011-12-16 08:44:43 -07:00
Brian Paul
2b3fdb1fae mesa: add MESA_FORMAT_RGB565[_REV] as candidates for GL_R3_G3_B2
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-16 08:44:43 -07:00
Brian Paul
3d3a21c5fa vbo: add comment for map_vp_non[] array 2011-12-16 08:44:43 -07:00
Brian Paul
89da5a1415 mesa: add a few comments for the z unpacking functions 2011-12-16 08:44:42 -07:00
Anuj Phogat
36a484bc98 Enabling display list support for glClearBuffer functions with minor fixes
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
2011-12-15 15:28:38 -08:00
Fredrik Höglund
cf59483808 gallium: fix a crash in drivers that don't support stream output 2011-12-15 20:50:29 +01:00
Christoph Bumiller
97144eef03 llvmpipe: adapt to struct stream_output_info modifications
My fault, I broke it with v5 of 861a029ddb.
2011-12-15 20:10:16 +01:00
Christoph Bumiller
14bd9d7648 nvc0: implement new stream output interface 2011-12-15 18:51:48 +01:00
Christoph Bumiller
14193da589 d3d1x: implement new stream output interface 2011-12-15 18:51:48 +01:00
Marek Olšák
c05fafa4a0 st/mesa: implement EXT_transform_feedback and ARB_transform_feedback2 2011-12-15 18:51:48 +01:00
Marek Olšák
36d66f8d4a u_blitter: implement copy_buffer using stream output 2011-12-15 18:51:48 +01:00
Marek Olšák
b177e2c54c u_blitter: restore stream output targets 2011-12-15 18:51:48 +01:00
Christoph Bumiller
1114b192af trace: implement stream output interface 2011-12-15 18:51:48 +01:00
Marek Olšák
6a00e4eaee noop: implement stream output 2011-12-15 18:51:48 +01:00
Marek Olšák
8a9a37cebe gallium: utility helper functions for stream output 2011-12-15 18:51:48 +01:00
Marek Olšák
861a029ddb gallium: interface changes necessary to implement transform feedback (v5)
Namely:
- EXT_transform_feedback
- ARB_transform_feedback2
- ARB_transform_feedback_instanced

The old interface was not useful for OpenGL and had to be reworked.

This interface was originally designed for OpenGL, but additional
changes have been made in order to make st/d3d1x support easier.

The most notable change is the stream-out info must be linked
with a vertex or geometry shader and cannot be set independently.
This is due to limitations of existing hardware (special shader
instructions must be used to write into stream-out buffers),
and it's also how OpenGL works (stream outputs must be specified
prior to linking shaders).

Other than that, each stream output buffer has a "view" into it that
internally maintains the number of bytes which have been written
into it. (one buffer can be bound in several different transform
feedback objects in OpenGL, so we must be able to have several views
around) The set_stream_output_targets function contains a parameter
saying whether new data should be appended or not.

Also, the view can optionally be used to provide the vertex
count for draw_vbo. Note that the count is supposed to be stored
in device memory and the CPU never gets to know its value.

OpenGL way | Gallium way
------------------------------------
BeginTF    = set_so_targets(append_bitmask = 0)
PauseTF    = set_so_targets(num_targets = 0)
ResumeTF   = set_so_targets(append_bitmask = ~0)
EndTF      = set_so_targets(num_targets = 0)
DrawTF     = use pipe_draw_info::count_from_stream_output

v2: * removed the reset_stream_output_targets function
    * added a parameter append_bitmask to set_stream_output_targets,
      each bit specifies whether new data should be appended to each
      buffer or not.
v3: * added PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME for ARB_tfb2,
      note that the draw-auto subset is always required (for d3d10),
      only the pause/resume functionality is limited if the CAP is not
      advertised
v4: * update gallium/docs
v5: * compactified struct pipe_stream_output_info, updated dump/trace
2011-12-15 18:51:48 +01:00
Marek Olšák
4f4a1be200 gallium: disable stream output in drivers that support it
I am going to make interface changes and I don't want to break compilation.
2011-12-15 18:50:44 +01:00
Marek Olšák
14bb957b99 mesa: implement DrawTransformFeedback from ARB_transform_feedback2
It's like DrawArrays, but the count is taken from a transform feedback
object.

This removes DrawTransformFeedback from dd_function_table and adds the same
function to GLvertexformat (with the function parameters matching GL).

The vbo_draw_func callback has a new parameter
"struct gl_transform_feedback_object *tfb_vertcount".

The rest of the code just validates states and forwards the transform
feedback object into vbo_draw_func.
2011-12-15 18:50:44 +01:00
Thomas Hellstrom
3baaa1bbd7 st/xa: Disable composite solid fill with mask
Xa doesn't support it yet. Trying to do that would cause a segfault.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-15 08:28:22 +01:00
Thomas Hellstrom
aa7d7656f5 st/xa: Fix format conversion copy alpha channel
When doing format conversion copies between a format without an
alpha channel and a format with an alpha channel, make sure the
destination alpha is set to 1.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-15 08:28:09 +01:00
Thomas Hellstrom
11c9459ba0 st/xa: Fix component alpha check
Component alpha only affects mask pictures.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-15 08:27:47 +01:00
Chia-I Wu
7aadb53ef0 st/egl: fix compiler warnings
One is about casting a pointer to integer and the other is about an unused
function when HAVE_WAYLAND_BACKEND is not defined.
2011-12-15 15:07:00 +08:00
Fredrik Höglund
a06f58fee5 st/egl: Implement EGL_NOK_swap_region for x11
v2: inline x11_drawable_copy_buffers().

Signed-off-by: Fredrik Höglund <fredrik@kde.org>

[olv: s/inline/INLINE/]
2011-12-15 15:02:56 +08:00
Fredrik Höglund
fa0f70e45e st/egl: Add support for EGL_NOK_swap_region
Backends indicate that they support this extension by returning
EGL_TRUE when native_display::get_param() is called with
NATIVE_PARAM_PRESENT_REGION and NATIVE_PARAM_PRESERVE_BUFFER.

native_present_control is extended to include the region that should
be presented. When native_present_control::num_rects is zero,
the whole surface is to be presented.

Signed-off-by: Fredrik Höglund <fredrik@kde.org>
2011-12-15 15:00:15 +08:00
Eric Anholt
3f41f7d1a0 i965: Drop separate stencil assertions in update_draw_buffer().
The comment said they deserved to be in emit_depthbuffer, and at this
point they were all there already.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-14 17:12:41 -08:00
Eric Anholt
7eb0aa398b intel: Simplify and touch up the FBO completeness test.
Now that we have miptrees for everything, we can more easily test for
!has_separate_stencil completeness.  Also, test for whether the
stencil rb is the wrong kind of format for separate stencil, or if we
are trying to do packed to different images of a single miptree.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-14 13:18:48 -08:00
Eric Anholt
950310e7a3 intel: Remove another renderbuffer allocation path.
Now there's the thing that CALLOCs and sets up window system vtable,
and the thing that CALLOCs and sets up user renderbuffer vtable.  The
user renderbuffer vtable gets replaced later by
intel_renderbuffer_update_wrapper for wrapped renderbuffers (things
with name == ~0).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-14 13:18:46 -08:00
Eric Anholt
a91c31668f intel: Make the separate stencil RB storage path match texture more.
There were too many things making intel_renderbuffer *s and tweaking
their bits.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-14 13:18:44 -08:00
Eric Anholt
f22068d5be intel: Move S8 width/height alignment to miptree creation.
We were doing it in the caller in the renderbuffer code, but it was
missed in the separate stencil creation for textures.  Apparently our
testing was using renderbuffers or pre-aligned sizes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-14 13:18:38 -08:00
Eric Anholt
8967f75095 intel: Drop check for wrapped_depth in RB mapping.
This used to be needed because irb->mt would be unset for fake packed
depth/stencil, but no longer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-14 13:18:18 -08:00
Eric Anholt
faa44bc2f6 intel: Fix uninitialized values in debug output for renderbuffer mapping. 2011-12-14 13:18:03 -08:00
Eric Anholt
b2469ff043 swrast: Add a note about overlapping support for framebuffer blit.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-14 13:18:00 -08:00
Eric Anholt
657f3214e7 swrast: Don't do Z24S8 drawpixels fast-paths with Z32_X24S8 input data.
The cool part was that in the "fbo-depthstencil -drawpixels
GL_DEPTH24_STENCIL8 32F_24_8_REV" testcase, the shifting happened to
end up with a value awfully close to the expected value, except for
every other pixel being 0 (the stencil value, shifted away to
nothing).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-14 13:17:45 -08:00
Christian König
5d1de8bc7d st/vdpau: fix unwanted output scaling
vlVdpPresentationQueueDisplay shouldn't scale, so
use size of destination surface as source rectangle.

Based on work of Maarten Lankhorst <m.b.lankhorst@gmail.com>

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-14 14:22:37 +01:00
Christian König
9e51c200a7 st/vdpau: some mixer fixes
Correctly use destination_rect and destination_video_rect
in the mixer, and also use a dirty area tracking for output surfaces.

Based on work of Maarten Lankhorst <m.b.lankhorst@gmail.com>

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-14 14:20:44 +01:00
Christian König
167b1b32c5 g3dvl/compositor: improve dirty area handling
Take viewport and scissors into account and make
the dirty area a parameter instead of a member.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-12-14 14:19:41 +01:00
Jian Zhao
606d3a3c3d Add mismatch check for glGetTexImage or it will return -1 and may lead to segment fault.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-14 17:22:47 +08:00
Kenneth Graunke
c87cb98bb4 glsl: Fix crashes caused by Bison error messages involving "'%'".
Invalid shaders containing the character % at an unexpected location
would cause Bison to call yyerror with a message of:

    syntax error, unexpected '%'

Bison expects yyerror() to take a string, while _mesa_glsl_error() is a
printf-style function.  This hit the classic printf string escape issue:

    _mesa_glsl_error(loc, state, "unexpected '%'");       // invalid!
    _mesa_glsl_error(loc, state, "%s", "unexpected '%'"); // correct.

This caused assertion failures after ralloc_asprintf_append called
vsnprintf to determine the length of the text that would be printed:
vsnprintf would see the invalid format and return -1, an invalid length.

The solution is to define a proper yyerror() wrapper function that calls
_mesa_glsl_error with the "%s".  Since we compile with -p "_mesa_glsl",
yyerror is defined as:

    #define yyerror         _mesa_glsl_error

So we have to #undef yyerror in order to be able to declare it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43564
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-12-13 22:54:16 -08:00
Ian Romanick
7e9cb2ac6d Regenerate files from previous commits
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Ian Romanick
0c6b930322 glapi/glx: For GLX code, use the existing _X_HIDDEN and _X_INTERNAL defines
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Ian Romanick
bc35da409b glapi/glx: Generate glapi_gentable.c so that the xserver can use it
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Ian Romanick
af50f3bf44 glapi/glx: Generate dispatch.h so that the xserver can use it
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Ian Romanick
2e16875873 glapi/glx: Xserver wants dispatch.h, not glapidispatch.h
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Ian Romanick
c0d2f4c123 glapi/glx: Don't send GL API files to the xserver
The versions in the xserver and in libGL have diverged enough that the
xserver doesn't want these.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Ian Romanick
e089a0e2ee glapi: Remove mention of nonexistent enums
glext.h doesn't have GL_MIN_PROGRAM_TEXEL_OFFSET_EXT or
GL_MAX_PROGRAM_TEXEL_OFFSET_EXT.  Using them in the XML causes code to
be generated for the xserver that won't compile.  Use the names that
exist instead.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Ian Romanick
090dd9428d glapi/glx: Remove g_disptab.h from xserver generated files
That file was removed from the xserver with commit:

    commit a80780a7638f847c3be20e5e0c7fe85e83d9bdd1
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Wed Nov 17 09:03:06 2010 -0500

        glx: Remove swap barrier and hyperpipe support

        Never implemented in any open source driver.  The implementation
        assumed explicit DDX driver knowledge of how the client-side driver
        worked, since at the time the server's GL renderer was not a DRI driver.
        But now, it is, so any implementation of these should be done with
        additional DRI driver API, like the swap control extension.

        Reviewed-by: Julien Cristau <jcristau@debian.org>
        Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
        Signed-off-by: Adam Jackson <ajax@redhat.com>

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2011-12-13 16:07:17 -08:00
Marek Olšák
35d2764f85 r300g: take advantage of KEEP_TILING_FLAGS flush flag
This fixes at least two multi-context-related races.
2011-12-13 21:34:18 +01:00
Marcin Slusarz
10e931219f nouveau: get rid of winsys object
Its only purpose was to destroy itself.
2011-12-13 21:06:29 +01:00
Stéphane Marchesin
642d11da20 i915g: Roll back to the previous shader limits.
Those shader limits seem to be responsible for a piglit hang.
2011-12-13 11:26:49 -08:00
Stéphane Marchesin
f41fd6b6c3 i915g: Update TODO. 2011-12-13 11:26:49 -08:00
Marek Olšák
41b75dc92c winsys/radeon: add flush option not to rewrite tiling flags in registers
Not used yet.
2011-12-13 18:41:17 +01:00
Marek Olšák
df809ae923 mesa: add const flags to skip MaxVarying and MaxUniform linker checks (v2)
This is only temporary until a better solution is available.

v2: print warnings and add gallium CAPs

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-13 17:49:00 +01:00
Marek Olšák
8a11d40c4e mesa: fix an out-of-bounds access in prog_print.c
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-13 17:49:00 +01:00
Bryan Cain
3b15f5046c glsl_to_tgsi: fix typo in comment 2011-12-13 10:39:52 -06:00
Bryan Cain
d24b44c37d glsl_to_tgsi: emit both operands of shift and bitwise operations
Fixes these operations when native integers are enabled.
2011-12-13 10:39:52 -06:00
Benjamin Franzke
2a58453e25 egl_dri2: Fix some valgrind reported leaks
Free the device_name, reported by Pekka Paalanen.

Destroy wayland display and drm resources,
if created by dri2_initialize_wayland.
2011-12-13 15:32:43 +01:00
Brian Paul
cbd65fe149 mesa: update comments for _DepthBuffer, _StencilBuffer fields
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:38 -07:00
Brian Paul
6596aeb4ff mesa: remove _DepthBuffer, _StencilBuffer resize code
This is handled in swrast now when we validate the framebuffer state.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:38 -07:00
Brian Paul
d7c0fac90b swrast: add debug code to test combined depth/stencil buffers
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
8ba9c22cdb mesa: remove unused depthstencil.[ch] files
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
6e1228976b mesa: move depth/stencil buffer validation to swrast
Since gl_framebuffer::_DepthBuffer and _StencilBuffer are only used
by swrast, do the validation of those fields in swrast too.
The main/depthstencil.[ch] code is no longer used and will be removed
next.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
2ac02ea29f swrast: update depth/stencil wrapper sizes
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
23527eb357 mesa: build swrast/s_depthstencil.c
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
ba35094068 swrast: add new s_depthstencil.[ch] files
These files are copies of main/depthstencil.[ch] with s/mesa/swrast/.
The main/depthstencil.[ch] will go away soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
c0a55cf68a mesa: move update_depth/stencil_buffer() functions
These functions update the gl_framebuffer::_DepthBuffer and _StencilBuffer
fields, possibly creating renderbuffer wrappers that make a shared
depth+stencil accessible as depth-only or stencil only.
This stuff is only used by swrast now and will be moved there next.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:37 -07:00
Brian Paul
2750809b2e radeon: stop using _DepthBuffer, _StencilBuffer fields
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:36 -07:00
Brian Paul
a782db5570 nouveau: stop using _DepthBuffer, _StencilBuffer fields
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:36 -07:00
Brian Paul
d124092864 mesa: stop using _Depth, _StencilBuffer fields in _mesa_BlitFramebufferEXT()
We're just looking at the depth/stencil renderbuffers to do error
checking.  We don't need to look at the depth/stencil wrappers to do
that.  Also, remove pointless readRb = depthRb = NULL assignments.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:36 -07:00
Brian Paul
02d12719e3 st/mesa: stop using _DepthBuffer, _StencilBuffer fields
We never want to use the depth/stencil buffer wrappers so always just
use the attachment renderbuffers.  This is a step toward removing the
_DepthBuffer, _StencilBuffer fields.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-13 06:45:36 -07:00
Brian Paul
22e806f570 swrast: add missing state validation calls for Blit, Clear 2011-12-13 06:45:36 -07:00
Alex Deucher
23895cc006 r600g: add some new pci ids
fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=43739

Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-12 09:48:15 -05:00
Marek Olšák
fc52534f01 mesa: fix possible precision issues in pack/unpack/fetch functions
GLfloat doesn't have enough precision to exactly represent 0xffffff
and 0xffffffff. (and a reciprocal of those, if I am not mistaken)

If -ffast-math is enabled, using GLfloat causes assertion failures in:
- fbo-blit-d24s8
- fbo-depth-sample-compare
- fbo-readpixels-depth-formats
- glean/depthStencil

For example:
fbo-depth-sample-compare: main/format_unpack.c:1769:
unpack_float_z_Z24_X8: Assertion `dst[i] <= 1.0F' failed.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-12 08:04:51 +01:00
Marek Olšák
4298c88f65 r300g: integer and fixed-point 16.16 textures are not supported 2011-12-12 08:04:51 +01:00
Marek Olšák
1ded658ce0 st/mesa: add color varyings to MaxVarying
The linker now adds color varyings to the number of used varyings and checks
against that limit.

NOTE: This is a candidate for the 7.11 branch.
2011-12-12 08:04:51 +01:00
Michael Karcher
592323de1e i915g: fix debug dump on 64 bit systems 2011-12-11 13:24:10 -08:00
Fatih Aşıcı
13632e64a0 i915g: Fix wrong indices for LINE_LOOP case 2011-12-11 13:23:42 -08:00
Maarten Lankhorst
45bb4b79f6 vl: Add missing mpeg fields to pipe_mpeg12_picture_desc
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-12-11 01:06:15 -05:00
Tobias Droste
e809f4e54c g3dvl/xlib: fix build by changing include order
fixes the following build error since
c83fb4d45f:

/usr/include/strings.h:46:13: error: expected declaration specifiers or
‘...’ before numeric constant
/usr/include/strings.h:46:13: error: conflicting types for ‘memset’
In file included from
../../../../src/gallium/winsys/g3dvl/xlib/xsp_winsys.c:34:0:
../../../../src/gallium/auxiliary/util/u_inlines.h: In function
‘pipe_buffer_create’:
../../../../src/gallium/auxiliary/util/u_inlines.h:189:4: error: too
many arguments to function ‘memset’
/usr/include/strings.h:46:13: note: declared here

bzero is defined in X11 as: #define bzero(b,len) memset(b,0,len)
including strings.h after the X11 header results in preprocessor
replacing 'bzero' in strings.h and generating unbuildable code.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
2011-12-11 01:03:20 -05:00
Dave Airlie
72cb103cf5 st/mesa: move frag depth up a level.
This fixes the segfault, and seems to put this closer to where other
properties are being set. Hopefully it still conforms.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-10 17:30:37 +00:00
Dave Airlie
b1a8b7b019 Revert "st/mesa: only resolve is number of samples is > 1"
This reverts commit 8c713626db.

Didn't mean to push this at all
2011-12-10 09:04:51 +00:00
Dave Airlie
8c713626db st/mesa: only resolve is number of samples is > 1
This fixes the firefox crash but I've no idea if its correct.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-10 09:02:38 +00:00
Dave Airlie
f767e96131 mesa: add missing RG_INTEGER and some RED_INTEGER_EXT checks.
This just adds the correct checks and asserts in the right places. This doesn't
fix all the tests that I've sent to piglit, need to add int paths to go alongside the uint paths that don't go via float to fix it up properly.

I'm not sure how much of that could be templated/shared will have a look
once I write it the long way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-10 09:02:17 +00:00
Marek Olšák
06f217d80f gallium: implement ARB_conservative_depth
This adds a new TGSI property to represent the GLSL layout qualifier in TGSI.
2011-12-10 01:27:11 +01:00
José Fonseca
c83fb4d45f util: Add strings.h include on unices
Fixes -Wimplicit-function-declaration for ffs with GCC.  Spotted/tested
by Kai Wasserbäch.
2011-12-09 20:17:34 +00:00
José Fonseca
f188c0d0f4 mesa/st: Don't modify the context draw/read buffers.
It sets the wrong values (GL_XXX_LEFT instead of GL_XXX), and no other
Mesa driver does this, given that Mesa sets the right draw/read buffers
provided the Mesa visual has the doublebuffer flag filled correctly
which is the case.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-09 18:34:40 +00:00
nobled
eefff37060 mesa,intel: use _mesa_image_offset() for PBOs
This avoids forming invalid pointers needlessly, which even if
never dereferenced is undefined behavior. It also makes
_mesa_validate_pbo_access() more comprehensible.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 21:23:59 +00:00
nobled
4a2b9b5305 mesa: add _mesa_image_offset()
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 21:20:25 +00:00
nobled
f22421e9b9 mesa/image: assert on bad format
NULL as an error indicator is meaningless, since it will return NULL
on success anyway if the caller passes in zero as the image's address
and asks to calculate the offset of the first pixel. For example,
_mesa_validate_pbo_access() does this.

This also matches the code in the non-GL_BITMAP codepath, which
already has an assert like this.

v2: Per Brian Paul's review, remove the function call entirely
and tighten the assert to only accept the two formats compatible with
GL_BITMAP. They always have one component per pixel.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-08 21:20:25 +00:00
nobled
37fd22a091 mesa/image: delete dead store
The return value here is a) always zero, b) never used.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 21:20:25 +00:00
Bryan Cain
20b0daf82d glsl_to_tgsi: fix a bug in eliminate_dead_code_advanced()
The bug, reported to me by Vadim Girlin on IRC, was causing overzealous
elimination of code in parallel if statements such as the following:

if (x) {
	r = false;
}
if (y) {
	r = true;
}

Before this commit, the assignment inside the first if block would be
misdetected as dead code and removed.
2011-12-08 13:54:16 -06:00
José Fonseca
6cf7245f69 llvmpipe: Trim the fragment shader cached based on LLVM IR instruction count.
Number of fragment shader variants is not very representative of the
memory used by LLVM, neither is number of shader instructions, as often
texture sampling constitutes most of the generated code.

This change adds an additional trim criteria: least recently used
fragment shader variants will be freed until the total number of LLVM IR
instruction falls below a specified threshold.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 17:59:33 +00:00
José Fonseca
f32c7232a8 llvmpipe,draw,gallivm: Ensure we don't walk beyond the end of the shader variant list.
u_simple_list.h uses a sentinel element, and not a NULL element. So
ensure list is not empty when reducing the list of shader variants.

Something I noticed while trying to free variants more aggressively.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 17:59:33 +00:00
Brian Paul
24e6484909 swrast: use malloc instead of MAX_WIDTH arrays in glCopyPixels, zoom code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:31 -07:00
Brian Paul
bf6aac24c1 mesa: use malloc instead of MAX_WIDTH array in glReadPixels()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:31 -07:00
Brian Paul
1614de4045 mesa: use malloc instead of MAX_WIDTH array in _mesa_convert_colors()
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:31 -07:00
Brian Paul
db247dd7b3 mesa: add MAX_PIXEL_BYTES define
In a few places we need to allocate space for some number of generic
pixels.  Use this new define instead of a magic number like 16 or
4 * sizeof(GLuint).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:31 -07:00
Brian Paul
eb3e1d8888 mesa: simplify _mesa_remove_renderbuffer() 2011-12-08 08:56:31 -07:00
Brian Paul
e4bb884dfb mesa: remove software-based renderbuffer code from core Mesa
We're now using the functions that live in swrast.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
d0dc75c000 mesa/drivers: use new swrast renderbuffer functions
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
b85284f45e mesa: build new s_renderbuffer.c file
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
379e0a3ada swrast: remove core renderbuffer functions from s_renderbuffer.[ch]
We'll use the functions that live in main/
Plus, rename the remaining functions with "swrast_" prefix.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
ff8e6420fb swrast: add s_renderbuffer.[ch], copied from main/renderbuffer.[ch]
Copying these files is the first step in moving the software buffer
code from main/renderbuffer.c to swrast/s_renderbuffer.c

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
6e8c1a92b3 mesa: remove unused functions in depthstencil.c
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
14721dfe99 mesa: make some renderbuffer functions static
The functions to allocate software color, depth, accum, etc buffers aren't
called from anywhere else.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
bb887b72f7 swrast: remove dead accum buffer context fields 2011-12-08 08:56:30 -07:00
Brian Paul
e6e734f143 mesa: remove dead swrast and state tracker accum buffer code 2011-12-08 08:56:30 -07:00
Brian Paul
122c6768e3 mesa: rewrite accum buffer support
Implemented in terms of renderbuffer mapping/unmapping and format
packing/unpacking functions.

The swrast and state tracker code for implementing accumulation are
unused and will be removed in the next commit.

v2: don't use memcpy() in _mesa_clear_accum_buffer()
v3: don't allocate MAX_WIDTH arrays, be more careful with mapping flags

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-08 08:56:30 -07:00
Brian Paul
aa6cb952c9 mesa: new format_pack.c code
This code packs colors, Z, stencil, etc. in the various mesa pixel
formats.  Will be used for things like glDrawPixels, glTexImage,
glAccum, etc.
2011-12-08 08:56:30 -07:00
Brian Paul
2f88139145 mesa: remove the ctx->Driver.IsTextureResident() hook
No driver implemented this and we always returned "True" for residence
queries.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-08 08:56:29 -07:00
Brian Paul
5acb291f31 mesa: remove TextureMemCpy driver hook
There's probably no reason to use a special version of memcpy() anymore.
2011-12-08 08:56:29 -07:00
Henri Verbeet
d958202663 st/mesa: Use util_blit_pixels_writemask() for depth blits as well in st_copy_texsubimage().
This has no piglit regressions on r600g and softpipe.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-08 12:54:14 +01:00
Thomas Hellstrom
340c0f6f9e st/xa: Update xa_yuv_planar_blit semantics
Change and document the interpretation of the color conversion matrix
in order to make the function more versatile and to simplify the
generated shader.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-08 09:51:19 +01:00
Paul Berry
d4976158c7 i965 gen6: Implement pass-through GS for transform feedback.
In Gen6, transform feedback is accomplished by having the geometry
shader send vertex data to the data port using "Streamed Vertex Buffer
Write" messages, while simultaneously passing vertices through to the
rest of the graphics pipeline (if rendering is enabled).

This patch adds a geometry shader program that simply passes vertices
through to the rest of the graphics pipeline.  The rest of transform
feedback functionality will be added in future patches.

To make the new geometry shader easier to test, I've added an
environment variable "INTEL_FORCE_GS".  If this environment variable
is enabled, then the pass-through geometry shader will always be used,
regardless of whether transform feedback is in effect.

On my Sandy Bridge laptop, I'm able to enable INTEL_FORCE_GS with no
Piglit regressions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
2011-12-07 16:38:01 -08:00
Paul Berry
2252e5e3f1 i965: Clean up misleading defines for DWORD 2 of URB_WRITE header.
R02_PRIM_END and R02_PRIM_START don't actually refer to bits in DWORD
2 of R0 (as the name, and comments in the code, would seem to
indicate).  Actually they refer to bits in DWORD 2 of the header for
URB_WRITE messages.

This patch renames the defines to reflect what they actually mean.  It
also addes a define URB_WRITE_PRIM_TYPE_SHIFT, which previously was
just hardcoded in .c files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:01 -08:00
Paul Berry
3f2283172b i965 gs: Clean up dodgy register re-use, at the cost of a few MOVs.
Prior to this patch, in the Gen4 and Gen5 GS, we used GRF 0 (called
"R0" in the code) as a staging area to prepare the message header for
the FF_SYNC and URB_WRITE messages.  This cleverly avoided an
unnecessary MOV operation (since the initial value of GRF 0 contains
data that needs to be included in the message header), but it made the
code confusing, since GRF 0 could no longer be relied upon to contain
its initial value once the GS started preparing its first message.
This patch avoids confusion by using a separate register ("header") as
the staging area, at the cost of one MOV instruction.

Worse yet, prior to this patch, the GS would completely overwrite the
contents of GRF 0 with the writeback data it received from a completed
FF_SYNC or URB_WRITE message.  It did this because DWORD 0 of the
writeback data contains the new URB handle, and that neds to be
included in DWORD 0 of the next URB_WRITE message header.  However,
that caused the rest of the message header to be corrupted either with
undefined data or zeros.  Astonishingly, this did not produce any
known failures (probably by dumb luck).  However, it seems really
dodgy--corrupting FFTID in particular seems likely to cause GPU hangs.
This patch avoids the corruption by storing the writeback data in a
temporary register and then copying just DWORD 0 to the header for the
next message.  This costs one extra MOV instruction per message sent,
except for the final message.

Also, this patch moves the logic for overriding DWORD 2 of the header
(which contains PrimType, PrimStart, PrimEnd, and some other data that
we don't care about yet).  This logic is now in the function
brw_gs_overwrite_header_dw2() rather than in brw_gs_emit_vue().  This
saves one MOV instruction in brw_gs_quads() and brw_gs_quad_strip(),
and paves the way for the Gen6 GS, which will need more complex logic
to override DWORD 2 of the header.

Finally, the function brw_gs_alloc_regs() contained a benign bug: it
neglected to increment the register counter when allocating space for
the "temp" register.  This turned out not to have any effect because
the temp register wasn't used on Gen4 and Gen5, the only hardware
models (so far) to require a GS program.  Now, all the registers
allocated by brw_gs_alloc_regs() are actually used, and properly
accounted for.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:01 -08:00
Paul Berry
43e39b58c7 i965 gen6: Allocate URB space for GS
When the GS is not in use, the entire URB space is available for the
VS.  When the GS is in use, we split the URB space 50/50.

The 50/50 split is probably not optimal--we'll probably want tune this
for performance in a future patch.  For example, in most situations,
it's probably worth allocating more than 50% of the space to the VS,
since VS space is used for vertex caching.  But for now this is good
enough.

Based on previous work by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 16:38:01 -08:00
Kenneth Graunke
7a63a311e5 i965: Set the maximum number of GS URB entries on Sandybridge.
We never filled this in before because we didn't care.

I'm skeptical these are correct; my sources indicate that both the VS
and GS # of entries are 256 on both GT1 and GT2.

I'm also loathe to change it and break stuff.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-12-07 16:38:00 -08:00
Paul Berry
dabe15da4f i965: Only convert if/else to conditional adds prior to Gen6.
Normally when outputting instructions in SPF (single program flow)
mode, we convert IF and ELSE instructions to conditional ADD
instructions applied to the IP register.  On platforms prior to Gen6,
flow control instructions cause an implied thread switch, so this is a
significant savings.

However, according to the SandyBridge PRM (Volume 4 part 2, p79):

   [Errata DevSNB{WA}] - When SPF is ON, IP may not be updated by
   non-flow control instructions.

So we have to disable this optimization on Gen6.

On later platforms, there is no significant benefit to converting flow
control instructions to ADDs, so for the sake of consistency, this
patch disables the optimization on later platforms too.

The reason we never noticed this problem before is that so far we
haven't needed to use SPF mode on Gen6.  However, later patches in
this series will introduce a Gen6 GS program which uses SPF mode.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:00 -08:00
Paul Berry
fcae281f06 i965 gs: Remove unnecessary mapping of key->primitive.
Previously, GS generation code contained a lookup table that mapped
primitive types POLYGON, TRISTRIP, and TRIFAN to TRILIST, mapped
LINESTRIP to LINELIST, and left all other primitives unchanged.  This
was silly, because we never generate a GS program for those primitive
types anyhow.

This patch removes the unnecessary lookup table.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-07 16:38:00 -08:00
Paul Berry
a98ceee0ee mesa: Track changes to transform feedback state.
This patch adds a new bit to the ctx->NewState bitfield,
_NEW_TRANSFORM_FEEDBACK, to track state changes that affect
ctx->TransformFeedback.  This bit can be used by driver back-ends to
avoid expensive recomputations when transform feedback state has not
been modified.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 16:38:00 -08:00
Aaron Plattner
63a6fd6603 glx: Fix indirect fallback when a non-Mesa GLX extension is present.
When driCreateScreen calls driConvertConfigs to try to convert the
configs for swrast, it fails and returns NULL.  Instead of checking,
it just clobbers psc->base.configs.  Then, when the application asks
for the FBconfigs, there aren't any.

Instead, make the caller responsible for freeing the old modes lists
if both calls to driConvertConfigs succeed.

Without the second fix, glxinfo fails unless you run it with
LIBGL_ALWAYS_INDIRECT:

    $ glxinfo
    name of display: :0.0
    Error: couldn't find RGB GLX visual or fbconfig

    $ LIBGL_ALWAYS_INDIRECT=1 glxinfo
    name of display: :0.0
    display: :0  screen: 0
    direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
    server glx vendor string: NVIDIA Corporation
    server glx version string: 1.4
    [...]

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-07 17:20:10 -07:00
Anuj Phogat
4558987818 glsl: Fix samplerCubeShadow support in shader compiler
This patch fixes the samplerCubeShadow support in GLSL shader compiler.
shader compiler was picking the 'r' texture coordinate for shadow comparison
when the expected behaviour is to use 'q' texture coordinate in case of cube
shadow maps.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-07 15:11:29 -08:00
Kenneth Graunke
4273943a07 i965: Set Ivybridge's is_array SURFACE_STATE bit.
Fixes piglit tests fbo-array, fbo-depth-array, fbo-generatemipmap-array,
and array-texture, as well as the array variants of my new textureSize
and texelFetch tests.

Not a candidate for 7.11 because EXT_texture_array wasn't supported.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 14:51:12 -08:00
Kenneth Graunke
d464a21e2d i965: Return BRW_DEPTHBUFFER_D32_FLOAT as the null-depthbuffer format.
Fixes many crashes on Ivybridge due to upload_sf_state calling
brw_depthbuffer_format without an actual depth buffer.  This was a
recent regression on master.

+3992 piglits on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-07 14:51:12 -08:00
Eric Anholt
5b27e44652 intel: Update comment about how depth/stencil miptrees are handled.
This evolved over several commits, and I also wanted to document some
new information about how we handle formats.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:54 -08:00
Eric Anholt
96159c37e3 intel: Rely on miptree mapping for all renderbuffer maps.
Now that all RBs have miptrees, and miptree mapping covered these last
two code paths, consistently use them.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:54 -08:00
Eric Anholt
5655ebf466 intel: Add support for LLC-cached reads of X-tiled miptrees using a blit.
This mimics the MapRenderbuffer code, and should improve the
performance of glGetTexImage().

v2: Fix broken error handling.
2011-12-07 13:38:53 -08:00
Eric Anholt
2d2bfd1f26 intel: Handle MapRenderbuffer of fake packed depth/stencil using miptree maps.
This gets the same performance win as the miptree maps did, and
removes a pile of code duplication.
2011-12-07 13:38:53 -08:00
Eric Anholt
e0d67a3a8b intel: Track miptrees for fake packed depth/stencil renderbuffers.
Right now the fake packed d/s RBs are creating two sub-renderbuffers
with their own storage, and the hardware setup and the mapping code
have been explicitly referencing them.  By setting miptrees on them,
we'll be able to make our renderbuffer code for fake packed
depth/stencil more consistent with all our other renderbuffers.

The interesting new behavior here is that there is now a mt with a
non-depthstencil format (X8Z24) that has a stencil_mt field
associated.  This looks like it should be safe, and we'll need to be
able to do this for floating point depth/stencil as well.
2011-12-07 13:38:51 -08:00
Eric Anholt
ed3aeb56ec intel: Make the fake packed depth/stencil mappings use a cached temporary.
Before, we had an uncached read of S8 to untile, then a RMW (so
uncached penalty) of the packed S8Z24 to store the value, then the
consumer would uncached read that once per pixel.  If data was written
to the map, we would then have to uncached read the written data back
out and do the scatter to the tiled S8 buffer (also uncached access
penalties, since WC couldn't actually combine).  So 3 or 5 uncached
accesses per pixel in the ROI (and we we were ignoring the ROI, so it
was the whole image).

Now we get an uncached read of S8 to untile, and an uncached read of
Z.  The consumer gets to do cached accesses.  Then if data was
written, we do streaming Z writes (WC success), and scattered S8
tiling writes (uncached penalty).  So 2 or 3 uncached accesses per
pixel in the ROI.

This should be a performance win, to the extent that anybody is doing
software accesses of packed depth/stencil buffers.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:38:08 -08:00
Eric Anholt
4cb1d6a25e intel: Make intel_region_map return void *.
We don't gripe about void * arithmetic for our driver, and this
prevents silly casting when assigning the result of mapping to
non-byte types.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
b48c3bca87 intel: Move separate-stencil s8 mapping logic to intel_miptree_map.
We're going to want to reuse this logic in mapping of fake packed
miptrees wrapping separate depth/stencil miptrees.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
baeaa062e9 intel: Move the gtt-particular texture mapping logic to a helper function.
This code will be incrementally moving to a model like intel_fbo.c's
renderbuffer mapping with helper functions, as I move that code here.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
221a36514b intel: Make mapping of texture slices track the region of interest.
This will be used for things like packed depth/stencil temporaries and
making LLC-cached temporary mappings using blits.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
b75291c61c intel: Move the teximage mapping logic to a miptree level/slice mapping.
This will let us share teximage mapping logic with renderbuffer
mapping, which has an intel_mipmap_tree but not a gl_texture_image.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Eric Anholt
5c9a55665d intel: Only prefer separate stencil when we can do HiZ.
This required is_hiz_depth_format to start returning true on S8_Z24 as
well, since that's the format we have here.  The two previous callers
are only calling it on non-depthstencil formats.

This avoids us needing to have HiZ working on a new Z format
immediately upon exposing the format (particularly painful for
Z32_FLOAT_X24S8, which means all the fake packed depth/stencil paths).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-12-07 13:36:57 -08:00
Thomas Hellstrom
576161289d st/dri: Use depth instead of bpp when communicating formats with the X server v3
Some hardware can't reinterpret the format of hardware buffers and thus
the X server needs to know the format when the buffer is created.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Daenzer <michel@daenzer.net>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-12-07 20:05:24 +01:00
Kenneth Graunke
6781fd05e9 i965: Set SURFACE_STATE vertical alignment bit on Ivybridge.
See intel_vertical_texture_alignment_unit() in intel_tex_layout.c;
certain surface types require setting this to VALIGN_4.

Analogous to commit dd0e46c410 on Gen6.

Fixes piglit test fbo-generatemipmap-formats with the
GL_ARB_depth_texture and GL_EXT_packed_depth_stencil arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-12-06 15:14:56 -08:00
Patrice Mandin
9419894835 nouveau/nvfx: Add more unsupported PIPE_CAP values
Signed-off-by: Patrice Mandin <patmandin@gmail.com>
2011-12-06 21:42:31 +01:00
Dave Airlie
2ee8704a8a radeon: add original r100 to the always tiled depth list.
According to Alex, he thinks r100 is also covered.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 16:10:43 +00:00
Fabio Pedretti
9ab43f7454 vega: remove unused vars
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-06 08:44:07 -07:00
Fabio Pedretti
0b34074bdb osmesa: remove unused bpc variable
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-12-06 08:42:54 -07:00
Dave Airlie
781a204bcf radeon/r200: add RV200 detiling + add an always tiled flag
passes readpix sanity on the M7.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 15:12:00 +00:00
Dave Airlie
1136da9c6b r200: add Z16 depth detiling.
This passes readPixSanity with z16 visuals.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 15:11:36 +00:00
Dave Airlie
61a40581d2 r200: handle Z24 depth buffers correctly
The same detiling pattern applies to X8_Z24 as well.

Signed-off-by: Dave Airlie <Airlied@redhat.com>
2011-12-06 15:11:36 +00:00
Vadim Girlin
e98521e0f3 r600g: check shaders presence in r600_draw_vbo
This patch should prevent the crashes when some shaders are absent,
see https://bugs.freedesktop.org/show_bug.cgi?id=43341

Note this is a candidate for the stable branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-06 09:53:35 -05:00
Dave Airlie
81a715605a r200: fix cb microtile setup
We shouldn't see this in buffers from the DDX but just in case.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 10:34:16 +00:00
Dave Airlie
4d4cecd05b r200: enable tiling flags on blitter setup.
The r200 blitter also didn't set the correct tiling flags.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-06 10:34:16 +00:00
Anuj Phogat
c3aae7745a swrast: Add depth cube map support.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-05 17:02:13 -08:00
Anuj Phogat
29a7d7784d mesa: Allow glTexImage2D with a depth component cube map.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-12-05 17:02:05 -08:00
Kenneth Graunke
84d6201567 i965: Fix incorrect comment about single program flow on Ironlake.
The code forces single program flow to be enabled on Ironlake, or
equivalently, disables multiple program flow.  The comment was reversed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-05 17:00:07 -08:00
Jerome Glisse
e368eefc68 r600g: fix error path and use util_slab_free
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-12-05 18:42:38 -05:00
Jerome Glisse
bbc320a94d gallium/radeon: fix indentation
Indentation cleanup, to keep consistency.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2011-12-05 18:40:53 -05:00
Dave Airlie
a8bbbcae4a radeon/r200: drop old span depth/stencil code.
This is no longer used with the new renderbuffer code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 19:15:52 +00:00
Dave Airlie
7d91ecf7a3 radeon/r200: add draw/stencil buffer detiling
This moves the detiling to the fbo mapping, r200 depth is always tiled,
and we can't detile it with the blitter.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 19:15:04 +00:00
Dave Airlie
c48763643e radeon: fix warnings 2011-12-05 16:51:03 +00:00
Dave Airlie
f24e106ead radeon: use mesa renderbuffer accessors for depth for now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 16:25:27 +00:00
Dave Airlie
5c666bdfdb radeon: add some tiling support for r100.
This sets up the tiling flags on the blitter.

Fixes some piglit tests with tiling enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 15:41:24 +00:00
Dave Airlie
b2596c36c8 radeon: texture/renderbuffer overhaul.
This could have been split up better, but the driver is just broken now,
so bisecting the brokenness is going to be painful no matter what.

This adds renderbuffer mapping/unmapping along with texture image allocation.
It drops all the old texture upload paths, some of which could possible be
reimplemented with the blitter later.

It also redoes the span code paths to use its own set of image mapping handlers,
along with removing the tiling decode paths for the color buffers, since
we now hope to use the blitter for this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 14:36:19 +00:00
Dave Airlie
fd7fcfcc2d radeon: set texture bits to always emit.
I think there is a missing state update or flush somewhere, and every
so often PP_CNTL goes to the kernel with a texture enabled but no texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie
4ed8a58584 radeon: update flush according to glXMakeCurrent man page
This also copies code from intel driver to do this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie
6d573c4dd7 radeon: drop border check
now that we strip borders off earlier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Dave Airlie
fbfa807034 radeon: add a bit more debugging to the blit debug code.
For debugging blits it helps if we printed out the offsets as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-05 11:31:15 +00:00
Eric Anholt
887c349d54 mesa: Reject glDrawPixels(integer format).
When folding GL_EXT_texture_integer into the core, a new (and very
sensible) restriction was added.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-04 14:54:16 -08:00
Brian Paul
1bb59b382a util: add casts in fprintf() calls to silence warnings
And wrap to 80 columns.
2011-12-03 09:31:45 -07:00
Mathias Fröhlich
b14c06e10d mesa: Use VERT_{ATTRIB,BIT}* for ARB input validation.
For validating ARB program inputs replace hard
coded bitfield and attribute number with the appropriate
VERT_{ATTRIB,BIT}* variant.

This should fix:

https://bugs.freedesktop.org/show_bug.cgi?id=43407

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-12-03 08:13:49 +01:00
Chia-I Wu
b7a69cbb71 egl_glx: fix eglDestroyContext
Wrong pointers are passed to glXDestroyContext.

Spotted by Brian Paul.
2011-12-03 11:10:16 +08:00
Stuart Abercrombie
aa010157a3 i965: Fix emit of a MOV with bad destination channel on gen6 math in FPs.
Previously a zero writemask would result in dst_chan == -1, meaning an
unnecessary MOV with the destination register dictated by undefined
memory contents would be emitted before returning.  This caused
intermittent GPU hangs, e.g. with glean/texCombine.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-02 15:28:44 -08:00
Eric Anholt
079bb3fff7 mesa: Fix assertions for block size handling in glCompressedTexSubImage2D.
Anything of less than (bw, bh) size is possible when you consider
rectangular textures, and this code is (now) safe for those.  Even for
power-of-two textures, width could be 4 for FXT1 while not being
aligned to block size.

Fixes piglit compressedteximage GL_COMPRESSED_RGB_FXT1_3DFX

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 15:28:44 -08:00
Eric Anholt
1e0b6a90d7 mesa: Fix glCompressedTexSubImage (and non-Sub) for height == 2 or 1.
Generally this code works with width and height aligned to compressed
blocks, but at the 2x2 and 1x1 levels of a square texture (or height <
bh in general), we were skipping uploading our single row of blocks.

Fixes piglit compressedteximage GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 15:28:44 -08:00
Eric Anholt
bda361e0d4 mesa: Fix glCompressedTexImage when dstRowStride != srcRowStride.
Since the MapTextureImage changes on Intel, nwn had corruption in the
scrollbar at the load game menu, and corrupted ground textures in the
starting zone.  Heroes of Newerth's intro screen was also thoroughly
garbled.  A new piglit test "compressedteximage" was created to
regression test this.

The issue was this code now seeing dstRowStride aligned to hardware
requirements instead of a temporary buffer that gets uploaded to
hardware later.  The existing code was just trying to memcpy
srcRowStride * height / bh, while the glCompressedTexSubImage2D()
storage code nearby did the correct walking by blockheight rows at a
time.  Just reuse the subimage upload instead of duplicating that
logic.

v2: Update comment at the top of the function (suggestion by Joel
Forsberg)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41451
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-12-02 15:28:44 -08:00
Marcin Slusarz
27e77cb902 nv50/nvc0: fix crash when channel allocation fails 2011-12-02 19:31:50 +01:00
Brian Paul
19b1025172 mesa: add casts to fix unpack_SIGNED_GR1616()
We were passing unsigned values to the macro before.
2011-12-02 07:22:40 -07:00
Brian Paul
bbbab8de63 mesa: remove unreachable code in _mesa_unpack_color_span_ubyte()
We checked if srcType == GL_UNSIGNED_BYTE earlier so there was no
way to reach this code.  This was left-over code from the GLchan
removal work.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:40 -07:00
Brian Paul
01cd9a7d92 vbo: remove unreachable _mesa_error() call
If mode is not GL_POINT/LINE/FILL we'll have already reported the
error earlier in the function and returned so we can never get here.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:40 -07:00
Brian Paul
89efc1b839 mesa: move _mesa_error() call in compressedteximage()
We shouldn't call _mesa_error() if the target is a proxy texture.
Errors are handled later in the function.
Fixes a Coverity warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-12-02 07:22:39 -07:00
Brian Paul
9ec5050898 mesa: fix potential mem leak in generate_mipmap_compressed()
Fixes a coverity warning.

Reviewed-by: Vinson Lee <vlee@vmware.com>
2011-12-02 07:22:39 -07:00
Brian Paul
98ebe833fe glsl: return visit_stop in ir_validate::visit_enter() to silence warning 2011-12-02 07:22:39 -07:00
Brian Paul
06913497d6 mesa: fix some minor texstore comments
For the texsubimage commands, we're not mapping the whole image/region.
2011-12-02 07:22:39 -07:00
Brian Paul
b4aecc4e18 mesa: rename MESA_FORMAT_RG88_REV to MESA_FORMAT_RG88
R is in the high byte, G in the low byte.
2011-12-02 07:22:39 -07:00
Brian Paul
0a3c895f34 mesa: rename MESA_FORMAT_RG88 to MESA_FORMAT_GR88
To better reflect the component ordering and be consistent with other
format names.
2011-12-02 07:22:39 -07:00
Brian Paul
0be753a143 mesa: fix unpacking of RG88_REV texels
R should be in the high byte and G in the low byte for this format.
2011-12-02 07:22:39 -07:00
Kenneth Graunke
e304aa3600 i965: Make gen6_resolve_implied_move a no-op for MRF sources.
Attempting to move an MRF to a MRF is not only pointless, it will fail
because MRFs are read-only, resulting in garbage in your register.

If we already set up a MRF source, there's nothing to resolve anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-12-02 02:49:23 -08:00
Mathias Fröhlich
ce45aecfda mesa: Renumber the tnl attributes to match VERT_ATTRIB*.
Also renumber the tnl modules vertex attributes to match
the renumbered VERT_ATTRIB_* values.

This should fix

https://bugs.freedesktop.org/show_bug.cgi?id=43353

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Tested-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 07:04:49 +01:00
Mathias Fröhlich
a4f345e0d2 mesa: Extend BITSET64_*_RANGE to work on arbitrary ranges.
The BITSET64_{TEST,SET,CLEAR}_RANGE macros only work on ranges
wither in the lower 32 or in the upper 32 bits of the bitset.
This change extends these macros to work on arbitrary ranges
possibly crossing the bitset word boundary.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 07:04:49 +01:00
Stéphane Marchesin
52b75c6165 i915g: Implement GL_STREAM_* for textures by using untiled textures. 2011-12-01 18:12:56 -08:00
Stéphane Marchesin
d269ce0a39 i915g: Add unsupported PIPE_SHADER_CAP_OUTPUT_READ to silence warnings. 2011-12-01 18:09:18 -08:00
Chia-I Wu
912f7b6bfe docs: list GL_OES_compressed_ETC1_RGB8_texture in 7.12 release notes
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:47 +08:00
Chia-I Wu
cde6c91fd5 st/mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Have st/mesa recognize MESA_FORMAT_ETC1_RGB8 then we are good to advertise the
extension.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
5c31eb78e5 gallium: add PIPE_FORMAT_ETC1_RGB8
The format is defined by GL_OES_compressed_ETC1_RGB8_texture.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
d4a38e86d4 mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa.  There is no
driver support yet.

Unlike desktop GL compressed texture formats, GLES compressed texture formats
usually can only be used with glCompressedTexImage2D.  All other gl*Tex*Image*
functions are updated to check for that.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:46 +08:00
Chia-I Wu
51f4d27254 mesa: add ETC1 decoding routines
The format is defined by GL_OES_compressed_ETC1_RGB8_texture.  These routines
will be used in the following commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:45 +08:00
Chia-I Wu
4eae2b37a8 glapi: regenerate files for GL_OES_compressed_ETC1_RGB8_texture
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:45 +08:00
Chia-I Wu
35b506148e glapi: add GL_OES_compressed_ETC1_RGB8_texture for GLES
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-02 08:43:44 +08:00
Mathias Fröhlich
a4c952f36f swrast: Fix signed/unsigned problems with negative strides.
In swrast_map_renderbuffer negative strides lead to
render buffer map pointers that are off by 2^32.
Make sure that intermediate negative values are not
converted to an unsigned.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-01 21:44:57 +01:00
Vinson Lee
de93347d48 u_vbuf: Silence uninitialized variable warnings.
Fixes these GCC warnings.
u_vbuf.c: In function ‘u_vbuf_draw_begin’:
u_vbuf.c:839:20: warning: ‘max_index’ may be used uninitialized in this function [-Wuninitialized]
u_vbuf.c:838:20: warning: ‘min_index’ may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-12-01 11:41:14 -08:00
Alex Deucher
5df2d18f70 r600g: add some new pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-12-01 11:06:49 -05:00
Brian Paul
e10942c8e9 mesa: fix unpack_ARGB1555_REV()
We weren't doing the necessary byte swap.

v2: use same arithmetic as unpack_ARGB1555() to be consistent.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-12-01 08:07:34 -07:00
Brian Paul
478f0d228b mesa: fix indentation in attrib.c 2011-11-30 20:35:02 -07:00
Eric Anholt
51e5a266c1 i965/fs: Fix regression in fbo-alphatest-nocolor.
In the refactor for handling user-defined out params, we failed to set
up the new color output tracking when there was no color drawbuffer in
place but alpha testing was on.  Just always set up at least one when
handling gl_FragColor, since we won't make use of its value unless we
need to.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42806
2011-11-30 11:23:26 -08:00
Eric Anholt
a3b8c5ed5b i965/fs: Make register file enum 0 be the undefined register file.
In 6d874d0ee1, I checked whether a
register that had been stored was BAD_FILE (as opposed to a legitimate
GRF), but actually the unset register was ARF NULL because it had been
memset to 0.  Finding BAD_FILE for unset values in debugging was my
intention with that file, so make it the case more often by
rearranging the enum.  There was only one place we relied on the magic
enum register_file to hardware register file correspondance anyway.
2011-11-30 11:23:26 -08:00
Eric Anholt
c6abde211f i965: Don't perform the precompile on fragment shaders by default.
It is useful to have this option for shader-db, and it was also good
at the time where we were rejecting shaders due to various internal
limits we hadn't supported yet.  However, at this point the precompile
step takes extra time (since not all NOS is known at link time) and
spews misleading debug in the common case of debugging a real app.

This is left in place for VS, where we still have a couple of codegen
failure paths that result in link failure through precompile.  Those
need to be fixed.

shader-db can still get at the debug info it wants using
"shader_precompile=true" driconf option.  Long term, we can probably
build a good-enough app for shader-db to trigger real codegen.
2011-11-30 11:22:53 -08:00
Kai Wasserbäch
0a22fb6a5d gallium/failover: Remove the deprecated module.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-30 17:26:40 +00:00
Brian Paul
15245cbad4 st/mesa: fix indentation 2011-11-30 07:09:46 -07:00
Brian Paul
efcf5aa13f mesa: use _mesa_is_bufferobj() in update_array() 2011-11-30 06:57:38 -07:00
Brian Paul
529fa77529 mesa: use Elements() macro in program printing code 2011-11-30 06:57:37 -07:00
Brian Paul
c67d9cfd9d mesa: fix signed/unsigned comparison warning 2011-11-30 06:57:37 -07:00
Brian Paul
c3a57841a3 mesa: fix MESA_FORMAT_RG88 format match test
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-30 06:57:37 -07:00
Brian Paul
76374e60cd mesa: fix printf format warning in _mesa_fprint_program_parameters() 2011-11-30 06:57:37 -07:00
Brian Paul
1ad5a1a246 tnl: s/INLINE/inline/ 2011-11-30 06:57:37 -07:00
Brian Paul
22ad02b3ff mesa: regenerated dispatch.h (s/INLINE/inline/) 2011-11-30 06:57:37 -07:00
Brian Paul
919c835835 glapi: s/INLINE/inline/ for dispatch.h file 2011-11-30 06:57:36 -07:00
Brian Paul
ea472ffe67 swrast: use STATIC_ASSERT to make sure texfetch table isn't missing entries
When new MESA_FORMAT_x enums are added we need to add a new entry in
the table of texture fetch functions.  In the past this has been
missed if swrast isn't actually tested.  Using a static assertion
should help with that.
2011-11-30 06:57:36 -07:00
Brian Paul
15be8b4bf0 mesa: add STATIC_ASSERT() macro for compile-time assertions
This can be used to check that tables have the right number of entries,
etc. at compile-time.  This will hopefully catch things that are missed
if particular drivers aren't tested, for example.

v2: Simplify the macro to omit the extra line number info (the compiler
already indicates the line number).  And wrap the macro for readability.
2011-11-30 06:57:36 -07:00
Brian Paul
25c8a112ab mesa: access pixels as GLushort in unpack_SL8()
Per the format comments and the texstore code, use a GLushort to access the
pixel.  The code was OK as-is on little endian machines.
2011-11-30 06:57:36 -07:00
Eric Anholt
2134d2f35b mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().
There was only one consumer of this API, meta.c, which was intending
to ask "is this format just stencil index (and nothing else)?".
Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type
formats, it would just try to draw the stencil parts.  Nothing good
came of this.

This function looks rather silly at this point, but I'm leaving it in
place to be the obvious parallel API to _mesa_is_depth_format().  Note
that if you want the old behavior, you should use it as
(_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is
commonly done for depth-related tests.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
ed945b0bc7 mesa: Fix the datatype of GL_DEPTH32F_STENCIL8's depth channel.
Asking for the datatype of MESA_FORMAT_Z32_FLOAT_X24S8 is a bit funny
-- there's a float depth channel, and a stencil channel that doesn't
have a particular GLenum associated with its type, so what's the
correct response?

Because there is no query for stencil, just make this format's
datatype be that of the depth channel.  It fixes the depth query (and
thus a failure in piglit gl-3.0-required-sized-formats), and none of
the other consumers of the _mesa_get_format_datatype() API care.

v2: Add a comment for why the DataType is this way for this format.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
d2235b0f46 i965: Always handle GL_DEPTH_TEXTURE_MODE through the shader.
We were already doing it through the shader (layered underneath
GL_EXT_texture_swizzle) in the shadow compare case.  This avoids
having per-format logic for switching out the surface format dependent
on the depth mode.

v2: Also do the swizzling for DEPTH_STENCIL.  oops.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
f98bfb5d68 i965: Fix EXT_texture_swizzle with a writemask in the FFFS/FP backend.
I tripped over this bug in the next commit, relying on our
EXT_texture_swizzle to do some shadow sampler-related swizzling.  If a
writemask was masking out a channel of the destination that was a live
channel of the texture swizzle, it would read undefined values.

Fixes piglit ARB_fragment_program_shadow/masked.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Eric Anholt
d84a180417 i965: Base HW depth format setup based on MESA_FORMAT, not bpp.
This will make handling new formats (like actually exposing Z32F)
easier and more reliable.

v2: Remove the check for hiz buffer -- the MESA_FORMAT should really
    be giving us the value we want even for hiz.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-29 16:44:51 -08:00
Kai Wasserbäch
ccd4d4367f gallium/cell: Remove the driver.
Complicates Gallium3D development and doesn't seem to have active users.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-29 20:26:53 +00:00
Eric Anholt
09e67706e9 i965: Don't depth test the fake depthbuffer when one isn't present.
For the non-separate-stencil-only case, we've been using a NULL
surface for depth, so we didn't have to care.  However, to support
separate stencil with no depthbuffer, we have to make the depth
surface non-NULL or the stencil test always fails thanks to separate
stencil inheriting the surface type of depth.

Fixes hiz-depth-stencil-test-d0-s8.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-29 11:18:23 -08:00
Ian Romanick
e6c314f7d2 mesa: Allow generic attributes for glGetActiveAttrib and GL_ACTIVE_ATTRIBUTES
Page 77 (page 91 of the PDF) says about glGetActiveAttrib:

    "The returned attribute name can be the name of a generic
    attribute or a conventional attribute (which begin with the prefix
    "gl_", see the OpenGL Shading Language specification for a
    complete list)."

Page 261 (page 275 of the PDF) says about glGetProgramiv:

    "If pname is ACTIVE_ATTRIBUTES, the number of active attributes in
    program is returned."

It doesn't say anything about built-in vs. user-defined attributes.
From the language around glGetActiveAttrib and the lack of an
exclusion of built-in attributes, which exists other places (e.g.,
around glBindAttribLocation), we can infer that GL_ACTIVE_ATTRIBUTES
should include the active attribute count.  It should also be included
in the values returned by glGetActiveAttrib.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43138
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Yi Sun <yi.sun@intel.com>
2011-11-29 11:14:28 -08:00
Chad Versace
03bbcd447c swrast: Fix some static analysis warnings
To each switch statement in s_texfilter.c, add a break statement to the
default case.

Eliminates the Eclipse static analysis warning: No break at the end of
this case.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-29 10:36:15 -08:00
José Fonseca
10b07665be Remove windows kernel support code.
Not actively used.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 17:34:56 +00:00
José Fonseca
57f8e26ca8 gallium/auxiliary: Remove os_stream.
XP kernel mode was the only subsystem lacking stdio FILES.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 17:34:30 +00:00
Kai Wasserbäch
23a8a7fe8c docs: Removed i965 entry in the source tree listing.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-29 16:27:50 +00:00
Kai Wasserbäch
5383c9c7be docs: Added item to release notes for 7.12.
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-29 16:27:48 +00:00
José Fonseca
c8db5a3d53 st/vega: Fix warnings about dllimport attributes on windows. 2011-11-29 15:55:40 +00:00
Kai Wasserbäch
2c27f204f1 i965g: Delete this driver.
Never completed, and no plans to do so.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-29 15:44:09 +00:00
Chia-I Wu
76ba431b97 mesa: distinct gl_client_array arrays are gone
Fix build errors since 762c9766c9.

Acked-by: Jose Fonseca <jfonseca@vmware.com>
2011-11-29 17:13:01 +08:00
Mathias Fröhlich
762c9766c9 mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.
Replace the distinct struct gl_client_array members in gl_array_object by
an array of gl_client_arrays indexed by VERT_ATTRIB_*.
Renumber the vertex attributes slightly to keep the old semantics of the
distinct array members. Make use of the upper 32 bits in VERT_BIT_*.
Update all occurances of the distinct struct members with the array
equivalents.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:37:19 +01:00
Mathias Fröhlich
dca6a28a14 mesa: Make gl_program::InputsRead 64 bits.
Make gl_program::InputsRead a 64 bits bitfield.
Adapt the intel and radeon driver to handle a 64 bits
InputsRead value.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
f364ac1da1 mesa: Make gl_array_object::_Enabled 64 bits.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
ed42c25807 vbo: Use The VERT_{ATTRIB,BIT} defines.
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
104b81def4 mesa: Replace _NEW_ARRAY_* bits with VERT_BIT_*
Consolidate the two distinct set of flags to use VERT_BIT_*.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Mathias Fröhlich
b57101302d mesa: Introduce more symbolic VERT_{ATTRIB,BIT}* defines.
Introduce a set of defines for VERT_ATTRIB_* and VERT_BIT_*
that will be used in the followup patches.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-29 06:35:44 +01:00
Yuanhan Liu
a0a5bd4bb3 mesa: move ElementArrayBufferObj to gl_array_object
According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

NOTE: this is a candidate for the 7.11 branch.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-29 09:48:50 +08:00
Brian Paul
4ff212aac3 mesa: update comments for _mesa_format_matches_format_and_type(), 80-column wrapping 2011-11-28 18:10:30 -07:00
Brian Paul
0cbdead62e mesa: add component comments for sRGB formats 2011-11-28 18:10:30 -07:00
Brian Paul
ae70caf7eb mesa: update texstore comments for R/G textures 2011-11-28 18:10:30 -07:00
Brian Paul
50b91aa305 mesa: fix comments for RG formats
The position of the red and green bits was misstated in the comments.
Arguably, the names of these formats should be changed to "GR" to reflect
the component ordering and to be consistent with other formats.
2011-11-28 18:10:30 -07:00
Brian Paul
6856472689 st/mesa: don't try to allocate zero-sized renderbuffers
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43047
and https://bugs.freedesktop.org/show_bug.cgi?id=43048

Note: This is a candidate for the 7.11 branch.

Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-28 18:10:30 -07:00
Daniel Vetter
8f15c31338 gallium/i965g: hide that utterly broken driver better
And warn loudly in case people want to use it. Too many tester report
gpu hangs on irc and we rootcause this ...

Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-28 23:54:47 +01:00
Brian Paul
e32ada1b26 swrast: add missing texfetch table entry for MESA_FORMAT_ARGB2101010_UINT
As with the other integer-valued formats, use NULL until we support
integer textures.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43316

Tested-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-28 15:40:11 -07:00
Brian Paul
5c84e961e3 mesa: remove unused gl_texture_object::DriverData field 2011-11-28 10:07:19 -07:00
Brian Paul
c5012c1d56 mesa: handle MapTextureImage() failures in mipmap generation code
And handle potential malloc failures too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul
e984085299 mesa: handle MapTextureImage() failures in glGetTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul
1ad88fb42d mesa: handle MapTextureImage() failures in glTexImage code
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:13:13 -07:00
Brian Paul
e68994494b mesa: fix frag shader generation for alpha test with no color buffers
If alpha test is enabled and there's no color buffers we still need the
fragment shader to emit a color.

v2: add _NEW_COLOR flag in _mesa_update_state_locked()

Fixes piglit fbo-alphatest-nocolor-ff failures with Gallium drivers.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Eric Anholt <eric@anholt.net> (i965)
2011-11-28 08:13:04 -07:00
Brian Paul
56b870e441 mesa: check for null ptr in _mesa_is_bufferobj()
This simplifies a few callers.  And it adds a bit of robustness.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-11-28 08:07:32 -07:00
Brian Paul
37bf720da4 mesa: move _mesa_base_format_has_channel() into image.c
This is where other format-related functions live.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:32 -07:00
Brian Paul
d45c9b239f mesa: combine GL_TEXTURE_INTENSITY/LUMINANCE_SIZE queries
Use the _mesa_base_format_has_channel() helper as we do for the
other texture format component queries.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:26 -07:00
Brian Paul
f0b6e9a729 mesa: use _mesa_base_format_has_channel() in fbobject.c queries
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 08:07:09 -07:00
Brian Paul
858d1f0b1c mesa: fix indexing error in unpack_Z32_FLOAT_X24S8()
The source array elements are 8-bytes (float + uint) so we need
to multiply the src index by 2 to get the right array stride.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-28 08:04:48 -07:00
Dave Airlie
ee47e19738 mesa/docs: add ARB_texture_rgb10_a2ui to relnotes/gl3.txt
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-28 09:40:53 +00:00
Dave Airlie
9f9c8592e6 st/mesa: add ARB_texture_rgb10_a2ui support
Add support to the state tracker format and extension enablement code.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-28 09:40:53 +00:00
Dave Airlie
f449be660e mesa/format: add mesa MESA_FORMAT_ARGB2101010_UINT support.
This format is used in the ARB_texture_rgb10_a2ui spec.

It adds core mesa support, texformat + texstore support, format_unpack
and fbobject.c (all patches from list merged + fixed up).

also fixes some whitespace issues.

Parts were:
Reviewed-by: Eric Anholt <eric@anholt.net>

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-28 09:40:53 +00:00
Dave Airlie
47e2e36717 image/pack: fix missing GL_BGR(A)_INTEGER support.
These codepaths were missing the cases for BGR_INTEGER/BGRA_INTEGER.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-28 09:03:17 +00:00
Ian Romanick
537c687116 docs: Add 7.11.2 release notes and news 2011-11-27 14:17:40 -08:00
Dave Airlie
923f143335 image: fix legal types for packed integer formats.
After reading ARB_texture_rgb10_a2ui it appears the packed formats
for integer types are only specified via this extension, and not via
the original ones. So condition the checks on this.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-27 20:44:01 +00:00
Dave Airlie
9608ef5dec r600g: add framebuffer support for 2/10/10/10 integer 2011-11-27 20:36:27 +00:00
Dave Airlie
d38768fe38 r600g: add int support for 2/10/10/10 format.
integer wasn't set properly for the non-uniform types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 19:32:05 +00:00
Dave Airlie
c33d2e6b08 docs/gl3: these two interfaces are complete now.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 17:36:48 +00:00
Dave Airlie
b50e017ae1 pack: fix indentation (trivial)
just saw this while looking for other problems.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 17:36:22 +00:00
Dave Airlie
8c1037042f glapi: add ARB_texture_rgb10_a2ui support.
This just adds one enum.

regenerate enums.c.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 16:25:12 +00:00
Dave Airlie
ee7bc10391 gallium: add B10G10R10A2_UINT format
This format is used for ARB_texture_rgb10_a2ui extension.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-27 16:25:12 +00:00
Chia-I Wu
d4fcf67a3a mesa: add MESA_FORMAT_RGBX8888 and MESA_FORMAT_RGBX8888_REV
MESA_FORMAT_RGBX8888_REV is one of the opaque pixel formats used on Android.
Thanks to texture-from-pixmap, drivers may actually see texture images with
this format on Android.

MESA_FORMAT_RGBX8888 is added only for completeness.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: Move the new formats after MESA_FORMAT_ARGB8888_REV in gl_format.  I
      accidentally moved them to the wrong place when preparing the patch.]
2011-11-27 12:43:24 +08:00
Beren Minor
6baa5f10c0 egl_glx: Try first a default lookup for glXGetProcAddress before loading dynamic lib.
GLX functions are sometimes directly available in the current binary. In such
cases, we do not need any alternate library loaded using dlopen. Otherwise,
dlopen may find the wrong libGL library and get functions that conflicts with
the current loaded ones.

For example, on Debian Sid with nvidia binary drivers, using mesa's libEGL with
GLX driver leads to wrong glXGetFBConfigs symbol loaded (or loaded twice?),
which leads to "GLX: failed to create any config" error message as the
glXGetFBConfigs symbol seems to return garbage. If the binary is linked with
nvidia's libGL, the GLX symbols are already available.
Without this patch, convert_fbconfig (src/egl/drivers/glx/egl_glx.c:233) fails
for every config found, after glXGetFBConfigAttrib(... GLX_RENDER_TYPE, ...)
call, as the value returned has GLX_COLOR_INDEX_BIT and not GLX_RGBA_BIT.

[olv: initialize handle, prepend egl_glx to the commit log]
2011-11-27 11:22:24 +08:00
Chia-I Wu
496f68bb9d android: bring in i915_dri and i965_dri automatically
Add i915_dri and i965_dri to libGLES_mesa's LOCAL_REQUIRED_MODULES when
enabled.
2011-11-26 11:42:08 +08:00
Chia-I Wu
d2cd621086 android: pass -std=c99 by default
Several modules expect a C99 compiler already.  It is also the default for
Makefile build.
2011-11-26 11:42:08 +08:00
Chia-I Wu
4d3d6f76ff android: move libGLES_mesa build rules to src/egl/main/.
Keep the top-level Android.mk away from building modules.
2011-11-26 11:42:08 +08:00
Chia-I Wu
169ef48c85 android: clean up libglapi bulid rules a bit
Make the output prettier.  Make the rules reusable if we ever want to add
other modules, such as libGLESv2_mesa.
2011-11-26 11:42:01 +08:00
Thomas Hellstrom
dbf00812b0 st/xa: Kill a couple of compilation warnings
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:38:44 +01:00
Thomas Hellstrom
32b1641a59 st/xa, xa/vmwgfx: Generate exported symbol list from the st/xa symbols.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:38:36 +01:00
Thomas Hellstrom
4d04367eca st/xa, xa/vmwgfx: Use XA_EXPORT attribute to indicate global visibility
Also fix up Makefiles to use the default mesa compilation flags.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrants <jakob@vmware.com>
2011-11-25 16:38:16 +01:00
Thomas Hellstrom
404d2f9c86 st/xa, xa/vmwgfx: Set the right version on library suffix
Also remove some unused variables in the st/xa makefile.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-25 16:36:29 +01:00
Chia-I Wu
75cc24c876 android: add support for ICS
With ICS (Android 4.0), several headers and structs are renamed.  Define
ANDROID_VERSION so that we can choose a different path depending on the
platform version.

I've tested only softpipe and llvmpipe.  r600g is also reported to work.
2011-11-25 12:34:33 +08:00
Chia-I Wu
42c2c371d6 vbo: fix !FEATURE_beginend build
Fix a build error in GLES-only build.
2011-11-25 11:18:50 +08:00
Chia-I Wu
d3d3c12a95 st/egl: fix a crash in Android backend
There is no buffer and android_surface_present should be a no-op when
eglSwapBuffers is called twice in a row.
2011-11-25 11:18:02 +08:00
Brian Paul
24d25b55bf softpipe: s/int/unsigned/ to be consistent in alpha test code 2011-11-23 15:04:01 -07:00
Brian Paul
173427841a softpipe: remove pointless break stmt 2011-11-23 15:02:05 -07:00
Chad Versace
f99d5af03b i965/gen6: Fix GPU hang when using stencil buffer without depth
Enable the bit 3DSTATE_DEPTH_BUFFER.Tiled_Surface.  From the Sandybridge
PRM, Volume 2, Part 1, Section 7.5.5.1.1 3DSTATE_DEPTH_BUFFER, Bit 1.27
Tiled Surface:
   [DevGT+]: This field must be set to TRUE.

Fixes GPU hangs on the following Piglit tests:
   hiz-stencil-test-fbo-d0-s8
   hiz-stencil-read-fbo-d0-s8

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-23 11:03:31 -08:00
Eric Anholt
8d15268a61 i915: Fix complete texturing regression since 27505a105a
I had notes to myself to test gen3 and gen4, and then I tested gen4
and called it good.  Turns out I forgot to actually call the new
function on gen3.
2011-11-23 09:45:17 -08:00
Eric Anholt
87f12bb2d9 i915: Fix build since hiz merge.
v2: Guard against rb->mt being NULL, since we may enter the draw
regions path before intel_prepare_render() has been called to set
them.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com> (v1)
2011-11-23 09:44:58 -08:00
Brian Paul
ca4e664f21 mesa: fix incorrect error message in format_unpack.c 2011-11-23 08:40:46 -07:00
Vasily Khoruzhick
8265bb7fb8 i915g: don't set alpha to 1 for RGBX and BGRX
This patch fixes regression introduced in
1f3c5eae5c

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-11-23 11:32:13 +01:00
Brian Paul
fc144728c7 mesa: update comment for clear_teximage_fields() 2011-11-22 17:16:50 -07:00
Brian Paul
12dd5dedf5 gallium: remove trailing comma and unneeded comments in p_defines.h 2011-11-22 17:08:36 -07:00
Marek Olšák
a7c107f3bc mesa: re-implement unpacking of DEPTH_COMPONENT32F
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43122

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-11-23 00:00:40 +01:00
Eric Anholt
27505a105a i915: Move the texture format setup for this driver out of shared code.
The i965 driver is now enabling all of these formats on its own from
the surface format table.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
899e6ea8d3 i965: Drop intel_context.c's texture format set up for this driver.
This is a no-op change on gen6, but should result in some
actually-unsupported formats on gen4 no longer being chosen (like
RGBA_FLOAT32 now being RGBA_FLOAT16).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
f8b13ba137 i965: Add support for ARGB2101010 rendering.
GL 3.0 specifies GL_RGB10_A2 as a required sized format for rendering
and texturing.

This introduces two piglit regressions: one due to fbo-mipmap-copypix
hitting swrast GetRow (we want to convert swrast to MapRenderbuffer),
and one due to fbo-blending-formats being too picky while leaving
dithering on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
b0a0f4bf14 i965: Add support for RGBA_16 unorm rendering.
GL 3.0 specifies GL_RGBA16 as a required sized format for rendering
and texturing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:39 -08:00
Eric Anholt
1e42568bf3 i965: Add support for half-float formats.
Now that all the rest of the driver is driven off of the surface
formats table, all we really need to do is add the mapping from
MESA_FORMAT to BRW_SURFACEFORMAT.  However, we also add format
override for I16/L16 render targets at the same time, so that existing
users of I16 that were getting promoted to I32 and then getting the
I32->R32 override still get FBO support.

Fixes failures in piglit gl-3.0-required-sized-texture-formats, and
will prevent regressions in ARB_texture_float on gen4 when moving to
fully table-driven texture format setup.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
f258c0dfa8 mesa: Fix unpack for MESA_FORMAT_INTENSITY_FLOAT16.
Fixes failures in i965 on fbo-blending-formats when the format is enabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
6216a5b495 mesa: Fall back to float16 if float32 isn't supported in ChooseTexFormat.
Until GL 3.0, there isn't any requirement on the actual sizes of
channels chosen.  By falling back to 16 here, we can correctly support
ARB_texture_float on original i965 hardware, which can't correctly
filter 32-bit floats.
2011-11-22 13:58:38 -08:00
Eric Anholt
babe26b3ef mesa: Add fallback from RGB_FLOAT16 to RGBA_FLOAT16 before RGBA_FLOAT32.
Not all i965 hardware can do RGB float16, and this will at least save
half the memory and have expected behavior in terms of precision.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
2d159e6b36 i965: Reorganize MESA_FORMAT -> BRW_SURFACEFORMAT table.
This should be a no-op change.  The initializers are reordered to
match the ordering of the enum, since there isn't a clearly sensible
ordering, but "the order they were added to the driver, sort of" is
definitely not one.

Also, the unsupported formats are explicitly initialized to 0, so it's
more obvious what we aren't claiming to support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
1b4910b305 i965: Mark texture formats as supported using the surface formats table.
This is currently duplicated with intel_context.c's setup of the
formats table, and sets true for exactly the same set of formats on
gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
3d798abc81 intel: Improve debug output for begin/finish render texture.
I've never seen a use for the thread ID value, but knowing the format
being rendered is kind of a big deal.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
05ab8fc134 intel: Remove duplicate test for texture attachment completeness.
We are already testing this if appropriate in
intel_validate_framebuffer (FBO completeness), so no need to avoid
attaching the texture to the renderbuffer here.

This causes MESA_FORMAT_R11_G11_B10_FLOAT to now be renderable as a texture
attachment on i965.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
925356c8c0 i965: Don't require spans (swrast) support to consider a format FBO complete.
We don't want to go writing GetRow/PutRow for every format required by
GL 3.0, when it's very hard to get those functions called, and in
every case we want to make swrast do direct mapping through
MapRenderbuffer anyway.

This causes MESA_FORMAT_R11_G11_B10_FLOAT to be considered complete on gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
ca10b2d449 i965: Use the surface format table to determine render target supportedness.
This moves any chipset-dependent logic we want for render target
format choices to init time as well.  There is still logic left at
state update for SRGB handling, where format choices change based on
GL state.

The brw_render_target_supported() function should now return correct
results, instead of relying on the limited results from
intel_span_supports_format() to avoid lying about FBO completeness.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
6661b7596f intel: Add the context to the render_target_supported() vtbl method.
We're going to want to provide different answers per chipset
generation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 13:58:38 -08:00
Eric Anholt
e589ebdf23 i965: Add a table of the surface format information from the PRM.
This will be used to drive chosing formats and determining framebuffer
completeness, instead of the bunch of ad-hoc checks we have had until
now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 13:58:38 -08:00
Eric Anholt
755f0a0a02 mesa: Make formats.c "datatype" values match glGetTexLevelParameter return.
The formats.c code's "datatype" value is "what does this value mean",
i.e. unorm or snorm or float, and is the return value from the
GL_TEXTURE_RED_TYPE class of queries.  The depth formats were marked
as GL_UNSIGNED_INT, which is what we use for integer, and not what we
should be returning from the glGetTexLevelParameter.

In texstore, we were inappropriately using it as an argument to
_mesa_unpack_depth_span() that was expecting a value like
GL_UNSIGNED_INT or GL_UNSIGNED_SHORT.  Just hardcode
_mesa_unpack_depth_span()'s arguments for now, though it looks like
the consumers of that interface would be happier with using
MESA_FORMAT.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-22 13:58:37 -08:00
Eric Anholt
250a9c8e7e mesa: Don't report types for 0-sized components of textures.
The GL_TEXTURE_WHATEVER_SIZE entrypoints were checking if the
specified base type of the texture allowed that channel to be present
before reporting the size of the channel, so that GL_RGB didn't end up
with an alpha size if the hardware driver had to store it that way.

The GL_TEXTURE_WHATEVER_TYPE entrypoints weren't checking it, so you
would end up with strange responses from the GL involving 0-bit
floating-point alpha components in GL_RGB32F, even though it says
GL_NONE as expected for other 0-sized channels.

Make _TYPE check _BaseFormat the same as _SIZE, which results in
fixing most of the GL_RGB* testcases of gl-3.0-required-sized-formats
pass on i965.

v2: Add a default case with a warning (suggestion by Brian Paul)

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2011-11-22 13:58:37 -08:00
Marek Olšák
034e63b9f8 r600g: handle all remaining CAPs 2011-11-22 20:56:51 +01:00
Marek Olšák
4ac250c9d5 r600g: remove default case statements in get_param
This will throw a compile warning if there's an unhandled CAP.
2011-11-22 20:56:51 +01:00
Marek Olšák
650f6a6815 r300g: re-order shaders CAPs 2011-11-22 20:56:51 +01:00
Marek Olšák
410c12352a r300g: handle SHADER_CAP_OUTPUT_READ 2011-11-22 20:56:51 +01:00
Marek Olšák
684d74e000 r300g: remove default case statements in get_param
This will throw a compile warning if there's an unhandled CAP.
2011-11-22 20:56:51 +01:00
Marek Olšák
fba685a099 u_vbuf_mgr: rename to u_vbuf 2011-11-22 20:56:51 +01:00
Marek Olšák
611a8b82e3 u_vbuf_mgr: better way to find a free VB slot + check errors early 2011-11-22 20:56:51 +01:00
Marek Olšák
1146441a2d u_vbuf_mgr: remove a useless variable 2011-11-22 20:56:51 +01:00
Marek Olšák
c4f51b225b u_vbuf_mgr: remove redundant memset 2011-11-22 20:56:51 +01:00
Marek Olšák
498e86e414 u_vbuf_mgr: don't reference non-native vertex buffers as native
also don't mark them as 'user', because they will be uploaded through
the translate fallback anyway.
2011-11-22 20:56:51 +01:00
Marek Olšák
1e53a26b9c u_vbuf_mgr: rename translate_vb_slot -> fallback_vb_slot 2011-11-22 20:56:51 +01:00
Marek Olšák
bb71f9249a gallium: separate out floating-point CAPs into its own enum
The motivation behind this is to add some self-documentation in the code
about how each CAP can be used.

The idea is:
- enum pipe_cap is only valid in get_param
- enum pipe_capf is only valid in get_paramf

Which CAPs are floating-point have been determined based on how everybody
except svga implemented the functions. svga have been modified to match all
the other drivers.

Besides that, the floating-point CAPs are now prefixed with PIPE_CAPF_.
2011-11-22 20:56:50 +01:00
Marek Olšák
2a0126932b gallium: remove PIPE_CAP_GLSL and enable GLSL unconditionally
Only i965g does not enable GLSL, but that driver has been unmaintained and
bitrotting for quite a while anyway.
2011-11-22 20:56:50 +01:00
Marek Olšák
a92ee4abfe glsl: convervative_depth is not allowed in the vertex shader
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 20:56:50 +01:00
Marek Olšák
6b43d6fdda glsl: finish up ARB_conservative_depth (v2)
v2: updated an error message

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 20:56:50 +01:00
Marek Olšák
bbcb648bc2 mesa: rename the AMD_conservative_depth extension flag to ARB
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-22 20:56:50 +01:00
Marek Olšák
e99df05cce st/mesa: quick fix of CopyPixels with GL_DEPTH_STENCIL
This fixes:
- depthstencil-default_fb-copypixels
- fbo-depthstencil-GL_DEPTH24_STENCIL8-copypixels

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-22 20:56:50 +01:00
Ian Romanick
151867b422 linker: Remove erroneous multiply by 4 in uniform usage calculation
The old count_uniform_size::num_shader_uniforms was actually
calculating the number of components used.  Multiplying by 4 when
setting gl_shader::num_uniform_components caused us to count 4x as
many uniform components as were actually used.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42930
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42966
Acked-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Vinson Lee <vlee@vmware.com>
Tested-by: Pavel Ondračka <pavel.ondracka@email.cz>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-22 11:50:19 -08:00
Chad Versace
4ce635c871 Merge branch 'hiz' of ssh://people.freedesktop.org/~chadversary/mesa 2011-11-22 10:52:29 -08:00
Chad Versace
e5411d8fdc i965/gen6: Enable HiZ by default
Regresses one Piglit test: bugs/fdo10370.

I'm not enabling HiZ for gen7 yet because it causes a mysterious
performance regression.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Chad Versace
b18875d441 intel: Use separate stencil whenever possible
For depthstencil renderbuffers, we were using separate stencil only if the
hardware required it. Since the performance gains from HiZ is so high, we
should always use separate stencil if the hardware supports it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Kenneth Graunke
e7e81714f3 i965: Implement the actual tables for texture alignment units [v2]
I implemented functions for horizontal/vertical alignment units separately
because I find it easier to read that way...especially with all the
corner-cases.

[chad] Corrected the vertical alignment calculation by checking for
depthstencil formats.

v2:
   - Fix typos in intel_horizontal_texture_alignment_unit():
     s/height/width/ and s/VALIGN/HALIGN.
   - Remove special case for compressed formats in
     intel_get_texture_alignment unit(). Compressed formats are already
     handled in the halign and valign functions.
   - Replace check ``_mesa_is_depth_format(...) ||
     _mesa_is_depthstencil_format(...)`` with explcitit checks against
     GL_DEPTH_COMPONENT and GL_DEPTH_STENCIL.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Chad Versace
dd0e46c410 i965/gen6: Set vertical alignment in SURFACE_STATE batch
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:52 -08:00
Chad Versace
017c13d55b intel: Store miptree alignment units in the miptree
This allows us to replace all the calls to
intel_get_texture_alignment_unit() with a single call at miptree creation.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
293e9a7ccf intel: Enable HiZ for texture renderbuffers
When a depth texture is first attached to framebuffer, allocate a HiZ
miptree for it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
b264698d30 intel: Resolve buffers in intel_map_renderbuffer()
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
d2e35a5460 intel: Resolve buffers in intel_map_texture_image()
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
3d760664e6 intel: Mark needed resolves when first enabling HiZ on a miptree
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
1b2baf3b08 i965: Mark that depth buffer needs depth resolve after drawing
After brw_try_draw_prims() emits a batch, mark that the depth buffer needs
a depth resolve if the buffer was written to and if it has an accompanying
HiZ buffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
622bae07a5 intel: Resolve buffers in intelSpanRenderStart
Resolve all buffers that will be mapped by intelSpanRenderStart. This
comprises resolving the depth buffer of each enabled texture and of the
read and draw buffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
1eede4aa87 intel: Refactor intelSpanRenderStart
Factor the mapping loops from intelSpanRenderStart() into
intel_span_map_buffers(). This in preparation for the next commit,
which resolves the buffers before mapping.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:51 -08:00
Chad Versace
3b0d295e12 i965: Resolve buffers before drawing [v2]
Before emitting primitives in brw_try_draw_prims(), resolve the depth
buffer's HiZ buffer and resolve the depth buffer of each enabled depth
texture.

v2: [anholt] The driver no longer validates drm bo's, so update a comment
    to reflect that.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
b95986729e i965: Prevent recursive calls to FLUSH_VERTICES [v2]
To do so, we must resolve all buffers on entering a glBegin/glEnd block.
For the detailed explanation, see the Doxygen comments in this patch.

v2:
   - Fix typo: s/enusure/ensure/.
   - In brwPrepareExecBegin(), do the same resolves as done by
     brw_predraw_resolve_buffers().

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
1249855346 i965/gen6: Manipulate state batches for HiZ meta-ops [v4]
A lot of the state manipulation is handled by the meta-op state setup.
However, some batches need manual intervention.

v2:
   Do not special-case the 3DSTATE_DEPTH_STENCIL.Depth_Test_Enable bit
   for HiZ in gen6_upload_depth_stencil(). The HiZ meta-op sets
   ctx->Depth.Test, just read the value from that.

v3:
   Add a new dirty flag, BRW_STATE_HIZ, for brw_tracked_state. Flag it
   immediately before and after executing the HiZ operation in
   gen6_resolve_slice(). Add the flag to the the dirty bits for the
   following state packets:
      gen6_clip_state
      gen6_depth_stencil_state
      gen6_sf_state
      gen6_wm_state

v4:
   - Add BRW_NEW_STATE_HIZ to the dirty bit table in brw_state_upload.c.
     This is needed for INTEL_DEBUG=state.
   - Align brw dirty bit for gen6_depth_stencil_state.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
d1f1d348d8 i965/gen6: Complete stubs for HiZ buffer resolves
Some state batches also need to be manipulated. That's done in the next
commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
77a18428ff i965: Add HiZ operation state to brw_context
brw_context::hiz contains state needed to perform HiZ meta-ops and
indicates if a HiZ operation is currently in progress.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
1383e56bd9 intel: Add resolve functions for renderbuffers
Add the following functions:
   intel_renderbuffer_resolve_hiz
   intel_renderbuffer_resolve_depth

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:50 -08:00
Chad Versace
2945abea33 intel: Add resolve functions for miptrees
Add functions that
   - set a miptree slice as needing a resolve
   - resolve a single slice of a miptree
   - resolve all slices of a miptree

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
cf5e08c8e4 intel: Add field intel_mipmap_tree::hiz_map
This is a map of miptree slices to needed resolves.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
8d3aa14e89 intel: Define struct intel_resolve_map [v2]
This is a map of miptree slices to needed resolves, implemented as
a linked list. A future commit will embed such a list in
intel_mipmap_tree.

If you think I'm crazy to put a list in a miptree, read the Doxygen in
this patch for intel_resolve_map.

v2: [anholt] Move Doxygen from functin prototypes to definitions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
f17b12278d intel: Change signature of HiZ resolve functions
Now that intel_renderbuffer::region has been replaced with a miptree, the
HiZ functions region parameter must be replaced with a miptree parameter.

Change the return type from bool to void.

Rename the 'depth' parameter to 'layer', because it will correspond to
irb->mt_layer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
c015183947 intel: Remove unused HiZ functions
Remove the following functions:
   i830_hiz_resolve_noop
   i915_hiz_resolve_noop
   brw_hiz_resolve_noop

My original strategy for how intel->vtbl.resolve_*buffer was used has
substantially changed. The above functions are no longer called in the
current strategy.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
a2e44b0813 intel: Replace intel_mipmap_tree::hiz_region with a miptree [v2]
This is required to correctly implement HiZ for mipmapped and
multi-layered textures.

v2: Accomodate refcount fixes in intel_process_dri2_buffer_*() that were
    introduced in v2 of commit
        intel: Replace intel_renderbuffer::region with a miptree [v2]

Reviewed-by: Eric Anholt <eric@anholt>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:49 -08:00
Chad Versace
3eb12dfaee intel: Replace intel_texture_image::stencil_irb with intel_mipmap_tree::stencil_mt [v3]
For depthstencil textures using separate stencil, we embedded a stencil
buffer in intel_texture_image. The intention was that the embedded stencil
buffer would be the golden copy of the texture's stencil bits. When
necessary, we scattered/gathered the stencil bits between the texture
miptree and the embedded stencil buffer.

This approach had a serious deficiency for mipmapped or multi-layer
textures. Any given moment the embedded stencil buffer was consistent with
exactly one miptree slice, the most recent one to be scattered. This
permitted tests of type A to pass, but broke tests of type B.

Test A:
    1. Create a depthstencil texture.
    2. Upload data into (level=x1,layer=y1).
    3. Read and test stencil data at (level=x1, layer=y1).
    4. Upload data into (level=x2,layer=y2).
    5. Read and test stencil data at (level=x2, layer=y2).

Test B:
    1. Create a depthstencil texture.
    2. Upload data into (level=x1,layer=y1).
    3. Upload data into (level=x2,layer=y2).
    4. Read and test stencil data at (level=x1, layer=y1).
    5. Read and test stencil data at (level=x2, layer=y2).

v2:
   Only allocate stencil miptree if intel->must_use_separate_stencil,
   because we don't make the conversion from must_use_separate_stencil to
   has_separate_stencil until commit
        intel: Use separate stencil whenever possible

v3:
   Don't call ChooseNewTexture in intel_renderbuffer_wrap_miptree() in
   order to determine the renderbuffer format. Instead, pass the format as
   a param to that function.

CC: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:41 -08:00
Chad Versace
c80b31fdee intel: Refactor intel_render_texture() [v2]
This is in preparation for properly implementing glFramebufferTexture*()
for mipmapped depthstencil textures. The FIXME comments deleted by this
patch give a rough explanation of what was broken.

This refactor does the following:
   - In intel_update_wrapper() and intel_wrap_texture(), change the
     parameters to prepare to remove functions' dependency on
     gl_texture_image.
   - Move the call to intel_renderbuffer_set_draw_offsets() from
     intel_render_texture() into intel_udpate_wrapper().

Each time I encounter those functions, I dislike their vague names.
(Update which wrapper? What is wrapped? What is the wrapper?). So, while
I was mucking around, I also renamed the functions.

v2:
   In addition to the ``GLenum internal_format`` parameter to
   intel_wrap_miptree(), add a ``gl_format format`` parameter. This
   removes the need to recalculate for the true format from
   internal_format with ChooseNewTextureFormat, which was just weird.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:50:31 -08:00
Chad Versace
73540690f7 intel: Define intel_miptree_check_level_layer()
This is a small helper function that asserts that a given level and layer
are valid for a miptree. I will be extensively using it in the future
miptree HiZ functions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:42 -08:00
Chad Versace
3b38b33c16 intel: Remove unneeded params from intel_renderbuffer_set_draw_offset()
Since the renderbuffer tracks the miptree level and layer that it wraps,
the 'tex_image' and 'zoffset' params are no longer needed to calculate the draw
offsets.

Not only are they no longer needed, but their presence would prevent
calculating the renderbuffer draw offsets in situations where there were
no texture image. Such situations will occur during the HiZ meta-op and
during scatter/gather of separate stencil textures.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:42 -08:00
Chad Versace
24da7335b2 intel: Track the miptree layer wrapped by a renderbuffer [v2]
TODO: Make v2 for kwg.

Add two fields to intel_renderbuffer:
    mt_level
    mt_layer

Multiple renderbuffers may simultaneously wrap a single texture and each
provide a different view into that texture. [Consider
glFramebufferTextureLayer()].  The new fields indicate which slice of the
miptree is wrapped by the renderbuffer.

The buffer resolve operations, to be introduced in the future, require
these fields in order to resolve the correct slice in the miptree.

To add the fields, it was necessary to replace the type of some function
parameters from gl_texture_image to gl_renderbuffer_attachment.

v2: [kwg] Replace confusing condition `CubeMapFace > 0` with the more
    sensible `Target == GL_TEXTURE_CUBE_MAP`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:42 -08:00
Chad Versace
d7b33309fe intel: Kill intel_mipmap_level::nr_images [v4]
For all texture targets except GL_TEXTURE_CUBE_MAP, the 'nr_images' and
'depth' fields of intel_mipmap_level were identical.  In the exceptional
case, nr_images == 6 and depth == 1.

It is simple to determine if a texture is a cube or not, so the presence
of two fields here was not helpful. Worse, it was confusing. When we
eventually implement GL_ARB_texture_cube_map_array, this mess would have
become even more confusing.

This patch removes 'nr_images' and assigns to 'depth' a consistent
meaning: depth is the number of 2D slices at each miplevel.  The exact
semantics of depth varies according to the texture target:
   - For GL_TEXTURE_CUBE_MAP, depth is 6.
   - For GL_TEXTURE_2D_ARRAY, depth is the number of array slices. It is
     identical for all miplevels in the texture.
   - For GL_TEXTURE_3D, it is the texture's depth at each miplevel. Its
     value, like width and height, varies with miplevel.
   - For other texture types, depth is 1.

As a consequence, parameters were removed from the following function
signatures:
    intel_miptree_set_level_info
        Remove 'nr_images'.

    i945_miptree_layout
    brw_miptree_layout_texture
    brw_miptree_layout_texture_array
        Remove 'slices'.

v2:
   - Replace "It's" with "Its".
   - Remove all hunks in intel_fbo.c. The hunks were spurious and sneaked
     in during a rebase.
   - Remove unneeded hunk in intel_tex_map_image_for_swrast(). It was
     a little refactor of the for-loop's upper bound.

v4:
   In intel_miptree_get_image_offset(), document the conditions under
   which different if-branches are taken.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-22 10:35:32 -08:00
Vasily Khoruzhick
1f3c5eae5c i915g: implement RGBX and BGRX render targets
They're not supported by hw directly, but it's easy to emulate
them with a shader swizzling fixup.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
[danvet: The important thing is to write a 1 to the unused alpha
channel, the ddx is relying on this for render accel.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-11-22 17:08:13 +01:00
Brian Paul
c87d1a3c3d st/mesa: fix accum buffer allocation in st_renderbuffer_alloc_storage()
If the gallium driver doesn't support PIPE_FORMAT_R16G16B16A16_SNORM
the call to st_choose_renderbuffer_format() would fail and we'd generate
an GL_OUT_OF_MEMORY error.  We'd never get to the subsequent code that
handles software/malloc-based renderbuffers.

Add a special-case check for PIPE_FORMAT_R16G16B16A16_SNORM which is used
for software-based accum buffers.  This could be fixed in other ways but
it would be a much larger patch.  st_renderbuffer_alloc_storage() could
be reorganized in the future.

This fixes accum buffer allocation for the svga driver.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-22 06:39:41 -07:00
Chad Versace
278e77a119 intel: Refactor intel_miptree_copy_teximage()
Extract the body of the inner loop into a new function,
intel_miptree_copy_slice().

This is in preparation for adding support for separate stencil and HiZ to
intel_miptree_copy_teximage(). When copying a slice of a depthstencil
miptree that uses separate stencil, we will also need to copy the
corresponding slice of the stencil miptree. The easiest way to do this
will be to call intel_miptree_copy_slice() recursively. Analogous
reasoning applies to copying a slice of a depth miptree with HiZ.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:38 -08:00
Chad Versace
c2ddde70da intel: Refactor intel_mipmap_level offsets
Add a new field, intel_mipmap_level::slice, and move the offset fields
into it. Also add some much needed documentation for these fields.

Before this patch, a separate array was allocated for the
intel_mipmap_level::{x,y}_offsets.  This was just silly; it incurred an
extra call to malloc and diminished memory locality.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:36 -08:00
Chad Versace
da2816a45e intel: Replace intel_renderbuffer::region with a miptree [v3]
Essentially, this patch just globally substitutes `irb->region` with
`irb->mt->region` and then does some minor cleanups to avoid segfaults
and other problems.

This is in preparation for
  1. Fixing scatter/gather for mipmapped separate stencil textures.
  2. Supporting HiZ for mipmapped depth textures.

As a nice benefit, this lays down some preliminary groundwork for easily
texturing from any renderbuffer, even those of the window system.

A future commit will replace intel_mipmap_tree::hiz_region with a miptree.

v2:
   - Return early in intel_process_dri2_buffer_*() if region allocation
     fails.
   - Fix double semicolon.
   - Fix miptree reference leaks in the following functions:
       intel_process_dri2_buffer_with_separate_stencil()
       intel_image_target_renderbuffer_storage()

v3:
   - [anholt] Fix check for hiz allocation failure. Replace
     ``if (!irb->mt)` with ``if(!irb->mt->hiz_region)``.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:35 -08:00
Chad Versace
005149d586 intel: Define intel_miptree_create_for_renderbuffer()
This function creates a miptree that is suitable as storage for
a non-texture renderbuffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:34 -08:00
Chad Versace
c3c7cbd154 intel: Move inline functions from intel_fbo.h to .c
Move the following inline functions:
    intel_get_rb_region
    intel_framebuffer_has_hiz

A future commit will replace the renderbuffer's region with a miptree.
This small refactor will eliminate the need for intel_fbo.h to include
intel_mipmap_tree.h on that commit. I'd like to avoid the situation where
each header transitively includes every other header.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:33 -08:00
Chad Versace
19faa12bb7 intel: Kill intel_framebuffer_get_hiz_region()
The only user of intel_framebuffer_get_hiz_region() was
intel_framebuffer_has_hiz(). So I folded the body of the former into the
latter.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:32 -08:00
Chad Versace
7e9b3c098c intel: Temporarily disable HiZ for textures
A great refactor thrashing begins after this commit for HiZ and separate
stencil.  Removing code for texture HiZ will make that refactoring easier,
because then we don't have to maintain that code during the refactor.

To disable HiZ for textures, I've removed the hook in
intel_update_wrapper() that allocates a HiZ buffer when attaching a depth
texture to a framebuffer.

HiZ was broken for textures anyway, so there's no regression here.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:31 -08:00
Chad Versace
190aec75a4 intel: Always gather stencil buffer in intel_map_renderbuffer_separate_s8z24()
The function gathered the stencil buffer into the depth buffer only when
the map mode contained the read bit. But we must do the gather even if the
map mode is write-only. If we do not, then, when the depth buffer's stencil
bits are scattered into the stencil buffer by intel_unmap_renderbuffer(),
some of the scattered stencil bits would be invalid.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:29 -08:00
Chad Versace
af35a3523d intel: Fix swrast_render_start() for depthstencil buffers with separate stencil
1. Don't map the depthstencil buffer twice

   Place a guard in intel_renderbuffer_map() to prevent a renderbuffer
   from being mapped twice. This happened if a single buffer was attached to
   the framebuffer's depth and stencil attachment points.  (Interestingly,
   because intel_map_renderbuffer_gtt() is idempotent, the double mapping did
   not cause bugs for depthstencil buffers *without* separate stencil).

2. Stop overriding gl_framebuffer::_DepthBuffer,_StencilBuffer

   Normally, if a depthstencil buffer is attached to the framebuffer's
   depth attachment point, then _mesa_update_framebuffer() installs
   a wrapper depth renderbuffer at gl_framebuffer::_DepthBuffer. Ditto for
   the stencil attachment point and gl_framebuffer::_StencilBuffer

   A depthstencil intel_renderbuffer with separate stencil contains hidden
   depth and stencil renderbuffers, which are the *real* renderbuffers. In
   order to force swrast to work, we were installing, in
   brw_update_draw_buffer(), the hidden renderbuffers at
   gl_framebuffer::_DepthBuffer and _StencilBuffer, thus overriding the
   behavior of _mesa_update_framebuffer().  However, now that
   intel_renderbuffer_map() is implemented with MapRenderbuffer(),
   overriding _mesa_update_framebuffer's introduces bugs.  This patch
   removes the override code.

Fixes several Piglit tests on gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:28 -08:00
Chad Versace
3d2235e6c7 intel: Don't use special stencil span accessors
The special stencil span accessors, as set by intel_span_init_funcs.
perform software W detiling. Since intel_renderbuffer_map() now uses
MapRenderbuffer, rb->Data points to an *untiled* stencil buffer.

Fixes several Piglit tests on gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-21 16:58:24 -08:00
Vadim Girlin
0fe14178db r600g: handle PIPE_SHADER_CAP_OUTPUT_READ
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-21 17:38:38 -05:00
Vadim Girlin
915bcc29d4 st/mesa: use PIPE_SHADER_CAP_OUTPUT_READ
Don't replace outputs with temps when the driver supports reading outputs.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-21 17:38:38 -05:00
Vadim Girlin
40864b85aa gallium: add PIPE_SHADER_CAP_OUTPUT_READ
It's intended to indicate whether the driver/hardware supports reading
of the values written into shader outputs.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-21 17:38:37 -05:00
Yuanhan Liu
2e6402feb7 swrast: fix unmatched span->array->ChanType
texture_combine converts the result rgba to CHAN_TYPE from FLOAT. At the
same time, make sure the span->array->ChanType is changed, too.

v2: pick a nicer comment from Brian

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-21 16:32:39 +08:00
Yuanhan Liu
6ba8f0688a swrast: simplify the prototype of function texture_combine
Parameter n and rgbaChan are both from structure span, thus using span
as paramter to simplify the prototype. Function texture_combine is only
used by _swrast_texture_span, so I guess it's safe to do so.

This patch is mainly for the next patch.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-21 16:32:29 +08:00
Marek Olšák
94cd9d6be8 r300g: set max_index to 0xffffff if there are no per-vertex attribs 2011-11-20 19:29:19 +01:00
Marek Olšák
03df791c6f u_vbuf_mgr: correctly compute max vertex count from hw buffers
And update r300g.

This is different from util_draw_max_index in how it obtains vertex elements
and that it doesn't have to call util_format_description due to additional
precomputed data in vertex elements.
2011-11-20 16:24:12 +01:00
Marek Olšák
72e1117e48 u_vbuf_mgr: correctly obtain min/max_index for uploads and translate
This forks vbo_get_minmax_index. We need to know the index range when
translating non-native vertices into native ones. There is no other way
around it.
2011-11-20 16:24:12 +01:00
Marek Olšák
c95bd12bec r600g: use u_vbuf_mgr to set/get the index buffer 2011-11-20 16:24:12 +01:00
Marek Olšák
a18dad8055 r300g: use u_vbuf_mgr to set/get the index buffer 2011-11-20 16:24:12 +01:00
Marek Olšák
4cfc8c775c u_vbuf_mgr: add set_index_buffer function
It will use the index buffer soon.
2011-11-20 16:24:11 +01:00
Marek Olšák
b5b7cc19d8 u_vbuf_mgr: add comments 2011-11-20 16:24:11 +01:00
Marek Olšák
df49b0ce90 u_vbuf_mgr: don't upload user buffers which have been uploaded by translate 2011-11-20 16:24:11 +01:00
Marek Olšák
dd2227e3fd r600g: set MIN/MAX_VTX_INDX to 0 and ~0, respectively
The CS checker doesn't check the regs and the state-tracker-provided values
are not to be trusted.

This also removes the hack for non-zero index bias.
2011-11-20 16:24:11 +01:00
Marek Olšák
496a3dab5f r300g: always set VF_MIN_VTX_INDX to 0
It's not really useful to have non-zero there.
2011-11-20 16:24:11 +01:00
Kenneth Graunke
bdffb941d3 i965: Remove unused file brw_fallback.h. 2011-11-19 14:40:26 -08:00
Marek Olšák
b781fc88b0 gallium/docs: remove obsolete documentation 2011-11-19 20:58:37 +01:00
Marek Olšák
ec174a4244 mesa: set the gl_FragDepth layout in the GLSL linker
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-19 17:35:49 +01:00
Marek Olšák
90be99427a glsl: when cloning a variable, copy the depth layout too
This fixes AMD_conservative_depth.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 16:46:59 +01:00
Brian Paul
038a7dfcaa mesa: handle MapRenderbuffer() failures in glReadPixels
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:08 -07:00
Brian Paul
72fb25cefb mesa: make slow_read_rgba_pixels() a void function
The boolean return value was ignored by the caller.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:07 -07:00
Brian Paul
2efa3d4f9f mesa: define, use _mesa_is_cube_face() in several places
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-19 07:28:07 -07:00
Ben Skeggs
16f2e7e0fb nvc0: add support for GF119 (NVD9)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-11-18 15:45:54 -08:00
Brian Paul
a43908fe62 st/mesa: rewrite the primitive restart fallback code
Previously we were mapping/unmapping the index buffer each time we
found the restart index in the buffer.  This is bad when the restart
index is frequently used.  Now just map the index buffer once, scan
it to produce a list of sub-primitives, unmap the buffer, then draw
the sub-primitives.

Also, clean up the logic of testing for indexed primitives and calling
handle_fallback_primitive_restart().  Don't call it for non-indexed
primitives.

v2: per Jose, only map the relevant part of the index buffer with
pipe_buffer_map_range()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-18 07:39:14 -07:00
Ian Romanick
08b288be8e docs: Add 7.11.1 release md5sums
(cherry picked from commit 228da884c9)
2011-11-17 12:15:10 -08:00
Ian Romanick
6306245fc6 docs: Add news items for 7.11 and 7.11.1 releases 2011-11-17 12:00:40 -08:00
Ian Romanick
92e512230b docs: Import 7.11 release notes from branch 2011-11-17 12:00:40 -08:00
Ian Romanick
b3aaafc74c docs: Import 7.11.1 release notes from branch 2011-11-17 12:00:40 -08:00
Eric Anholt
7e84a64dd0 i965/gen4: Fix sampling from integer textures.
On original gen4, the surface format didn't determine the return data
type from sampling like it does on g45 and later.

Fixes GL_EXT_texture_integer/texture_integer_glsl130

Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-17 08:31:55 -08:00
Vadim Girlin
0cddea37b2 r600g: don't change the order of writes in merge_inst_group
Merge may produce incorrect order of operations for r600-eg:

	x: inst1 R0.x, ... ;  //from current group
	...
	t: inst0 R0.x, ... ;  //from previous group, same destination

Result of inst1 will be lost.

So compare destinations and don't allow this.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-17 09:10:37 -05:00
Michel Dänzer
4b1205d53b Revert "read_rgba_pixels: Don't force clamping if the renderbuffer is normalized."
This reverts commit b11c16752a.

Breaks at least luminance destination formats.
2011-11-17 15:04:40 +01:00
Michel Dänzer
b11c16752a read_rgba_pixels: Don't force clamping if the renderbuffer is normalized.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-17 10:46:44 +01:00
Ben Skeggs
4517153278 nvc0: add support for GF119 (NVD9)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-11-17 10:17:06 +10:00
Brian Paul
f4c03da327 mesa: initialize stencilMap, Stride if stencilRb==depthRb 2011-11-16 14:16:29 -07:00
Ian Romanick
010dc29283 mesa: Only update sampler uniforms that are used by the shader stage
Previously a vertex shader that used no samplers would get updated (by
calling the driver's ProgramStringNotify) when a sampler in the
fragment shader was updated.  This was discovered while investigating
some spurious code generation for shaders in Cogs.  The behavior in
Cogs is especially pessimal because it ping-pongs sampler uniform
settings:

    glUniform1i(sampler1, 0);
    glUniform1i(sampler2, 1);
    draw();
    glUniform1i(sampler1, 1);
    glUniform1i(sampler2, 0);
    draw();
    glUniform1i(sampler1, 0);
    glUniform1i(sampler2, 1);
    draw();
    // etc.

ProgramStringNotify is still too big of a hammer.  Applications like
Cogs will still defeat the shader cache.  A lighter-weight mechanism
that can work with the shader cache is needed.  However, this patch at
least restores the previous behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-16 08:37:44 -08:00
Brian Paul
f6a50c0b1f mesa: don't map depth+stencil buffer twice in glReadPixels()
In slow_read_depth_stencil_pixels_separate() we might have separate
depth and stencil buffers or a combined buffer.  In the later case,
don't map the buffer twice.  This function is used when the depth
scale/bias pixel transfer values are not the defaults.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=42963

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-16 08:49:22 -07:00
Kenneth Graunke
728a830fae i965: Fix inconsistent indentation in brw_gs_emit.c. 2011-11-16 00:57:35 -08:00
Kenneth Graunke
5e3e9a8e9c glsl: Add missing textureSize(samplerCubeShadow, int) variant.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-16 00:57:33 -08:00
Yuanhan Liu
4f677ca5f9 mesa: do not skip att and spot calculation for infinite light
glspec doesn't say that we should skip the attenuation and spot
calculation for infinite light(Ppli.w == 0). Instead, it gives a same
formula to do the light calculation for both finite light and infinite
light(see page 62 of glspec 2.1.pdf)

Also from the formula (2.4) at page 62 of glspec 2.1.pdf, we can skip
attenuation calculation if Ppli.w == 0.

This would fix all the intel oglc l_sed fail subcases and introduces no
intel oglc regressions.

v2: fix an wrong intendation(comments from Brian).

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Acked-by: Brian Paul <brianp@vmware.com>
2011-11-16 11:31:04 +08:00
Yuanhan Liu
099c4e372d mesa: make sure all lighting tables are updated before the computation
Make sure all lighting tables are updated before using the table to
calculate something, say using _SpotExpTable to calculate
_VP_inf_spot_attenuation.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-16 11:20:49 +08:00
Eric Anholt
d4df6318a1 mesa: Fix a couple of missed conversion to arrays in format_unpack.
Fixes regression in piglit:
ARB_color_buffer_float/GL_RGBA16F-getteximage
ARB_color_buffer_float/GL_RGBA16F-readpixels
ARB_color_buffer_float/GL_RGBA32F-getteximage
ARB_color_buffer_float/GL_RGBA32F-readpixels

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-15 17:38:41 -08:00
Eric Anholt
2bf9aeaa19 mesa: Include R/RG integer textures in _mesa_is_integer_format.
Fixes some spurious GL errors in the upcoming
gl-3.0-required-sized-formats piglit test.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-15 16:23:56 -08:00
Chad Versace
79653c12d6 intel: Fix separate stencil in builtin DRI2 backend
intelAllocateBuffer() was oblivious to separate stencil buffers.  This
patch fixes it to allocate a non-tiled stencil buffer with special pitch,
just as the DDX does.

Without this, any app that attempted to create an EGL surface with stencil
bits would crash. Of course, this affected only environments that used the
builtin DRI2 backend, such as Android and Wayland.

Fixes GLBenchmark2.1 on Android on gen7.

Note: This is a candidate for the 7.11 branch.
Tested-by: Louie Tsaie <louie.tsai@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Chad Versace
50b3356078 intel: Fix region dimensions for stencil buffers received from DDX
I changed the dimensions of the stencil buffer's region, as allocated by
the DDX, at xf86-video-intel commit
   commit 3e55f3e88b40471706d5cd45c4df4010f8675c75
   dri: Do not tile stencil buffer
But I forgot to make the analogous update to the Intel DRI2 glue in Mesa.
This patch makes that update.

Surprisingly, the mismatch did not cause any bugs. But the mismatch, if
left unfixed, *would* create bugs in the next commit.

Note: This is a candidate for the 7.11 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Chad Versace
dc4c3a31c6 intel: Simplify stencil detiling arithmetic
When calculating the y offset needed for detiling window system stencil
buffers, replace the term
   region->height * 2 + region->height % 2 - 1
with
   rb->Height - 1 .

The two terms are incidentally equivalent due to some out-of-date,
incorrect code in the Intel DRI2 glue for DDX. (See
intel_process_dri2_buffer_with_separate_stencil(), line ``buffer_height /=
2;``).

Note: This is a candidate for the 7.11 branch (only the intel_span.c hunk).
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 08:00:29 -08:00
Brian Paul
1161facaf9 radeon: use _mesa_readpixels() instead of _swrast_ReadPixels() 2011-11-15 08:10:24 -07:00
Brian Paul
b31bc6b543 i965: use _mesa_readpixels() instead of _swrast_ReadPixels() 2011-11-15 08:07:22 -07:00
Brian Paul
caaefe1969 mesa: convert unpack functions to operate on an array of values
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
546f76d58f mesa: new BYTE/SHORT_TO_FLOATZ() macros
Rather than redefining the BYTE/SHORT_TO_FLOAT macros, just define new
ones with different names.  These macros preserve zero when converting.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
b098e1af1c mesa: move CEILING() macro into macros.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
bef4b42938 mesa: remove unused macros in macros.h
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
83863d468e mesa: consolidate cases in _mesa_components_in_format()
and _mesa_sizeof_packed_type()

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
6dbf2bac50 swrast: fix glReadPixels from texture attachment
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42635
2011-11-15 07:49:26 -07:00
Brian Paul
d0836eda5e st/mesa: check for missing VBO in setup_interleaved_attribs()
This fixes a crash with the piglit vbo-too-small test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-15 07:49:26 -07:00
Brian Paul
438d7ac146 util/draw: replace assertions with conditionals in util_draw_max_index()
Don't assert/die if a VBO is too small.  Return zero instead.  For
debug builds, emit a warning message since this is an unusual situation
that might indicate that there's a bug in the app.

Note that util_draw_max_index() now returns max_index+1 instead of
max_index.  This lets us return zero to indicate that one of the VBOs
is too small to draw anything.

Fixes a failure with the new piglit vbo-too-small test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-15 07:49:26 -07:00
Brian Paul
94780b5ee6 st/mesa: remove most of the ReadPixels code
We can use the core Mesa code for glReadPixels now.  We just have to
validate state and flush the bitmap cache before reading.
2011-11-15 07:49:26 -07:00
Brian Paul
3754ebb33d st/mesa: remove dependencies on code in st_cb_readpixels.c
st_cb_readpixels.c is going away next.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
77c85f014a mesa: remove _swrast_ReadPixels()
We use the code in main/readpix.c now.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
bd5ba36bf7 mesa: use _mesa_readpixels() as default driver hook
Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
d2a23d4ded mesa: move swrast ReadPixels code into core Mesa
The swrast ReadPixels code has no dependencies on swrast since moving
to Map/UnmapRenderbuffer().  We'll be able to remove s_readpix.c and
remove the state tracker's glReadPixels code next.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:26 -07:00
Brian Paul
e0e454943c st/mesa: check renderbuffer orientation in st_MapRenderbuffer()
We'll soon be able to use these for a core Mesa implementation of
glReadPixels.

Acked-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
371b1648ab mesa: remove support for software alpha buffers
This was only used by the xlib driver to add an alpha channel to the
front/window color buffer.  This was no longer going to work well with
the move to direct mapping of renderbuffers.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
6c6803f28d xlib: remove xm_image.[ch] files
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
bc63b226bc xlib: remove a ton of old xlib driver cruft
The days of 1-bpp, 8-bpp and dithering are long behind us.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
c9bfad2921 xlib: use MESA_FORMAT_XRGB8888 for pixmap surfaces
We no longer have software-allocated alpha buffers so we can forget
about the alpha channel.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
dff2394e08 xlib: remove software alpha buffer support
Seldom used and this won't work when we move to using Map/UnmapRenderbuffer
everywhere.  This will let us remove a bunch of core Mesa code too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-15 07:49:25 -07:00
Brian Paul
6d68855df1 mesa: replace GLstencil with GLubyte 2011-11-15 07:49:25 -07:00
Chad Versace
cc502aa941 intel: Fix intel_map_renderbuffer() for depthstencil buffers with separate stencil
For a depthstencil buffer with separate stencil,
intel_renderbuffer::region is null. (The regions are kept in hidden depth
and stencil buffers). Since the region is null, intel_map_renderbuffer()
assumed there was no data and returned a null map pointer, which in turn
was dereferenced (!) by MapRenderbuffer's caller.

This patch fixes intel_map_renderbuffer() to map the hidden depth buffer
through the GTT and return that as the mapped pointer. Also, the stencil
bits are scattered and gathered when needed.

Fixes the following Piglit tests on gen7:
    fbo/fbo-readpixels-depth-formats
    hiz/hiz-depth-read-fbo-d24s8
    hiz/hiz-stencil-read-fbo-d24s8
    EXT_packed_depth_stencil/fbo-clear-formats
    EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-blit
    EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-drawpixels
    EXT_packed_depth_stencil/fbo-depth-GL_DEPTH24_STENCIL8-readpixels
    EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8
    EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-FLOAT-and-USHORT
    EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:42:09 -08:00
Chad Versace
5365ba19db intel: Fix software detiling of system stencil buffers
If a window system stencil buffer had a region with odd height, then the
calculated y offset needed for software detiling was off by one.  The bug
existed in intel_{map,unmap}_renderbuffer_s8() and in the intel_span.c
accessors.

Fixes the following Piglit tests on gen7:
    general/depthstencil-default_fb-readpixels-24_8
    general/depthstencil-default_fb-readpixels-FLOAT-and-USHORT

Fixes SIGABRT in the following Piglit tests on gen7:
    general/depthstencil-default_fb-blit
    general/depthstencil-default_fb-copypixels
    general/depthstencil-default_fb-drawpixels-24_8
    general/depthstencil-default_fb-drawpixels-FLOAT-and-USHORT

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:42:05 -08:00
Chad Versace
87d6b35974 intel: Fix intel_unmap_renderbuffer_s8()
When gathering the temporary buffer's pixles into the gem buffer, we had
the two buffers juxtaposed. Oops.

Fixes the following Piglit tests on gen7:
   general/GL_SELECT - alpha-test enabled
   general/GL_SELECT - depth-test enabled
   general/GL_SELECT - no test function
   general/GL_SELECT - scissor-test enabled
   general/GL_SELECT - stencil-test enabled

Fixes SIGABRT in Piglit tests EXT_framebuffer_object/fbo-stencil-* on
gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:42:00 -08:00
Chad Versace
f911cac7a7 intel: Refactor intel_map_renderbuffer()
The function already implements 3 cases (map through GTT, blit to
a temporary, and detile stencil buffer to temporary), and a 4th will be
added soon: scatter/gather for depthstencil buffers using separate
stencil.  For sanity's sake, this factors each case out into its own
function.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-15 06:41:49 -08:00
Yuanhan Liu
9d4d9d34d8 ir_to_mesa: don't init unfirom if link failed
Don't call set_unfiform_initializers if link failed, or it would trigger
a GL_INVALID_OPERATION error. That's not an expected behavior of
glLinkProgram function.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-15 16:25:40 +08:00
Kenneth Graunke
f1a677cefb glsl: Always search for an exact function signature match.
Previously, we would fail to compile the following shader due to a bug
in lazy built-in importing:

    #version 130
    void main() {
        float f = abs(5.0);
        int i = abs(5);
    }

The first call, abs(5.0), would fail to find a local signature, look
through the built-ins, and import "float abs(float)".

The second call, abs(5), would find the newly imported float signature
in the local shader, and settle for that.  Unfortunately, it failed to
search the built-ins for the correct/exact signature, "int abs(int)".

Thus, abs(5) ended up being a float, causing a bizarre type error when
we tried to assign it to an int.

Fixes piglit test builtin-overload-matching.frag.

This is /not/ a candidate for stable branches, as it should only be
possible to trigger this bug using GLSL 1.30's built-in functions that
take integer arguments.  Plus, the changes are fairly invasive.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 17:18:12 -08:00
Kenneth Graunke
cdc9408266 glsl: Split code to generate an ir_call out from match_function_by_name.
match_function_by_name performs two fairly separate tasks:
1. Hunt down the appropriate ir_function_signature for the callee.
2. Generate the actual ir_call (assuming we found the callee).

Both of these are complicated.  The first has to handle exact/inexact
matches, lazy importing of built-in prototypes, different scoping rules
for 1.10, 1.20+, and ES.  Not to mention printing a user-friendly error
message with pretty-printed "maybe you meant this" candidate signatures.

The second has to deal with void/non-void functions, pre-call implicit
conversions for "in" parmeters, and post-call "out" call conversions.

Trying to do both in one function is just too unwieldy.  Time to split.

This patch purely moves the code to generate an ir_call into a separate
function and reindents it.  Otherwise, the code is identical.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-14 17:18:03 -08:00
Kenneth Graunke
861d0a5e12 glsl: Add a new matching_signature() variant that returns exact/inexact.
When matching function signatures across multiple linked shaders, we
often want to see if the current shader has _any_ match, but also know
whether or not it was exact.  (If not, we may want to keep looking.)

This could be done via the existing mechanisms:

   sig = f->exact_matching_signature(params);
   if (sig != NULL) {
      exact = true;
   } else {
      sig = f->matching_signature(params);
      exact = false;
   }

However, this requires walking the list of function signatures twice,
which also means walking each signature's formal parameter lists twice.
This could be rather expensive.

Since matching_signature already internally knows whether a match was
exact or not, we can just return it to get that information for free.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-14 17:17:39 -08:00
Marek Olšák
4f7c21899a r600g: fix the representation of control-flow instructions
We need something that looks like a compiler and not like some hacker
put some functions together. /rant

This is a band-aid for these two problems:
- The R600 and EG control-flow instructions appear in switch statements
  next to each other, causing conflicts when adding new instructions.
- The ALU control-flow instructions are bitshifted by 3 (from CF_INST 26:29
  to CF_INST 23:29, as is defined by r600 ISA) even for EG, where CF_INST
  is 22:29.

To fix this mess, the 'inst' field is bitshifted to the left either by 22, 23,
or 26 (directly in the definitions), such that it can be just or'd when making
bytecode without any shifting. All switch statements have been divided into
two, one for R600 and the other for EG.

Of course, there is a better way to do this, but that is left for future
work.

Tested on RV730 and REDWOOD with no regressions.

v2: minor cleanup as per Alex's comment.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-15 00:04:43 +01:00
Ian Romanick
fa704cc558 glsl: Remove resource count checks from ir_to_mesa and st_glsl_to_tgsi
These checks are now performed by the linker.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:53 -08:00
Ian Romanick
92f8159045 linker: Validate resource usage in the linker
This is also done in ir_to_mesa and st_glsl_to_tgsi, but that code
will be removed soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:51 -08:00
Ian Romanick
6ac895a664 linker: Count the number of uniform components used by a shader during linking
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:49 -08:00
Ian Romanick
812aa88393 linker: Count the number of samplers used by a shader during linking
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-14 11:08:28 -08:00
Eric Anholt
196c6d4adf meta: Fix restoring of fixed function texture enables.
If they were disabled on entry, and we enabled one (like for
BlitFramebuffer), we wouldn't disable it on the way out.  Retain the
attempted optimization here (don't keep calling to set each bit for
changes that won't matter) by just setting the bits directly with
appropriate flushing.

Fixes misrendering on the second draw of piglit fbo-blit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-14 09:26:53 -08:00
Eric Anholt
95a826bed3 meta: Don't forget to flag state when restoring texobjects.
It's unlikely that we changed the object but no other texture
parameter, but be correct anyway.  Noticed by inspection.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-14 09:26:53 -08:00
Christoph Bumiller
da1544b39e st/mesa: fix system value to semantic mapping
Broken by addition of SYSTEM_VALUE_VERTEX_ID in
919c53e87a.
2011-11-14 18:14:02 +01:00
Christoph Bumiller
e7ccd703a2 gallium: add TGSI_SEMANTIC_VERTEXID 2011-11-14 18:12:46 +01:00
Vadim Girlin
a2bcaba1cd r600g: mask write for fake VS export components 2011-11-14 11:11:54 -05:00
Vadim Girlin
dcdc062dda r600g: fix op3 & write in merge_inst_groups 2011-11-14 11:11:31 -05:00
Alex Deucher
ebecbbc2e6 r600g: set max max tex/vtx instructions count to 16 for cayman
Cayman is 16 as well.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-14 11:01:00 -05:00
Vadim Girlin
c32ca6d9c1 r600g: set max tex/vtx instructions count to 16 for evergreen
According to evergreen-isa doc 16 is max value for evergreen.
More than 16 doesn't work for me.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-14 10:59:53 -05:00
Fabio Pedretti
8f55f5b77b radeon: further cleanup of shared code
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-14 10:54:19 -05:00
Alex Deucher
494d005390 radeon: add some missing FireMV pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-14 09:57:05 -05:00
José Fonseca
8f9fc8b9d2 mesa/st: Flush stdout after pritingin the GLSL.
Otherwise it gets all garbled with stderr.
2011-11-14 14:43:25 +00:00
José Fonseca
b0cdeda4f2 glsl: Add missing ';' in action statement.
Addresses the warnings:

  warning: a `;' might be needed at the end of action code
  warning: future versions of Bison will not add the `;'
2011-11-14 14:14:45 +00:00
José Fonseca
ab3ace56c4 llvmpipe: Silent warnings about undeclared llvmpipe_check_render_cond. 2011-11-14 13:50:33 +00:00
José Fonseca
6246c217ec util: Avoid signed/unsigned comparison in u_trim_pipe_prim(). 2011-11-14 10:06:01 +00:00
José Fonseca
d7edd5db31 llvmpipe: Remove unused variables.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:01 +00:00
José Fonseca
c88f3e0374 llvmpipe: Make more resilient to out-of-memory situations.
Most of the code was alright, but we were missing a few paths.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:01 +00:00
José Fonseca
9e29cdbe95 draw: Handle failure to allocate aligned_constant_storage.
Also, actually update const_storage_size, therefore avoiding to
unnecessarily reallocate aligned_constant_storage every single time
draw_vs_set_constants() is called.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:00 +00:00
José Fonseca
e21c5157b6 gallivm: Remove duplicate statement.
ary_ge_arx_arz is already set earlier.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-14 10:06:00 +00:00
José Fonseca
34930facfe gallivm: Include stddef.h before the LLVM C++ headers.
Necessary with build against LLVM 2.6, with recent gcc, as LLVM headers
depend on ptrdiff_t but don't properly include stddef.h
2011-11-14 10:06:00 +00:00
Dave Airlie
b04d19da10 llvmpipe: fix unswizzle of packed float types.
I messed up adding the ubyte->float conversion.

This fixes getteximage-formats

https://bugs.freedesktop.org/show_bug.cgi?id=42837

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-14 09:35:17 +00:00
Alex Deucher
579c04e42e r600g: properly handle cayman in is_alu_vec_unit_inst()
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-13 17:46:01 -05:00
Vadim Girlin
3d441153a1 r600g: fix cb offset for flushed_depth_texture
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:27:16 -05:00
Vadim Girlin
d5e91a2364 r600g: fix stencil buffer ref counting on evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:25:16 -05:00
Vadim Girlin
8e366dc365 r600g: lazy load for AR register
Emit MOVA* instruction only when AR is used.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:10:02 -05:00
Vadim Girlin
88a140cd19 r600g: include INTERP_[XY|ZW] in is_alu_vec_unit_inst
This will disallow moving them to the trans slot in merge_inst_groups

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:09:59 -05:00
Morgan Armand
54346d1f9b glcpp: Add GL_ARB_draw_instanced #define. 2011-11-12 12:39:51 -08:00
Kenneth Graunke
b618e78897 i965: Don't try to normalize cubemap coordinates for textureSize.
Although textureSize is represented as an ir_texture with op == ir_txs,
it doesn't have a coordinate, so normalizing it doesn't make sense.

Fixes crashes in oglconform glsl-bif-tex-size basic.samplerCube.* tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-12 00:56:20 -08:00
Chad Versace
bf8ad170c5 mesa: Fix glFramebufferTexture*() for depth and stencil attachments
This patch solves three bugs.

1. When a texture was attached to the GL_DEPTH_STENCIL_ATTACHMENT point,
Mesa attached the texture only to the depth attachment point
    gl_framebuffer::Attachment[BUFFER_DEPTH]
and failed to attach it to the stencil attachment point
    gl_framebuffer::Attachment[BUFFER_STENCIL]

2. When a texture was attached to the GL_DEPTH_ATTACHMENT point and then
later attached to the GL_STENCIL_ATTACHMENT point, Mesa created two
separate renderbuffer wrappers. This caused a GL error in
glGetFramebufferAttachmentParameteriv().

3. Same as 2, but with depth and stencil juxtaposed.

Fixes Piglit test ARB_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL

Note: This is a candidate for the stable branches.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-11 12:28:22 -08:00
Eric Anholt
8727807f7e i965: Expose GLSL 1.30 on gen6+.
With the gl_VertexID support, everything required should now be
supported.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:28:12 -08:00
Eric Anholt
1c65abb211 i965: Add support for gl_VertexID and gl_InstanceID.
The compiler setup for these VF-uploaded attributes looks a little
cheesy with mixing system values and real VBO-sourced attributes.  It
would be nice if we could just compute the ATTR[] map to GRF index up
front and use it at visit time instead of using ir->location in the
ATTR file.  However, we don't know the reg_offset at
visit(ir_variable *) time, so we can't do the mapping that early.

Fixes piglit vertexid test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:59 -08:00
Eric Anholt
9472f66776 i965: Replace a should-never-happen fallback with asserts where it matters.
We only allow 16 vec4s of attributes in our GLSL/ARB_vp programs, and
1 more element will get used for gl_VertexID/gl_InstanceID.  So it
should never have been possible to hit this fallback, unless there was
another bug.  If you do hit this, you're probably using gl_VertexID
and falling back to swrast won't work for you anyway.

This also updates the limits for gen6+.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:54 -08:00
Eric Anholt
919c53e87a mesa: Make gl_VertexID be a system value like gl_InstanceID.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:51 -08:00
Eric Anholt
44fc3c6c1c glsl: Move builtin_variables.h into .cpp.
This used to be script-generated, but now it's just a bunch of static
variables in a .h file for no good reason.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:27:49 -08:00
Eric Anholt
ab5c2622b6 glsl: Move ir_variable.cpp to builtin_variables.cpp.
It's only about builtins, not variables in general.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-11 08:21:34 -08:00
Mathias Fröhlich
8ca76386f5 state_tracker: remove written but never used variable. 2011-11-11 17:00:00 +01:00
Dave Airlie
2f98ac473b radeon: fix build.
I had a later patch remove this code, but cherry-picked across it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-11 15:55:52 +00:00
Dave Airlie
88ec12539a radeon: drop unused constant_cliprect field 2011-11-11 15:04:53 +00:00
Dave Airlie
0dd6bdf632 radeon: disable texobj state for 3d texture
for 3d texture fallback, disable the texobj state.

Signed-off-by : Dave Airlie <airlied@redhat.com>
2011-11-11 15:04:53 +00:00
Dave Airlie
99109e9fe0 radeon: use meta bitmap
Now that the stride bug is fixed, enable Bitmap via meta mode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-11 15:04:52 +00:00
Dave Airlie
beb3e81b86 radeon: fix bug with wrong stride being used for rectangluar textures.
This broke the meta bitmap code when it was enabled.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-11 15:04:52 +00:00
Brian Paul
ba3b9fad60 i965: remove #include of api_noop.h 2011-11-11 07:23:45 -07:00
Brian Paul
6e9b1d5d0d xlib: set alpha to 0xff when mapping RGB pixmaps
Fixes a bunch of conform regressions.
2011-11-11 07:13:00 -07:00
Brian Paul
16bff7e2ce swrast: avoid calling _mesa_get_srgb_format_linear() inside a loop 2011-11-11 07:12:59 -07:00
Brian Paul
0f3f6cf02b swrast: remove bogus assertion
It would fail for images that were never allocated (and wouldn't be
used during rendering).
2011-11-11 07:12:55 -07:00
Brian Paul
871dc64869 svga: don't crash/assert if we fail to allocate a vertex buffer
v2: check if pipe_buffer_map() returns NULL, and return NULL from
svga_vbuf_render_map_vertices().  Per Jose's suggestion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-11 07:10:56 -07:00
Brian Paul
aa66130682 draw: handle out of memory conditions
If the vbuf backend fails to allocate a vertex buffer, don't crash
or assert.
2011-11-11 07:10:56 -07:00
Brian Paul
7288bfb2a4 util: check for null vertex buffer object in blit code
Don't crash if we fail to allocate a vertex buffer.
2011-11-11 07:10:56 -07:00
Brian Paul
2551ff5900 st/mesa: fix OOM failure in bitmap code 2011-11-11 07:10:56 -07:00
Brian Paul
97dedfda5f vbo: better handling of VBO allocation failures
Previously, if we failed to allocate a VBO (either for display list
compilation or immediate mode rendering) we'd eventually segfault
when trying to map the non-existant buffer or in a glVertex/Color/etc
call when we hit a null pointer.

Now we don't try to map non-existant buffers and if we do fail to
allocate a VBO we plug in no-op functions for glVertex/Color/etc
so we don't segfault.
2011-11-11 07:10:56 -07:00
Brian Paul
e6c4159372 mesa: replace api_noop.[ch] with vbo_noop.[ch]
None of the code in api_noop.c was used anymore.  The new vbo_noop.c
functions are true no-ops.  They'll be used to no-op glBegin/End functions
when we run out of VBO memory.
2011-11-11 07:10:56 -07:00
Brian Paul
cd30c28e3b vbo: pull some code from api_noop.c into vbo module
Only a handful of functions from api_noop.c are actually used by
the VBO module.  Move them to the VBO module.  With this change,
none of the code in api_noop.c is actually used anymore.
2011-11-11 07:10:56 -07:00
Brian Paul
6ba0ba09b4 mesa: remove ancient, unused gl_free_control_points prototoype 2011-11-11 07:10:55 -07:00
Brian Paul
9c0d7828d2 docs: add another viewperf issue 2011-11-11 07:10:55 -07:00
Kenneth Graunke
9ae10e9cbd i965: Make Gen6+ renderbuffer surface updates not depend on NEW_COLOR.
NEW_COLOR is only needed on Gen4-5 as brw_update_renderbuffer_surfaces
only uses ctx->Color when intel->gen < 6.

This should reduce unnecessary state updates.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
d46dfed958 i965: Reorder state atom lists so all the surface state is together.
Not strictly necessary, but seems like a good idea.

Suggested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
a17a78a212 glsl: Handle constant expressions involving ir_binop_equal/nequal.
Constant expressions which called GLSL's equal() and notEqual()
built-ins on bvecs would hit an assertion failure; we simply forgot to
implement them for booleans.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
83d0514f1f glsl: Remove textureGradOffset built-ins taking samplerCube parameters.
These simply don't exist in the 1.30 specification---none of the Offset
variants allow samplerCube.  This must have been a cut and paste error
from textureGrad, which /does/ allow cubemaps.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
6a77f36ad9 glsl: Fix misnamed textureProjOffset prototypes in built-in profiles.
Due to a cut and paste error, these were accidentally misnamed
textureProj() rather than textureProjOffset().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
2eb43bbb77 glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.
From the GLSL 1.30 spec, section 8.7 "Texture Lookup Functions":
"In all functions below, the bias parameter is optional for fragment
 shaders.  The bias parameter is not accepted in a vertex shader."

This was a cut and paste mistake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
51b1d412ec i965: Put a proper sampler count in 3DSTATE_VS.
See similar code for 3DSTATE_WM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
29fc0d8c8a i965: Upload SAMPLER_STATE pointers for the VS on Ivybridge.
See similar code in gen7_wm_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
32dfa6e5ef i965: Move and rename "wm sampler" fields to just "sampler".
brw_wm_samplers actually enables any active samplers regardless of what
pipeline stage is using them, so it doesn't make much sense for it to be
WM-specific.  So, rename it to "brw_samplers."

To properly generalize it, move sampler_count and sampler_offset from
brw_context::wm to a new brw_context::sampler that can be shared without
looking strange.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
91043c21f9 i965: Clean up code for VS pull constant surface creation.
Like for the WM pull constants, we can merge the former prepare/emit
stages into one tracked state atom.  Furthermore, the code that used to
handle the binding table was removed in the last commit, leaving some
rather silly looking short functions that can easily be folded in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
e7c29c5de8 i965: Use a single binding table for all pipeline stages.
Although the hardware supports separate binding tables for each pipeline
stage, we don't see much advantage over a single shared table.

Consider the contents of the binding table:
- Textures (16)
- Draw buffers (8)
- Pull constant buffers (1 for VS, 1 for WM)

OpenGL's texture bindings are global: the same set of textures is
available to all shader targets.  So our binding table entries for
textures would be exactly the same in every table.

There are only two pull constant buffers (not many), and although draw
buffers aren't interesting to the VS, it shouldn't hurt to have them in
the table.  The hardware supports up to 254 binding table entries, and
we currently only use 26.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
4a42bd3931 i965: Split brw_wm_surfaces state into renderbuffer and texture atoms.
First, the texturing setup code is relevant for all pipeline stages,
while renderbuffer surfaces are only used by the WM.

Secondly, renderbuffer and texture setup depends on a different set of
dirty bits.  There's no reason to walk the array of textures when
changing draw buffers, or vice-versa.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
a7d0fa209b i965: Combine the two WM pull constant tracked state atoms.
These were only split for historical reasons: brw_wm_constants used to
be the "prepare" step, while brw_wm_constant_surface was "emit".  Now
that both happen at emit time, it makes sense to combine them.

Call the newly combined state atom "brw_wm_pull_constants" to indicate
help distinguish it from the Gen6+ atoms that handle push constants.

Finally, remove the BRW_NEW_WM_CONSTBUF dirty bit entirely now that it's
never flagged nor used.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
f3e9ccb3bc i965: Rename gen6_*_constants tracked state atoms to "push_constants".
When reading the "brw_wm_constants" and "gen6_wm_constants" atoms
side-by-side, I initially failed to notice the crucial difference:
the Gen6 atoms are for Push Constants, while brw_wm_constants handles
Pull Constants.  (Gen4/5 Push Constants are handled by "brw_curbe.")

Renaming these should clarify the code and save me from constant
confusion over the fact that "gen6_wm_constants" isn't just a newer
version of "brw_wm_constants."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
e4b1c9b4be i965: Remove nr_surfaces computation from brw_update_wm_surfaces.
This code is fairly fragile, as it depends on the ordering of the
entries in the binding table, which will change soon.

Also, stop listening on the BRW_NEW_WM_CONSTBUF dirty bit as it's no
longer required.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
6ba9090ea0 i965: Use 0 for the number of binding table entries in 3DSTATE_(VS|WM).
These fields control how many entries the hardware prefetches into the
state cache, so they only impact performance, not correctness.  However,
it's not clear how to use this in a way that's beneficial.

According to the documentation, kernels "using a large number" of
entries may wish to program this to zero to avoid thrashing the cache;
it's unclear how many is too many.  Also, Ironlake's WM was missing this
feature entirely---the count had to be zero.

The dirty bit tracking to handle this complicates the surface state
and binding table setup; removing it should simplify things and make
future refactoring easier.  So just set 0 for the number of entries
rather than trying to compute and track it.

Appears to have no impact on Nexuiz and OpenArena on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
0983c6869b i965: Remove outdated comment about CACHE_NEW_SURF_BIND dirty bit.
The comment states that brw_update_vs_constant_surface produces a
CACHE_NEW_SURF_BIND dirty bit, but it doesn't.   In fact, that bit
no longer even exists.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
d1d86dc55c i965: Remove BRW_NEW_NR_VS_SURFACES dirty bit from brw_vs_surfaces.
brw_vs_surfaces _produces_ the BRW_NEW_NR_VS_SURFACES dirty bit, so it
makes no sense for it to subscribe to it.

Fixes an assertion failure in many piglit tests when INTEL_DEBUG is set:
  brw_state_upload.c:484: void brw_upload_state(struct brw_context *):
  Assertion `!check_state(&examined, &generated)' failed.

One such piglit test is vs-uniform-array-mat2-col-rd.shader_test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
7c057f2360 i965: Add missing CACHE_NEW_WM_PROG dirty bit to WM pull constants.
Comparing brw_upload_vs_pull_constants and brw_upload_wm_pull_constants,
it became evident that something was amiss: the VS code had both
CACHE_NEW_VS_PROG and BRW_NEW_VERTEX_PROGRAM, while the WM code was
missing the CACHE_NEW_WM_PROG flag.

Not observed to fix anything, but likely necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:18 -08:00
Kenneth Graunke
c3e3903a90 i965: Use new vtable entries for surface state updating functions.
Now that we have vtable entries in place, we should use them.  This
allows us to drop the cut and pasted Gen7 brw_tracked_state atoms as
they now do exactly the same thing as their brw_wm_surface_state
counterparts.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:18 -08:00
Kenneth Graunke
5d448b42b7 i965: Add new vtable entries for surface state updating functions.
Gen7+ SURFACE_STATE is different from Gen4-6, so we need separate
per-generation functions for creating and updating it.  However, the
usage is the same, and callers just want to utilize the appropriate
functions with minimal pain.  So, put them in the vtable.

Since these take a brw_context pointer and are only used on Gen4, just
add a forward declaration.  This is the simplest (if not cleanest)
solution.  It would be nicer to have a i965-specific vtable, but that's
a refactor for another day.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:18 -08:00
Marek Olšák
b8428e6335 r600g: don't set the query result to 0 after a call to get_query_result
get_query_result doesn't reset the result. Only begin_query does.
2011-11-11 00:08:01 +01:00
Marek Olšák
72c1658554 r600g: the type of OCCLUSION_PREDICATE result should be boolean 2011-11-11 00:03:52 +01:00
Brian Paul
3800fe800b mesa: silence uninitialized var warning 2011-11-10 16:00:46 -07:00
Brian Paul
3da5196263 radeon: silence initializer warnings 2011-11-10 16:00:46 -07:00
Brian Paul
1462114475 draw/llvm: silence uninitialized variable warnings 2011-11-10 16:00:46 -07:00
Brian Paul
fe5ba5da7e radeon: silence unused var warnings 2011-11-10 16:00:46 -07:00
Brian Paul
2e15f0c860 egl: silence unused var warning 2011-11-10 16:00:46 -07:00
Wayne E. Robertz
beef101eb3 mklib: fix static lib building by filtering out -L, -l options
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-10 16:00:46 -07:00
Marek Olšák
b999be8374 r600g: implement PIPE_QUERY_OCCLUSION_PREDICATE 2011-11-10 23:11:57 +01:00
Marek Olšák
083482d493 r300g: fix query result of GPU_FINISHED 2011-11-10 22:58:34 +01:00
Marek Olšák
c5ae81652d r300g: implement PIPE_QUERY_GPU_FINISHED 2011-11-10 22:53:54 +01:00
Marek Olšák
014b3aa07d r300g: implement PIPE_QUERY_OCCLUSION_PREDICATE 2011-11-10 22:53:54 +01:00
Dave Airlie
4fd485666a llvmpipe/u_format: add support for EXT_texture_shared_exponent + EXT_packed_float
These two are fairly unique types so add specific cases for decoding them.

Passes piglit fbo-clear-format and fbo-generatemipmap-format tests for these
two extensions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 20:37:55 +00:00
Dave Airlie
ab14915dce llvmpipe: add NV_conditional_render support.
This ports the softpipe NV_conditional_render support to llvmpipe.

This passes the nv_conditional_render-* piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 20:32:13 +00:00
Marek Olšák
dbd24b5df6 r600g: remove useless texture barrier 2011-11-10 18:49:26 +01:00
Marek Olšák
ec3d2c7f08 r600g: flush the whole context when CS is full, not just hw_context
Because we disable render condition in r600_flush, but not in r600_context_flush.
2011-11-10 18:48:23 +01:00
Marek Olšák
6a490149d9 r600g: turn some CS overflow checks into assertions
They're not really exhaustive and not so useful either.
2011-11-10 18:09:10 +01:00
Marek Olšák
5222e16e2b r600g: put the rest of CS overflow checks in r600_need_cs_space 2011-11-10 18:09:10 +01:00
Marek Olšák
30a570e450 r600g: flush caches regardless of render condition
What if somebody enables render condition just before we flush...
2011-11-10 18:09:10 +01:00
Marek Olšák
578b211be6 r600g: disable render condition at the end of CS, re-enable at the beginning 2011-11-10 18:09:10 +01:00
Marek Olšák
9564185b0a r600g: don't suspend queries if they have already been suspended by blitter
And add some assertions.
2011-11-10 18:09:10 +01:00
Marek Olšák
cb7c6c30d0 r600g: properly reserve CS space for queries_suspend 2011-11-10 18:09:10 +01:00
Marek Olšák
1d09831253 r600g: reserve CS space for a draw command in begin_query and render_condition
There's no point in emitting those if you can't emit a draw command too.
2011-11-10 18:09:10 +01:00
Marek Olšák
11bdd28796 r600g: consolidate checking whether CS is full
This adds a new function r600_need_cs_space. Currently, it's easy to overflow
the CS - queries are not counted in. I guess that's not the only case where
the driver may crap out.
2011-11-10 18:09:09 +01:00
Dave Airlie
216be4120d radeon: fix tex1d-border2d
Fixes pigit test with T wrap usage.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 15:49:40 +00:00
Dave Airlie
c8fb700f2b radeon: fix 3-coordinate swtcl emission
This fixes mipmap generation on swtcl rv100.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 15:49:40 +00:00
Eric Anholt
11a90af1ef swrast: Add support for glReadPixels() to integer types.
With this change, i965 passes
GL_EXT_texture_integer/fbo_integer_precision_clear

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
e34c9edcda mesa: Add support for unpacking 32-bit integer formats to int spans.
This is the inverse operation to _mesa_pack_rgba_span_int.  The 16-bit
code isn't done because of lack of testing and not being sure how sign
extension/clamping should be handled between, say, 16-bit int and
32-bit int or uint.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
84277cb7d3 meta: Add support for glClear() to integer color buffers.
This requires using a new fragment shader to get the integer color
output, and a new vertex shader because #version has to match between
the two.

v2: Clarify that there's no need for BindFragDataLocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-11-09 12:59:20 -08:00
Eric Anholt
42c5552b0e i965: Claim to support rendering to integer FBOs.
We're missing support for the software paths still, but basic
rendering is working.

v2: Override RGB_INT32/UINT32 to not be renderable, since the hardware
    can't do it but we do allow texturing from it now.  Drop the
    DataType override, since the _mesa_problem() isn't in that path
    any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-11-09 12:59:20 -08:00
Eric Anholt
6d874d0ee1 i965/fs: Add support for user-defined out variables.
Before, I was tracking the ir_variable * found for gl_FragColor or
gl_FragData[].  Instead, when visiting those variables, set up an
array of per-render-target fs_regs to copy the output data from.  This
cleans up the color emit path, while making handling of multiple
user-defined out variables easier.

v2: incorporate idr's feedback about ir->location (changes by Kenneth Graunke)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
e988d816e1 i965/fs: Preserve the source register type when doing color writes.
When rendering to integer color buffers, we need to be careful to use
MRFs of the correct type when emitting color writes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:20 -08:00
Eric Anholt
e19dfc75b6 i965: Make brw_type_for_base_type return the element type for arrays.
Previously, brw_type_for_base_type returned UD for array variables,
similar to structures.  For structures, each field may have a different
type, so every field access must explicitly override the register's type
with that field's type.  We chose to return UD in this case since it was
the least common, so errors would be more obvious.

For arrays, it makes far more sense to return the type corresponding to
an element of the array.  This allows normal array access to work
without the hassle of explicitly overriding the register's type.

This should obsolete a bunch of type overrides throughout the code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:19 -08:00
Eric Anholt
a00c5a71cd i965: Enable ChooseTexFormat for supported GL_EXT_texture_integer formats.
v2: s/GL_TRUE/true/, and re-enable RGB_INT32 based on discussion
    yesterday about required RB formats vs texture formats.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2011-11-09 12:59:19 -08:00
Eric Anholt
35be4ae77e i965: Add mapping from MESA_FORMAT to BRW_SURFACEFORMAT for integer.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:59:09 -08:00
Eric Anholt
704b7551e8 intel: Expose GL_EXT_texture_integer when GL 3.0 override is set.
This will let the feature be incrementally developed, hidden behind
the flag we're all using as we work on GL 3.0 support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:38:58 -08:00
Eric Anholt
6e610a0485 docs: Note EXT_texture_array on i965.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:38:30 -08:00
Eric Anholt
e56aecf249 i965: Add support for 16-bit unorm L, A, and I textures.
While not required by any particular spec version, mplayer was asking
for L16 and hoping for actual L16 without checking.  The 8 bits
allocated led to 10-bit planar video data stored in the lower 10 bits
giving only 2 bits of precision in video.  While it was an amusing
effect, give them what they actually wanted instead.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41461

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-09 12:04:39 -08:00
Eric Anholt
b5444a6ebd intel: Don't _mesa_problem when asked for an RB of a texturing-only type.
We want to be able to support some formats for texturing that we can't
render to, which means that some choices for RenderbufferStorage end
up being incomplete (for example, L8 currently).  For these, where we
don't render to them, we don't want to have to make up an rb->DataType
that's only used for GetRow()/PutRow().
2011-11-09 12:04:39 -08:00
Paul Berry
01ccddbed6 r200: remove dangling radeon.h symlink.
Commit 1401b96b (radeon: cleanup radeon shared code after r300 and
r600 classic drivers removal) removed the file
src/mesa/drivers/dri/radeon/server/radeon.h, but it left behind the
symlink which was used to share that file into the
src/mesa/drivers/dri/r200/server directory.

This patch removes the dangling symlink.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-11-09 11:26:27 -08:00
Paul Berry
871ddb919b glsl: Assign transform feedback varying slots in linker.
This patch modifies the GLSL linker to assign additional slots for
varying variables used by transform feedback, and record the varying
slots used by transform feedback for use by the driver back-end.

This required modifying assign_varying_locations() so that it assigns
a varying location if either (a) the varying is used by the next stage
of the GL pipeline, or (b) the varying is required by transform
feedback.  In order to avoid duplicating the code to assign a single
varying location, I moved it into its own function,
assign_varying_location().

In addition, to support transform feedback in the case where there is
no fragment shader, it is now possible to call
assign_varying_locations() with a consumer of NULL.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
2011-11-09 11:12:47 -08:00
Ian Romanick
6f5c737970 glsl: Clamp vector indices when lowering to swizzles
This prevents other code from seeing a swizzle of the 16th component
of a vector, for example.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Christian Holler <choller@mozilla.com>
2011-11-09 10:50:35 -08:00
José Fonseca
1d1c0fa2f3 scons: Disable deprecated POSIX name MSVC warnings. 2011-11-09 10:33:21 +00:00
José Fonseca
63e7a4c6e5 mesa,glsl,mapi: Put extern "C" { ... } where appropriate.
Probably a several places missing, but enough to cover all headers
(in)directly included by uniform_query.cpp, and fix the MSVC build.
2011-11-09 10:24:37 +00:00
José Fonseca
f4b42aa5b7 scons: Don't list m_xform.c twice. 2011-11-09 10:24:37 +00:00
José Fonseca
9b8ee08248 glu: Fix deprecated conversion from string constant to ‘char*’ warning. 2011-11-09 10:24:37 +00:00
Marek Olšák
60302f83e2 r600g: clarify meaning of one variable in shader codegen
It's easier to read now.
2011-11-09 00:18:53 +01:00
Marek Olšák
1b375f8413 r600g: cosmetic changes in query code
Mainly updating comments and removing one use of a magic number.
2011-11-09 00:18:53 +01:00
Marek Olšák
8187ad0754 r600g: use modulo for computing index into query (ring) buffers 2011-11-09 00:18:53 +01:00
Marek Olšák
552e90bd6a r600g: make r600_query_result more generic
We'll soon start adding new query types, maybe even querying more than
one value per query.
2011-11-09 00:18:52 +01:00
José Fonseca
4eb3225b38 Remove tgsi_sse2.
tgsi_exec is simple. llvm is fast. tgsi_sse2 ends up being neither.
2011-11-08 22:57:34 +00:00
Brian Paul
207a016eca mesa: fix signed/unsigned integer comparison warnings
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-08 13:51:50 -07:00
Brian Paul
fab8882273 glsl: remove trailing comma to silence warning 2011-11-08 13:51:50 -07:00
Ian Romanick
59012c3133 mesa: Implement glGetFragDataLocation
Fixes piglit's getfragdatalocation test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-08 11:10:11 -08:00
Ian Romanick
b12b5d9ab5 linker: Use app-specified fragment data location during linking
Fixes piglit's bindfragdata-link-error.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-08 11:10:11 -08:00
Ian Romanick
4464a4b27b mesa: Stub implementation of glBindFragDataLocation
This just validates the input parameters so far.

Fixes piglit's bindfragdata-invalid-parameters test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-08 11:10:07 -08:00
Morgan Armand
0a0d820f7b softpipe: don't clamp or do logical operations on floating-point buffers.
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-08 08:36:39 -07:00
Vinson Lee
3210cad3f2 st/mesa: Fix memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 20:41:21 -08:00
Vinson Lee
f4515d106c st/dri: Fix memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 20:36:07 -08:00
Dan McCabe
5c02e2e2de glsl: Generate IR for switch statements
Up until now modifying the GLSL compiler has been pretty straightforward.
This is where things get interesting. But still pretty straightforward.

Switch statements can be thought of a series of if/then/else statements.
Case labels are compared with the value of a test expression and the case
statements are executed if the comparison is true.

There are a couple of aspects of switch statements that complicate this simple
view of the world. The primary one is that cases can fall through sequentially
to subsequent case, unless a break statement is encountered, in which case,
the switch statement exits completely.

But break handling is further complicated by the fact that a break statement
can impact the exit of a loop. Thus, we need to coordinate break processing
between switch statements and loop statements.

The code generated by a switch statement maintains three temporary state
variables:
    int test_value;
    bool is_fallthru;
    bool is_break;

test_value is initialized to the value of the test expression at the head of
the switch statement. This is the value that case labels are compared against.

is_fallthru is used to sequentially fall through to subsequent cases and is
initialized to false. When a case label matches the test expression, this
state variable is set to true. It will also be forced to false if a break
statement has been encountered. This forcing to false on break MUST be
after every case test. In practice, we defer that forcing to immediately after
the last case comparison prior to executing a case statement, but that is
an optimization.

is_break is used to indicate that a break statement has been executed and is
initialized to false. When a break statement is encountered, it is set to true.
This state variable is then used to conditionally force is_fallthru to to false
to prevent subsequent case statements from executing.

Code generation for break statements depends on whether the break statement is
inside a switch statement or inside a loop statement. If it inside a loop
statement is inside a break statement, the same code as before gets generated.
But if a switch statement is inside a loop statement, code is emitted to set
the is_break state to true.

Just as ASTs for loop statements are managed in a stack-like
manner to handle nesting, we also add a bool to capture the innermost switch
or loop condition. Note that we still need to maintain a loop AST stack to
properly handle for-loop code generation on a continue statement. Technically,
we don't (yet) need a switch AST stack, but I am using one for orthogonality
with loop statements, in anticipation of future use. Note that a simple
boolean stack would have sufficed.

We will illustrate a switch statement with its analogous conditional code that
a switch statement corresponds to by examining an example.

Consider the following switch statement:
	switch (42) {
	case 0:
	case 1:
		gl_FragColor = vec4(1.0, 2.0, 3.0, 4.0);
	case 2:
	case 3:
		gl_FragColor = vec4(4.0, 3.0, 2.0, 1.0);
		break;
	case 4:
	default:
		gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
	}

Note that case 0 and case 1 fall through to cases 2 and 3 if they occur.

Note that case 4 and the default case must be reached explicitly, since cases
2 and 3 break at the end of their case.

Finally, note that case 4 and the default case don't break but simply fall
through to the end of the switch.

For this code, the equivalent code can be expressed as:
	int test_val = 42; // capture value of test expression
	bool is_fallthru = false; // prevent initial fall through
	bool is_break = false; // capture the execution of a break stmt

	is_fallthru |= (test_val == 0); // enable fallthru on case 0
	is_fallthru |= (test_val == 1); // enable fallthru on case 1
	is_fallthru &= !is_break; // inhibit fallthru on previous break
	if (is_fallthru) {
		gl_FragColor = vec4(1.0, 2.0, 3.0, 4.0);
	}

	is_fallthru |= (test_val == 2); // enable fallthru on case 2
	is_fallthru |= (test_val == 3); // enable fallthru on case 3
	is_fallthru &= !is_break; // inhibit fallthru on previous break
	if (is_fallthru) {
		gl_FragColor = vec4(4.0, 3.0, 2.0, 1.0);
		is_break = true; // inhibit all subsequent fallthru for break
	}

	is_fallthru |= (test_val == 4); // enable fallthru on case 4
	is_fallthru = true; // enable fallthru for default case
	is_fallthru &= !is_break; // inhibit fallthru on previous break
	if (is_fallthru) {
		gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
	}

The code generate for |= and &= uses the conditional assignment capabilities
of the IR.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:22 -08:00
Dan McCabe
85beb39e14 glsl: Reference data structure ctors in grammar
We now tie the grammar to the ctors of the ASTs they reference.

This requires that we actually have definitions of the ctors.

In addition, we also need to define "print" and "hir" methods for the AST
classes. The Print methods are pretty simple to flesh out. However, at this
stage of the development, we simply stub out the "hir" methods and flesh
them out later.

Also, since actual class instances get returned by the productions in the
grammar, we also need to designate the type of the productions that
reference those instances.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:22 -08:00
Dan McCabe
a0afcc6719 glsl: Create AST structs corresponding to new productions in grammar
Previously we added productions for:
	switch_body
	case_label_list
	case_statement
	case_statement_list
Now add AST structs corresponding to those productions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:22 -08:00
Dan McCabe
80944599dc glsl: Add productions to GLSL grammar for switch statement
The grammar is modified to support switch statements. Rather than follow the
grammar in the appendix, which allows case labels to be placed ANYWHERE
as a regular statement, we follow the development of the grammar as
described in the body of the GLSL spec.

In this variation, the switch statement has a body which consists of a list
of case statements. A case statement is preceded by a list of case labels and
ends with a list of statements.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:21 -08:00
Dan McCabe
19daba5470 glsl: Create AST data structures for switch statement and case label
Data structures for switch statement and case label are created that parallel
the structure of other AST data.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 16:31:21 -08:00
Chia-I Wu
a69da5c0ce util: add log2f for Android
It is needed for nv50's new shader backend.  With this change, both u_math.h
and imports.h in core mesa define the same function.  I have to #undef log2f
here to avoid the conflict.  Not sure if there is a better way to deal with
the situation.

Acked-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 17:04:11 -07:00
Brian Paul
2051a11823 mesa: remove prog_uniform.c from SConscript 2011-11-07 16:35:38 -07:00
Ian Romanick
be4524aeed Delete code made dead by previous uniform related patches
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:17 -08:00
Ian Romanick
c42ca36d67 mesa: Add missing check for glUniform*v count > 1 on non-array
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
719909698c mesa: Rewrite the way uniforms are tracked and handled
Switch all of the code in ir_to_mesa, st_glsl_to_tgsi, glUniform*,
glGetUniform, glGetUniformLocation, and glGetActiveUniforms to use the
gl_uniform_storage structures in the gl_shader_program.

A couple of notes:

 * Like most rewrite-the-world patches, this should be reviewed by
   applying the patch and examining the modified functions.

 * This leaves a lot of dead code around in linker.cpp and
   uniform_query.cpp.  This will be deleted in the next patches.

v2: Update the comment block (previously a FINISHME) in _mesa_uniform
about generating GL_INVALID_VALUE when an out-of-range sampler index
is specified.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
143d20c16a i965: Move _mesa_ir_link_shader call before device-specific linking
_mesa_ir_link_shader needs to be called before cloning the IR tree so
that the var->location field for uniforms is set.

WARNING: This change breaks several integer division related piglit
tests.  The tests break because _mesa_ir_link_shader lowers integer
division to an RCP followed by a MUL.  The fix is to factor out more
of the code from ir_to_mesa so that _mesa_ir_link_shader does not need
to be called at all by the i965 driver.  This will be the subject of
several follow-on patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
cfab4327c3 mesa: Add log_uniform and log_program_parameters to dump data
These were both useful debugging aids while developing this code.
log_uniform will be used to keep the MESA_GLSL=uniform behavior.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
d7a7e4fc99 ir_to_mesa: Add _mesa_associate_uniform_storage
Connects all of the gl_program_parameter structures with the correct
gl_uniform_storage structures.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
70650d08fa mesa: Add _mesa_uniform_{attach,detach_all}_driver_storage functions
These functions are used to create and destroy the connections between
a uniform and the storage used by the driver to hold its value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
9516182e80 mesa: Add _mesa_propagate_uniforms_to_driver_storage
This function propagates the values from the backing storage of a
gl_uniform_storage structure to the driver supplied data locations.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
07731ed169 linker: Track uniform locations to new tracking structures
This is just the infrastructure and the code.  It's not used yet.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
9a21d4670c mesa: Add structures for "new style" uniform tracking in shader programs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
466d5ffee4 linker: Add helper class for parcelling out backing storage to uniforms
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
57f79de6d0 linker: Add helper class for determining uniform usage
v2: Remane class count_uniform_size based on feedback from Eric:

    "Maybe just "count_uniform_size"?  "usage" makes me think "way it's
    dereferenced" or something."

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
2f45ed393a mesa: Move most of uniforms.c to uniform_query.cpp
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
65add4327d mesa: Refactor parameter validate for GetUniform, Uniform, and UniformMatrix
v2: Update a comment block about the different treatment of
location=-1 based on feedback from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
637a7eb9e9 mesa: Move {split,merge}_location_offset to uniforms.h
Prepend _mesa_uniform_ to the names and rework the calling
convention.  The calling convention was changed for a couple reasons.

1. Having a single variable named 'location' have completely different
meanings at different places in the function is confusing.  Before
calling split_location_offset the location is the encoded value
returned by glGetUniformLocation.  After calling split_location_offset
it's the index of the uniform in the gl_uniform_list::Uniforms array.

2. In a later commit the original value of 'location' is needed after
split_location_offset has been called.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
4ad460991c glsl: Add new structures for tracking uniforms in linked shaders
v2: Update some comments based on feedback from Eric Anholt.

v3: Remove gl_uniform_storage::dirty field.  Make
gl_uniform_storage::initialized be bool, and make
gl_uniform_storage::sampler be uint8_t.

v4: Include stdbool.h after Tom Stellard noticed a build failure that
was introduced by the changes in v2.  Oops.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:16 -08:00
Ian Romanick
4ad41af616 mesa: Make get_uniform available outside compilation unit
Also rename to _mesa_get_uniform.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
fa7eccb8c0 mesa: Move the link check from _mesa_get_uniform_location to _mesa_GetUniformLocationARB
There are cases where we might want to internally query the location
of a uniform in a shader that failed linking.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
f6ee7bce65 linker: Make invalidate_variable_locations available outside the compilation unit
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
68db407b20 glsl: Allow glsl_types.h to be included in C sources
Some C code will want access to the glsl_base_type and
glsl_sampler_dim enums in the near future.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
017346f403 mesa: Add string_to_uint_map::clear method to clear the map
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2011-11-07 13:33:15 -08:00
Ian Romanick
295e07ef51 mesa: Fix error generation for glClearBuffer{i ui}v with GL_DEPTH or GL_STENCIL
The spec says "Only ClearBufferiv should be used to clear
stencil buffers." and "Only ClearBufferfv should be used to clear
depth buffers."  However, on the following page it also says:

    "The result of ClearBuffer is undefined if no conversion between
    the type of the specified value and the type of the buffer being
    cleared is defined (for example, if ClearBufferiv is called for a
    fixed- or floating-point buffer, or if ClearBufferfv is called
    for a signed or unsigned integer buffer). *This is not an error.*"

Emphasis mine.

Fixes problems with piglit's clearbuffer-invalid-drawbuffer test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-07 13:32:22 -08:00
Brian Paul
f4fb0be605 mesa: fix the selection of soft renderbuffer color formats
This fixes a regression from the recent glReadPixels changes found
with the piglit hiz tests.

Use either MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV for color
buffers depending on endian-ness.  Before, the gl_renderbuffer::Format
field was MESA_FORMAT_RGBA8888 but the data was really stored as
MESA_FORMAT_RGBA8888_REV when using a little endian machine.

Getting this right matters now that we can access renderbuffer data
without going through the span functions (namely glReadPixels() +
MapRenderbuffer()).
2011-11-07 14:25:48 -07:00
Brian Paul
0ef8c0ddc7 mesa: remove unneeded soft renderbuffer format-setting code
These vars will just get overwritten when we call _mesa_add_renderbuffer()
anyway.  We only need to set the InternalFormat field when we create the
software renderbuffer.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-07 14:25:48 -07:00
Brian Paul
87ac3ae50e mesa: fix comment typo in intel_renderbuffer 2011-11-07 14:25:48 -07:00
Brian Paul
46f5ef557f intel: update intel_texture_image comment 2011-11-07 14:25:48 -07:00
Brian Paul
24524784cf intel: wrap comment and fix typo 2011-11-07 14:25:48 -07:00
Brian Paul
377eb5c30c st/mesa: first implementation of Map/UnmapRenderbuffer()
Untested, but also unused at this point.
2011-11-07 14:25:48 -07:00
Brian Paul
32c3957991 xlib: implement renderbuffer mapping/unmapping
This fixes the glReadPixels() regression for reading from the front/back
color buffers.

Note, we only allow one mapping of an XImage/Pixmap renderbuffer
at any time.  That might need to be revisited in the future.
2011-11-07 14:25:47 -07:00
Brian Paul
68c3d21b68 mesa: check for immutable texture in _mesa_test_texobj_completeness()
One of the points of GL_ARB_texture_storage is to make it impossible
to have malformed mipmap stacks.  If we know the texture object is
immutable, we can skip a bunch of size checking.
2011-11-07 14:25:47 -07:00
Brian Paul
b64dc2a275 swrast: update program type assertion
Fixes bogus failed assertion when using NV_fragment_program, such
as with demos/fplight.c

Note: This is a candidate for the 7.11 branch.
2011-11-07 14:25:47 -07:00
Brian Paul
af734468fe st/mesa: clean-up st_translate_interp() 2011-11-07 14:25:47 -07:00
Brian Paul
0d05422c20 st/mesa: add some null pointer checking to better handle out of memory
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-07 13:25:46 -07:00
Morgan Armand
245edfb005 st/mesa: fix memory leaks
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-07 13:25:46 -07:00
Morgan Armand
33ca21fc3c st/mesa: fix indentation
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-07 13:25:46 -07:00
Morgan Armand
89d6044b7b softpipe: fix memory leaks
This series of patches is a splitted version of my previous one, as suggested by Brian.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-07 13:25:46 -07:00
Kenneth Graunke
dceb202297 i965: Fix Sandybridge regression introduced by workaround-free math.
Commit a73c65c534 had a typo which
accidentally enabled the workaround-free Gen7 code on Gen6.

Fixes GPU hangs in anything using pow() or integer division/modulus.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 12:09:02 -08:00
Kenneth Graunke
a73c65c534 i965: Enable faster workaround-free math on Ivybridge.
According to the documentation, Ivybridge's math instruction works in
SIMD16 mode for the fragment shader, and no longer forbids align16 mode
for the vertex shader.

The documentation claims that SIMD16 mode isn't supported for INT DIV,
but empirical evidence shows that it works fine.  Presumably the note
is trying to warn us that the variant that returns both quotient and
remainder in (dst, dst + 1) doesn't work in SIMD16 mode since dst + 1
would be sechalf(dst), trashing half your results.  Since we don't use
that variant, we don't care and can just enable SIMD16 everywhere.

The documentation also still claims that source modifiers and
conditional modifiers aren't supported, but empirical evidence and
study of the simulator both show that they work just fine.

Goodbye workarounds.  Math just works now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-07 11:03:22 -08:00
Marek Olšák
97534d92e2 mesa: add missing checks to compute_version
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-07 13:19:58 +01:00
Fabio Pedretti
1401b96bb9 radeon: cleanup radeon shared code after r300 and r600 classic drivers removal
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-07 09:21:38 +00:00
Kenneth Graunke
4abba27ae0 i965: Fix struct vs class warnings in brw_fs_vector_splitting.cpp.
Makes clang happier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-06 23:02:27 -08:00
Dave Airlie
0d8deb5bc9 llvmpipe: fix typo in the depth sampling aos code.
Just found by reading llvmpipe code for no great reason.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 22:32:04 +00:00
Dave Airlie
73c6657596 llvmpipe: enable RGTC after u_format fix.
The two piglit tests pass + render correctly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 22:32:04 +00:00
Dave Airlie
f0d1b5f41a u_format: fix RGTC support in fits 8unorm.
Signed RGTC won't fit in a unorm, so don't allow them.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 22:32:04 +00:00
Chia-I Wu
8b64b86a65 scons: add CPP_SOURCES for nv50/nvc0 2011-11-06 14:38:23 -07:00
Chia-I Wu
ad156efe39 android: add CPP_SOURCES for nv50/nvc0 2011-11-06 14:38:23 -07:00
Chia-I Wu
917b8e3814 android: reorder nouveau pipe drivers
To match targerts/dri-nouveau, and to fix a potential

  "undefined reference to `nv50_ir::getTargetNVC0(unsigned int)'"

error.
2011-11-06 14:38:23 -07:00
Dave Airlie
2318443ebd gl3.txt: update for ARB_texture_storage.
As per Brian's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 19:39:36 +00:00
Dave Airlie
391e33ffbf r600g: add initial linestipple support.
It seems line loop stipple in hardware needs something I don't know, it might
need a proper geometry shader who knows.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-06 12:54:27 +00:00
Christian Inci
3031708e64 gallivm: change sys::getHostTriple to sys::getDefaultTargetTriple for LLVM >= 0x0301
LLVM change r143502

Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2011-11-06 07:41:10 +00:00
Vinson Lee
adb7f1351e g3dvl: Fix memory leaks on error paths.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-05 22:09:03 -07:00
Vinson Lee
9288253051 pp: Reorder calloc to avoid memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-05 22:06:35 -07:00
Vadim Girlin
e532c710c6 r600g: move SPI setup to PS setup
SPI semantic indices for PS/VS are now static, so we don't
need to update spi config for every shaders combination. We can move
the functionality of r600_spi_update to r600(evergreen)_pipe_shader_ps.

Flatshade state is now controlled by the global FLAT_SHADE_ENA flag
instead of updating FLAT_SHADE for all inputs.

Sprite coord still requires the update of spi setup when
sprite_coord_enable is first changed from zero (enabled), and then
only when it's changed to other non-zero value (enabled for other input).
Change to zero (disabling) and back to the same value is handled via
global SPRITE_COORD_ENA.

New field "sprite_coord_enable" added to "struct r600_pipe_shader"
to track current state for the pixel shader. It's checked in the
r600_update_derived_state.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-05 17:23:29 -04:00
Vadim Girlin
5b27b63de6 r600g: precalculate semantic indices for SPI setup
There is no need to duplicate semantic mapping which is done in hw, so get
rid of r600_find_vs_semantic_index.

TGSI name/sid pair is mapped to the 8-bit semantic index for SPI.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-05 17:23:22 -04:00
Matt Turner
9f52b876f4 docs: fix grammar and punctuation in llvmpipe docs. 2011-11-05 17:11:59 -04:00
Dave Airlie
7494c814ef gl3.txt: add not of ARB_texture_storage work started. 2011-11-05 17:18:57 +00:00
José Fonseca
65d0c840b0 docs: Update llvmpipe docs.
Recommend LLVM 2.9, it has been working quite well, and unlike earlier
versions, it works out-of-the-box without patches.

Update Windows instructions.
2011-11-05 11:00:06 +00:00
Chia-I Wu
95ef069e1c configure.ac: gbm_gallium requires DRI_LIB_DEPS to link
gbm_gallium does not depend on DRI, but its build rules depend on DRI_LIB_DEPS
being set.  Output an error when the user enables gbm_gallium but disables
DRI.  This is just a workaround.
2011-11-05 15:15:21 +08:00
Chia-I Wu
0c771e260b shared-glapi: fix a linking error for SELinux
Link with -lselinux when SELinux is enabled.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41571
2011-11-05 14:42:05 +08:00
Alex Deucher
df121b868a Revert "r600g: precalculate semantic indices for SPI setup"
This reverts commit c15f8569fd.

This breaks r6xx.
2011-11-04 18:33:31 -04:00
Alex Deucher
9212637f34 Revert "r600g: move SPI setup to PS setup"
This reverts commit 9804cf3118.

This breaks r6xx.
2011-11-04 18:32:42 -04:00
Brian Paul
1ca48b3161 svga: fix varying var remapping for unused FS outputs
If the VS has outputs that aren't consumed by the FS we were mapping
them all to one unused VS output index, but that's illegal.  Instead,
map unused VS outputs to unique indexes.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-04 16:05:33 -06:00
Brian Paul
0bc15650c1 svga: add comments and reformat code in svga_tgsi_decl_sm30.c 2011-11-04 16:05:33 -06:00
Marek Olšák
d2633af696 st/mesa: set geometry shader to NULL when doing internal drawing
The code expects the geometry shader to be NULL.
We don't have geometry shaders now, but it's good to be prepared.

v2: check for support in the cso context
2011-11-04 23:01:47 +01:00
José Fonseca
794c5158b0 mesa/st: Be nice with the stack -- use malloc for large structures/arrays.
st_translate_program's data was taking 51K off the stack, causing stack
overflow on Windows.
2011-11-04 22:01:17 +00:00
George Sapountzis
cd86a5d2f8 dri: cosmetic
To smooth minor diff between dri_util & drisw_util
2011-11-04 23:33:06 +02:00
George Sapountzis
2fbba6bb90 dri_util: move drawable functions 2011-11-04 23:33:06 +02:00
George Sapountzis
2314021d60 dri_util: move context functions 2011-11-04 23:33:06 +02:00
George Sapountzis
9292ab7190 dri_util: move context functions 2011-11-04 23:33:05 +02:00
George Sapountzis
c98d15c9f5 dri_util: move screen functions
This is to reorder as screen/context/drawable similar to drisw_util
2011-11-04 23:33:05 +02:00
George Sapountzis
3e80a34315 dri: drop stray includes and typedef 2011-11-04 23:33:05 +02:00
George Sapountzis
ceda4da857 dri: move __driUtilMessage to xmlconfig.c
__driUtilMessage seems to have fallen out of favor and is only used by xmlconfig.c now
2011-11-04 23:33:05 +02:00
George Sapountzis
78c076e654 dri: drop drisw_util.h 2011-11-04 23:33:04 +02:00
George Sapountzis
96bd41b315 dri: reorder as driver,screen,context,drawable 2011-11-04 23:33:04 +02:00
George Sapountzis
e438a36d83 dri: unify __DRIcontextRec, __DRIdrawableRec 2011-11-04 23:33:04 +02:00
George Sapountzis
875a757ddd dri: unify __DRIscreenRec
Also drop DriverAPI field, this is a static symbol and I don't see why it
should be accessed through __DRIscreenRec
2011-11-04 23:33:04 +02:00
George Sapountzis
7192c37294 dri: unify __DriverAPIRec
I dropped the comments because they don't add much.
2011-11-04 23:33:04 +02:00
George Sapountzis
fc9e80fab9 dri: drop drmLock remnants 2011-11-04 23:33:03 +02:00
George Sapountzis
721669d078 dri: drop DRI_VALIDATE macros 2011-11-04 23:33:03 +02:00
Marek Olšák
c5e48025ed gallium/cso_cache: remove one call to pipe_sampler_view_reference 2011-11-04 21:56:56 +01:00
Vadim Girlin
9804cf3118 r600g: move SPI setup to PS setup
SPI semantic indices for PS/VS are now static, so we don't
need to update spi config for every shaders combination. We can move
the functionality of r600_spi_update to r600(evergreen)_pipe_shader_ps.

Flatshade state is now controlled by the global FLAT_SHADE_ENA flag
instead of updating FLAT_SHADE for all inputs.

Sprite coord still requires the update of spi setup when
sprite_coord_enable is first changed from zero (enabled), and then
only when it's changed to other non-zero value (enabled for other input).
Change to zero (disabling) and back to the same value is handled via
global SPRITE_COORD_ENA.

New field "sprite_coord_enable" added to "struct r600_pipe_shader"
to track current state for the pixel shader. It's checked in the
r600_update_derived_state.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-04 16:23:24 -04:00
Vadim Girlin
c15f8569fd r600g: precalculate semantic indices for SPI setup
There is no need to duplicate semantic mapping which is done in hw, so get
rid of r600_find_vs_semantic_index.

TGSI name/sid pair is mapped to the 8-bit semantic index for SPI.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-04 16:23:19 -04:00
José Fonseca
2df15d07c0 svga: Tighten the register file assertions.
Untested. But should fix fdo 42576.
2011-11-04 20:10:01 +00:00
Dave Airlie
26ebf9c5e1 radeon/r200: strip texture borders.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-04 17:17:17 +00:00
Dave Airlie
71f1d468b4 radeon/r200: fix r100/r200 blit to use the offsets.
This is needed to do proper renderbuffer operation on mipmaps.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-04 17:17:17 +00:00
Dave Airlie
2431c992cb radeon: drop mtface/mtlevel, use ones in base class.
This just uses the base class copies.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-04 17:17:17 +00:00
Marek Olšák
85c151f3d9 u_vbuf_mgr: avoid one call to pipe_resource_reference in most cases 2011-11-04 18:11:01 +01:00
José Fonseca
f800a29ee2 swrast: Avoid void * arithmetic.
An error with MSVC.
2011-11-04 08:54:55 +00:00
Eric Anholt
eab201bad4 i965/gen6: Improve glReadPixels() performance by blitting to a linear temp.
The readpixels microbenchmark in mesa-demos goes from 47Mpix/sec at
1000x1000 to 450Mpix/sec.  The 10x10 sizes stay about the same.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:48:07 -07:00
Eric Anholt
a1488eec38 intel: Add safety asserts for the blit engine's pitch alignment requirements.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
ac6a376f52 intel: Don't force a batchbuffer flush in readpixels.
Renderbuffer mapping handles flushing the batchbuffer if required, so
all we need to do is make sure any pending rendering has reached the
batchbuffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
e7349a55f7 radeon: Remove early dereference of src/dst width in glCopyTexSubImage.
There doesn't appear to be any particular reason for this -- it's not
like the width is changing between the deref and the use.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
d9f2add181 swrast: Drop the global mapping of buffers across glReadPixels().
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
5b1ad74824 swrast: Drop the remaining GetRow-based glReadPixels() fast-path.
In all of piglit, only two tests hit it (reading to RGBA float, where
GetRow would drop floats into place from R, RG, or RGB).  Mostly this
is because _ColorReadClamp has been causing transferOps to always be
set, skipping any fast-paths anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
91b2ce85d1 swrast: Remove dead _swrast_read_depth_span_uint().
All the code using it is converted to MapRenderbuffer and the core
unpack functions.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:53 -07:00
Eric Anholt
345fc41619 swrast: Convert color glReadPixels slow path to using MapRenderbuffer.
This may be a bit slower than before because we're switching from
per-format compiled loops in GetRow to
_mesa_unpack_rgba_block_unpack's loop around a callback to unpack a
pixel.  The solution there would be to make _mesa_unpack_rgba_block
fold the span loop into the format handlers.

(On the other hand, function call overhead will hardly matter if
MapRenderbuffer means the driver gets the data into cacheable memory
instead of uncached).

The adjust_colors code should no longer be required, since the unpack
function does the 565 to float conversion in a single pass instead of
converting it (poorly) through 8888 as apparently happened in the
past.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
3e51ef0990 swrast: Skip _swrast_validate_derived in _swrast_ReadPixels().
None of the callgraph below this uses derived state (almost nothing
even dereferences the swrast context).

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
2e82daa31b swrast: Add a readpixels fast-path based on memcpy and MapRenderbuffer.
v2: Move _mesa_get_format_bytes out of the loop.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
5f140bceda mesa: Add a function for comparing gl_format to format/type.
This should be useful in making more generic fast paths in the pixel
paths.

v2: Add note about PACK_SWAP_BYTES, and fix up for endianness by
    synchronizing with memcpy_texture paths in texstore.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
e887df9bf5 swrast: Switch the remaining depth readpixels to MapRenderbuffer.
This avoids the wrapper, which should improve performance on packed
depth/stencil drivers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
d072a5f545 swrast: Switch the remaining depth/stencil readpixels path to MapRenderbuffer.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
f53680857a swrast: MapRenderbuffer in separate depth/stencil readpixels fastpath
This introduces two new span helper functions we'll want to use in
several places as we move to MapRenderbuffer, which pull out integer
depth and stencil values from a renderbuffer mapping based on the
renderbuffer format.

v2: Use format_unpack helper for stencil read.
v3: Clean up comment after conversion to format_unpack.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
e452fbe871 swrast: Calculate image address/stride once for depth/stencil readpixels.
The fast and slow paths were doing these separately before.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
b832ac974f swrast: Make the packed depth/stencil read fastpath use MapRenderbuffer.
This also makes it handle 24/8 vs 8/24, fixing piglit
depthstencil-default_fb-readpixels-24_8 on i965.  While here, avoid
incorrectly fast-pathing if packing->SwapBytes is set.

v2: Move the unpack code to format_unpack.c, fix BUFFER_DEPTH typo
v3: Fix signed/unsigned comparison.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Eric Anholt
ff27e058bc swrast: Directly map the stencil buffer in read_stencil_pixels.
This avoids going through the wrapper that has to rewrite the data for
packed depth/stencil.  This isn't done in _swrast_read_stencil_span
because we don't want to map/unmap for each span.

v2: Move the unpack code to format_unpack.c.
v3: Fix signed/unsigned comparison.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 23:29:52 -07:00
Vinson Lee
492d223590 radeon: Fix variable initialization typo.
Fixes Coverity uninitialized scalar variable defect.
2011-11-03 20:34:02 -07:00
Paul Berry
8fad0f9998 i965: Fix constant propagation into 32-bit integer MUL.
i965's MUL instruction can't take an immediate value as its first
argument.  So normally, if constant propagation wants to propagate a
constant into the first argument of a MUL instruction, it swaps the
order of the two arguments.

This doesn't work for 32-bit integer (and unsigned integer)
multiplies, because the MUL operation is asymmetric in that case (it
multiplies 16 bits of one operand by 32 bits of the other).

Fixes piglit tests {vs,fs}-multiply-const-{ivec4,uvec4}.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-03 18:18:34 -07:00
Brian Paul
df73a70fba svga: use the draw-module's sprite stage depending on FS inputs
If we're drawing sprites and the fragment shader needs both auto-
generated texcoords and user-defined varying vars we need to use
this fallback path.
The reason is when we enable auto texcoord generation, it gets
enabled for all texcoord sets.  And that clobbers the user-defined
varying vars.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-03 17:41:08 -06:00
Brian Paul
022e270b1b svga: pass fragment shader to draw module
If we use the draw-module for wide point/line/etc drawing we'll need
a fragment shader too (like we pass in the vertex shader).

This fixes sprite point rendering when forcing the swtnl path.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-03 17:41:08 -06:00
Brian Paul
58ea42b7db svga: implement generic variable index remapping
The state tracker may generate shaders that use generic vs outputs /
fs inputs like:

DCL IN[0], GENERIC[0]
DCL IN[1], GENERIC[10]
DCL IN[2], GENERIC[11]

This patch remaps 0, 10, 11 to small integers like 1, 2, 3 so that we
stay inside the SVGA3D limit (8).

The remapping is done to both the vertex shader outputs and the
fragment shader inputs.  The same mapping must be used for a vs/fs
pair.

Note that 'union svga_compile_key' is now 'struct svga_compile_key'
because we needed to add the register remapping table.  The change in
size isn't really significant though (it's not a search key).

Also, add assertions when building up SVGA3D src/dst registers to we
don't try to store too large of value for the bitfield size.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-03 17:41:08 -06:00
Brian Paul
e814d57725 draw: assert that we have non-null fragment shader
Instead of just segfaulting.  Recently ran into this.
2011-11-03 16:56:11 -06:00
nobled
ac0ec07e6c texgetimage: add missing return on error
Missed this back in the arb_robustness branch
<6b329b9274b18c50f4177eef7ee087d50ebc1525>.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-03 15:27:08 -07:00
Brian Paul
bf5255fb30 mesa: fix texture target mix-up in NV_fragment_program parser
The returned value should be a texture target index, not a bit.
I spotted this from seeing a new compiler warning caused by the increase
in the number of texture targets.  This has been broken for a long time.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-03 15:32:19 -06:00
Ian Romanick
f37b1ad937 linker: Check that initializers for global variables match
This requires tracking a couple extra fields in ir_variable:

 * A flag to indicate that a variable had an initializer.

 * For non-const variables, a field to track the constant value of the
   variable's initializer.

For variables non-constant initalizers, ir_variable::has_initializer
will be true, but ir_variable::constant_initializer will be NULL.  The
linker can use the values of these fields to check adherence to the
GLSL 4.20 rules for shared global variables:

    "If a shared global has multiple initializers, the initializers
    must all be constant expressions, and they must all have the same
    value. Otherwise, a link error will result. (A shared global
    having only one initializer does not require that initializer to
    be a constant expression.)"

Previous to 4.20 the GLSL spec simply said that initializers must have
the same value.  In this case of non-constant initializers, this was
impossible to determine.  As a result, no vendor actually implemented
that behavior.  The 4.20 behavior matches the behavior of NVIDIA's
shipping implementations.

NOTE: This is candidate for the 7.11 branch.  This patch also needs
the preceding patch "glsl: Refactor generate_ARB_draw_buffers_variables
to use add_builtin_constant"

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34687
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Ian Romanick
d3b39194dc glsl: Refactor generate_ARB_draw_buffers_variables to use add_builtin_constant
v2: Remove int cast based on feedback from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Ian Romanick
22af08b410 glsl: Put all bitfields in ir_variable together for better packing
The diff looks weird because ir_variable::depth_layout was between the
last two bitfields in the structure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Ian Romanick
46173f9079 linker: Fix the indentation of a block in cross_validate_globals
I suspect the indentation got messed up during a code merge.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-11-03 13:36:00 -07:00
Eric Anholt
9954a93ab7 radeon: Check an error return instead of assigning it to a dead variable.
Fixes gcc set-but-unused-variable warning.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
2011-11-03 09:13:46 -07:00
Marek Olšák
ca0f515f85 r300g: force buffer placements to GTT on big endian machines 2011-11-03 16:39:40 +01:00
Maarten Lankhorst
eadbcb221d state_trackers/vdpau: Add support for VC-1 decoding
Add a struct with all the fields.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst
91d33b5c58 state_trackers/vdpau: Add mpeg4 part2 to PipeToProfile and ProfileToPipe
So it can actually be used when someone implements it. :)

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst
12bf452945 state_trackers/vdpau: Add support for MPEG4 Part 2
Just the support patch, no decoder implements it currently.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst
1eb48c5500 state_trackers/vdpau: Test if profile is supported first before trying to create decoder
So a nicer error message is returned.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst
c4d47f065a state_trackers/vdpau: Add num_slices to mpeg12 picture structure
Bitstream parsers might need that field.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:01 +01:00
Maarten Lankhorst
c9c6eec1c6 state_trackers/vdpau: Implement VdpGenerateCSCMatrix
With the smpte240 profile, which was missing.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-11-03 13:52:00 +01:00
Christian König
8a7e645c9b g3dvl: remove some stale variable increment
Incrementing "td" before initializing it is
pointless and just leads to an uninitialized
variable warning with MSVC.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-11-03 13:52:00 +01:00
Dave Airlie
c6a3026472 r600g: more integer support
just some more trivial integer changes for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-03 10:11:32 +00:00
Dave Airlie
d546dcbb1b radeon: fix some regressions in texturing code.
On a piglit run vs 7.11 this fixes 23 tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-03 10:10:07 +00:00
José Fonseca
97213fd741 scons: Use -static-libstdc++ on 32bits builds w/ Mingw-w64 too. 2011-11-03 09:59:34 +00:00
José Fonseca
3276c3d42b libgl-gdi: Mingw-w64 in 32bit mode matches the Mingw32's .DEF semantics. 2011-11-03 09:59:34 +00:00
Chia-I Wu
a56951139a docs: list GL_OES_EGL_image_external in 7.12 release notes 2011-11-03 15:09:45 +08:00
Chia-I Wu
8cd0873d31 st/mesa: add support for GL_OES_EGL_image_external
To pipe drivers, external textures are just 2D textures.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:45 +08:00
Chia-I Wu
0c87f16817 mesa: add support for GL_OES_EGL_image_external
This is an OpenGL ES specific extension.  External textures are textures that
may be sampled from, but not be updated (no glTexSubImage* and etc.).  The
image data are taken from an EGLImage.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:45 +08:00
Chia-I Wu
79463f18ac mesa: clean up validate_texture_wrap_mode
GL_TEXTURE_RECTANGLE_NV (and soon GL_TEXTURE_EXTERNAL_OES) is special.  Handle
it in its own if-block.  There should be no functional change.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:45 +08:00
Chia-I Wu
d8ba30af11 mesa: fix a logic error in glFramebufferTexture2D
Unrecognized texture target should give an error.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu
2903816aad glsl: add support for GL_OES_EGL_image_external
This extension introduces a new sampler type: samplerExternalOES.
texture2D (and texture2DProj) can be used to do a texture look up in an
external texture.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu
db73264e14 mesa: add GL_OES_EGL_image_external to the extension list
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu
1b1af84149 mesa: add missing defines for GL_OES_EGL_image_external
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu
1ab1b15e9d mesa, i965: prepare for more than 8 texture targets
3-bit fields are used store texture target in several places.  That will fail
when TEXTURE_EXTERNAL_INDEX, which happends to be the 9th texture target, is
added.  Make them 4-bit fields.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:44 +08:00
Chia-I Wu
833d707db1 glapi: regenerate files 2011-11-03 15:09:43 +08:00
Chia-I Wu
6e093935bb glapi: add entry points for OES_EGL_image_external
Only enums actually.

Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:43 +08:00
Chia-I Wu
61e81851be GLES: upgrade glext.h to revision 13240
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-03 15:09:43 +08:00
Yuanhan Liu
9f7b6a39f6 swrast: simplify the condition test for _swrast_choose_texture_sample_func
remove another long if condition test. I don't feel a strong need of
this patch. But for it make the code a little simpler(I do think so),
I send it out.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:24:28 +08:00
Yuanhan Liu
49f8447acc mesa: fix the low limit of width and height for glRenderbufferStorage
glRenderbufferStorage man page says:

  GL_INVALID_VALUE is generated if either of width or height is negative,
  or greater than the value of GL_MAX_RENDERBUFFER_SIZE.

NOTE: this is a candidate for the 7.11 branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:22:56 +08:00
Yuanhan Liu
1f5bd65efa mesa: fix inital value for new renderbuffer
EXT_framebuffer_object bspec says:

    Get Value                          Type    Get Command 		Initial Value
    -------------------------------    ------  -----------      	-----------
    RENDERBUFFER_INTERNAL_FORMAT_EXT   Z+     GetRenderbufferParameterivEXT  RGBA

NOTE: this is a candidate for the 7.11 branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:22:15 +08:00
Yuanhan Liu
77cd3bf18d mesa: complete the GL_TEXTURE_SWIZZLE* setup
The ARB_texture_swizzle spec says:
    The error INVALID_OPERATION is generated if TexParameteri,
    TexParameterf, TexParameteriv, or TexParameterfv, parameter <pname>
    is TEXTURE_SWIZZLE_R, TEXTURE_SWIZZLE_G,  TEXTURE_SWIZZLE_B,
    or TEXTURE_SWIZZLE_A, and <param> is not RED, GREEN, BLUE, ALPHA,
    ZERO, or ONE.

    The error INVALID_OPERATION is generated if TexParameteriv, or
    TexParameterfv, parameter <pname> TEXTURE_SWIZZLE_RGBA, and the four
    consecutive values pointed to by <param> are not all RED, GREEN, BLUE,
    ALPHA, ZERO, or ONE.

So, the GL_TEXTURE_SWIZZLE* pname is legal for glTexParameterf(v)

NOTE: this is a candidate for the 7.11 branch

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:19:49 +08:00
Yuanhan Liu
d9f05ac828 mesa: remove the redundant check
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-03 10:18:58 +08:00
Carl-Philip Haensch
34a5598d86 driconf: updated german translation 2011-11-02 14:28:19 -07:00
Carl-Philip Haensch
997a477d0c driconf: updated de.po 2011-11-02 14:28:19 -07:00
Morgan Armand
c7fc4067eb wglSetPixelFormat should ignore the ppfd parameter.
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-11-02 19:51:09 +00:00
Michel Dänzer
0be1f79770 r300g: Fix queries on big endian hosts.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2011-11-02 18:59:30 +01:00
Michel Dänzer
4a3be16fd2 gallium/util: Add macros for converting from little endian to CPU byte order.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-11-02 18:24:09 +01:00
Paul Berry
29e2bc8b13 i965: Add support for integral vertex attributes.
When a vertex shader input attribute is declared with an integral type
(e.g. ivec4), we need to ensure that the generated vertex shader code
addresses the vertex attribute register using the proper register
type.  (Previously, we assumed all vertex shader input attributes were
floating-point).

In addition, when uploading vertex data that was specified with
VertexAttribIPointer, we need to instruct the vertex fetch unit to
convert the data to signed or unsigned int, rather than float.  And
when filling in the implied w=1 on a vector with less than 4
components, we need to fill it in with the integer representation of 1
rather than the floating-point representation of 1.

Fixes piglit tests vs-attrib-{ivec4,uvec4}-precision.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-02 09:29:35 -07:00
Paul Berry
8f84c237b3 mesa: Set the "Integer" field of gl_client_array properly.
This patch ensures that gl_client_array::Integer is properly set to
GL_TRUE for vertex attributes specified using glVertexAttribIPointer,
and to GL_FALSE for vertex attributes specified using
glVertexAttribPointer, so that the vertex attributes can be
interpreted properly by driver back-ends.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-02 09:29:35 -07:00
Paul Berry
9abda92b27 glsl: Fix type mismatch when incrementing or decrementing uint.
When converting an expression like "++x" to GLSL IR we were failing to
account for the possibility that x might be an unsigned integral type.
As a result the user would receive a bogus error message "Could not
implicitly convert operands to arithmetic operator".

Fixes piglit tests {vs,fs}-{increment,decrement}-uint.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-02 09:28:54 -07:00
José Fonseca
a0d8e5d12a gallium/dri: Remove references to vblank. 2011-11-02 16:16:50 +00:00
Kristian Høgsberg
d14a107158 Fix gallium dri compile and a merge conflict 2011-11-02 12:01:46 -04:00
Jakob Bornecrantz
292c21bfdc svga: Tag cursors with the scanout hint
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-11-02 16:22:57 +01:00
Kristian Høgsberg
8b65c33eb8 dri: Remove unused memops.h 2011-11-02 11:16:04 -04:00
Kristian Høgsberg
6c26d998ef dri: Remove a few unused dri helper functions 2011-11-02 11:16:03 -04:00
Kristian Høgsberg
2e53f3018f dri: Remove unused dri texmem.c 2011-11-02 11:16:03 -04:00
Kristian Høgsberg
c2711cdfb6 dri: Move _dri_texformat_* to radeon_texture.c
They are only used by the r200 driver now.
2011-11-02 11:16:03 -04:00
Kristian Høgsberg
1ca2e84921 r200: Don't use driIsTextureResident helper
With DRI2, textures are always resident and using the DRI texmem helper
here is broken anyway, since nothing else uses it.
2011-11-02 11:16:03 -04:00
Kristian Høgsberg
a14bb89d3f dri: Drop unused dri renderbuffer helper functions 2011-11-02 11:16:03 -04:00
Kristian Høgsberg
c467db4cc7 dri: Move driUpdateFramebufferSize to dri_util.c
drirenderbuffer.[ch] is going bye-bye.
2011-11-02 11:16:03 -04:00
Kristian Høgsberg
90de3b9d96 dri: Remove unnecessary #defines and #includes 2011-11-02 11:16:02 -04:00
Kristian Høgsberg
e9beaf65fd dri: Remove unnecessary timestamp pointer indirection 2011-11-02 11:16:02 -04:00
Kristian Høgsberg
e8ed01f693 dri: Remove unused fields from __DriverAPIRec 2011-11-02 11:16:02 -04:00
Kristian Høgsberg
03855bc2ac dri: Remove dri2.enabled flag
DRI2 is always enabled now.
2011-11-02 11:16:01 -04:00
Kristian Høgsberg
a2ea34d705 dri: Remove DRI1 fields from DRI structs 2011-11-02 11:16:01 -04:00
Kristian Høgsberg
1837fb8e7c dri: Remove remaining DRI1 vblank code 2011-11-02 11:16:01 -04:00
Kristian Høgsberg
d24b81e0e0 dri: Remove cliprect information from __DRIdrawable 2011-11-02 11:16:00 -04:00
Kristian Høgsberg
24002daf01 dri: Drop unused driCalculateSwapUsage 2011-11-02 11:16:00 -04:00
Kristian Høgsberg
8e6c22136f dri: Remove unused driIntersectArea 2011-11-02 11:15:59 -04:00
Kristian Høgsberg
bfb6f9e690 dri: Drop __driUtilUpdateDrawableInfo and helper macros 2011-11-02 11:15:59 -04:00
Kristian Høgsberg
6260618b29 dri: Remove unused driSwapBuffers 2011-11-02 11:15:59 -04:00
Kristian Høgsberg
e78f7b8b44 dri: Drop unused driCreateNewContext 2011-11-02 11:15:58 -04:00
Kristian Høgsberg
f5ba7662bd dri: Fold driCreateNewDrawable into dri2CreateNewDrawable 2011-11-02 11:15:58 -04:00
Kristian Høgsberg
c786debe98 dri: Remove unsused driCreateNewScreen 2011-11-02 11:15:58 -04:00
Kristian Høgsberg
d02bd705fb dri: Remove unused __DRIswapInfoRec 2011-11-02 11:15:57 -04:00
Kristian Høgsberg
73ec71cb16 dri: Remove driMediaStreamCounterExtension
Also DRI1-only.
2011-11-02 11:15:57 -04:00
Kristian Høgsberg
759cbb751b dri: Remove driSwapControlExtension
DRI1-only as well.
2011-11-02 11:15:57 -04:00
Kristian Høgsberg
8e898e83c6 dri: Drop driCopySubBufferExtension
Another DRI1-only extension.
2011-11-02 11:15:56 -04:00
Kristian Høgsberg
ad32215871 dri: Drop driReadDrawableExtension
All DRI2 drivers support setting a separate read drawable.
2011-11-02 11:15:56 -04:00
Kristian Høgsberg
3203912600 dri: Drop driLegacyExtension
There are no DRI1 drivers left.
2011-11-02 11:15:56 -04:00
George Sapountzis
0c425ac18c st/dri/sw: add get_image inline helper similar to put_image
TODO: check if GetImage works with passing the pitch as width, similar to PutImage,
which avoids the extra copy, ala dri_sw_displaytarget_display() in src/gallium/winsys/sw/dri/dri_sw_winsys.c
2011-11-02 17:07:59 +02:00
Benjamin Franzke
31156c07b0 st/dri/sw: Fix incorrect cast
Missed one casting error due to rebase for commit
98aa2a8f72.
2011-11-02 15:56:23 +01:00
Benjamin Franzke
98aa2a8f72 st/dri/sw: Implement texture_from_pixmap
This is a cleanup of commit 02f1b50987.

Update tex buffer using a dri_drawable hook from implemented in sw/drisw.c.
This saves us the duplication of dri_drawable.c.

CC: Stuart Abercrombie <sabercrombie@chromium.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
2011-11-02 15:43:27 +01:00
Benjamin Franzke
0a2afcb754 Revert "Duplicate state_tracker/dri/sw/dri_drawable.c"
This reverts commit 569bde1fa7.

CC: Stuart Abercrombie <sabercrombie@chromium.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
2011-11-02 15:43:26 +01:00
Benjamin Franzke
5da7c5e364 Revert "state_trackers/dri/sw: Implement texture_from_pixmap."
This reverts commit 02f1b50987.

CC: Stuart Abercrombie <sabercrombie@chromium.org>
CC: Stéphane Marchesin <marcheu@chromium.org>
2011-11-02 15:43:26 +01:00
Alex Deucher
0a2c4889cb r600g: add comment about special shader exports
Certain exports (position, point size, etc.) are treated
specially by the shader and not counted as generic exports.

Note the exports and any relevant related state bits.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-02 09:47:40 -04:00
Vadim Girlin
16c0a3a972 r600g: take into account PSIZE output for spi mapping
Skip PSIZE and POSITION when counting VS outputs.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=42435

Tested without regressions on evergreen.

NOTE: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-02 09:47:10 -04:00
José Fonseca
e8f646fa7e svga: Update state prototypes to return pipe_error.
Fixes a bunch of prototype mismatch warnings..
2011-11-02 11:18:35 +00:00
Jeremy Huddleston
666c70ce8e Build fix for -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-11-01 21:04:51 -07:00
Yuanhan Liu
81d5195a61 intel: fix potential segfault error
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-02 11:14:53 +08:00
Eric Anholt
8524be3fb4 swrast: Use MapRenderbuffer for glReadPixels(GL_DEPTH_COMPONENT) fast-paths.
This fixes issues with the code playing fast and loose with types of
buffers, and as a bonus avoids the wrappers that were previously used
to pull bits out of packed depth/stencil buffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
789cb3435c mesa: Make unpack_uint_z_row return 32 bits of data.
Some of the return values were u32, some were 24 bits, and z16
returned 16 bits.  The caller would have to do all the work of
interpreting the format all over again.  However, there are no callers
of this function at this point.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
4b8f4e7ce1 nouveau: Add implementation of MapRenderbuffer.
Perhaps the easiest implementation, nouveau can directly map buffers
even if tiled, and uses separate surfaces for its texture
renderbuffers so we don't have to worry about that offset.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
425b8d54b8 radeon: Add implementation of MapRenderbuffer.
Unlike intel, we do a blit to/from GTT memory in order to
untile/retile the renderbuffer data, since we don't have fence
registers for accessing it.

(There is software tiling code in radeon_tile.c, but it's unused and
doesn't support macro tiling)

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:18 -07:00
Eric Anholt
bae10c0d2e intel: Use MapRenderbuffer in spans setup.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:17 -07:00
Eric Anholt
92054cd94e intel: Add an implementation of MapRenderbuffer.
v2: Add separate stencil S8 W-tile swizzling/deswizzling.  Tested for
    the swizzling case with env INTEL_SEPARATE_STENCIL=1 INTEL_HIZ=1
    ./bin/hiz-depth-stencil-test-fbo-d24-s8
v3: Apply Chad's fix for S8 window system buffers.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-11-01 15:42:17 -07:00
Eric Anholt
6b341662b3 intel: Improve the debug info for renderbuffer allocation. 2011-11-01 15:42:17 -07:00
Eric Anholt
76d1275474 Add MapRenderbuffer implementations for software drivers.
Mesa core's is generic for things like osmesa.

For swrast_dri.so, we have to do Y flipping.  The front-buffer path
isn't actually tested, though, because both before and after it fails
with a BadMatch in XGetImage.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:17 -07:00
Eric Anholt
a25a452fbe mesa: Add a driver hook for mapping renderbuffers.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-01 15:42:17 -07:00
Eric Anholt
15b58d8c22 Revert "intel: Drop the immediate validation of the texture object in TFP."
This reverts commit abaebcee78.

The assertion I made was that "the zero-copy code in validation" would
zero copy.  Of course, I deleted that check back in January because
the two sites that would trigger it (glTexImage() and this one) both
immediately bound their mt to the object, making the other check
pointless.

Removes two extra blits in glx-tfp.  Also fixed the Android home
screen, which wasn't rendering because the extra copy broke the
relationship between the texture and the eglimage.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42152
Tested-by: Chad Versace <chad@chad-versace.us>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-11-01 15:42:17 -07:00
Brian Paul
689df24503 mesa: make save_EndConditionalRender param list (void) to silence warning 2011-11-01 16:39:37 -06:00
Brian Paul
f6fa34f7ad postprocess: remove const qualifiers on unsigned int parameters
to match the prototype in postprocess.h
2011-11-01 16:39:37 -06:00
Chia-I Wu
45568faba2 scons: include src/glsl/Makefile.sources
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-11-02 06:36:58 +08:00
Chia-I Wu
fb0e4a23fa android: include src/glsl/Makefile.sources
This also fixes the build error due to missing link_uniforms.cpp in the source
lists.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>

[olv: the missing link_uniforms.cpp was added before this patch is committed]
2011-11-02 06:36:24 +08:00
Chia-I Wu
dfdb34b7c1 glsl: Refactor source lists to Makefile.sources
With the hope that Android.mk and SConscript can share the file to reduce
future breakage.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-11-02 06:34:39 +08:00
Vinson Lee
3d6d443481 mesa: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.
2011-11-01 14:41:24 -07:00
Adam Jackson
6d3d0ca9e9 drisw: Enable SGI_make_current_read for direct contexts
Equivalent to glXMakeContextCurrent, which had better already work since
we advertise GLX 1.3.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-11-01 13:52:48 -04:00
Thomas Hellstrom
dc4ef91601 st/xa: Add a scanout flag for surfaces
Bump minor to signal availability.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-11-01 18:18:14 +01:00
Eugeni Dodonov
48a4b9b70c Build link_uniforms for android
Otherwise android-x86 build fails.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-11-01 15:05:24 -02:00
José Fonseca
a1b737d72f llvmpipe: Re-advertise support for stencil formats...
"no fetch_rgba_float for uint formats" => "llvmpipe does not support uint formats"

"stencil == uint" => "llvmpipe does not support stencil"
2011-11-01 12:28:47 +00:00
José Fonseca
0cbb49aff5 llvmpipe: Use -1 instead of ~0 for "no slot".
As the value of unsigned ~0 depends on the bit-width.

Fixes fdo 42411.
2011-11-01 11:29:31 +00:00
Marek Olšák
4a0afa2c3b docs: update relnotes-7.12 2011-11-01 11:37:11 +01:00
Nicholas Miell
66389bb99d dri/nouveau: Enable NV_fog_distance on NV10 and NV20 hardware
Add support for NV_fog_distance to the NV10 and NV20 drivers.

[ Francisco Jerez: Fix fog coord. signedness for
  GL_EYE_RADIAL_NV/GL_EYE_PLANE on nv20 ]
2011-11-01 11:37:11 +01:00
Nicholas Miell
64cebb6c83 st/mesa: Enable NV_fog_distance for Gallium drivers
The fixed-function generated vertex program is all that's needed for
Gallium drivers.
2011-11-01 11:37:11 +01:00
Nicholas Miell
fadd5e1b00 mesa: Add NV_fog_distance to the fixed-function vertex program generator
This is all that is needed to implement NV_fog_distance on programmable
hardware.
2011-11-01 11:37:10 +01:00
Nicholas Miell
740467dd62 mesa: Add the basics for the NV_fog_distance extension
No driver implements it yet.
2011-11-01 11:37:10 +01:00
José Fonseca
7f08248c2e ralloc: Use _vscprintf on MinGW.
MinGW uses MSVC's runtime DLLs for most of C runtime's functions, and
there has same semantics for vsnprintf.

Not sure how this worked until now -- maybe one of the internal
vsnprintf implementations was taking precedence.
2011-11-01 08:47:39 +00:00
José Fonseca
e33447aac6 svga: Fix potential buffer overflow in rs draw state.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-31 21:33:04 +00:00
José Fonseca
0f26c6ae3f llvmpipe: Remove unsed variables. 2011-10-31 19:40:54 +00:00
José Fonseca
7ff247712d util: Add missing initializer. 2011-10-31 19:40:54 +00:00
Paul Berry
9734bd0560 i965: Fix flat integral varyings.
Previously, the vertex and fragment shader back-ends assumed that all
varyings were floats.  In GLSL 1.30 this is no longer true--they can
also be of integral types provided that they have an interpolation
qualifier of "flat".

This required two changes in each back-end: assigning the correct type
to the register that holds the varying value during shader execution,
and assigning the correct type to the register that ties the varying
value to the rest of the graphics pipeline (the message register in
the case of VS, and the payload register in the case of FS).

Fixes piglit tests fs-int-interpolation and fs-uint-interpolation.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-31 11:29:44 -07:00
Paul Berry
fa0066ae2b mesa: Add glsl_type::get_scalar_type() function.
This function is similar to get_base_type(), but when called on
arrays, it returns the scalar type composing the array.  For example,
glsl_type(vec4[]) => float_type.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-31 11:29:14 -07:00
Paul Berry
f40c6b2a99 i965/gen6+: Switch GLSL from ALT to IEEE floating point mode
i965 graphics hardware has two floating point modes: ALT and IEEE.  In
ALT mode, floating-point operations never generate infinities or NaNs,
and MOV instructions translate infinities and NaNs to finite values.
In IEEE mode, infinities and NaNs behave as specified in the IEEE 754
spec.

Previously, we used ALT mode for all vertex and fragment programs,
whether they were GLSL programs or ARB programs.  The GLSL spec is
sufficiently vague about how infs and nans are to be handled that it
was unclear whether this mode was compliant with the GLSL 1.30 spec or
not, and it made it very difficult to test the isinf() and isnan()
functions.

This patch changes i965 GLSL programs to use IEEE floating-point mode,
which is clearly compliant with GLSL 1.30's inf/nan requirements.  In
addition to making the Piglit isinf and isnan tests pass, this paves
the way for future support of the ARB_shader_precision extension.

Unfortunately we still have to use ALT floating-point mode when
executing ARB programs, because those programs require 0^0 == 1, and
i965 hardware generates 0^0 == NaN in IEEE mode.

Fixes piglit tests "isinf-and-isnan fs_fbo", "isinf-and-isnan vs_fbo",
and {fs,vs}-{isinf,isnan}-{vec2,vec3,vec4}.
2011-10-31 11:24:03 -07:00
Paul Berry
ede60bc467 glsl: Add isinf() and isnan() builtins.
The implementations are as follows:

isinf(x) = (abs(x) == +infinity)
isnan(x) = (x != x)

Note: the latter formula is not necessarily obvious.  It works because
NaN is the only floating point number that does not equal itself.

Fixes piglit tests "isinf-and-isnan fs_basic" and "isinf-and-isnan
vs_basic".
2011-10-31 11:24:03 -07:00
Paul Berry
b6f32bbe12 glsl: Add '.ir' extension to builtin IR files
This patch adds the extension '.ir' to all the files in
src/glsl/builtins/ir/, and changes generate_builtins.py so that it no
longer globs on '*' to find the files to build.  This prevents
spurious files (such as EMACS' infamous *~ backup files) from breaking
the build.
2011-10-31 11:24:03 -07:00
Paul Berry
b726639e1b glsl: Fix copy-paste error in constant_expression_value(ir_binop_nequal)
The implementation of ir_binop_nequal in constant_expression_value()
appears to have been copy-and-pasted from the implementation of
ir_binop_equal, but with all instances of '==' changed to '!='.  This
is correct except for one minor flaw: one of those '==' operators was
in an assertion checking that the types of the two arguments were
equal.  That one needs to stay an '=='.

Fixes piglit tests {fs,vs}-inline-notequal.
2011-10-31 11:24:03 -07:00
Brian Paul
d09b1109d4 docs: list GL_ARB_texture_storage in 7.12 release notes 2011-10-31 10:52:57 -06:00
Brian Paul
414e183ed7 mesa: add note about immutable textures for _mesa_test_texobj_completeness() 2011-10-31 10:52:57 -06:00
Brian Paul
12d69fca09 swrast: implement GL_ARB_texture_storage 2011-10-31 10:52:57 -06:00
Brian Paul
e0a0496971 st/mesa: implement GL_ARB_texture_storage 2011-10-31 10:52:57 -06:00
Brian Paul
2ace9ffc8e mesa: plug in dispatch functions for GL_ARB_texture_storage 2011-10-31 10:52:57 -06:00
Brian Paul
29eb2e8944 mesa: compile new texstore.c file 2011-10-31 10:52:56 -06:00
Brian Paul
a7d9e449f0 mesa: init extension entry for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
7d577d703d mesa: display list dispatch for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
a0d736b3b7 mesa: new glTexImage error checks for GL_ARB_texture_storage
If the texture memory was allocated with glTexStorage1/2/3D() we can
only change the image data with glTexSubImage calls.
2011-10-31 10:52:56 -06:00
Brian Paul
fbc419314e mesa: glGetTexParameter support for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
a8fcb7927b mesa: implement new functions for GL_ARB_texture_storage
This is the glTexStorage1D/2D/3D() functions.  Basically do error
checking then call the driver hook to actually allocate memory.
2011-10-31 10:52:56 -06:00
Brian Paul
ae9bef240d glapi: regenerated API files for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
af95504dad glapi: new API specs for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
Brian Paul
2e322bb8d1 mesa: add new driver hook for AllocTextureStorage() 2011-10-31 10:52:56 -06:00
Brian Paul
b296315881 mesa: add new fields for GL_ARB_texture_storage 2011-10-31 10:52:56 -06:00
José Fonseca
1e9d8934a1 svga: Flush the hwtnl primitives before writing to buffers.
svga keeps a small queue of similar primitive draws in order to coalesce
them into a single draw primitive command.

But the buffers referred in primitives not yet emitted were being ignored
in the considerations to flush or not the context.

This fixes piglit vbo-map-remap, vbo-subdata-sync, vbo-subdata-zero, and
Seeker.

Based on investigation and patch from Brian Paul.

Reviewed-By: Brian Paul <brianp@vmware.com>
2011-10-31 15:22:09 +00:00
Thomas Hellstrom
c04b9d1d56 st/xa: Plug a pipe context leak.
Forgot to destroy the pipe context on xa context destroy.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-31 14:35:23 +01:00
Thomas Hellstrom
037e7a68f5 pipebuffer/debug: Fix a recursive mutex lock
pb_debug_manager_dump was trying to take a lock already
held by all callers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jos Fonseca <jfonseca@vmware.com>
2011-10-31 13:25:39 +01:00
Dave Airlie
56d30bb00d radeon/r200: drop remains of r300/r600 support along with old drm 1.x kernel
This drops all the old drmSupports* checks since KMS does them all, and it
also drop R300_CLASS and R600_CLASS.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-30 16:40:56 +00:00
Chia-I Wu
e252af3406 llvmpipe: fix a crash in non-SSE path
It is a typo went unnoticed.
2011-10-30 20:05:05 +08:00
Chia-I Wu
d1d456a774 intel: enable GL_OES_draw_texture 2011-10-30 20:00:07 +08:00
Chia-I Wu
b4dc35d9bc meta: add _mesa_meta_DrawTex()
It is set to dd->DrawTex.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: set dd->DrawTex in _mesa_init_driver_functions]
2011-10-30 20:00:03 +08:00
Marek Olšák
9eac0fce83 r600g: reset the render condition to NULL when rendering unconditionally 2011-10-30 02:25:51 +02:00
Marek Olšák
b40edc63d7 r600g: shortcut ctx->screen->ws to ctx->ws 2011-10-30 02:25:51 +02:00
Eric Anholt
44c65d0e4e i965: Remove the prepare() hook from state atoms.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:26 -07:00
Eric Anholt
2649ff4d90 i965: Remove the memcpy()ed atoms array now that everything is emit()-based.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:23 -07:00
Eric Anholt
35c7e8cebe i965: Merge brw_validate_state() and brw_upload_state() together.
They were called back-to-back at this point.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:21 -07:00
Eric Anholt
68c813e8ea i965: Remove state upload code for calling prepare() now that there are none.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:17 -07:00
Eric Anholt
26cfca825d i965: Remove some old texturing debug code.
It caught one possible bug I recall in my time working on the driver,
and we haven't been setting it for non-fixed-function since the new FS
backend came along.  The bug it caught was likely a confusion about
sampler mappings, which we have tests for these days.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:15 -07:00
Eric Anholt
bd27c25ff9 i965: Finally, move the global fallbacks check to emit() time.
This was the last prepare() function, and it's the first state atom,
so it must be ready to move.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:13 -07:00
Eric Anholt
c83bfeabc6 i965: Move index buffer upload to emit() time.
It's consumed by the brw_emit_index_buffer() code at emit() time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:11 -07:00
Eric Anholt
78a010127f i965: Do a hack job of merging VB prepare()/emit() together.
I don't really want to touch this impenetrable code in this series, so
just call the one function from the other, since no other atom cares
about them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:09 -07:00
Eric Anholt
bf11c9e4c1 i965: Move the WM input sizes calculation to emit() time.
It's used for program compile.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:07 -07:00
Eric Anholt
dc9a753f66 i965: Move program compile to emit() time.
Only 4 other prepare() functions are left, which don't rely on this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:03 -07:00
Eric Anholt
0969568fce i965/gen4: Move CURBE offset calculation to emit() time.
This is consumed by the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:17:01 -07:00
Eric Anholt
47c4d950cb i965/gen4: Fold push constant prepare()/emit() together.
While other units need to know about our constant buffer offsets,
nothing else cared about which particular BO other than the emit() half.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:59 -07:00
Eric Anholt
752cad8f33 i965/gen6: Move viewport state setup to emit() time.
Only the emit() for the pointers into the batch later in this file
cares.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:56 -07:00
Eric Anholt
8f0a54e6ff i965/gen4: Move URB fence recalculate to emit() time.
This is used by the unit state, which is at emit() time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:54 -07:00
Eric Anholt
ab8637b03f i965: Fold the gen6/7 URB state prepare()/emit() together.
No other unit cares about the prepare state, unlike gen4-5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:49 -07:00
Eric Anholt
395a8605fa i965: Move VS pull constant upload to emit() time.
Only needed by the emit() for VS surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:45 -07:00
Eric Anholt
c933b33dc8 i965: Fold prepare() and emit() of VS surface state setup together.
This rearranges the code a bit, and makes the upload of the binding
table take only as many surfaces as there are in use.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:42 -07:00
Eric Anholt
2b730c1f19 i965: Move WM pull constant setup to emit() time.
It's needed by the WM surface state setup, which is now emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:39 -07:00
Eric Anholt
4de2cfc3a0 i965/gen7: Fold WM surface state prepare()/emit() together.
These produce BRW_NEW_SURFACES (used by binding table emit()) and
BRW_NEW_NR_WM_SURFACES (used by WM unit emit()).  Fixes a bug where
with no texturing and no color buffer, we wouldn't consider the null
renderbuffer in nr_surfaces.  This was harmless because nr_surfaces is
only used for the prefetch info in the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:36 -07:00
Eric Anholt
93cabff7d6 i965/gen4: Fold WM surface state prepare()/emit() together.
These produce BRW_NEW_SURFACES (used by binding table emit()) and
BRW_NEW_NR_WM_SURFACES (used by WM unit emit()).  Fixes a bug where
with no texturing and no color buffer, we wouldn't consider the null
renderbuffer in nr_surfaces.  This was harmless because nr_surfaces is
only used for the prefetch info in the unit state.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:32 -07:00
Eric Anholt
9a5f8a98ed i965: Move sampler state to emit() time.
This is consumed by the WM unit, which is already at emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:30 -07:00
Eric Anholt
c4aaf85285 i965/gen4: Move unit state setup to emit() time.
It is only needed in time for brw_psp_urb_cbs(), which is also an emit().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:27 -07:00
Eric Anholt
c0574d5a90 i965/gen7: Fold prepare() and emit() of SF CLIP/VP state together.
The prepare() only made state for its emit(), not anybody else.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:24 -07:00
Eric Anholt
7a874d04a8 i965/gen4: Move CC VP to emit() time, since it's only needed by CC's emit().
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:20 -07:00
Eric Anholt
9015969e6e i965: Move push constants setup to emit() time.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:18 -07:00
Eric Anholt
f84f3322b4 i965/gen6: Move setup of CC state batches to emit time.
This is part of a series trying to eliminate the separate prepare()
hook in state upload.  The prepare() hook existed to support the
check_aperture in between calculating state updates and setting up the
batch, but there should be no reason for that any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:15 -07:00
Eric Anholt
78188bc537 i965: Check Fallback again after upload.
As we move state to emit() time from prepare() time, a couple of the
places that flag fallbacks will move here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:12 -07:00
Eric Anholt
eaf4d3e6e2 i965: Remove the validated BO list, now that it's unused.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:09 -07:00
Eric Anholt
3d851ae488 i965: Use the batch save/reset code to avoid needing the BO validate step.
We were doing the BO validate step in prepare() (brw_validate_state())
hooks of atoms so that we could check_aperture before emitting the
relocation trees during brw_upload_state() that would actually make
the batchbuffer reference too much memory to be executed.  Now that
all relocations occur in the batchbuffer, we can instead
check_aperture after emitting our state into the batchbuffer, and
easily roll back, flush, and retry if we happened to go over the
limits.

This will let us remove the whole prepare() vs emit() split in our
state atoms, which is a source of tricky dependencies and duplicated
code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:05 -07:00
Eric Anholt
da8f052560 intel: Return error value from intel_batchbuffer_flush().
This will let the caller do something sensible on error, if it cares.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:16:02 -07:00
Eric Anholt
fff693828e i965: Add a note about an unsafe-looking state check.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:15:59 -07:00
Eric Anholt
3faf56ffbd intel: Add an interface for saving/restoring the batchbuffer state.
This will be used to avoid the prepare() step in the i965 driver's
state setup.  Instead, we can just speculatively emit the primitive
into the batchbuffer, then check if the batch is too big, rollback and
flush, and replay the primitive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:15:56 -07:00
Eric Anholt
db364a8af0 i915: Move the always_flush_cache code to triangle emit.
This could have broken always_flush_cache on i965, since
reserved_space doesn't reflect the size of the workaround flushes, and
we might run out of space.  This should make always_flush_cache more
useful on pre-i965, anyway (since the point is to flush around each
draw call, even within a batchbuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-29 12:15:33 -07:00
Morgan Armand
439d67f502 glsl: Fix compilation of glsl_lexer.ll with MSVC.
strtoull is not supported on msvc (as there is no C99 support).
2011-10-29 10:37:58 -07:00
Mathias Fröhlich
e8139ebf58 r600g: Replace needless flush in texture upload.
Replace pipe->flush() with pipe->texture_barrier() in
the texture upload path for the staging texture.
This should be enough to get data out of the gpu
caches ready to be read for texture fetch.
2011-10-29 18:36:42 +02:00
Marek Olšák
7684808f9c r600g: remove one pointless flush
It's not useful for anything.
The rest of the patch is just a cleanup resulting
from some of the variables being no longer used.

There are no piglit regressions.
2011-10-29 13:48:39 +02:00
Dave Airlie
09a92e376b radeon/r200: forgot one somehow
drops last usage.
2011-10-29 08:15:27 +01:00
Dave Airlie
b490fa0172 radeon/r200: drop remains of non-libdrm_radeon build
These wrappers and associated symlinks were from the non-libdrm_radeon build.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-29 08:13:47 +01:00
Dave Airlie
4dfee0011a mesa/st: get interpolation mode from the fragment shader.
With the recent changes to interpolation stuff, we can now get the value
direct from the program instead of just being fail.

fixes some of the glsl-1.30 interpolation tests with softpipe

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-29 07:41:46 +01:00
Adam Jackson
25620eb1d2 glx: Don't enable INTEL_swap_event unconditionally
DRI2 supports this now - and already enables it explicitly - but drisw
does not and should not.  Otherwise toolkits like clutter will only ever
SwapBuffers once and wait forever for an event that's not coming.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-10-28 20:38:32 -04:00
Morgan Armand
0c6a2c78fd implement WGL_ARB_create_context
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-10-28 21:58:36 +01:00
Marek Olšák
bbad5103e6 r600g: get backend mask after the context is fully set up 2011-10-28 22:55:01 +02:00
Ian Romanick
276000472a ir_to_mesa: Let check_resources halt compilation
Previously check_resources could fail, but we'd still try to optimize
the shader, do device-specific code generation, etc.  In some cases,
this could explode (especially in the device-specific code
generation).  I haven't found that I could trigger this with the
current code.  When too many samplers were used with the new uniform
handling code, I observed several crashes deep down in the driver.

NOTE: This is candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41609
Cc: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:55 -07:00
Ian Romanick
6da9b21f71 i965: Use glsl_type::column_type instead of open-coding it
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:55 -07:00
Ian Romanick
f5ba4d055e glsl: Clean-up spurious error message on bad structure definitions
Previously a shader like

int X;
struct X { int i; };

void main() { gl_Position = vec4(0.0); }

would generate two error message:

0:2(19): error: struct `X' previously defined
0:2(20): error: incomplete declaration

The first one is the real error, and the second is spurious.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:55 -07:00
Ian Romanick
a04211ecb8 glsl: Generate an error for array-of-array declarations
Other parts of the code already caught things like 'float x[4][2]'.
However, nothing caught 'float [4] x[2]'.

Fixes piglit test array-multidimensional-new-syntax.vert.

NOTE: This is candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-28 13:28:36 -07:00
Marek Olšák
e79aaf000b r300c/compiler: remove the compiler too
Gallium has a fork of this.
2011-10-28 21:28:31 +02:00
Kenneth Graunke
512431b357 i965/fs: Use the actual hardware g0 register for texel offset setup.
The idea here is to set up the message header with the Sampler State
pointer which the hardware provides as part of the PS Thread Payload in
register g0.

Unfortunately, the existing code

   fs_reg(GRF, 0, BRW_REGISTER_TYPE_UD))

actually references "virtual GRF 0" rather than the hardware g0.  This
is just some arbitrary GRF temporary which will get register allocated.

So, we ended up setting up the header with garbage.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-28 12:11:52 -07:00
Eric Anholt
058e712415 u_format: Fix -NaN handling for packing of 10F_11F_11F_REV to match GL specs.
Fixes the remainder of piglit GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
00d3716f4a u_format: Fix clamping of overflow in 10F_11F_11F_REV to match GL specs.
Fixes the 1000000.0 overflow cases of piglit
GL_EXT_packed_float/pack.c

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
b4d988bc9f mesa: Don't do [0, 1] clamping on glGetTexImage() of packed float formats.
From the GL_EXT_packed_float spec:

    For an RGBA color, if <type> is not one of FLOAT,
    UNSIGNED_INT_5_9_9_9_REV_EXT, or UNSIGNED_INT_10F_11F_11F_REV_EXT,
    or if the CLAMP_READ_COLOR_ARB is TRUE, or CLAMP_READ_COLOR_ARB
    is FIXED_ONLY_ARB and the selected color (or texture) buffer is
    a fixed-point buffer, each component is first clamped to [0,1].
    Then the appropriate conversion formula from table 4.7 is applied
    the component."

(but we previously resolved that the CLAMP_READ_COLOR bit is not
relevant to glGetTexImage())

This fixes most of the cases in piglit GL_EXT_packed_float/pack.

Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
3d7477206d u_format: Fix bitshifting for unpacking from 10F.
This code was copy and pasted from the 11F unpacking, but not updated
for actually being 10 bits instead of 11.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41206
Reviewed-by: Marek Ol ák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:10:01 -07:00
Eric Anholt
028ce1cd0f u_format: Fix bit definition of UF10_MANTISSA_BITS.
This is only used in the code for packing to INF, and resulted in an
extra bit set that was set anyway, so it was harmless except for the
confusion caused.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:09:47 -07:00
Eric Anholt
687e4446bf glsl: Implement GLSL 1.30's literal integer range restrictions.
From page 22 (28 of PDF) of GLSL 1.30 spec:
    It is an error to provide a literal integer whose magnitude is too
    large to store in a variable of matching signed or unsigned type.

    Unsigned integers have exactly 32 bits of precision.  Signed integers
    use 32 bits, including a sign bit, in two's complement form.

Fixes piglit int-literal-too-large-0[123].frag.

v2: Take care with INT_MIN, use stroull, and make it a function.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 12:03:03 -07:00
Eric Anholt
974c66875e radeon: Remove the non-libdrm kernel memory manager support.
We should have never been building this at this point.
2011-10-28 11:32:10 -07:00
Eric Anholt
830e546f94 radeon: Insist on libdrm being present to build.
There's no sense in building a broken driver.  Previously, there was
the potential of building a DRI1-only driver that would work for DRI1
and fail on DRI2 because the newer libdrm code wasn't present.  Now
the radeon build system should be matching intel and nouveau.
2011-10-28 11:32:00 -07:00
Eric Anholt
48c9925367 configure.ac: Fix equality checks in gallium st setup. 2011-10-28 11:31:11 -07:00
Eric Anholt
bd51e8e4f4 dri: Remove driver GenerateMipmap hooks.
Mesa sets up _mesa_meta_GenerateMipmap as the default hook, which does
this check for fallback and call the fallback itself.
2011-10-28 11:31:11 -07:00
Eric Anholt
eb135fe8c1 radeon: Drop some remaining DRI1 vblank support code. 2011-10-28 11:31:11 -07:00
Eric Anholt
a9f7515890 intel: remove dead prototype for old DRI1 code.
Noticed while grepping for radeon code.
2011-10-28 11:31:11 -07:00
Eric Anholt
339c1731c3 radeon: Simplify cliprects computation now that there's just 1.
This can probably be reduced even further by moving this logic to the
scissor state update or just removing the logic entirely, but I don't
trust myself in radeon quite that much.
2011-10-28 11:31:11 -07:00
Eric Anholt
cab4578024 radeon: Drop the clipping in spans, now that we always have (0,0) -> (w,h). 2011-10-28 11:31:11 -07:00
Eric Anholt
8c11f0a883 radeon: Drop the legacy BO manager code. 2011-10-28 11:27:56 -07:00
Eric Anholt
976d4f58fa radeon: Drop the DRI1 zero-copy TFP code. 2011-10-28 11:27:42 -07:00
Eric Anholt
1553723712 radeon: Drop the radeon_cs_legacy code now that we rely on kernel mm. 2011-10-28 11:23:43 -07:00
Eric Anholt
53b382637c radeon: Drop dri2 checks now that it's always true.
This makes LOCK_HARDWARE empty, so it goes away.
2011-10-28 11:23:33 -07:00
Eric Anholt
fb52b4303d radeon: Drop the DRI1 swapbuffers implementation. 2011-10-28 11:23:09 -07:00
Eric Anholt
0973a1ec78 radeon: Drop the non-kernel-memory-manager support, and thus DRI1.
It's past time, and it was going to get in the way of the renderbuffer
mapping refactor.  We dropped all the other DRI1 drivers for this
release, and I can't imagine anybody supporting DRI1 radeon classic in
a new release of Mesa.

Diff produced by treating kernel_mm as true, deleting the DRI1 paths
that produce kernel_mm false, and deleting code.
2011-10-28 11:23:09 -07:00
Eric Anholt
4a2f00889b r200: Drop the non-kernel-memory-manager and DRI1 code. 2011-10-28 11:22:26 -07:00
Eric Anholt
3996ed555e radeon: Unifdef RADEON_R300 and RADEON_R600. 2011-10-28 11:21:38 -07:00
Eric Anholt
b300d62617 docs: Update to note that r300 and r600 have been replaced. 2011-10-28 11:20:30 -07:00
Eric Anholt
de22b9018f r300c, r600c: Remove these DRI drivers.
They have been superseded by the gallium equivalents.

Acked-by: Michel Dänzer <michel@daenzer.net>
Acked-by: Alex Deucher <alexdeucher@gmail.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Acked-by: Corbin Simpson <mostawesomedude@gmail.com>
2011-10-28 11:20:30 -07:00
Eric Anholt
2f4c7ebea6 mesa: Remove build infrastructure for r300c and r600c.
These drivers have been superseded by the gallium equivalents.
2011-10-28 11:19:56 -07:00
Eric Anholt
9171bfe5f6 radeon: Delete DRI1 screen init code and thus support for !kernel_mm.
It's past time, and it was going to get in the way of the renderbuffer
mapping refactor.  We dropped all the other DRI1 drivers for this
release, and I can't imagine anybody supporting DRI1 radeon classic in
a new release of Mesa.

Cleanup of the resulting dead code to follow.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
2011-10-28 11:19:14 -07:00
Eric Anholt
a34c28f1aa dri: Drop _dri_texformats that just obfuscate MESA_FORMAT names.
The remaining _dri_texformats are the ones that are variable depending
on the endianness of the system.
2011-10-28 11:19:14 -07:00
Eric Anholt
8d9c5167ac radeon: Use _mesa_get_format_base_format for winsys renderbuffer setup. 2011-10-28 11:19:14 -07:00
Eric Anholt
964c5195a2 radeon: Remove dead swrast renderbuffer setup code.
This was from the stub code in the initial commit of this file.
2011-10-28 11:19:14 -07:00
Kenneth Graunke
3b4d2eac60 glsl: Remove pointless uses of glsl_type::get_base_type().
These are effectively doing type->get_base_type()->base_type, which is
equivalent to type->base_type.  Just use that, as it's simpler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-28 11:12:33 -07:00
Marek Olšák
1e1a7011ee r600g: don't flush before reading query results
Taken care of by the winsys.
2011-10-28 19:29:05 +02:00
Marek Olšák
e9b6f21a50 r600g: only maintain the list of active queries
And not all existing queries. The only reason we have that list is to be able
to suspend and resume the active ones.

This reduces looping over queries when suspending and resuming.
The queries no longer have to track some of their states.
2011-10-28 19:29:05 +02:00
Marek Olšák
b70a51318a r600g: cleanup r600_query_result 2011-10-28 19:29:05 +02:00
Marek Olšák
1de02d7364 r600g: don't flush in r600_get_backend_mask
The winsys does the flush in buffer_map.
2011-10-28 19:29:05 +02:00
Marek Olšák
6e79127e79 r600g: remove redundant variable r600_query::buffer_size 2011-10-28 19:29:05 +02:00
Marek Olšák
671af44b19 r300g: remove useless code 2011-10-28 19:29:04 +02:00
Alan Coopersmith
68657183b0 gallium/auxiliary/util: Solaris also has standard Unix sockets
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-27 22:43:02 -07:00
Tom Stellard
17a1c0cb0d r300/compiler: Fix scheduler bug causing texture corruption
We weren't setting TEX_SEM_WAIT on instructions that read the value of a
TEX instruction and also wrote the same register as the TEX instruction.

This is the sequence we were miscompiling:

1: TEX temp[0], input[2].xy__, 2D[0]
...
16: src0.xyz = temp[22], src1.xyz = temp[0], src2.xyz = temp[19]
      MAD temp[0].xyz, src0.xxx, src1.xyz, src2.xxx

https://bugs.freedesktop.org/show_bug.cgi?id=42090
2011-10-27 20:35:31 -04:00
Paul Berry
5aa96286e7 i965/gen6+: Add support for noperspective interpolation.
This required the following changes:

- WM setup now makes the appropriate set of barycentric coordinates
  (perspective vs. noperspective) available to the fragment shader,
  based on whether the shader requires perspective interpolation,
  noperspective interpolation, both, or neither.

- The fragment shader backend now uses the appropriate set of
  barycentric coordiantes when interpolating, based on the
  interpolation mode returned by
  ir_variable::determine_interpolation_mode().

- SF setup now uses gl_fragment_program::InterpQualifier to determine
  which attributes are to be flat shaded (as opposed to the old logic,
  which only flat shaded colors).

- CLIP setup now ensures that the clipper outputs non-perspective
  barycentric coordinates when they are needed by the fragment shader.

Fixes the remaining piglit tests of interpolation qualifiers that were
failing:
- interpolation-flat-*-smooth-none
- interpolation-flat-other-flat-none
- interpolation-noperspective-*
- interpolation-smooth-gl_*Color-flat-*

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:20 -07:00
Paul Berry
4d563ec1cc i965/gen6+: Rename GEN6_CLIP_BARYCENTRIC_ENABLE.
The name was misleading.  The actual effect of the bit is to cause
the clipper to emit *non-perspective* barycentric coordinate
information (which is only needed when doing noperspective
interpolation).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:08 -07:00
Paul Berry
f8386a29f0 i965/fs: use determine_interpolation_mode().
This patch changes how fs_visitor::emit_general_interpolation()
decides what kind of interpolation to do.  Previously, it used the
shade model to determine how to interpolate colors, and used smooth
interpolation on everything else.  Now it uses
ir_variable::determine_interpolation_mode(), so that it respects GLSL
1.30 interpolation qualifiers.

Fixes piglit tests interpolation-flat-*-smooth-{distance,fixed,vertex}
and interpolation-flat-other-flat-{distance,fixed,vertex}.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:32:00 -07:00
Paul Berry
e04bdeae82 i965/gen6+: Parameterize barycentric interpolation modes.
This patch modifies the fragment shader back-end so that instead of
using a single delta_x/delta_y register pair to store barycentric
coordinates, it uses an array of such register pairs, one for each
possible intepolation mode.

When setting up the WM, we intstruct it to only provide the
barycentric coordinates that are actually needed by the fragment
shader--that is computed by brw_compute_barycentric_interp_modes().
Currently this function returns just
BRW_WM_PERSPECTIVE_PIXEL_BARYCENTRIC, because this is the only
interpolation mode we support.  However, that will change in a later
patch.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:53 -07:00
Paul Berry
102bdd26e1 i965/fs: Fix split_virtual_grfs() when delta_xy not in a virtual register.
This patch modifies the special case in
fs_visitor::split_virtual_grfs() that prevents splitting from being
applied to the delta_x/delta_y register pair (this register pair needs
to remain contiguous so that it can be used by the PLN instruction).

When gen>=6, this register pair is in a fixed location, not a virtual
register, so it was in no danger of being split.  And
split_virtual_grfs' attempt not to split it was preventing some other
unrelated register from being split.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:47 -07:00
Paul Berry
baf7f99fd7 glsl: add ir_variable::determine_interpolation_mode() function.
This function determines how a variable should be interpolated based
both on interpolation qualifiers and the current shade model.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:32 -07:00
Paul Berry
c488150dea glsl: Distinguish between no interpolation qualifier and 'smooth'
Previously, we treated the 'smooth' qualifier as equivalent to no
qualifier at all.  However, this is incorrect for the built-in color
variables (gl_FrontColor, gl_BackColor, gl_FrontSecondaryColor, and
gl_BackSecondaryColor).  For those variables, if there is no qualifier
at all, interpolation should be flat if the shade model is GL_FLAT,
and smooth if the shade model is GL_SMOOTH.

To make this possible, I added a new value to the
glsl_interp_qualifier enum, INTERP_QUALIFIER_NONE.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:31:20 -07:00
Paul Berry
cf45949d6a mesa: Expose GLSL interpolation qualifiers in gl_fragment_program.
This patch makes GLSL interpolation qualifiers visible to drivers via
the array InterpQualifier[] in gl_fragment_program, so that they can
easily be used by driver back-ends to select the correct interpolation
mode.

Previous to this patch, the GLSL compiler was using the enum
ir_variable_interpolation to represent interpolation types.  Rather
than make a duplicate enum in core mesa to represent the same thing, I
moved the enum into mtypes.h and renamed it to be more consistent with
the other enums defined there.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 15:30:58 -07:00
Marek Olšák
0fbc8d301b docs: update GL3 status
EXT_texture_array has been completed for quite a while.

Removing BindBufferBase+Range, because they're part of EXT_transform_feedback.
2011-10-27 15:57:08 +02:00
Marek Olšák
a19e6a8f28 r600g: remove redundant variable r600_pipe_context::blit 2011-10-27 12:27:34 +02:00
Marek Olšák
48dcdcffd6 mesa: initialize ARB_transform_feedback2 dispatch
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 11:26:19 +02:00
Marek Olšák
dc93a81a3d mesa: improve EXT_transform_feedback display list support
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 11:26:19 +02:00
Marek Olšák
f77aa278d3 mesa: fix GL error checking in TransformFeedbackVaryings
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-27 11:26:19 +02:00
Brian Paul
27de26073b st/glx: fix mixed declarations and code, remove unused var 2011-10-26 16:45:04 -06:00
Brian Paul
2997b45896 st/mesa: tell VBO module to always unmap buffers before drawing
Without this it's possible to wind up in a draw call with the
glBegin/End VBO still in a mapped state.  This is a problem for
the SVGA3D driver and probably not good for other HW drivers.
2011-10-26 16:45:03 -06:00
Eric Anholt
4fc9a98a0e glsl: Rename remaining internal builtins from gl_MESA* to gl_*MESA.
This matches the usual convention for extension builtin variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-26 12:52:11 -07:00
Eric Anholt
4ad8a0adec intel: Drop texture border support code.
Now that texture borders are gone, we never need to allocate our
textures through non-miptrees, which simplifies some irritating paths.

v2: Remove the !mt support case from intel_map_texture_image()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:28 -07:00
Eric Anholt
96db07e28c intel: Enable stripping of texture borders.
This replaces software rendering of textures with the deprecated
1-pixel border (which is always bad, since mipmapping is rather broken
in swrast, and GLSL 1.30 is unsupported) with hardware rendering that
just pretends there was never a border (so you have potential seams on
apps that actually intentionally used the 1-pixel borders, but correct
rendering otherwise).

This doesn't regress any piglit tests on gen6 (since the texwrap
border/bordercolor cases already failed due to broken border color
handling), but regresses texwrap border cases on original gen4 since
those end up sampling the border color instead of the border pixels.
It's a small price to pay for not thinking about texture borders any
more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:23 -07:00
Eric Anholt
638b657f83 mesa: Apply StripTextureBorder to CopyTexImage as well.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:20 -07:00
Eric Anholt
9c4b025287 mesa: Fold gallium's texture border stripping into a core Mesa option.
We wanted to reuse this in the Intel driver.

v2: Move the flag to ctx->Const

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:17 -07:00
Eric Anholt
b31104e318 mesa: Skip texstore for 0-sized texture data.
The intel driver (and gallium, it looks like, though it doesn't use
these texstore functions at this point) doesn't bother making storage
for textures with 0 width, height, or depth.  This avoids them having
to deal with returning a mapping for that nonexistent data.

Fixes assertion failures with an upcoming intel driver change.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-26 12:42:13 -07:00
Marek Olšák
69e48e7220 r600g: remove redundant assignment of pipe_draw_info in draw_vbo 2011-10-26 15:54:30 +02:00
Dave Airlie
d404f60693 llvmpipe: llvmpipe doesn't support pure integers yet.
Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=42240

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-26 15:51:31 +02:00
Marek Olšák
344039d81d r600g: cleanup draw_vbo and add comments 2011-10-26 15:15:57 +02:00
Vinson Lee
20a20c781a ralloc: Move declaration before code.
Fixes build error with MSVC.
2011-10-25 20:31:14 -07:00
Vinson Lee
a936b206a0 scons: Add link_uniforms.cpp to SConscript. 2011-10-25 20:19:07 -07:00
Ian Romanick
6437a71d41 ir_to_mesa: Use uniform_field_visitor to add all struct fields to parameter list
Previously the uniform was passed as single, whole structure to
_mesa_add_parameter.  This was completely bogus and resulted in a
DataType of 0 (instead of a valid GLSL type enum).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-25 17:51:57 -07:00
Ian Romanick
747e59c759 linker: Add uniform_field_visitor class to process leaf fields of a uniform
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-25 17:51:57 -07:00
Kenneth Graunke
ca95593d49 ralloc: Add new [v]asprintf_rewrite_tail functions.
This can be useful if you want to create a bunch of temporary strings
with a common prefix.  For example, when iterating over uniform
structure fields, one might want to create temporary strings like
"pallete.primary", "palette.outline", and "pallette.shadow".

This could be done by overwriting the '.' with a null-byte and calling
ralloc_asprintf_append, but that incurs the cost of strlen("pallete")
every time...when this is already known.

These new functions allow you rewrite the tail of the string, given a
starting index.  If the starting index is the length of the string, this
is equivalent to appending.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-25 17:51:43 -07:00
Ian Romanick
960d722bf7 linker: Eliminate more dead code after demoting shader inputs and outputs
Consider the following vertex shader and fragment shader:

// vertex shader
varying vec4 v;
uniform vec4 u;

void main() { gl_Position = vec4(0.0); v = u; }

// fragment shader
void main() { gl_FragColor = vec4(0.0); }

Since the fragment shader does not use 'v', it is demoted from a
varying to a simple global variable.  Once that happens, the
assignment to 'v' is useless, and it should be removed.  In addition,
'u' is no longer active, and it should also be removed.

Performing extra dead code elimination after demoting shader inputs
and outputs takes care of this.  This elimination must occur before
assigning uniform locations, or the declaration of 'u' cannot be
removed.

This change *breaks* the piglit test getuniform-01, but that test is
already incorrect.  The test uses a vertex shader that assigns to a
user-defined varying, but it has no fragment shader.  Since Mesa does
not support ARB_separate_shader_objects (we only support the EXT
version), the linker correctly eliminates the user-defined varying.
The cascading effect is that the uniform queried by the C code of the
test is also (correctly) eliminated.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-10-25 17:51:43 -07:00
Ian Romanick
1d5d67f8ad glsl: Add uniform_locations_assigned parameter to do_dead_code opt pass
Setting this flag prevents declarations of uniforms from being removed
from the IR.  Since the IR is directly used by several API functions
that query uniforms in shaders, uniform declarations cannot be removed
after the locations have been set.  However, it should still be safe
to reorder the declarations (this is not tested).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41980
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Cc: Vinson Lee <vlee@vmware.com>
Cc: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-10-25 17:51:43 -07:00
Kenneth Graunke
384ad987a1 i965: Add more #defines for Gen6+ 3DSTATE_GS fields.
These should be useful for doing transform feedback on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:35 -07:00
Kenneth Graunke
f1694eabdd i965: Add new brw_context::max_gs_threads constant.
These are correct to the best of my knowledge, gleaned from a variety of
internal sources.  Sadly, the Sandybridge PRM has incorrect limits.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:32 -07:00
Kenneth Graunke
db6dd6d88f i965: Rename (vs|wm)_max_threads to max_(vs|wm)_threads for consistency.
The inconsistency between vs_max_threads and max_vs_entries was rather
annoying.  I could never seem to remember which one was reversed, which
made it harder to find quickly.  "Max __ Threads" seems more natural.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:30 -07:00
Kenneth Graunke
47f1d9deff i965: Remove "single threaded" INTEL_DEBUG mode.
According to the docs for 3DSTATE_PS (Gen7+) and 3DSTATE_WM (Gen6),
there is a platform dependent value for the minimum number of pixel
shader threads.  It may also vary based on whether WIZ Hashing is on.

For example, Ivybridge requires at least 4 threads if WIZ hashing is
disabled, and 8 if it's enabled.  Programming it to use less threads is
illegal.  Sandybridge appears to have similar restrictions.

So on newer platforms, INTEL_DEBUG=sing will probably just hang the GPU.
Rather than try to patch it up for newer platforms and extend it to
support geometry shaders, just remove it as it isn't that useful anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-25 17:09:21 -07:00
Kenneth Graunke
7a86bf816c mesa: Remove unnecessary and incorrect TexEnv parameter validation.
For GL_RGB_SCALE and GL_ALPHA_SCALE targets, the API wrapper code
attempts to ensure the parameter is 1.0, 2.0, or 4.0.

This is unnecessary: set_combiner_scale in texenv.c (called by
_mesa_TexEnvfv) already checks this and raises an appropriate error.

It's also incorrect: For glTexEnvx, the API validation code directly
compares the GLfixed input parameter with a floating point constant,
prior to converting fixed-point to floating point.

Fixes an issue in the OpenGL ES 1.1 conformance suite.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-25 16:25:39 -07:00
Stéphane Marchesin
00ddc7ea47 st/glx: Implement texture_from_pixmap without DRI.
Makes texture_from_pixmap work with non-DRI llvmpipe.
2011-10-25 14:35:46 -07:00
Stéphane Marchesin
b1d93d2aa8 i915g: Cleanup the vertex sampler interface a bit. 2011-10-25 14:30:08 -07:00
Stéphane Marchesin
2b4ab1435f i915g: Flesh out TODO idea. 2011-10-25 14:30:07 -07:00
Chad Versace
882c83377d intel: Kill dead code in intel_miptree_copy_teximage()
Kill the code paths taken when src_mt is null. It is never null, otherwise
there would be a segfault on line 4 of this function:
    GLuint width = src_mt->level[level].width;

(Some interleaved lines in the diff make the real diff non-obvious. All
I did was delete some code and then left-shifted what remained to correct
the indentation.)

Reviewed-by: Eric Anholt <eric@aholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-25 11:28:32 -07:00
Vinson Lee
265f55e627 tgsi: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-25 11:12:51 -07:00
Vinson Lee
c81b441ba2 swrast: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-25 11:09:45 -07:00
Brian Paul
e8d0d7893a swrast: use _mesa_ffs() instead of ffs()
Fixes MSVC build.
2011-10-25 11:26:26 -06:00
Marek Olšák
765503bb5d r600g: move some code out of draw_vbo into new r600_update_derived_state 2011-10-25 19:21:49 +02:00
Marek Olšák
3d79347609 r600g: cleanup some magic numbers 2011-10-25 19:12:33 +02:00
Marek Olšák
dc651aff0c r600g: don't render if pipe_draw_info::count is 0
Also call r600_conv_pipe_prim earlier.
2011-10-25 19:12:33 +02:00
Brian Paul
05720e14ba mesa: fix comment language 2011-10-25 08:45:58 -06:00
Vinson Lee
ca1b60057a pp: Fix memory leak on error path.
Fixes Coverity resource leak defect.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-25 07:38:53 -07:00
Marek Olšák
faa16dc456 r600g: set correct tiling flags in depth info
The kernel currently overwrites the flags, but if we stopped doing that,
this would break badly.
2011-10-25 01:47:03 +02:00
Jeremy Huddleston
5c44c1348e apple: Implement applegl_unbind_context
glXMakeCurrent(dpy, None, NULL) would not correctly unbind the context
causing subsequent GLX requests to fail in peculiar ways

http://xquartz.macosforge.org/trac/ticket/514

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24 16:21:28 -07:00
Brian Paul
9dc7df1fea util: handle failed mapping in u_upload_alloc()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-24 16:39:58 -06:00
Brian Paul
19961da4cb util: handle failed mapping in u_upload_alloc_buffer()
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-24 16:39:58 -06:00
Vinson Lee
4e6a0b40c5 mesa: Fix memory leak in out-of-memory path.
Fixes Coverity resource leak defect.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-24 14:13:01 -07:00
Eric Anholt
cc4ddc3a1e glsl: Fix gl_NormalMatrix swizzle setup to match i965's invariants.
A driver trying to set up builtin uniforms is faced with a problem:
How do I walk the ir_variable structure (representing an array of
structs, or array of matrices, or struct, or whatever), and set up
driver structures so that dereference of that uniform gets the
corresponding ParameterValues[] entry.  The rule in general is that
each corresponding vector-sized field of an array of structs is one
builtin uniform state slot.  i965 relied on another invariant: each
state slot has a number of unique channel swizzles corresponding to
the number of elements in the field's vector, to avoid needing to walk
the glsl_type in parallel to get at vector_elements.

All of the builtin uniforms followed this behavior, except for
gl_NormalMatrix.  That's a mat3 (so 3 vec3s), but it was swizzled as 3
vec4s.

Fixes piglit glsl-fs-normalmatrix.
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-10-24 13:43:02 -07:00
Eric Anholt
2ecfa88548 glsl: Add gl_MaxVaryingComponents in GLSL 1.30.
This is the new name for gl_MaxVaryingFloats now that non-float
varyings exist.  Fixes piglit
glsl-1.30/execution/maximums/gl_MaxVaryingFloats

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-24 13:43:02 -07:00
Kenneth Graunke
3cc0a7be23 i965: Apply post-sync non-zero workaround to homebrew workaround.
In commit 3e5d3626, Eric added a homebrew workaround to fix GPU hangs in
the Mesa "engine" demo and oglc's api-texcoord test.

Unfortunately, his PIPE_CONTROL contains a Depth Stall, which
necessitates the post-sync non-zero workaround,

Fixes GPU hangs in Civilization 4, PlaneShift, and 3DMMES.
Hopefully Heroes of Newerth as well, though I haven't tested that.

NOTE: This is candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40324
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41096
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Eric Anholt <eric@anholt.net>
2011-10-24 13:32:33 -07:00
Marek Olšák
56ac7ccae6 docs: update relnotes-7.12 2011-10-24 21:08:13 +02:00
Marek Olšák
cdaf9b89e4 r300g: expose ARB_ES2_compatibility by claiming FIXED format support 2011-10-24 21:05:38 +02:00
Adel Gadllah
fc8196f7a6 nv50: fix max texture levels
MAX_TEXTURE_2D_LEVELS and MAX_TEXTURE_CUBE_LEVELS are supposed to be
14 not 13, while MAX_TEXTURE_3D_LEVELS should be 12 not 10.
2011-10-24 20:07:22 +02:00
Marek Olšák
ef64da8f01 winsys/radeon: don't use the new GEM_WAIT ioctl for now 2011-10-24 20:01:14 +02:00
Tom Fogal
cbb2b4149b Only use gcc visibility support with gcc4+.
I had a colleague hitting issues compiling with an old gcc3.2
system.  These patches got them through.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-24 10:22:52 -06:00
Mathias Fröhlich
2717b8f034 winsys/radeon: restore the old r600g winsys memory characteristics.
Use VRAM for static and immutable buffers. This restores the
recently removed r600g winsys behaviour for memory locations.
This also improoves rendering times on the gpu for some
OpenSceneGraph based test cases by about 15%.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-10-24 18:20:07 +02:00
Brian Paul
50b0069fc1 util: remove gotos in u_upload_mgr.c
We can trivially remove the gotos in two places in this code and make
it a bit more readable.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-24 09:31:01 -06:00
Mathias Fröhlich
9ed88983b0 mesa: Avoid ABA problem on buffer object bind.
Make sure we do not run into the classic ABA problem on buffer object bind,
reusing this name and may be never rebind since we get an new name
that was just deleted and never rebound in between.
The explicit rebinding to the debault object in the current context
prevents the above in the current context, but another context
sharing the same objects might suffer from this problem.

Minor var renaming and comments edited by Brian.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-24 08:37:19 -06:00
Brian Paul
c9bb1bdc48 swrast: fix comment typo (s/texure/texture/) 2011-10-23 20:21:18 -06:00
Brian Paul
b487fc50b0 mesa: remove dead code from teximage.c 2011-10-23 20:17:53 -06:00
Mathias Fröhlich
597df3efda mesa: Fix multithreaded buffer object refcounting.
Buffer objects may be shared across contexts.
Rework the array attrib push/pop implementation
to be thread safe. Make use of more library functions
for this purpose.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-23 21:35:05 +02:00
Marek Olšák
21e3c585f7 r300g: don't call u_trim_pipe_prim in r300_swtcl_draw_vbo
This was dead code anyway.
2011-10-23 20:29:06 +02:00
Marek Olšák
89ce12a2d2 u_blitter: accept overriden width0 and height0
We'll use this soon.
2011-10-23 20:27:07 +02:00
Marek Olšák
37b62cc354 u_blitter: add a copy_texture function which uses views and not resources
The views (sampler views and surfaces) are great tools for changing resource
properties without having to change pipe_resource.
2011-10-23 20:27:06 +02:00
Brian Paul
cf81f2349c intel: remove duplicated #include of texstore.h 2011-10-23 11:22:33 -06:00
Brian Paul
37fdfbfb0e radeon: remove unnecessary #includes of texstore.h 2011-10-23 11:22:23 -06:00
Brian Paul
39503c1419 configs: add vmgfx-related dirs to configs/linux-dri 2011-10-23 11:10:06 -06:00
Brian Paul
b7f670655d swrast: update renderbuffer format assertion
Failed when exercising i965 swrast fallback rendering.
2011-10-23 10:44:47 -06:00
Brian Paul
68da4b50e9 mesa: add swrast_texture_image::Buffer
In the past, swrast_texture_image::Data has been overloaded.  It could
either point to malloc'd memory storing texture data, or it could point
to a current mapping of GPU memory.

Now, Buffer always points to malloc'd memory (if we're not using GPU
memory) and Data always points to mapped memory.  The next step would
be to rename Data -> Map.

This change also involves adding swrast functions for mapping textures
and renderbuffers prior to rendering to setup the Data pointer.  Plus,
corresponding functions to unmap texures and renderbuffers.  This is
very much like similar code in the dri drivers.
2011-10-23 10:44:47 -06:00
Brian Paul
66681b4c8c mesa: remove _mesa_alloc_texmemory(), _mesa_free_texmemory()
Core Mesa no longer does any texture memory allocation.
2011-10-23 10:44:47 -06:00
Brian Paul
6e0f9001fe mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrast
Only swrast and the drivers that fall back to swrast need these fields now.
This removes the last of the fields related to software rendering from
gl_texture_image.
2011-10-23 10:44:47 -06:00
Brian Paul
33abbd4fbd llvmpipe: point out that there's two stencil writemasks
In lp_build_stencil_op() the incoming 'stencil' var is a 2-element array.
There's a front-face writemask and a back-face writemask but we're ignoring
the later.  This patch doesn't fix anything but at least points out the
problem.
2011-10-23 10:09:34 -06:00
Brian Paul
c7aa8da957 llvmpipe: compare front_facing to NULL to improve readability
Compare 'front_facing' to NULL to make it more obvious that front_facing
is a pointer and not a simple boolean value.
2011-10-23 10:09:34 -06:00
Brian Paul
903a14ed91 gallivm: added lp_build_print_ivec4() function 2011-10-23 10:09:33 -06:00
Brian Paul
08b2cc018d mesa: improve the warning message in _mesa_choose_tex_format()
Bug 42128 hits this _mesa_warning() call.
2011-10-23 10:00:04 -06:00
Eric Anholt
dc637b66b2 glsl: Add support for constant expression evaluation on round(), roundEven().
v2: Avoid the C99 rounding functions, because I don't trust
get/setting the C99 rounding mode from inside our library not having
other side effects.  Instead, open-code roundEven() behavior around
Mesa's IROUND, which we're already testing for C99 rounding mode
safety.

Fixes glsl-1.30/compiler/built-in-functions/round*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-23 00:37:14 -07:00
Mathias Fröhlich
b27a67af89 dri-r600: Hook up a drm_descriptor configuration function
Returns a configuration that makes the dri state-tracker-manager
throttle.
2011-10-23 09:08:18 +02:00
Mathias Fröhlich
d5bfcf73fd r600g: make r[67]00 not bail out on PRED_SETNE_INT. 2011-10-23 08:57:43 +02:00
Dave Airlie
8b36958ceb r600g: make if's use PRED_SETNE_INT no matter what.
This is more correct for TGSI if, and with native ints enabled
it fixes 25 piglit fails.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:58 +01:00
Dave Airlie
d54407040b r600g: print inst in hex in dumps
since we have them as hex in the headers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:57 +01:00
Dave Airlie
608a7009d9 r600g: drop specific i2f it should be a trans only op2.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:57 +01:00
Mathias Froehlich
409748ac0b vbo: Clean up unused variables in the vbo module.
Remove some unused or unused but set variables
from the vbo module.
2011-10-22 13:02:35 +02:00
Alan Coopersmith
7986e4c5a9 Convert additional GNUC_MINOR checks to multiplied version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-21 18:40:36 -07:00
Alan Coopersmith
8c509e1181 Fix gcc version checks for _mesa_bitcount
- Fix _GNUC__ typo in both checks
- Fix logic error in check for gcc < 3.4 that breaks for gcc 2.x & older

Without this fix, builds with gcc 3.4.x end up depending on undefined
_mesa_bitcount instead of gcc's __builtin_popcount.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-21 18:39:50 -07:00
Maarten Lankhorst
df8f864bf6 gallium/targets: Add vdpau target for nouveau
Should fall back to shader based decoding (g3dvl) for now.

This is probably broken on systems that support xvmc, because
nouveau_video_buffer_create has no way to know for what api
the buffer is created, so I think this call might need a
separate argument as workaround.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-10-21 23:39:01 +02:00
Christoph Bumiller
27b0c9d513 d3d1x: set primitive restart in the correct draw calls 2011-10-21 23:00:40 +02:00
Christoph Bumiller
bb0482a55b nv50/ir: import SM4 converter 2011-10-21 23:00:40 +02:00
Christoph Bumiller
d988361ead nouveau,nvc0: fix/improve handling of multiple constant buffers 2011-10-21 23:00:40 +02:00
Christoph Bumiller
28271fd00d nvc0: add support for linear and buffer textures and RTs 2011-10-21 23:00:40 +02:00
Christoph Bumiller
73ea0e7fd4 nvc0: add support for clip distance shader outputs 2011-10-21 23:00:40 +02:00
Christoph Bumiller
b4ecef4b1b nvc0: handle more query types 2011-10-21 23:00:40 +02:00
Christoph Bumiller
3cc1dd5b80 nvc0: fix location of the PrimitiveID output 2011-10-21 23:00:39 +02:00
Christoph Bumiller
3637537a1f nvc0: prevent VERTEXID/INSTANCEID from consuming input slots 2011-10-21 23:00:39 +02:00
Christoph Bumiller
44c23e9052 nvc0: fixes for program tessellation parameters 2011-10-21 23:00:39 +02:00
Christoph Bumiller
8bc3a87f40 nv50,nvc0: reset per-instance state for inactive vertex elements 2011-10-21 23:00:39 +02:00
Christoph Bumiller
6994b57a50 nv50,nvc0: reset base element in draw_arrays
It affects VERTEX_BUFFER_FIRST,COUNT submission, too.
2011-10-21 23:00:39 +02:00
Christoph Bumiller
8828004e67 nvc0: apply first_layer offset to all resources with array_size
Makes CUBE arrays work with d3d1x.
2011-10-21 23:00:39 +02:00
Christoph Bumiller
840bc04b43 nvc0: emit state to allow GP to select the RT layer 2011-10-21 23:00:39 +02:00
Christoph Bumiller
6db14200eb nvc0: validate GP samplers, textures 2011-10-21 23:00:39 +02:00
Christoph Bumiller
e104bb9f92 nvc0: fix clear_render_target/depth_stencil region
In all 3 dimensions (now clearing all layers too).
2011-10-21 23:00:39 +02:00
Christoph Bumiller
ff583a47ee nvc0: fix assertion that immediate array buffer fits 2011-10-21 23:00:39 +02:00
Christoph Bumiller
52c8c52b22 nv50/ir: use RDSV to fetch FrontFacing before lowering 2011-10-21 23:00:39 +02:00
Christoph Bumiller
9c930639d9 nv50/ir: fix textureGrad with offsets and in non-FPs 2011-10-21 23:00:39 +02:00
Christoph Bumiller
0e4e0ca6df nv50/ir: add wrap mode for shift operations
D3D1x specifies that only the low 5 bit of the shift are used.
2011-10-21 23:00:39 +02:00
Christoph Bumiller
974102c7c2 nv50/ir: initialize RelocInfo to 0 2011-10-21 23:00:38 +02:00
Christoph Bumiller
7920c3c192 nvc0/ir: fix emission of cvt when register and type size differ 2011-10-21 23:00:38 +02:00
Christoph Bumiller
37a08ddce5 nv50/ir: fix argument count for CUBE_ARRAY texture target 2011-10-21 23:00:38 +02:00
Christoph Bumiller
2ec5c8feb3 nvc0/ir: GP emit address must end up in $r0 2011-10-21 23:00:38 +02:00
Christoph Bumiller
30cb66cd74 nvc0/ir: TXQ requires different lowering from normal TEX 2011-10-21 23:00:38 +02:00
Christoph Bumiller
6b27f14680 nv50/ir: initialize default prog_info values for GP,TP 2011-10-21 23:00:38 +02:00
Christoph Bumiller
63ca1abcc4 nv50/ir: fix memory value equality check 2011-10-21 23:00:38 +02:00
Christoph Bumiller
e3a3844e8d nv50/ir: fix leak in removal of graph root 2011-10-21 23:00:38 +02:00
Christoph Bumiller
d5cfab703b d3d1x: fix/improve OMSetRenderTargets
Don't count trailing NULL RTVs.
Don't skip update if only DSV has changed.
2011-10-21 23:00:38 +02:00
Christoph Bumiller
3dff43d897 d3d1x: avoid translating invalid blend, depth or stencil state 2011-10-21 23:00:38 +02:00
Christoph Bumiller
74ff845e33 d3d1x: add support for buffer views 2011-10-21 23:00:38 +02:00
Christoph Bumiller
1fc5aee8ff d3d1x: improve CreateInputLayout 2011-10-21 23:00:38 +02:00
Christoph Bumiller
856f3336dc d3d1x/context: fix IASetVertexBuffers stride comparison 2011-10-21 23:00:38 +02:00
Christoph Bumiller
5b6f3a2e3c d3d1x: use ZS formats for TYPELESS resources with DS binding 2011-10-21 23:00:38 +02:00
Christoph Bumiller
845808f105 d3d1x: use resource format if view format is UNKNOWN 2011-10-21 23:00:37 +02:00
Christoph Bumiller
5081ebf238 d3d1x: fix shadow comparison to gallium enum off by one 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c0e03c7694 d3d1x: improve CheckFormatSupport 2011-10-21 23:00:37 +02:00
Christoph Bumiller
77574bf0f4 d3d1x: update format mapping table
Use the proper integer formats.
Fix mapping of some PIPE depth formats to DXGI.
2011-10-21 23:00:37 +02:00
Christoph Bumiller
6ab6c43079 d3d1x: fix translation of subresource to layer 2011-10-21 23:00:37 +02:00
Christoph Bumiller
4b7851623e d3d1x: fix initial data upload for 3D textures 2011-10-21 23:00:37 +02:00
Christoph Bumiller
dac5baf2e4 d3d1x: MipLevels -1 in resource view desc means all 2011-10-21 23:00:37 +02:00
Christoph Bumiller
5d70b5d10b d3d1x/dxgi: fix initialization of pipe_box for Present copy 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c463dfe4e4 d3d1x: implement array textures 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c43b2f6a30 nvc0/ir: handle levelZero modifier in TEX emission 2011-10-21 23:00:37 +02:00
Christoph Bumiller
b5f2c0505f nvc0/ir: fix lowering of DIV F32 2011-10-21 23:00:37 +02:00
Christoph Bumiller
cb88426293 d3d1x: fix refcounting of GalliumD3D11DeviceChild objects
An external Release would have lowered the device reference count,
but an internal reference in the context does not raise it (by
design).
2011-10-21 23:00:37 +02:00
Christoph Bumiller
3fc2818f2b nvc0/ir: fix xy confusion typo in readTessCoord 2011-10-21 23:00:37 +02:00
Christoph Bumiller
c8ae342bf3 d3d1x/sm4: save CUSTOMDATA
This is the data for the immediate constant buffer.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
903e3257d0 d3d1x: add FORK/JOIN phase opcodes to declarations
The phase instance counts are not necessarily redeclared so with
the separation of declarations and instructions we wouldn't know
which instance count applies to which phase.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
d2cc8aedb5 d3d1x: add shader signature to sm4_program
Correct linkage requires examining the signature itself, it cannot
be reconstructed from declarations only since unused registers may
have been omitted from them.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
47eb8a23eb d3d1x: attempt to detect D3D10 feature level
Virtually all applications refuse to use the D3D10 backend if this
level is not supported, which makes testing annoying.
2011-10-21 23:00:36 +02:00
Christoph Bumiller
65303c49d1 d3d1x: switch to TGSI SAMPLE opcodes
We don't want to clutter the code or handicap new hardware for
the sake of ancient GPUs on which d3d1x won't ever be used,
much less be fully compliant, anyway.
2011-10-21 23:00:36 +02:00
Brian Paul
6b72eded19 st/mesa: fix a bug in and re-org setup_interleaved_attribs()
We were mis-computing the size of the user-space vertex buffer in
some circumstances.  This led to a failed assertion at u_inlines.h:222
when using the VMware svga driver.

For example, if we had arrays such as:

array[0]: element_offset = 12, stride = 24
array[1]: element_offset = 0, stride = 24

We'd mistakenly compute 'bytes' to be 12 bytes too small.

I've reorganized the function too.  By time it's called, we know that
we've got interleaved arrays either all in one VBO or all in user memory
and the stride is equal for all arrays.

Move the code that lived inside the attr==0 test after the loop.

In the loop we compute the true vertex size.  That size factors into the
pipe->redefine_user_buffer() call later.  Using the vertex size instead
of array[0]'s element_offset fixes the failed assertion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-21 10:09:48 -06:00
Kenneth Graunke
1595c79d9c glsl: Short-circuit lower_if_to_cond_assign when MaxIfDepth is UINT_MAX.
Setting MaxIfDepth to UINT_MAX effectively means "don't lower anything."

Explicitly checking for this common case allows us to avoid walking the
IR, computing nesting levels, and so on.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-10-21 01:11:20 -07:00
Kenneth Graunke
01f9fdc4ac i965: Set MaxIfDepth to UINT_MAX on Gen6+ and 16 on prior generations.
Commit 488fe51cf8 converted the EmitNoIfs
flag to MaxIfDepth, an unsigned integer saying "flatten if-statements
nested beyond this depth."

Unfortunately, i965 left this initialized to 0, which made ir_to_mesa
attempt to flatten all if-statements.  We didn't notice right away
because we usually throw away ir_to_mesa's code in favor of the native
VS and FS backends...but this still creates a lot of unnecessary work.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-21 01:11:17 -07:00
Jeremy Huddleston
9f2abbee62 apple: Use the correct (OpenGL.framework) glViewport and glScissor during init
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-21 00:34:06 -07:00
Jeremy Huddleston
098ecfad83 apple: Silence some debug spew
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-21 00:34:06 -07:00
Marek Olšák
7a3bbd3d5d r600g: cleanup r600_reset_blittable_to_compressed 2011-10-21 03:34:54 +02:00
Vinson Lee
f664d6a2f3 st/mesa: Initialize variable.
ptr is uninitialized if ib is NULL.

Fixes Coverity uninitialized pointer read defect.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-20 17:12:37 -07:00
Alan Coopersmith
b27298055e Add solaris detection for PIPE_ARCH_LITTLE_ENDIAN/PIPE_ARCH_BIG_ENDIAN
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-20 17:02:12 -07:00
Kenneth Graunke
6e160d01f2 i965: Remove copy and pasted gen7_wm_constants state atom.
Now that this is identical to gen6_wm_constants, just use that instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-20 15:25:37 -07:00
Kenneth Graunke
b293b3cbb1 i965: Use AUB_TRACE_WM_CONSTANTS in gen7_prepare_wm_push_constants.
This makes it match gen6_prepare_wm_push_constants.  For some reason, it
had been using AUB_TRACE_NO_TYPE.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-20 15:25:34 -07:00
Kenneth Graunke
61d7f4b9d4 i965: Fix incorrect dirty bit in gen6_prepare_wm_push_constants.
We definitely want CACHE_NEW_WM_PROG, not CACHE_NEW_VS_PROG.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-20 15:25:26 -07:00
Marek Olšák
a04f8c3612 r300g: don't return NULL in resource_from_handle if the resource is too small
The DDX may allocate a buffer with a too small size.
Instead of failing, let's pretend everything's alright.

Such bugs should be fixed in the DDX, of course.

NOTE: This is a candidate for the stable branches.
2011-10-20 23:37:22 +02:00
Brian Paul
c60eb632b7 docs: document known issues with Viewperf 11 2011-10-20 15:13:17 -06:00
Eric Anholt
31874f074c i965/vs: Fix comparisons with uint negation.
The condmod instruction ends up generating garbage condition codes,
because apparently the comparison happens on the accumulator value (33
bits for UD), not the truncated value that would be written.

Fixes vs-op-neg-*

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-20 09:51:58 -07:00
Eric Anholt
73b0a28ba8 i965/fs: Fix comparisions with uint negation.
The condmod instruction ends up generating garbage condition codes,
because apparently the comparison happens on the accumulator value (33
bits for UD), not the truncated value that would be written.

Fixes fs-op-neg-*

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-20 09:50:49 -07:00
Christoph Bumiller
55c5ad8dfa d3d1x: make use of new query types 2011-10-20 18:03:54 +02:00
Christoph Bumiller
1f4f0c41db softpipe: implement/fix TIMESTAMP queries 2011-10-20 18:03:49 +02:00
Christoph Bumiller
10f67c070b gallium: add new query types and missing documentation 2011-10-20 18:03:23 +02:00
Eric Anholt
c0cd947117 mesa: Fix detection of whether an ARB_vp is enabled for two sided lighting.
When there is no ARB_vertex_program program enabled, the Current
pointer points at a default program, so we were always using
VERTEX_PROGRAM_TWO_SIDE, even for fixed function lighting.

Fixes piglit two-sided-lighting*

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-20 08:45:20 -07:00
Eric Anholt
f80e1e7d1d mesa: Round the argument to PixelStoref instead of truncating.
From the GL 2.1 specification, page 114 (page 128 of the PDF):

    "The version of PixelStore that takes a floating-point value
     may be used to set any type of parameter; if the parameter is
     boolean, then it is set to FALSE if the passed value is 0.0
     and TRUE otherwise, while if the parameter is an integer, then
     the passed value is rounded to the nearest integer."

Fixes piglit roundmode-pixelstore.
Note: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-20 08:45:07 -07:00
Yuanhan Liu
46d5fb576a mesa: handle PBO access error in display list mode
Simply generate GL_INVALID_OPERATION error at display list mode. As
explained by Brian, we are going to access PBO data at compile time.
No need to defer the error at execution time.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-20 11:42:54 +08:00
Brian Paul
3560027977 i965: silence signed/unsigned comparison warning
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-10-19 13:54:42 -06:00
Brian Paul
d89c6689df st/mesa: remove primitive restart assertion
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 10:24:52 -06:00
Jakob Bornecrantz
07c3e752f8 st/mesa: Don't have indices buffers map when calling draw 2011-10-19 10:12:38 -06:00
Jakob Bornecrantz
72bd2b603b st/mesa: Implement primitive restart in software 2011-10-19 10:10:12 -06:00
Brian Paul
d3561bd0bc swrast: fix float->uint conversion of gl_FragDepth
Using IROUND() to convert a float depth value to a 32-bit uint Z value.
didn't work (it returns a signed value).  Just use a cast instead

Fixes piglit fbo-depth-array failure with swrast.

Note: this is a candidate for the 7.11 branch.
2011-10-19 09:32:30 -06:00
Brian Paul
ab9136ef75 mesa: better debug messages in _mesa_test_texobj_completeness()
And use a gl_texture_image var to simplify the code a bit.
2011-10-19 09:32:02 -06:00
José Fonseca
35ffe94a34 mesa/st: Backport WPOS adjustment fixes from st_mesa_to_tgsi.c to st_glsl_to_tgsi.cpp.
This is a trivial verbatim copy of the code from Christoph Bumiller's commit
f986a6560f.

Fixes fdo 39939 and 39942.
2011-10-19 16:59:47 +02:00
Thomas Hellstrom
60f67cd1f1 winsys/svga: Remove some unneeded debug code
This code isn't really relevant since the kernel takes care not
to destroy busy GMR buffers.

Also with the advent of fence objects, the code was incorrect since
it didn't refcount fence handles.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-19 15:33:26 +02:00
Vinson Lee
116b7bb5ea scons: Add uniform_query.cpp to SConscript. 2011-10-18 18:39:11 -07:00
Yuanhan Liu
02b801c1ed mesa: handle the pbo case for save_Bitmap
Wrap _mesa_unpack_bitmap to handle the case that data is stored in pixel
buffer object.

This would make calling Bitmap with data stored in PBO by display list work.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-19 09:29:44 +08:00
Yuanhan Liu
403cf7c56f mesa: fix inverted pbo test error at _mesa_GetnCompressedTexImageARB
It seems like a typo.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-19 09:28:51 +08:00
Yuanhan Liu
9024d8af0a mesa: generate error if pbo offset is not aligned with the size of specified type
v2: quote the spec; explicitly exclude the GL_BITMAP case to make code
    more readable. (comments from Ian)

v3: Cast the offset by GLintptr to remove the compile warning(comments
    from Brian).

    I also found that I should use _mesa_sizeof_packed_type() instead,
    as it includes packed pixel type, like GL_UNSIGNED_SHORT_5_6_5.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-19 09:25:30 +08:00
Yuanhan Liu
76669381c0 i965: setup address rounding enable bits
The patch(based on the reading of the emulator) came from while I was
trying to fix the oglc pbo texImage.1PBODefaults fail. This case
generates a texture with the width and height equal to window's width
and height respectively, then try to texture it on the whole window.
So, it's exactly one texel for one pixel.  And, the min filter and mag
filter are GL_LINEAR. It runs with swrast OK, as expected. But it failed
with i965 driver.

Well, you can't tell the difference from the screen, as the error is
quite tiny. From my digging, it seems that there are some tiny error
happened while getting tex address. This will break the one texel for
one pixel rule in this case. Thus the linear result is taken, with tiny
error.

This patch would fix all oglc pbo subcase fail with the same issue on
both ILK, SNB and IVB.

v2: comments from Ian, make the address_round filed assignment consistent.
    (the sampler is alread memset to 0 by the xxx_update_samper_state
     caller, so need to assign 0 first)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-10-19 09:24:54 +08:00
Brian Paul
483ea0a76f i915: make i830/i915_hiz_resolve_noop() static 2011-10-18 19:12:27 -06:00
Brian Paul
5485192fc8 mesa: use format string in _mesa_error() call to silence warning 2011-10-18 19:00:07 -06:00
Brian Paul
973b4ddd0e i965: remove unused vars in brw_set_ff_sync_message() 2011-10-18 19:00:07 -06:00
Ian Romanick
58a7461e16 glsl_to_tgsi: Use _mesa_generate_parameters_list_for_uniforms
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-10-18 17:26:38 -07:00
Ian Romanick
b2572928a5 ir_to_mesa: Generate gl_program_parameter list by walking the GLSL IR.
Generate the program parameters list by walking the IR instead of by
walking the list of linked uniforms.  This simplifies the code quite a
bit, and is probably a bit more correct.  The list of linked uniforms
should really only be used by the GL API to interact with the
application.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Bryan Cain <bryancain3@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
2011-10-18 17:26:38 -07:00
Ian Romanick
bbbb8345ab ir_to_mesa: Move some things outside the 'extern "C"' blocks
Having a few of these includes or forward declarations inside the
'extern "C"' block can cause problems later.  Specifically, it
prevents C++ linkage functions from being added to ir_to_mesa.h and
makes G++ angry if 'struct foo' is seen both inside and outside an
'extern "C"'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:38 -07:00
Ian Romanick
1375d67984 mesa: Use glsl_type::gl_type in glGetActiveUniform
This has the same value has gl_program_parameter::DataType field.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:38 -07:00
Ian Romanick
a541ff3fb9 mesa: Move _mesa_GetActiveUniformARB to uniform_query.cpp
Fold _mesa_get_active_uniform into its only caller in the process.
More changes are coming soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:37 -07:00
Ian Romanick
118fd08b58 mesa: Simplify uniform debug logging logic
This simplificiation was enabled by the earlier refactors that
eliminated the references to the assembly shaders stored in the
gl_shader_program structure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 17:26:37 -07:00
Kenneth Graunke
188f074255 i965: Disassemble Ivybridge Data Port/Data Cache messages.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:56 -07:00
Kenneth Graunke
dcf03e7c09 i965: Document most of the brw_instruction message structs.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
53798f90e8 i965: Rename pixel_scoreboard_clear to last_render_target for clarity.
Finding this bit in the documentation proved challenging.  It wasn't in
the SEND instruction's message descriptor section, nor the data port
message descriptor section.  It turns out to be part of the Render
Target Write message's control bits, and in the documentation is named
"Last Render Target Select".

Shaders that use Multiple Render Targets should set this bit on the last
RT write, but not on any prior ones.

The GPU does update the Pixel Scoreboard appropriately, but doesn't
document this bit as directly causing a scoreboard clear.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
feaff3aeeb i965: Remove duplicate copies of mlen & rlen from instruction decode.
After printing the details of a specific message, we always print out
the message length and response length with nice "mlen" and "rlen"
labels.

For Gen5+ URB writes, we were dumping mlen and rlen a second time:
urb 0 urb_write interleave used complete mlen 5, rlen 0 mlen 5 rlen 0

Also, for Gen6 data port messages, we were including mlen and rlen in
the tuple of undecipherable integers.

Both of these are completely redundant.  So, remove them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
fa0aa3796d i965: Factor out code for setting Message Descriptors.
Every brw_set_???_message function had duplicated code, per-generation,
to set the Message Descriptor and Extended Message Descriptor bits
(SFID, message length, response length, header present, end of thread).

However, these fields are actually specified as part of the SEND
instruction itself; individual types of messages don't even specify
them (except for header present, but that's in the same bit location).

Since these are exactly the same regardless of the message type, just
create a function to set them, using the generic message structs.  This
not only shortens the code, but hides a lot of the per-generation
complexity (like the SFID being in destreg__conditionalmod) in one spot.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
43ccd3200c i965: Remove EOT parameter from brw_SAMPLE and brw_set_sampler_message.
The existing code asserted that eot == 0, as it doesn't make sense for
a thread to sample a texture as the last thing it does.

It doesn't make much sense to pass around a dead parameter either.
Especially for a function which already has a long parameter list.

So, remove the parameter and just set EOT to 0.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
0ec04c5a33 i965: Document the brw_instruction Message Descriptor structures.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
2e124388a4 i965: Rename BRW_MESSAGE_TARGET_* to BRW_SFID_* and document them.
When reading the data port code, it was not clear to me what these
values meant, nor where I could find them in the documentation.
Especially since the latest BSpec and older PRMs document them in
radically different places...neither of which are near the descriptions
of individual messages.

Cite the documentation, and rename them to SFID to signify that these
are Shared Function IDs that one can read about in the GPU overview,
rather than arbitrary bitfields.  While we're add it, make them an enum.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
bbea5c5a5a i965: Clarify check for which cache to use on Gen6 data port reads.
Currently, we use the Render Cache for scratch access (read/write data)
and the Sampler Cache for all read only data (pull constants).

Reversing the condition here is clearer: if the caller requested the
Render Cache, use that.  Otherwise, they requested the Data Cache
(which does not exist on Gen6) or Sampler Cache, so use the Sampler
Cache.

This should not change behavior in any way.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 15:57:55 -07:00
Kenneth Graunke
0d4a9ba9b2 i965: Use Ivybridge's "Legacy Data Port" for reads/writes.
Using the constant cache for reads isn't going to work for scratch
reads (variably-indexed arrays or register spills), as these aren't
constant at all.

Also, in the new VS backend, use the proper message number for OWord
Dual Block Write messages.  It's now 10, instead of 9.

+205 piglits.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-18 15:57:47 -07:00
Brian Paul
9a8791c889 softpipe: remove unused vars in softpipe_clear() 2011-10-18 15:43:22 -06:00
Kenneth Graunke
3c22e35165 glsl: Stop tree grafting if a variable is overwritten as an 'out' param.
While reviewing some compiler cleanups I'd sent out, Paul noticed that
tree grafting wasn't taking "out" parameters into account.

Further investigation revealed that it isn't strictly necessary: ir_call
ends basic blocks, and tree grafting currently only operates on basic
blocks.  So calls already kill grafts.

However, just to be safe, this patch makes "out" parameters explicitly
kill grafts.  Paul and I both prefer this.  It's a bit clearer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-10-18 12:24:48 -07:00
Chad Versace
f8377b411d intel: Add 'mode' param to intel_region_map
The 'mode' param is a bitset of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT.

A future commit will perform buffer resolves in intel_region_map().  So,
even though the access mode is irrelevant to the GTT, the extra
information allows us to intelligently avoid unneccessary buffer resolves.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
7b0f748efa intel: Add HiZ operations to intel_context::vtbl for all drivers
Add the following to the vtbl:
    hiz_resolve_depthbuffer
    hiz_resolve_hizbuffer

For all drivers for which HiZ is not enabled, the methods are set to be
no-ops. If HiZ is enabled, the methods are currently to set to empty
stubs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
b393fa9167 i965: Initialize intel_context::vtbl after calling intelInitContext()
intel_context::gen field is set by intelInitContext(). So, by calling
intelInitContext() before initializing the vtable, we can can construct
different vtables for different gens.

Specifically, this allows us to set the HiZ operations to be no-ops for
contexts for which HiZ is not enabled.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
ef6de0141c intel: Fix scatter/gather for depthstencil textures
During anholt's MapTextureImage refactoring, the call to
intel_tex_image_s8z24_create_renderbuffers was missplaced. It needs to
occur *after* the miptree is allocated.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
b48e02383e i965/gen6: Fix segfault in prepare_blend_state()
Don't dereference the color buffer if one isn't attached.

This fixes the following Piglit tests in my experimental HiZ branch:
    glean/logicOp
    glean/paths

Note: This is a candidate for the stable branches.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
8c7c589c4e vbo: Redeclare bind_array() as non-static vbo_bind_array()
This is necessary because i965 will need to call vbo_bind_array() when
cleaning up after a buffer resolve meta-op.

Detailed Explanation
--------------------
The vbo module tracks vertex attributes separately from the gl_context.
Specifically, the vbo module maintins vertex attributes in
vbo_exec_context::array::inputs, which is synchronized with
gl_context::Array::ArrayObj::VertexAttrib by vbo_bind_array().
vbo_draw_arrays() calls vbo_bind_array() to perform the synchronization
before calling the real draw call, vbo_context::draw_arrays.

Intel hardware accomplishes buffer resolves with a meta-op. Frequently,
that meta-op must be performed within glDraw* in the moment immediately
before the draw occurs (The hardware designers hate us...). After
performing the meta-op, but before calling vbo_bind_array(), the
gl_context's vertex attributes will have been restored to their original
state (that is, their state before the meta-op began), but the vbo
module's vertex attribute are those used in the last meta-op. Therefore we
must manually synchronize the two with vbo_bind_array() before continuing
with the original draw command (that is, the one requested with glDraw*).

See brw_predraw_resolve_buffers(), which will be added in a future commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:54 -07:00
Chad Versace
fd7c46f53f mesa: Add dd_function_table::PrepareExecBegin
This hook allows the driver to prepare for a glBegin/glEnd.

i965 will use the hook to avoid avoid recursive calls to FLUSH_VERTICES
during a buffer resolve meta-op.

Detailed Justification
----------------------
When vertices are queued during a glBegin/glEnd block, those vertices must
of course be drawn before any rendering state changes. To enusure this,
Mesa calls FLUSH_VERTICES as a prehook to such state changes. Therefore,
FLUSH_VERTICES itself cannot change rendering state without falling into
a recursive trap.

This precludes meta-ops, namely i965 buffer resolves, from occuring while
any vertices are queued. To avoid that situation, i965 must satisfy the
following condition: that it queues no vertex if a buffer needs resolving.
To satisfy this, i965 will use the PrepareExecBegin hook to resolve all
buffers on entering a glBegin/glEnd block.

--------
v2: Don't add dd_function_table::CleanupExecEnd. Anholt and I discovered
    that hook to be unnecessary.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
4b6311978f swrast: Fix fastpaths for glRead/WritePixels(GL_DEPTH_STENCIL)
In some cases, Intel hardware requires that depth and stencil buffers be
separate. To accommodate swrast, i965 resorts to hackery that causes
a segfault in the fastpaths of draw_depth_stencil_pixels() and
read_depth_stencil_pixels().

The hack is that i965 sets framebuffer->Attachment[BUFFER_DEPTH].Renderbuffer
and framebuffer->Attachment[BUFFER_STENCIL].Renderbuffer to a dummy
renderbuffer for which the GetRow accessors and friends are null. The real
buffers are located at framebuffer->_DepthBuffer and framebuffer->_Stencilbuffer.

To fix the segault, this patch skips the fastpath if
framebuffer->Attachment[BUFFER_DEPTH].Renderbuffer->GetRow is null.

Note: This is a candidate for the 7.11 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
aa97ababfc meta: Bump MAX_META_OPS_DEPTH from 2 to 8
When i965 uses (in the near future) meta-ops to perform buffer resolves,
the meta-op stack exceeds depth 2. I bumped it to 8 because... 8 is bigger
than 2, but not too big.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
c5f4024a79 meta: Add flag MESA_META_SELECT_FEEDBACK
If this flag is set, then _mesa_meta_begin/end will save/restore the state of
GL_SELECT and GL_FEEDBACK render modes.

Intel's future buffer resolve meta-ops will require this, since buffer resolves
may occur when the GL_RENDER_MODE is GL_SELECT.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Chad Versace
c56d0a61b9 mesa: Declare _mesa_RenderMode as non-static
This is required in order for meta-ops to save/restore the GL_RENDER_MODE
state.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:42:53 -07:00
Kenneth Graunke
2e5a1a254e intel: Convert from GLboolean to 'bool' from stdbool.h.
I initially produced the patch using this bash command:
for file in {intel,i915,i965}/*.{c,cpp,h}; do [ ! -h $file ] && sed -i
's/GLboolean/bool/g' $file && sed -i 's/GL_TRUE/true/g' $file && sed -i
's/GL_FALSE/false/g' $file; done

Then I manually added #include <stdbool.h> to fix compilation errors,
and converted a few functions back to GLboolean that were used in core
Mesa's function pointer table to avoid "incompatible pointer" warnings.

Finally, I cleaned up some whitespace issues introduced by the change.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chad Versace <chad@chad-versace.us>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-18 11:38:39 -07:00
Eric Anholt
1b45d68c11 mesa: Make the program texel offsets limits available with GLSL 1.30.
It was previously under gpu_shader4, but I'm pretty sure everyone's
going to be doing GLSL 1.30 first (since gpu_shader4 is basically 1.30
plus a bunch of extra stuff).

Fixes piglit glsl-1.30/texel-offset-limits.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-18 11:14:23 -07:00
Neil Roberts
5625f78cd7 meta: Fix saving the active program
When saving the active program in _mesa_meta_begin, it was actually
saving the fragment program instead. This means that if the
application binds a program that only has a vertex shader then when
the meta saved state is restored it will forget the bound program.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41969
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-18 11:12:58 -07:00
Eric Anholt
7ec2b0d0d6 mesa: Convert fixed function fragment program generator to GLSL IR.
This is a step towards providing a direct route for drivers accepting
GLSL IR for codegen.  Perhaps more importantly, it runs the fixed
function fragment program through the GLSL IR optimization.  Having
seen how easy it is to make ugly fixed function texenv code that can
do unnecessary work, this may improve real applicatinos.
2011-10-18 10:54:32 -07:00
Eric Anholt
57f7978b1d mesa: Add a flag for shader programs to allow SSO linkage in GLES2.
On converting fixed function programs to generate GLSL, the linker
became cranky that we were trying to make something that wasn't a
linked vertex+fragment program.  Given that the Mesa GLES2 drivers
also support desktop GL with EXT_sso, just telling the linker to shut
up seems like the easiest solution.
2011-10-18 10:54:32 -07:00
Eric Anholt
f868cb0963 glsl: Add gl_CurrentAttrib{Vert,Frag}MESA internal builtin uniforms.
These will be used by the FF VS/FS to represent the current attributes
when they don't have an active vertex array.
2011-10-18 10:54:32 -07:00
Eric Anholt
b64ecf7db8 ff_fragment_shader: Use FRAG_RESULT_COLOR to write all our colors at once.
This is a slight simplification on the way to actually generating GLSL
fragment shaders.
2011-10-18 10:54:31 -07:00
Thomas Hellstrom
6235846cb7 svga: Plug a fence leak
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-18 10:37:12 +02:00
Stéphane Marchesin
0b3842edb1 i915g: Use the right shader limits. 2011-10-17 21:43:46 -07:00
Stéphane Marchesin
3637b5f0dd i915g: Add TODO. 2011-10-17 21:43:46 -07:00
Mathias Fröhlich
e556983fc8 r600g: Use the bitfield define matching the register it is used for.
Fix a typo that should result in the same code.
2011-10-18 06:35:21 +02:00
Marcin Slusarz
638d5a10f3 st/xorg: fix build when /lib/gallium directory does not exist yet
TARGET was not defined, so make checked directory instead of file
2011-10-17 22:57:27 +02:00
Marcin Slusarz
106c99fee5 targets/va/vdpau/xvmc: don't rebuild target lib every time
Dependency on target directory caused unnecessary relink. Remove them.
2011-10-17 22:57:27 +02:00
Marcin Slusarz
adbab41e67 st/xorg: remove target library on make clean 2011-10-17 22:57:27 +02:00
Marcin Slusarz
757390491c gallium/targets: use c++ compiler for linking
As pointed out by Michel Dänzer, gcc -lstdc++ doesn't work on all systems,
because it may require other libraries which are only pulled in implicitly
by g++. And libstdc++ is available only with GNU compiler.

Use c++ compiler for linking and remove redundant LDFLAGS += -lstdc++
all over the tree.
2011-10-17 22:57:27 +02:00
Tom Fogal
c0573fb29d Add an autoconf option for mangling Mesa.
In addition to setting up the flags correctly, this renames the
generated libraries to ensure they get 'Mangled' in the name.
This is very useful for distros and the like, where mangled Mesa
and non-mangled GL libraries typically need to be installed
side-by-side.

Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-10-17 10:14:26 -06:00
Tom Stellard
53d32600cc r300/compiler: Try to eliminate REPL_ALPHA instructions
Scalar instruction that need to write to the xyz components of a
register must reserve the RGB instruction slot for a REPL_ALPHA
instruction.  With this commit, the scheduler will attempt to free
the RGB slot by moving the write to the w component of a register.
2011-10-16 19:54:48 -07:00
Tom Stellard
8327fd18c9 r300/compiler: More agressive RGB to Alpha conversions 2011-10-16 19:54:48 -07:00
Tom Stellard
653c7af3d6 r300/compiler: Only convert RGB->Alpha when optimizations are enabled 2011-10-16 19:54:48 -07:00
Yuanhan Liu
e9edcf8b1d mesa: add a function to do the image data copy stuff for save_CompressedTex(Sub)Image
Introuduce a simple function called copy_data to do the image data copy
stuff for all the save_CompressedTex*Image function. The function check
the NULL data case to avoid some potential segfault. This also would
make the code a bit simpler and less redundance.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-17 09:41:58 +08:00
José Fonseca
1448bdf1c0 configure: Use -fno-builtin-memcmp.
Issue spotted by Adam Jackson <ajax at redhat.com>.

http://lists.freedesktop.org/archives/mesa-dev/2011-June/009077.html
2011-10-16 16:11:46 +01:00
José Fonseca
e1e03ce492 gallivm: Eliminate tgsi_util_get_full_src_register_sign_mode call.
It complicates more than it simplifies, now that there's only one negate
bit on TGSI registers.
2011-10-16 14:18:42 +01:00
José Fonseca
e9c1d87ce7 llvmpipe: Use lp_build_ifloor_fract for exp2 calculation.
Instead of separate ifloor / fract calls.

No change for SSE4.1 code, but less FP<->SI conversions on non SSE4.1
systems.
2011-10-16 14:18:41 +01:00
Marek Olšák
1350882e49 Revert "r300g: fix rendering with a non-zero index bias in draw_elements_immediate"
This reverts commit 5506f6ef96.

It breaks more things than it fixes.
2011-10-16 03:19:11 +02:00
Chad Versace
4bcda85698 swrast: Remove redundant term in logic expression
Fix is in {read,draw}_depth_stencil_pixels().  If depthRb == stencilRb,
then it is redundant to check depthRb->x *and* stencilRb->x.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-15 15:49:03 -07:00
Chad Versace
244a02c47d swrast: Fix fastpaths in glRead/WritePixels(GL_DEPTH_STENCIL)
For glReadPixels, the user supplied pixels have format
GL_UNSIGNED_INT_24_8.  But, when the depthstencil buffer's format was
MESA_FORMAT_S8_Z24, the fastpath read from the buffer without reordering
the depth and stencil bits. To fix this, this patch just skips the
fastpath when the format is not MESA_FORMAT_Z24_S8.

The problem and fix for glWritePixels is analagous.

Fixes the Piglit tests below on i965/gen6 and causes no regressions.
   general/depthstencil-default_fb-drawpixels-24_8
   general/depthstencil-default_fb-readpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-drawpixels-24_8
   EXT_packed_depth_stencil/fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8

Note: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-15 15:45:07 -07:00
Christoph Bumiller
9934bfe28d nv50,nvc0: extend formats table for integer formats 2011-10-15 14:12:31 +02:00
Christoph Bumiller
a4f26f2bea gallium: add PIPE_BIND_BLENDABLE flag
This is required for an accurate implementation of d3d1x's
CheckFormatSupport query.

It also seems generally useful for state trackers, which could
choose alternative rendering paths or formats if blending would
come at a significant performance loss.
2011-10-15 14:12:31 +02:00
Tom Stellard
0dc97e7fd4 r300/compiler: Enable reg rename pass on r500 and run it before optimizations
The scheduler and the register allocator are now smart enough to handle
it.
2011-10-14 18:30:14 -07:00
Tom Stellard
163629fd05 r300/compiler: Implement the texture semaphore
The texture semaphore allows for prefetching of texture data.  On my
RV515, this increases the FPS of Lightsmark by 33% (This is with the
reg_rename pass enabled, which is enabled in the next commit).

There is a new env variable now called RADEON_TEX_GROUP, which allows
you to specify the maximum number of texture lookups to do at once.
The default is 8, but different values could produce better results
for various application / card combinations.
2011-10-14 18:30:14 -07:00
Tom Stellard
51fe9994bd r300/compiler: Don't pair output writes with GPR writes in the scheduler 2011-10-14 18:30:14 -07:00
Tom Stellard
6fafb6beb7 r300/compiler: Prevent regalloc from creating non-native swizzles 2011-10-14 18:30:14 -07:00
Tom Stellard
47c7512846 r300/compiler: Allow merged instructions to be scheduled on demand
We no longer emit full instructions immediately after they have been
merged.  Instead merged instructions are added to the ready list and
the scheduler can commit them whenever it wants.
2011-10-14 18:30:14 -07:00
Ian Romanick
c19f8ab279 mesa/vbo: Treat attribute 0 and vertex as the same
This is supported by the pseudo-code on pages 27 and 28 (pages 41 and
42 of the PDF) of the OpenGL 2.1 spec.  The last part of the
implementation of ArrayElement is:

    if (generic attribute array 0 enabled) {
      if (generic vertex attribute 0 array normalization flag is set, and
	  type is not FLOAT or DOUBLE)
	VertexAttrib[size]N[type]v(0, generic vertex attribute 0 array element i);
      else
	VertexAttrib[size][type]v(0, generic vertex attribute 0 array element i);
    } else if (vertex array enabled) {
      Vertex[size][type]v(vertex array element i);
    }

Page 23 (page 37 of the PDF) of the same spec says:

    "Setting generic vertex attribute zero specifies a vertex; the
    four vertex coordinates are taken from the values of attribute
    zero. A Vertex2, Vertex3, or Vertex4 command is completely
    equivalent to the corresponding VertexAttrib* command with an
    index of zero."

Fixes piglit test attribute0.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-14 09:40:31 -07:00
Marek Olšák
ae272a92a1 r300g: set max vertex samplers to 0 on swtcl chipsets
This should fix a bug added by f5bfe54a.

Might also fix:
https://bugs.freedesktop.org/show_bug.cgi?id=41715
2011-10-14 15:06:01 +02:00
Thomas Hellstrom
5dddeb7776 winsys/svga: Rework buffer allocation to make it more robust v2.
Don't allow any "CPU" buffers to be allocated by the pb_fenced
buffer manager, since we can't protect against failures during
buffer validation.
Also, add an extra slab buffer manager to allocate buffers from
the kernel if there is a failure to allocate from our big buffer pool.
The reason we use a slab manager for this, is to avoid allocating
many very small buffers from the kernel.

v2: Increased VMW_MAX_BUFFER_SIZE and fixed some comments.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:19 +02:00
Thomas Hellstrom
83d57635bc dri-vmwgfx: Hook up a drm_descriptor configuration function
Returns a configuration that makes the dri state-tracker-manager
throttle.
Also disable kernel-based throttling.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:15 +02:00
Thomas Hellstrom
bde2fc5a71 st/dri: Hook up throttling based on the drm driver_descriptor configuration
Hooks up throttling if there is a configuration function present and
it indicates that throttling is desired.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:11 +02:00
Thomas Hellstrom
ec7d5b8c02 drm_driver: Add a configuration function to the driver descriptor.
Adds a possibility for the state tracker manager to query the
target for a specific configuration.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:53:05 +02:00
Thomas Hellstrom
5a6ca7e9f2 svga/winsys: Make sure a flush always inserts and returns a fence if requested
Needed for throttling.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrant <jakob@vmware.com>
2011-10-14 09:53:01 +02:00
Thomas Hellstrom
23c41233ce st/dri: Implement the new dri2 throttling extension
But don't hook it up just yet until we figure out a good way to do that.
Also, we should, in the future, add driconf options to control what
throttling reasons should be honored, and the number of outstanding
swaps allowed.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2011-10-14 09:52:57 +02:00
Thomas Hellstrom
511dc295f8 dri2: Implement a throttle dri extension.
The X server has limited throttle support on the server side,
but doing this in the client has some benefits:

1) X server throttling is per client. Client side throttling can be done
per drawable.

2) It's easier to control the throttling based on what client is run,
for example using "driconf".

3) X server throttling requires drm swap complete events.

So implement a dri2 throttling extension intended to be used by direct
rendering clients.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-10-14 09:52:53 +02:00
Brian Paul
718cbe4ba9 swrast: be a bit smarter in clip_span()
If no pixels pass the clip test, return false.
2011-10-13 17:16:19 -06:00
Brian Paul
bc4ef33108 mesa: remove unused gl_sampler_object::_CompleteTexture field 2011-10-13 17:14:24 -06:00
Brian Paul
6fc6d5a09e meta: fix redBits size test in get_temp_image_type()
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41768
2011-10-13 17:12:44 -06:00
Mathias Froehlich
7b09a94282 st/wgl: Release stw_framebuffer::mutex after pbuffer creation.
This change releases the stw_framebuffer::mutex past creation of
the pbuffer stw_framebuffer. Without this change the pbuffers
lock is never released. Since on win32 mutexes are recursive, this
does not hurt as long as all actions on a context are done from
the same thread. But if, for example, context creation happens in
a different thread than usage, every access to the context will
block for ever.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-10-13 19:53:13 +01:00
Marcin Slusarz
349e4db99e st/xorg: fix build without LLVM 2011-10-13 19:02:20 +02:00
Paul Berry
7a4fee71aa i965 Gen6+: De-compact clip plane constants for old VS backend.
In commit 018ea68d87, when I
de-compacted clip planes on Gen6+, I updated both the old and new VS
back-ends to reflect the change in how clip planes are stored, but I
failed to change the code in gen6_vs_state.c that uploads clip plane
constants when using the old VS back-end.

As a result, if the set of enabled clip planes wasn't contiguous
starting with 0, then clipping would not occur properly.  This patch
corrects gen6_vs_state.c to upload clip plane constants in the new
de-compacted form.

This only affects the old VS back-end (which is used for
fixed-function and ARB vertex programs, not for GLSL vertex shaders).

Fixes Piglit test fixed-clip-enables.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41603

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 08:41:16 -07:00
Brian Paul
a9e5528f09 st/mesa: kill instruction if writemask=0 in eliminate_dead_code_advanced()
This fixes a bug where we'd wind up emitting an invalid instruction like
MOVE R[0]., R[1];  - note the empty/zero writemask.  If we don't write to
any dest register channels, cull the instruction.

v2: simply change/fix the existing test for instruction culling.
2011-10-13 08:35:19 -06:00
Brian Paul
e06277bd88 s/format/baseFormat/ to be more explicit
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:28 -06:00
Brian Paul
241b3e4bbe mesa: remove redundant buffer checks in copytexsubimage_error_check2()
Again, there was already a call to _mesa_source_buffer_exists() earlier in
the function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:24 -06:00
Brian Paul
63aa53bf34 mesa: remove redundant buffer checks in copytexture_error_check()
There was already a call to _mesa_source_buffer_exists() earlier in
the function.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-13 07:38:03 -06:00
Brian Paul
504d0add12 mesa: check attachment Type field in renderbuffer_exists()
Instead of the renderbuffer pointer.  In the future, attaching a texture
may not mean the renderbuffer pointer gets set too.
Plus, remove some commented-out assertions.
2011-10-13 07:37:43 -06:00
Brian Paul
e5fef34c21 mesa: consolidate _mesa_source/dest_buffer_exists()
v2: add a 'reading' parameter to distinguish between reading and writing
to the renderbuffer (we don't want to check if _ColorReadBuffer is null
when we're about to draw).  Eric found this mistake.
2011-10-13 07:37:43 -06:00
Christoph Bumiller
f1f7645f23 d3d1x: fix check for PIPE_CAP_CONDITIONAL_RENDER 2011-10-13 11:04:08 +02:00
José Fonseca
983fa4ad52 scons: Use -fno-builtin-memcmp.
ipers framerate on llmvpipe improves 60%.

Issue spotted by Adam Jackson <ajax at redhat.com>.

http://lists.freedesktop.org/archives/mesa-dev/2011-June/009077.html
2011-10-12 20:43:01 +01:00
Dave Airlie
ae1153c4ac softpipe: fix regression with tex tile cache since integer support.
Don't use the uint/int paths for ZS formats for tex tile cache.

fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41695

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-12 08:25:28 +01:00
Brian Paul
7aab0fbaa6 mesa: make _mesa_update_depth/stencil_buffer() static
These functions were only called in framebuffer.c where they were defined.
Remove the unneeded attIndex parameter too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-11 18:43:36 -06:00
Chad Versace
e9adfa2ba1 intel: Assert that no batch is emitted if a region is mapped
What I would prefer to assert is that, for each region that is currently
mapped, no batch is emitted that uses that region's bo. However, it's much
easier to implement this big hammer.

Observe that this requires that the batch flush in intel_region_map() be
moved to within the map_refcount guard.

v2: Add comments (borrowed from anholt's reply) explaining why the
assertion is a good idea.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-11 17:16:31 -07:00
Paul Berry
d06cc42c3c i965: Fix computation of abs(-x) in FS
When updating a register reference to reflect the fact that we were
taking its absolute value, the fragment shader back-end failed to
clear the negate flag, resulting in abs(-x) getting computed as
-abs(x).

I also found (and fixed) a similar problem in brw_eu.h, but I'm not
aware of an actual manifestation of that problem.

Fixes piglit test glsl-fs-abs-neg-with-intermediate.
2011-10-11 11:08:13 -07:00
Marcin Slusarz
7f3de70c3c nv50: don't crash on TXD opcode
It doesn't implement full TXD, but at least it does not crash.
Fixes arb_shader_texture_lod-texgrad and glsl-fs-shadow2DGradARB-*
piglit tests.
2011-10-11 19:35:04 +02:00
Kenneth Graunke
3f5e938a9d i965: Replace incorrect use of GLboolean with enum brw_compression.
brw_set_compression_control took a GLboolean as an argument, then
promptly used a switch statement to compare it with various enumeration
values.  Clearly it's not actually a boolean.

Introduce a new enumeration type, enum brw_compression, and use that.

Found by converting GLboolean to bool; clang then gave warnings about
switching on a boolean and ultimately duplicated case errors.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-11 10:26:52 -07:00
Ian Romanick
da2e41cd88 mesa: Only allow queries of window system FBO on desktop GL w/ARB_fbo
Neither OES_framebuffer_object nor EXT_framebuffer_object allow
querying the window system FBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:01:09 -07:00
Ian Romanick
a8328cc132 mesa: Accept GL_DEPTH and GL_STENCIL for window system FBO only
Previously GL_DEPTH_BUFFER and GL_STENCIL_BUFFER were (incorrectly)
allowed for both.  Those enums don't even really exist!  Now GL_DEPTH
and GL_STENCIL are only allowed for the window system FBO.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:00:54 -07:00
Brian Paul
b875838ec3 svga: remove old, unused sincos code for SM2.0 2011-10-11 09:55:48 -06:00
Brian Paul
94b219b9e2 svga: remove support for shader model 2.0
We've been requiring SM 3.0 all along so this just removes unused code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-10-11 09:30:09 -06:00
Dave Airlie
396ac41fc2 softpipe: add integer support
This adds support to the clear and tile caches for integer storage
and clearing, avoiding any floating paths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 16:13:29 +01:00
Dave Airlie
866f9b18c6 gallium: rename ZS stencil type to UINT (v2)
these are never USCALED, always UINT in reality.

taken from some work by Christoph Bumiller

v2: fixup formatting of table + tabs

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 16:13:29 +01:00
Brian Paul
6b3e75de7c llvmpipe: don't support rendering to sRGB surfaces
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=34199
2011-10-11 07:47:25 -06:00
Brian Paul
11938c87a3 draw/llvm: set draw->pt.user.planes field in draw_set_clip_state()
Previously it was getting set in draw_set_mapped_constant_buffer() but
if there were no shader constants, that function wasn't called.  So the
pt.user.planes field was null and we died when we tried to access the
clip planes in the LLVM-generated code.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41663

Note: This is a candidate for the 7.11 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-11 07:41:36 -06:00
Brian Paul
e6c237cfd6 draw/llvm: fix hard-coded number of total clip planes
Instead of 12 use DRAW_TOTAL_CLIP_PLANES.  The max number of user-defined
clip planes was increased to 8 so the total number of planes is 14.
This doesn't fix any specific bug, but clearly the old code was wrong.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-10-11 07:41:22 -06:00
Brian Paul
f0c036536f i915g: fix warning about void pointer arithmetic 2011-10-11 07:40:11 -06:00
Stéphane Marchesin
a13eed4b82 i915g: Remove duplicated comment. 2011-10-10 18:18:37 -07:00
Stéphane Marchesin
4855522678 i915g: Update TODO once more. 2011-10-10 16:56:49 -07:00
Chad Versace
f378e8fea0 i965: Change type of brw_context.primitive from GLenum to hardware primitive
For example, GL_TRIANLGES is converted to _3DPRIM_TRILIST.

The conversion is necessary because HiZ and MSAA resolve operations emit
a 3DPRIM_RECTLIST, which cannot be conveyed by GLenum.

As a consequence, brw_gs_prog_key.primitive is also converted.

v2
----
- [anholt] Split brw_set_prim into brw/gen6 variants in previous commit,
  since not much code is really shared between the two.
- [anholt] Replace switch statements with table lookups, since this is
  a hot path.

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:24:11 -07:00
Chad Versace
9559ca600d i965: Split brw_set_prim into brw/gen6 variants
The "slight optimization to avoid the GS program" in brw_set_prim() is not
used by Gen 6, since Gen 6 doesn't use a GS program. Also, Gen 6 doesn't use
reduced primitives.

Also, document that intel_context.reduced_primitive is only used for Gen < 6

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:23:41 -07:00
Dave Airlie
95fd5e5aba r600g: drop force int type workaround
now that we have integer texture types I can drop this workaround so that
copies of values is done properly (as floats would fail on some corner cases).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:53:26 +01:00
Dave Airlie
8d3e505ed6 r600g: add integer texture/render integer formats for r600/700.
with these I can drop the force int type hack.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:52:35 +01:00
Eric Anholt
d950a778b7 mesa: Prevent repeated glDeleteProgram() from blowing away our refcounts.
glDeleteProgram should only be able to remove the one refcount for the
user's reference to the program from the hash table (even though that
ref does live on in the hash table until the last other ref is
removed).

Fixes piglit ARB_shader_objects/delete-repeat.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 11:38:52 -07:00
Zou Nan hai
7457da5edd i965: Fix timer query on gen6+
PIPE_CONTROL reported time stamp are 64 bits value incrementing every
80 ns, and only the low 32 bits are active (high 32 are always 0).

v2: Cleaned up whitespace, function arguments (anholt).

Fixes piglit EXT_timer_query/time-elapsed

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2011-10-10 11:38:52 -07:00
Ian Romanick
9f0e98d1df linker: Fix a slightly incorrect comment
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:23:53 -07:00
Ian Romanick
f3650b05cf hash_table: Make string_to_uint_map make a copy of the name
The hash table needs a copy of the key that it can keep for
comparisons during searches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41499
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
Tested-by: Luzipher <luziphermcleod@yahoo.ie>
Tested-by: Michał Lipski <tallica@o2.pl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:21:20 -07:00
Dave Airlie
9e66b25880 u_blitter: clean up velem setup
as per Brian's suggestion, drop the pointless loops.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 17:22:17 +01:00
Stéphane Marchesin
6bf8c7c010 i915g: Update the TODO with another idea. 2011-10-10 00:15:06 -07:00
Stéphane Marchesin
9977fb42ac i915g: Enable instanced drawing. 2011-10-10 00:15:05 -07:00
Stéphane Marchesin
ddba509c16 mesa/st: Check for a NULL _LinkedShader[i] before using it.
The rest of the linker/glsl translation code checks for NULL, so I suppose we should check here too. Fixes crash on exit with i915g instanced drawing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 00:15:05 -07:00
Marek Olšák
0f55f133f1 u_blitter: query vertex shader caps instead of geometry for int vertices 2011-10-09 18:19:58 +02:00
Dave Airlie
9b34cea7e9 r600g: uarl fixes.
Not 100% sure these are correct yet
2011-10-09 16:48:45 +01:00
Dave Airlie
ddcdd6137b r600g: enable integer shader cap for evergreen.
Will get to adding r600/r700/cayman support, have it mostly written on
another PC.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:48:45 +01:00
Dave Airlie
dd20256a1c u_blitter: don't create integer vertex elements unless shader supports them
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=41613

We don't want to create these vertex elements unless the pipe driver
vertex stage can handle integers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:36:41 +01:00
José Fonseca
ee1487953b st/glx/xlib: Advertise GLX_ARB_create_context(_profile)
They were already implemented, but not advertised.
2011-10-09 16:11:26 +01:00
Marcin Slusarz
90dcd6c89a nouveau: hide some debugging messages behind environment variable
They spam console, but are not very useful - hide them behind
NOUVEAU_MESA_DEBUG environment variable.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
f03810fbdd nv50,nvc0: avoid unnecessary flushes
Relocations don't consume pushbuffer space, so there is no need to
ensure there is any space in pushbuffer.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
9849f366cb nouveau: fix fence hang
If there is not enough space in pushbuffer for fence emission
(nouveau_fence_emit -> nv50_screen_fence_emit -> MARK_RING),
the pushbuffer is flushed, which through flush_notify ->
nv50_default_flush_notify -> nouveau_fence_update marks currently
emitting fence as flushed. But actual emission is done after this mark.
So later when there is a need to wait on this fence and pushbuffer
was not flushed in between, fence wait will never finish causing
application to hang.

To fix this, introduce new fence state between AVAILABLE and EMITTED,
set it before emission and handle it everywhere.

Additionally obtain fence sequence numbers after possible flush in
MARK_RING, because we want to emit fences in correct order.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>

Note: This is a candidate for the 7.11 branch.
2011-10-09 14:49:30 +02:00
Dave Airlie
0110aa09e5 r600g/eg: add integer types support
adds handling for int texture/vertices to evergreen.

TODO r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:06:18 +01:00
Dave Airlie
4e28e6f6c7 u_blitter: add integer clear support
We need add a new set of fragment shader variants, along with new vertex
elements for signed and unsigned clears.

The new fragment shader variants are due to the integers values requiring
CONSTANT interpolation. The new vertex element descriptions are for passing
the clear color as an unsigned or signed integer value.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:01:08 +01:00
Stéphane Marchesin
06415d3fab i915g: Remove another TODO item which was done a while ago. 2011-10-08 23:58:46 -07:00
Stéphane Marchesin
5dfeab71cf i915g: Remove a TODO item. 2011-10-08 23:58:06 -07:00
Stéphane Marchesin
03cd54dc60 i915g: Fix comment. 2011-10-08 23:57:27 -07:00
Stéphane Marchesin
8a22064d31 i915g: Implement vertex textures. 2011-10-08 23:54:53 -07:00
Stéphane Marchesin
e125786be8 i915g: Silence warning. 2011-10-08 20:19:53 -07:00
Stéphane Marchesin
49fea2e039 i915g: Remove old heuristic flusing remains. 2011-10-08 17:42:18 -07:00
Stéphane Marchesin
cd41960e8f i915g: Cleanup caps code a bit. 2011-10-08 17:12:37 -07:00
Marek Olšák
39d7de69b1 pb_bufmgr_cache: flush cache when create_buffer fails and try again
NOTE: This is a candidate for the stable branches.
2011-10-08 18:54:28 +02:00
Dave Airlie
a66a2359d7 st/mesa: add readpixel integer support
This adds support for readpixels integer paths, it deals with the signed/unsigned crossovers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:46:38 +01:00
Dave Airlie
3213d55d99 st/mesa: add support for int type conversion
This adds the various mesa->gallium and gallium->mesa format conversions
along with the GL->gallium texture choosers for integers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:46:03 +01:00
Dave Airlie
a441feb757 gallium: add initial pure integer support (v2)
This add support for unsigned/signed integer types via adding a 'pure' bit
in the format description table. It adds 4 new u_format get/put hooks,
for get/put uint and get/put sint so that accessors can get native access
to the integer bits. This is used to avoid precision loss via float converting
paths.

It doesn't add any float fetchers for these types at the moment, GL doesn't
require float fetching from these types and I expect we'll introduce a lot
of hidden bugs if we start allowing such conversions without an API mandating
it.

It adds all formats from EXT_texture_integer and EXT_texture_rg.

0 regressions on llvmpipe here with this.

(there is some more follow on code in my gallium-int-work branch, bringing
 softpipe and mesa to a pretty integer clean state)

v2: fixup python generator to get signed->unsigned and unsigned->signed
fetches working.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:59 +01:00
Dave Airlie
c2060c0af7 mesa/texformat: add integer fallbacks to other formats
This fixes up the integer format choosing to pick the closest mesa format
then the most likely fallback.

(the formatting in this file needs cleaning in another patch).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:59 +01:00
Dave Airlie
8f9edbad6f mesa: add packing for int/uint
This just adds a simple packing for GL_UNSIGNED_INT/GL_INT destination formats.
This is enough for at least the gallium drivers to pack both unsigned and signed types for read pixels.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:58 +01:00
Dave Airlie
61285c6cfa u_format: add inline helper to find first non void channel
This is used in a few places in drivers as well, also the integer support
can use it as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:58 +01:00
Kenneth Graunke
b861479f83 i965: Fix inconsistent indentation in brw_eu_emit.c.
Most of these functions used three spaces for the first level of
indentation, but four spaces for the next level.  One used tabs and then
three spaces.  Some used 3/4 in a then block but 3/3 in the else block.

Normally I try to avoid field days like this, but since the functions
were so inconsistent, even internally, it was making it difficult to
edit without introducing spurious whitespace changes.

So, just get it over with.  git diff -b shows 0 lines changed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 20:23:47 -07:00
Marek Olšák
20788a908b r300g: remove unused r300_resource::tex_offset 2011-10-08 02:21:24 +02:00
Ian Romanick
93c26d8baf glsl: Remove unused method ir_variable::component_slots
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
0c76729f39 mesa: Silence several 'warning: unused parameter' in _mesa_GetnUniformdvARB
This function isn't implemented yet, so none of its parameters are
used yet.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
97a0fe8e93 mesa: Remove unused function _mesa_append_uniform
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
e2bdef5380 mesa: Simplify calling Driver.ProgramStringNotify after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-10-07 16:39:51 -07:00
Ian Romanick
77d67a44cc mesa: Simplify destroy_shader_program_variants_cb after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
5a4279f80d mesa: Simplify validate_shader_program after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
de772c4022 mesa: Use gl_shader_program::_LinkedShaders instead of FragmentProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Ian Romanick
39348bf79f mesa: Use gl_shader_program::_LinkedShaders instead of GeometryProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Ian Romanick
010cc547ca mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Chad Versace
2fae55666e mesa: Close Doxygen group
In dd_function_table, close the Doxygen group beginning with
   \name Support for multiple T&L engines
2011-10-07 15:51:54 -07:00
Marek Olšák
4c417697b6 u_blitter: bind a NULL geometry shader 2011-10-08 00:49:34 +02:00
Marek Olšák
c12c05c198 u_blitter: cleanup checking for and restoring saved states 2011-10-08 00:49:34 +02:00
Marek Olšák
5baa33a738 r300g: disable stream output on SWTCL chipsets
Unimplemented and not so useful for this driver.
2011-10-08 00:49:34 +02:00
Stéphane Marchesin
b7cd18bc49 i915g: Add two new unsupported PIPE_CAPs. 2011-10-07 15:14:39 -07:00
Chad Versace
53f8586373 i915,i830: Remove dead HiZ assertions in *update_draw_buffer()
i915 and i830 hardware doesn't have HiZ, so remove all HiZ related
assertions from *update_draw_buffer().

I've removed the dead format checks completely rather than replace them
with more appropriate checks. This doesn't reduce "assertion coverage",
however, because when I added these HiZ related assertions in c8fdf66
there were no pre-existing checks there.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:33:51 -07:00
Brian Paul
793d29d6d3 tnl: fix result vector allocation regression
We need to allocate all the output vectors.
Fixes a regression from commit f7f678331d
Fixes fd.o bugs 41441 and 41492.
2011-10-07 10:58:53 -06:00
Brian Paul
cea946307f i965: make swizzle_for_size() return unsigned
Silences a warning about comparing to an unsigned variable.  It looks like
the result of swizzle_for_size() is always assigned to unsigned vars.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
e967c5b38f i965: make size_swizzles[] static const
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
4170227407 i965: silence unused var warnings in non-debug builds
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
13b776ed51 intel: silence uninitialized var warning
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 10:38:30 -06:00
Brian Paul
23c6eb035b mesa: fix software mipmap generation code for packed Z/stencil formats
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=32458

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-07 09:52:04 -06:00
Brian Paul
9938912ccb r300: fix incompatible pointer type warnings 2011-10-07 08:23:24 -06:00
Brian Paul
8c3b5cf943 mesa: update gl_texture_image comments 2011-10-07 08:23:24 -06:00
Brian Paul
5ac96033c5 swrast: s/FetchTexelf/FetchTexel/ 2011-10-07 08:23:24 -06:00
Brian Paul
26b8dfc8ca swrast: silence unused var warnings in non-debug builds 2011-10-07 08:23:24 -06:00
Brian Paul
ba69c4a002 swrast: remove unused swrast_texture_image::FetchTexelc method
We only use the float-valued function now.
2011-10-07 08:23:24 -06:00
Brian Paul
d7477ad0a3 mesa: fix image unpacking when storing compressed textures
This fixes failures found with the new piglit texsubimage test.

Two things were broken:
1. The dxt code doesn't handle sources images where width != row stride.
   Check for that and take the _mesa_make_temp_ubyte_image() path to get
   an image where width = rowstride.
2. If we don't take the _mesa_make_temp_ubyte_image() path we need to
   take the source image unpacking parameters into account in order to
   get the proper starting memory address of the source texels.

Note: This is a candidate for the 7.11 branch.
2011-10-07 08:14:46 -06:00
Daniel Vetter
530728fb60 i915g: handle seperate stencil clear
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
ce775dc1b6 i915g: actually try to clear 16bit depth bufs
... with the right value.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
661b7ef9a8 i915g: hw can't fastclear both depth and color when bbp doesn't match
Do it in two passes in that case.

v2: Don't forget to handle stencil clears.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
0a6131b15c i915g: disable scissor in fast clear
Docs say this is obeyed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
b8f3381f2c i915g: add some obscure sampler formats
4bit palette ftw!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:17 +02:00
Daniel Vetter
8dd523b2df i915g: fixup clear params emission
Docs say that default shader input color input need to be spec
as ARGB8888. And a clear rect prim essentially uses this value
instead of default diffuse. Depth on the other hands is an ieee
32 bit float. Clear stencil is U8.

Completely different are the clear values for zone init prims.
These are speced in the actual output pixel layout (and need
to be repeated for 16 bit formats).

Clear up the confusion by adding some comments.

v2: Retain the target swizzling support added by Stephan Marchesin.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:16 +02:00
Daniel Vetter
305bcda4b5 i915g: make fixup swizzle into a real hw state
This way it can be reused in the fastclear path.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-07 14:31:16 +02:00
Jason Wood
c475a54578 glsl: Remove version check when looking for identifiers containing "__".
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-06 22:39:08 -07:00
Stéphane Marchesin
c2244cfa19 i915g: Announce GL 2.0.
We leave the debug code in place to troubleshoot issues while we complete the transition. That code might be removed after that.
2011-10-06 20:40:49 -07:00
Paul Berry
018ea68d87 i965 Gen6+: De-compact clip planes.
Previously, if the user enabled a non-consecutive set of clip planes
(e.g. 0, 1, and 3), the driver would compact them down to a
consecutive set starting at 0.  This optimization was of dubious
value, and complicated the implementation of gl_ClipDistance.

This patch changes the driver so that with Gen6 and later chipsets, we
no longer compact the clip planes.  However, we still discard any clip
planes beyond the highest number that is in use, so performance should
not be affected for applications that use clip planes consecutively
from 0.

With chipsets previous to Gen6, we still compact the clip planes,
since the pre-Gen6 clipper thread relies on this behavior.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:14 -07:00
Paul Berry
f4f686e825 i965 VS: Change nr_userclip to nr_userclip_planes.
The only remaining uses of brw_vs_prog_key::nr_userclip only occurred
when using clip planes (as opposed to gl_ClipDistance).  This patch
renames the value to nr_userclip_planes and sets it to zero when
gl_ClipDistance is in use.  This avoids unnecessary VS recompiles.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:10 -07:00
Paul Berry
18e2e19b07 i965: Make brw_compute_vue_map's userclip dependency a boolean.
Previously, brw_compute_vue_map required an argument indicating the
number of clip planes in use, but all it did with it was check if it
was nonzero.

This patch changes brw_compute_vue_map to take a boolean instead.
This allows us to avoid some unnecessary recompilation of the Gen4/5
GS and SF threads.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:07 -07:00
Paul Berry
8f6920a7b6 i965: Move ClipPlanesEnabled state to VS cache key.
Previous to this patch, setup_uniform_clipplane_values() was setting
up clip plane uniforms based on ctx->Transform.ClipPlanesEnabled, a
piece of state not stored in the vertex shader cache key.  As a
result, a change to this piece of state might not trigger a necessary
vertex shader recompile.

The patch adds a field to the vertex shader cache key,
userclip_planes_enabled, to store the current value of
ctx->Transform.ClipPlanesEnabled.  Also, it changes
setup_uniform_clipplane_values() to read from this new field, so that
it's manifestly clear that the vertex shader isn't depending on state
not stored in the cache key.

Note: when the vertex shader uses gl_ClipDistance, the VS backend
doesn't need to know which clip planes are in use, so we leave the
field as zero in that case to avoid unnecessary recompiles.

Fixes Piglit test vs-clip-vertex-enables.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:29:02 -07:00
Paul Berry
a1b37ebe75 i965: Rearrange VS cache key struct.
No functional change.  This patch rearranges the struct
brw_vs_prog_key so that the two fields related to clipping are
together, and documents those fields.  This should make the patches
that follow easier to comprehend, since they add additional
clipping-related fields to this structure.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:28:55 -07:00
Paul Berry
c163072197 mesa: Create _mesa_bitcount_64() to replace i965's brw_count_bits()
The i965 driver already had a function to count bits in a 64-bit uint
(brw_count_bits()), but it was buggy (it only counted the bottom 32
bits) and it was clumsy (it had a strange and broken fallback for
non-GCC-like compilers, which fortunately was never used).  Since Mesa
already has a _mesa_bitcount() function, it seems better to just
create a _mesa_bitcount_64() function rather than special-case this in
the i965 driver.

This patch creates the new _mesa_bitcount_64() function and rewrites
all of the old brw_count_bits() calls to refer to it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-06 19:27:33 -07:00
Kenneth Graunke
09fcd01301 mesa/es: Allow GL_CLIP_PLANE0+6 and GL_CLIP_PLANE0+7.
Fixes the ES1 conformance 'userclip' test, which broke when we increased
MAX_CLIP_PLANES to 8.  Core Mesa already validates incoming values
against MAX_CLIP_PLANES; we just need the ES wrapper to pass everything
through.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-06 11:24:11 -07:00
Kenneth Graunke
5785cd2bf5 mesa/get: Move MAX_LIGHTS from GL/ES2 to GL/ES1.
It's required for ES 1.0 and 1.1, and isn't specified for ES 2.

While the comment says Mesa depends on it internally, removing it from
ES2 doesn't seem to regress any Piglit or ES2 conformance tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-06 11:24:10 -07:00
Kenneth Graunke
300a4cd9f2 meta: Don't enable TEXTURE_RECTANGLE when it's unsupported.
In particular, drivers don't enable this in ES 1.1 contexts.

Prior to this, none of the OpenGL ES 1.1 conformance tests passed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-06 11:24:10 -07:00
Stéphane Marchesin
9f2c56fbd6 i915g: Silence warning.
We still need to investigate LIS7 though.
2011-10-06 01:02:23 -07:00
Stéphane Marchesin
527235223a i915g: Fix comment. 2011-10-05 22:53:48 -07:00
Brian Paul
0214712c30 mesa: remove some unneeded forward struct declarations 2011-10-05 21:43:43 -06:00
Brian Paul
068fcc029d st/mesa: fix comment 2011-10-05 21:43:21 -06:00
Brian Paul
c80aaad77e mesa: remove unused _mesa_rescale_teximage2d() function
It was only used by the old tdfx driver, IIRC.
2011-10-05 21:14:37 -06:00
Brian Paul
2c5bb57b50 mesa: remove unused gl_texture_image::DriverData field
Was only used by some older/removed DRI drivers.
2011-10-05 21:14:37 -06:00
Brian Paul
cf2439e246 st/mesa: don't use gl_texture_image::RowStride
It's always the same as the texture width.
2011-10-05 21:14:37 -06:00
Brian Paul
aff65241c8 st/mesa: completely stop using gl_texture_image::Data
Instead, use the new st_texture_image::TexData field to hold texture
images that don't fit the parent object's mipmap buffer.
2011-10-05 21:06:48 -06:00
Brian Paul
85f5aa1565 st/mesa: stop using gl_texture_image::Data when mapping/unmapping textures
Since core Mesa no longer depends on gl_texture_image::Data pointing to
mapped texture buffers we don't have to mess with it all over the place
in the state tracker.  Now Data is only used to point to malloc'd memory
that holds images which don't fit in the texture object's mipmap buffer.
2011-10-05 21:06:48 -06:00
Brian Paul
5253cf9805 mesa: get rid of imageOffsets arrays in texstore code
These were used to find the start of a 3D image slice (or 2D array texture
slice) given a base address.  Instead, use a simple array of address of
image slices instead.

This is a step toward getting rid of the gl_texture_image::ImageOffsets
field.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-05 21:06:47 -06:00
Stéphane Marchesin
c3ef232315 st/glx: remove the duplicated Drawable member.
If you want to access it, you should use the Drawable in xlib_drawable instead.
2011-10-05 17:36:32 -07:00
Eric Anholt
684b701c12 glsl: Consider "__" in identifers as reserved.
Fixes double-underscore-*.frag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-05 12:49:17 -07:00
Brian Paul
bf059ebd33 swrast: update texfetch_funcs table for new int/uint formats
This only adds dummy entries to the table to fix failed assertions.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41491
2011-10-05 13:35:35 -06:00
Paul Berry
d912669034 i965 Gen6: Implement gl_ClipVertex.
This patch implements proper support for gl_ClipVertex by causing the
new VS backend to populate the clip distance VUE slots using
VERT_RESULT_CLIP_VERTEX when appropriate, and by using the
untransformed clip planes in ctx->Transform.EyeUserPlane rather than
the transformed clip planes in ctx->Transform._ClipUserPlane when a
GLSL-based vertex shader is in use.

When not using a GLSL-based vertex shader, we use
ctx->Transform._ClipUserPlane (which is what we used prior to this
patch).  This ensures that clipping is still performed correctly for
fixed function and ARB vertex programs.  A new function,
brw_select_clip_planes() is used to determine whether to use
_ClipUserPlane or EyeUserPlane, so that the logic for making this
decision is shared between the new and old vertex shaders.

Fixes the following Piglit tests on i965 Gen6:
- vs-clip-vertex-const-accept
- vs-clip-vertex-const-reject
- vs-clip-vertex-different-from-position
- vs-clip-vertex-equal-to-position
- vs-clip-vertex-homogeneity
- vs-clip-based-on-position
- vs-clip-based-on-position-homogeneity
- clip-plane-transformation clipvert_pos
- clip-plane-transformation pos_clipvert
- clip-plane-transformation pos

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-10-05 11:51:00 -07:00
Paul Berry
7d68c639dd mesa: Add a gl_vert_result for gl_ClipVertex.
Before this patch, clip planes didn't work properly in Mesa when using
vertex shaders, because Mesa assigned both gl_ClipVertex and
gl_Position to the same gl_vert_result (VERT_RESULT_HPOS).  As a
result, backends couldn't distinguish between the two variables, so
any shader that wrote different values to them would fail to work
properly.

This patch paves the way for proper support of gl_ClipVertex by
creating a new enumerated value in gl_vert_result for it
(VERT_RESULT_CLIP_VERTEX).  After this patch, a back-end may add
support for gl_ClipVertex using the following algorithm:

- If using a user-supplied GLSL vertex shader:
  - If the bit corresponding to VERT_RESULT_CLIP_VERTEX is set in
    gl_program::OutputsWritten:
    - Clip using the vertex shader output VERT_RESULT_CLIP_VERTEX and
      the clip planes defined in gl_context::Transform.EyeUserPlane.
  - Else:
    - Clip using the vertex shader output VERT_RESULT_HPOS and the
      clip planes defined in gl_context::Transform.EyeUserPlane.
- Else (either using fixed function or an ARB vertex program):
  - Clip using the vertex shader output VERT_RESULT_HPOS and the clip
    planes defined in gl_context::Transform._ClipUserPlane (*)

where (*) represents the normal Mesa behavior before this patch.

An example of implementing the above algorithm can be found in the
patch that follows this one, which implements gl_ClipVertex in i965
Gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-05 11:50:21 -07:00
José Fonseca
e2072a1046 llvmpipe: Fix the 4 planes (lines) case properly.
The previous change was not effective for lines, because there is no
4 planes 4x4 block rasterization path: it is handled by the 16x16 block
case too, and the 16x16 block was not being budged as it should.

This fixes assertion failures on line rasterization.
2011-10-05 18:07:05 +01:00
José Fonseca
c620087432 llvmpipe: Ensure the 16x16 special rasterization path does not touch outside the tile.
llvmpipe has a few special rasterization paths for triangles contained in
16x16 blocks, but it allows the 16x16 block to be aligned only to a 4x4
grid.

Some 16x16 blocks could actually intersect the tile
if the triangle is 16 pixels in one dimension but 4 in the other, causing
a buffer overflow.

The fix consists of budging the 16x16 blocks back inside the tile.
2011-10-05 18:07:05 +01:00
Dave Airlie
9c697a9d00 mesa: update fbo format tablet for integer types.
This updates the fbo format table for the integer types.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:44:39 +01:00
Dave Airlie
38db7ae7fa mesa/texstore: add texstore paths for all the integer types.
This just adds the entries to the table and fixes the asserts up.

The int32 one is definitely wrong, since it uses a float temp
which will lose precision, but its no worse than now.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:44:36 +01:00
Dave Airlie
56a7111893 mesa/texformat: update choose_tex_format for integer types.
This adds the integer types to the tex format chooser.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:44:25 +01:00
Dave Airlie
7a41291c3a mesa/formats: add rest of integer formats.
This is taken from reading EXT_texture_integer + EXT_texture_rg in combination,

Comments on necessity of each format, naming of formats and bugs in the
formats tables please.

Is there any formats I've missed?

Eric looked over this to make sure its consistent at least.

As I've changed the ordering of things in the format table, the follow
patches are required to avoid regression.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:43:40 +01:00
Dave Airlie
6e1681a2c9 texstore: create texstore table on first access.
As per Brian's suggestion we can generate this table at first start
to make sure its correct. This is a sad workaround for compilers which
don't support named initialiser. (its 2011).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 13:18:17 +01:00
Stéphane Marchesin
af962e1183 glsl: Remove unneeded headers. 2011-10-04 18:03:22 -07:00
Brian Paul
041ff4c731 egl: restore missing \ in Makefile 2011-10-04 16:54:08 -06:00
Paul Berry
56a90f5ce1 r200/r300/r600: remove dangling radeon_tex_getimage.c symlinks.
Commit d1fda903 (radeon: Drop mapping we were doing around
glGetTexImage()) removed the common Radeon source file
radeon_tex_getimage.c, and pulled it out of the r200, r300, r600, and
radeon makefiles.  But it left behind the symlinks that were being
used to share that file among the four directories.

This patch removes the dangling symlinks.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 15:28:56 -07:00
Kenneth Graunke
d38839a498 glapi: Enclose glapi.h in an extern "C" block when included by C++.
Fixes a build failure introduced in commit
b7fa0d0727.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-and-tested-by: Paul Berry <stereotype441@gmail.com>
2011-10-04 15:11:42 -07:00
Brian Paul
6399b7d638 scons: add new files to src/mesa/SConscript 2011-10-04 15:59:09 -06:00
Brian Paul
a5f2010735 softpipe: fix Z interpolation invariance bug
We want quad/pixel Z values to be interpolated exactly the same for
multi-pass algorithms.  Because of how the optimized Z-test code is
written, we can't cull the first quad in a run even if it's totally
killed.  See the comment for more info.

NOTE: This is a candidate for the 7.11 branch.
2011-10-04 15:04:42 -06:00
Brian Paul
334a9dd3e6 softpipe: add check for DO_PSTIPPLE_IN_HELPER_MODULE
We only want to generate the fragment shader variant that does
stippling if DO_PSTIPPLE_IN_HELPER_MODULE is being used.
2011-10-04 15:04:41 -06:00
Ian Romanick
35613afee3 mesa: Remove unused gl_program::Attributes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:48 -07:00
Ian Romanick
24409ba196 mesa: Determine GL_ACTIVE_ATTRIBUTE_MAX_LENGTH by walking the GLSL IR.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:48 -07:00
Ian Romanick
c097c63aa8 mesa: Determine GL_ACTIVE_ATTRIBUTES by walking the GLSL IR.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:47 -07:00
Ian Romanick
a339ee8d85 mesa: Remove unused gl_shader_program::Attributes
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:47 -07:00
Ian Romanick
84d71a07bb mesa: Make _mesa_GetActiveAttribARB use the attributes in the shader IR
Instead of relying on the mirror in the Mesa IR assembly shader, just
use the variables actually stored in the GLSL IR.  This will be a bit
slower, but nobody cares about the performance of glGetActiveAttrib.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:47 -07:00
Ian Romanick
7a80c1bbc5 mesa: Move _mesa_GetActiveAttribARB to shader_query.cpp
This just folds get_active_attrib into _mesa_GetActiveAttribARB
and moves the resulting function function to the other source file.
More changes are coming soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
523b611646 linker: Use gl_shader_program::AttributeBindings for attrib locations
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
015d4f61ef mesa: Add gl_shader_program::AttributeBindings
This currently mirrors the state tracking
gl_shader_program::Attributes, but I'm working towards eliminating
that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
2fd80534f0 mesa: Move _mesa_BindAttribLocationARB to shader_query.cpp
This just folds bind_attrib_location into _mesa_BindAttribLocationARB
and moves the resulting function function to the other source file.
More changes are coming soon.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 13:17:46 -07:00
Ian Romanick
3ea297bdc4 mesa: Add string_to_uint_map facade class
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
2011-10-04 13:17:09 -07:00
Ian Romanick
acd834fde2 mesa: Add hash_table_replace
hash_table_replace doesn't use get_node to avoid having to hash the key twice.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 12:33:28 -07:00
Ian Romanick
b7fa0d0727 mesa: Move _mesa_GetAttribLocationARB to shader_query.cpp
This allows querying the linked shader itself rather than the Mesa IR.
This is the first step towards removing gl_program::Attributes.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 12:33:28 -07:00
Ian Romanick
7bbcc0b832 glsl: Delete symbol table in post-link shaders
The symbol table in the linked shaders may contain references to
variables that were removed (e.g., unused uniforms).  Since it may
contain junk, there is no possible valid use.  Delete it and set the
pointer to NULL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-04 12:33:28 -07:00
Ian Romanick
efd027a8b5 glapi: regen API files for new extension
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-04 12:25:58 -07:00
Ian Romanick
763b00f2c5 mesa: Remove ARB_draw_buffers extension enable flag
All drivers in Mesa have supported this extension for eons.  This
extension is an optional features in desktop OpenGL (via
GL_ARB_draw_buffers) and OpenGL ES 2.x (via GL_NV_draw_buffers).

The extension is not usable in OpenGL ES 1.x.  There is no
glDrawBuffers* entry point in OpenGL ES 1.x contexts, and glGet*v
generate errors when MAX_DRAW_BUFFERS or DRAW_BUFFERi is queried.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:58 -07:00
Ian Romanick
a92f02d04a mesa: Advertise NV_fbo_color_attachments on OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
cb016bbb1d mesa: Advertise NV_draw_buffers in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
f708166aad mesa/es: Allow querying GL_DRAW_BUFFERi in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
e0d5cb0f4f mesa/es: Allow querying GL_MAX_COLOR_ATTACHMENTS in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
2e3a4ab818 mesa/es: Allow other color attachments in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
43251b970d mesa/es: Make glDrawBuffersNV available in OpenGL ES 2.0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
188123ca06 glapi: Add entry point for NV_draw_buffers
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:57 -07:00
Ian Romanick
b2f23438a2 glapi: Move ARB_draw_buffers extension to a separate file
This also moves ATI_draw_buffers.  This is to facilitate enabling
NV_draw_buffers in OpenGL ES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Ian Romanick
accf293a33 mesa/es: Remove redundant renderbuffer target validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Ian Romanick
6dd8e76869 mesa/es: Validate FBO target enum in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Ian Romanick
7e4cb32d05 mesa/es: Validate FBO attachment enum in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-04 12:25:56 -07:00
Stéphane Marchesin
3db309aece configure: replace pkg-config calls with $(PKG_CONFIG) in the makefiles.
Us poor souls who cross compile mesa want to be able to specify which pkg-config to pick, or at least just change one place.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2011-10-04 11:19:48 -07:00
Stephen White
cd9627777c st/glx: Set the drawable attribute on xmesa_buffer creation.
Otherwise we'll be unable to use our pbuffers.
2011-10-04 11:19:45 -07:00
Marek Olšák
5506f6ef96 r300g: fix rendering with a non-zero index bias in draw_elements_immediate
NOTE: This is a candidate for the stable branches.
2011-10-04 17:45:53 +02:00
Guillem Jover
8fd39be383 docs: Update references to README files
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-04 07:49:04 -06:00
Guillem Jover
963727aec7 Remove remnants of legacy glide support
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-04 07:48:50 -06:00
Guillem Jover
0060551856 Ignore all shared objects
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-10-04 07:48:45 -06:00
Marek Olšák
024ac93e60 r600g: fix parsing TGSI declarations
It was a lucky coincidence that it worked.
2011-10-04 04:22:22 +02:00
Brian Paul
5f4f07f4ea nouveau: remove unused code, unused var 2011-10-03 18:20:59 -06:00
Brian Paul
c8e6565280 i915: don't include texstore.h 2011-10-03 18:20:59 -06:00
Brian Paul
d646d06929 i965: remove unneeded includes of texstore.h 2011-10-03 18:20:59 -06:00
Brian Paul
9119269ca1 swrast: fix delayed texel buffer allocation regression
Commit 617cdcd4c7 delayed the texel
buffer allocation until texture_combine() is called.  But the
texel buffer is needed sooner in _swrast_texture_span() at line 649.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41433
2011-10-03 17:51:06 -06:00
Brian Paul
6a04fa9cd4 mesa: fix warning (MSVC error) about void pointer arithmetic 2011-10-03 17:37:04 -06:00
Eric Anholt
669f1822d2 i965: Add support for GL_EXT_texture_array and GL_MESA_texture_array. 2011-10-03 13:29:38 -07:00
Eric Anholt
82691574b6 intel: Add a safety check for mapping 1D texture arrays.
So easy to screw up with the crazy way GL manages them.
2011-10-03 13:29:38 -07:00
Eric Anholt
cb86560ddb intel: Add debug output to intel_map_texture_image. 2011-10-03 13:29:38 -07:00
Eric Anholt
fd99cd0e10 intel: Add a helper function for getting miptree size from a texture image.
With 1D array textures, we no longer agree between the GL information
about width/height/depth of a texture and how we lay out a miptree.
2011-10-03 13:29:38 -07:00
Eric Anholt
2e0aefc1b9 i965: Refactor out the cube map setup for general texture array setup.
This is just moving the code out with s/6/slices/.
2011-10-03 13:29:38 -07:00
Eric Anholt
372cf26698 mesa: Reuse existing make_2d_mipmap for 2D array generation.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
6fc576fd8a mesa: Make the uncompressed sw mipmap gen path do a Map per 1D array slice.
This also fixes what was probably a bug in 1D arrays with border.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
229ebf511d mesa: When storing texture data for a 1D array, map each slice separately.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
5324f9c48d swrast: When asked to map a slice of a 1D array, give back that slice.
Until now, we've been treating 1D arrays as a single slice, and each
array slice is actually just a row of the 2D texture.  While swrast
still stores them this way, hardware drivers think that 1D arrays have
actual separate slices not stored as contiguous rows.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:38 -07:00
Eric Anholt
b07c78bfe9 intel: Consolidate texture validation copy code, and reuse it correctly.
The path for ->Data was failing to be called for the FBO draw offset
fallback, and also had mismatched compressed texture support code.

This drops the intel_prepare_render() in the blit path.  We aren't
copying to/from a GL_FRONT buffer, so it doesn't matter.
2011-10-03 13:29:38 -07:00
Eric Anholt
055995abc4 intel: Clean up the function chain for mapping texture images for swrast.
Too many separate functions each called from one location (in
different files).  This code should all die soon when swrast starts
using MapTextureImage.
2011-10-03 13:29:38 -07:00
Eric Anholt
9aff2944a4 intel: Make PBO TexImage use AllocTextureImageBuffer like non-PBO does.
Now that whole block that also lives in AllocTextureImageBuffer can go
away.
2011-10-03 13:29:37 -07:00
Eric Anholt
18198e299b intel: Rely on Mesa core for glTexImage storage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-03 13:29:37 -07:00
Eric Anholt
a73d56dce3 intel: Allocate s8z24 separate renderbuffers from AllocTextureImageBuffer().
Before, we were only allocating these from our TexImage, so if the
texture image was set up in any other way (non-accelerated
glGenerateMipmaps()), they'd be missing or wrong.
2011-10-03 13:29:37 -07:00
Eric Anholt
e928c34d3e intel: Add an AllocTextureImageBuffer() implementation using miptrees.
Now we can rely on Mesa core for uploads of data without introducing
an extra copy at validate time.
2011-10-03 13:29:37 -07:00
Brian Paul
e0304180c3 mesa: Convert _mesa_generate_mipmap to MapTexImage()-based access.
Now that we can zero-copy generate the mipmaps into brand new
glTexImage()-generated storage using MapTextureImage(), we no longer
need to allocate image->Data in mipmap generate.  This requires
deleting the drivers' old overrides of the miptree tracking after
calling _mesa_generate_mipmap at the same time, or the drivers
promptly lose our newly-generated data.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-03 13:29:30 -07:00
Kenneth Graunke
1165b64f56 i965: Stop lowering integer division to multiply and reciprocal.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:21 -07:00
Kenneth Graunke
b9af592dfa i965: Reverse the operands for INT DIV prior to Gen6.
Apparently on Gen4 and 5, the denominator comes first.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:12 -07:00
Kenneth Graunke
1d4f3ca8f0 i965/vs: Implement integer quotient and remainder math operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:11 -07:00
Kenneth Graunke
ff8f272b0d i965/fs: Implement integer quotient and remainder math operations.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:09 -07:00
Kenneth Graunke
6960f786c8 i965: Set the signed/unsigned type bit in Gen4/5 math messages.
It never mattered before since we only did floating point math.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:07 -07:00
Kenneth Graunke
6b10aab2bb i965: Fix message and response length calculations for INT DIV.
Both POW and INT DIV need a message length of 2; previously, we only
checked for POW.

Also, BRW_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER has a response
length of 2; previously, we only checked for SINCOS.  We don't use this
message, but in case we ever decide to, we may as well fix it now.

While we're at it, just move these computations into
brw_set_math_message, since they're entirely based on the function.
This fixes it for both brw_math and the old backend's brw_math_16.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:04 -07:00
Kenneth Graunke
ee2bf3a4b6 i965: Fix assertions about register types for INT DIV in brw_math.
BRW_MATH_FUNCTION_REMAINDER was missing.  Also, it seems worthwhile to
assert that INT DIV's arguments are signed/unsigned integers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:01:02 -07:00
Kenneth Graunke
e66fc1cb03 ir_to_mesa: Don't assertion fail on integer modulus.
Drivers implementing GLSL 1.30 want to do integer modulus, and until we
can stop generating code via ir_to_mesa, it's easier to make it silently
generate rubbish code.  Multiply will do.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-02 17:00:00 -07:00
Tom Stellard
d64c6d2ffc r300/compiler: Fix error in OMOD optimization
Classic compiler mistake.  In the example below, the OMOD optimization
was combining instructions 4 and 10, but since there was an instruction
(#8) in between them that wrote to the same registers as instruction 10,
instruction 11 was reading the wrong value.

Example of the mistake:

Before OMOD:
4: MAD temp[0].y, temp[3]._y__, const[0]._x__, const[0]._y__;
...
8: ADD temp[2].x, temp[1].x___, -temp[4].x___;
...
10: MUL temp[2].x, const[1].y___, temp[0].y___;
11: FRC temp[5].x, temp[2].x___;

After OMOD:
4: MAD temp[2].x / 8, temp[3]._y__, const[0]._x__, const[0]._y__;
...
8: ADD temp[2].x, temp[1].x___, -temp[4].x___;
...
11: FRC temp[5].x, temp[2].x___;

https://bugs.freedesktop.org/show_bug.cgi?id=41367
2011-10-02 15:21:15 -07:00
Tom Stellard
13814b0103 r300/compiler: Rewrite source swizzles when using OMOD 2011-10-02 15:21:15 -07:00
Tom Stellard
8b0418e478 r300/compiler: Fix rc_normal_rewrite_writemask()
This function had not been updated to use conversion swizzles.
2011-10-02 15:21:15 -07:00
Tom Stellard
b5ecf5ba46 r300/compiler: Use consistent src swizzles for transcendent instructions
Source swizzles for transcendent instructions were being stored in the X
channel regardless of what channel the instruction was writing.
This was causing problems for some helper functions that were expecting
source swizzles to occupy channels corresponding to the instruction's
writemask.  This commit makes transcendent instructions follow the same
convention as normal instructions for representing source swizzles.

Previous behavior:
LG2 temp[0].y, input[0].x___;

Current behavior:
LG2 temp[0].y, input[0]._x__;
2011-10-02 15:21:15 -07:00
Eric Anholt
e7c2b711a3 mesa: Respect GL_RASTERIZER_DISCARD for various meta-type operations.
From the EXT_transform_feedback spec:

    Primitives can be optionally discarded before rasterization by calling
    Enable and Disable with RASTERIZER_DISCARD_EXT. When enabled, primitives
    are discared right before the rasterization stage, but after the optional
    transform feedback stage. When disabled, primitives are passed through to
    the rasterization stage to be processed normally. RASTERIZER_DISCARD_EXT
    applies to the DrawPixels, CopyPixels, Bitmap, Clear and Accum commands as
    well.

And the GL 3.2 spec says it applies to ClearBuffer* as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-10-01 22:16:07 -07:00
Eric Anholt
3a1ba094f4 mesa: Add missing glGetIntegerv() support for ARB_color_buffer_float tokens.
Fixes piglit ARB_color_buffer_float/api-get

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 22:16:07 -07:00
Eric Anholt
42769c2da5 Revert "vbo: Don't discount stride == 0 for testing all varyings in VBOs."
This reverts commit d631c19db4.

The commit was broken, and ended up returning false all the time
because nobody in the world binds every single possible vertex array.
On further reflection, we don't want to discount stride == 0: This
function is just used for deciding to calculate whether to compute the
bonuds on the index, and there's no sense in computing index bounds
when stride == 0.

For the separate question of "how much data do I upload for this
vertex element?", the i965 driver was fixed to upload the data.

Fixes a regression of about 2x in 3DMMES, and most importantly, makes
Hammerfight playable.
2011-10-01 22:16:07 -07:00
Eric Anholt
ddc348d83e i965: Make sure to upload the data for a collection of Stride == 0 arrays.
Commit d631c19db4 avoided this problem
by forcing the driver to get the min/max index, but that commit was
broken, so just fix the driver problem (confusion between "do I need
to upload any data?" and "do I need the index bounds in order to
upload any data?").
2011-10-01 22:16:07 -07:00
Eric Anholt
617cdcd4c7 mesa: Delay s_texcombine.c memory allocation until it's used.
Generally we're using fragment programs in all our drivers, so wasting
4MB for code that's never called is pretty lame.  Reduces i965 memory
allocation for a short shader program from 21,932,128B to 17,737,816B.
2011-10-01 22:16:06 -07:00
Eric Anholt
f7f678331d tnl: Delay results allocation until we actually need them.
Decreases i965 peak memory allocation for a trivial shader program
from 23,483,048B to 21,932,128B, since we never actually use tnl for
rendering.
2011-10-01 22:16:06 -07:00
Ian Romanick
fe006a74f6 i965/vs: Fix swizzle related assertion
As innocuous as it seemed, ebca47a basically broke the world (e.g.,
>200 piglit regressions).  In vec4_visitor::emit_block_move,
src->swizzle was expected to be BRW_SWIZZLE_NOOP before setting it to
a swizzle that would replicate the existing channels of the source
type to a vec4 (e.g., .xyyy for a vec2).

The original assertion seems to have been a little bogus.  In addition
to being BRW_SWIZZLE_NOOP, src->swizzle might already be a swizzle
that would replicate the existing channels of the source type to a
vec4.  In other words, it might already have the value that we're
about to assign to it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-10-01 22:16:06 -07:00
Brian Paul
dd9574d7a5 mesa: number of combiner terms to pop depends on GL_NV_texture_env_combine4
If GL_NV_texture_env_combine4 is not supported, setting the fourth
combiner term would generate a GL error.
Of course, I noticed this right after committing the previous patch
to use a loop in the first place.  <sigh>

Note that GL_EXT_texture_env_combine is always supported so the first
three combiner terms are always accepted.
2011-10-01 08:29:34 -06:00
Brian Paul
9520f483b8 mesa: s/INLINE/inline/
INLINE is still seen in some files (some generated files, etc) but this
is a good start.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:16:36 -06:00
Brian Paul
c707ffa587 r600: include version.h for _mesa_override_glsl_version() prototype
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:16:00 -06:00
Brian Paul
b15ab1d228 mesa: use !! to simplify some _mesa_set_enable() calls in attrib.c
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:15:47 -06:00
Brian Paul
986a9bb180 mesa: use loop in pop_texture_group() to restore 4 combiner terms
There's four combiner terms (not 3) with GL_NV_texture_env_combine4.
Use a loop to make the code a little more compact.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-01 08:15:28 -06:00
Ian Romanick
1f8f8aef7f mesa: Refactor hash_table_{find,remove} to share some code
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Ian Romanick
16f7bdf555 mesa: Document an odd side-effect of hash_table_insert
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Ian Romanick
cd76f114e6 mesa: Remove unused field gl_program::Varying
Lots of things set and copy this field around, but nothing uses it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Ian Romanick
a9f25160af mesa: Use Add linker_error instead of fail_link
See also 8aadd89.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-30 15:37:00 -07:00
Marek Olšák
aae342cff0 r600g: fix a compiler warning 2011-09-30 23:20:27 +02:00
Marek Olšák
74d6f929b4 gallium/docs: update the documentation of capabilities
Still like 13 caps are undocumented.
2011-09-30 23:20:21 +02:00
Marek Olšák
bf0baa7717 r600g: move all files from winsys/r600 into drivers/r600
Be sure to reconfigure after this commit.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
363ff84475 winsys/radeon: move GEM domains out of the drivers into winsys
The drivers don't need to care about the domains. All they need to set
are the bind and usage flags. This simplifies the winsys too.

This also fixes on r600g:
- fbo-depth-GL_DEPTH_COMPONENT32F-copypixels
- fbo-depth-GL_DEPTH_COMPONENT16-copypixels
- fbo-depth-GL_DEPTH_COMPONENT24-copypixels
- fbo-depth-GL_DEPTH_COMPONENT32-copypixels
- fbo-depth-GL_DEPTH24_STENCIL8-copypixels
I can't explain it.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
af8eb5c851 winsys/radeon: remove a redundant parameter 'size' from buffer_from_handle
It's part of pb_buffer already.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
90ce3cdde9 r600g: remove struct radeon (or what's left of it)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
518557d74a r600g: move family and chip_class from struct radeon to r600_screen
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
6101b6d442 r600g: merge r600_bo with r600_resource
I have moved 'last_flush' and 'binding' from r600_bo to winsys/radeon.
The other members are now part of r600_resource.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
ba89086e79 gallium: add PIPE_CAP_TEXTURE_BARRIER
Same issue as with conditional_render.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
3d13b081c7 gallium: add PIPE_CAP_CONDITIONAL_RENDER
We were checking whether render_condition is set. That was not reliable,
because it's always set with trace and noop regardless of driver support.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
f5bfe54a34 gallium: add and use PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS
This removes:
- PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS
- PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS
in favor of the that new per-shader cap.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Marek Olšák
557c3febdf gallium: remove PIPE_CAP_TEXTURE_MIRROR_REPEAT
All drivers support it (well, except Cell). The boolean option is going away
from core Mesa too.

This is a follow-up to Ian Romanick's patch
"mesa: Remove ARB_texture_mirrored_repeat extension enable flag".

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-30 23:19:52 +02:00
Chris Wilson
67582e6eef i915: out-of-bounds write in calc_live_regs()
From a Coverity defect report.

src/mesa/drivers/dri/i915/i915_fragprog.c
   301  /*
   302   * TODO: consider moving this into core
   303   */
   304  static bool calc_live_regs( struct i915_fragment_program *p )
   305  {
   306      const struct gl_fragment_program *program = &p->FragProg;
   307      GLuint regsUsed = 0xffff0000;
-> 308      uint8_t live_components[16] = { 0, };
   309      GLint i;
   310
   311      for (i = program->Base.NumInstructions - 1; i >= 0; i--) {
   312          struct prog_instruction *inst =
&program->Base.Instructions[i];
   313          int opArgs = _mesa_num_inst_src_regs(inst->Opcode);
   314          int a;
   315
   316          /* Register is written to: unmark as live for this and
preceeding ops */
   317          if (inst->DstReg.File == PROGRAM_TEMPORARY) {
-> 318              if (inst->DstReg.Index > 16)
   319                 return false;
   320
-> 321              live_components[inst->DstReg.Index] &= ~inst->DstReg.WriteMask;
   322              if (live_components[inst->DstReg.Index] == 0)
   323                  regsUsed &= ~(1 << inst->DstReg.Index);
   324          }
   325
   326          for (a = 0; a < opArgs; a++) {
   327              /* Register is read from: mark as live for this and preceeding ops */
   328              if (inst->SrcReg[a].File == PROGRAM_TEMPORARY) {
   329                  unsigned c;
   330
   331                  if (inst->SrcReg[a].Index > 16)
   332                     return false;
   333
   334                  regsUsed |= 1 << inst->SrcReg[a].Index;
   335
   336                  for (c = 0; c < 4; c++) {
   337                      const unsigned field = GET_SWZ(inst->SrcReg[a].Swizzle, c);
   338
   339                      if (field <= SWIZZLE_W)
   340                          live_components[inst->SrcReg[a].Index] |= (1U << field);
   341                  }
   342              }
   343          }
   344
   345          p->usedRegs[i] = regsUsed;
   346      }

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40022
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 22:12:45 +01:00
Chris Wilson
ebca47af85 i965: Assign instead of compare inside assert
This is from a Coverity defect report.

src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
  1314  void
  1315  vec4_visitor::emit_block_move(dst_reg *dst, src_reg *src,
  1316                                const struct glsl_type *type, bool
predicated)
...
  1351     /* Do we need to worry about swizzling a swizzle? */
->1352     assert(src->swizzle = BRW_SWIZZLE_NOOP);
  1353     src->swizzle = swizzle_for_size(type->vector_elements);

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40158
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 22:00:05 +01:00
Chris Wilson
8ccbcda5c6 i965/gen6: Fix assign instead of compare in assert
This is from a Coverity defect report.

src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
   268  static void
   269  check_gen6_math_src_arg(struct brw_reg src)
   270  {
   271     /* Source swizzles are ignored. */
   272     assert(!src.abs);
   273     assert(!src.negate);
-> 274     assert(src.dw1.bits.swizzle = BRW_SWIZZLE_XYZW);
   275  }

Reported-by: Vinson Lee <vlee@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40214
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-30 21:49:29 +01:00
Carl Worth
201485bae0 glcpp: Add a test for #elif with an undefined macro.
As written, this test correctly raises an error for #elif being used
with an undefined macro (and not as an argument to "defined"). If the
preceding #if were '#if 1' then this diagnositc would correctly be
hidden. That allows code such as the following to not raise an error:

	#ifndef MAYBE_UNDEFINED
	#elif MAYBE_UNDEFINED < 5
	...
	#endif

So this test case is working as expected already. We add it here just
to improve test coverage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:21 -07:00
Carl Worth
c4aaf7943c glcpp: Raise error if defining any macro containing two consecutive underscores
The specification reserves any macro name containing two consecutive
underscores, (anywhere within the name). Previously, we only raised
this error for macro names that started with two underscores.

Fix the implementation to check for two underscores anywhere, and also
update the corresponding 086-reserved-macro-names test.

This also fixes the following two piglit tests:

	spec/glsl-1.30/preprocessor/reserved/double-underscore-02.frag
	spec/glsl-1.30/preprocessor/reserved/double-underscore-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:16 -07:00
Carl Worth
28842c2331 glcpp: Implement token pasting for non-function-like macros
This is as simple as abstracting one existing block of code into a
function call and then adding a single call to that function for the
case of a non-function-like macro.

This fixes the recently-added 097-paste-with-non-function-macro test
as well as the following piglit tests:

	spec/glsl-1.30/preprocessor/concat/concat-01.frag
	spec/glsl-1.30/preprocessor/concat/concat-02.frag

Also, the concat-04.frag test now passes for the right reason. The
test is intended to fail the compilation, but before this commit it
was failing compilation (and hence passing the test) for the wrong
reason.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:10 -07:00
Carl Worth
7bb3403e01 glcpp: Test a non-function-like macro using the token paste operator
Apparently we never implemented this, (but we've got a GLSL 1.30 test
in piglit that is exercising this case).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:44:04 -07:00
Carl Worth
3c01a58944 glcpp: Fix two (or more) successive applications of token pasting
There was already a loop here to look for multiple token pastes, but
it was mistakenly incrementing the iterator counter after performing
one paste.

Instead, leave the loop iterator in place to coalesce as many tokens
as necessary into one.

This fixes the recently add 096-paste-twice test as well as the
following piglit test:

	spec/glsl-1.30/preprocessor/concat/concat-03.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:43:59 -07:00
Carl Worth
8e6b99e7b1 glcpp: Add a test for a macro that implements token pasting twice.
This is something that piglit is exercising that currently fails.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Carl Worth <cworth@cworth.org>
2011-09-30 11:43:40 -07:00
Chad Versace
9c72b729f3 mesa: Remove unused tnl items from dd_functions
Remove NeedValidate and ValidateTnlModule.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-30 11:15:46 -07:00
Brian Paul
a8ca786ba6 meta: fix GetTexImage() for luminance, l/a, intensity formats
The GL spec says that luminance values are returned as (l, 0, 0, 1),
L/A values as (l, 0, 0, a) and intensity values as (i, 0, 0, 1).
Use the pixel transfer scale controls to implement that.
This fixes a few failures in the new piglit getteximage-formats
test when getting a compressed L or L/A image.
2011-09-30 08:16:34 -06:00
Brian Paul
57169c4694 mesa: add _NEW_CURRENT_ATTRIB in _mesa_program_state_flags()
If color material mode is enabled, constant buffer entries related
to the material coefficients will depend on glColor.  So add
_NEW_CURRENT_ATTRIB to the bitset returned for material-related
constants in _mesa_program_state_flags().

This fixes a bug exercised by the new piglit draw-arrays-colormaterial
test.

Note: This is a candidate for the 7.11 branch.
2011-09-30 08:16:21 -06:00
Brian Paul
4e6bb0774f st/mesa: implement AllocTextureImageBuffer() driver hook
This hasn't been needed so far since none of the core Mesa code paths
that call ctx->Driver.AllocTextureImageBuffer() are used with the
state tracker.  That will change in upcoming patches.
Note that this function duplicates some code seen in the st_TexImage()
function.  That can be cleaned up later.
2011-09-30 08:15:30 -06:00
Brian Paul
4368a65767 mesa: simplify parameters to GetTexImage() driver hook
The target, level and texObj can be obtained through the texImage
parameter.  We could make similar changes for the TexImage() hooks too.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-30 08:15:30 -06:00
Thomas Hellstrom
d742a64909 xorg/vmwgfx: Kill this target. It's not used anymore.
This fixes a build error introduced with commit
"winsys/svga: Update to vmwgfx kernel module 2.1"
if both the svga driver and the xorg state tracker was enabled
at the same time.

If needed we can re-add a minimal target for basic functionality.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-30 09:30:59 +02:00
Brian Paul
e4394fb19f intel: include version.h to get _mesa_override_glsl_version() prototype 2011-09-29 16:29:30 -06:00
Simon Farnsworth
c6f9d80ad2 gallium: Set renderbuffer's InternalFormat when rendering to texture
When an FBO is rendering to a texture (rather than a renderbuffer),
Gallium sets up an internal renderbuffer to handle the rendering, and
copies over enough texture state to make this work.

InternalFormat was missed out, causing glTexCopyImage to take a slow
path unnecessarily.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41263

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-29 13:46:48 -06:00
Thomas Hellstrom
e7843273fa winsys/svga: Update to vmwgfx kernel module 2.1
Introduces fence objecs and a size limit on query buffers.
The possibility to map the fifo from user-space is gone, and
replaced by an ioctl that reads the 3D capabilities.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecranz <jakob@vmware.com>
2011-09-29 20:24:57 +02:00
Thomas Hellstrom
e63f2787b6 st/xa: Don't call fence_reference with an unitialized fence handle as dst
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-29 20:24:57 +02:00
Thomas Hellstrom
5ec01ba7e8 st/xa: surfaces and sampler views are per context
Don't store references to these on the surface but on the context.
References to transfers are still stored on the surface since we allow
only a single map of a surface at a time.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-29 20:24:57 +02:00
Ian Romanick
ed48df8424 mesa: Remove ARB_texture_mirrored_repeat extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on mach64, mga, and savage
(Savage3D and other pre-Savage4).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:41:04 -07:00
Ian Romanick
b0824bd860 mesa: Remove EXT_blend_subtract extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on i810, mach64, mga,
savage, sis, and tdfx (Voodoo Banshee and Voodoo3).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:41:01 -07:00
Ian Romanick
1d5e49bf05 mesa: Remove EXT_stencil_wrap extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on mach64.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:58 -07:00
Ian Romanick
f9a2352c95 mesa: Remove EXT_texture_lod_bias extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

This extension was previously not supported on mach64, mga, or r128.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:55 -07:00
Ian Romanick
bde8bd99b6 mesa: Remove EXT_texture_env_combine extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.  The existing support is already partially
broken in Mesa (e.g., querying GL_TEXTURE_ENV_MODE in OpenGL ES 2.x).
This patch does not change the situation in any way.

It looks like the only hardware supported by Mesa that cannot do
ARB_texture_env_combine is pre-NV10 NVIDA chips.  It appears that
these chips cannot do the GL_SUBTRACT mode.  Based on looking at older
copies of nvOpenGLspecs.pdf found on the net, NVIDIA never supported
ARB_texture_env_combine on those chips either.

This extension was previously not supported on mach64, mga (G200),
r128, savage, sis, and tdfx (Voodoo Banshee and Voodoo3).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:51 -07:00
Ian Romanick
5c4f914f9a mesa: Remove EXT_texture_env_add extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.  The existing support is already partially
broken in Mesa (e.g., querying GL_TEXTURE_ENV_MODE in OpenGL ES 2.x).
This patch does not change the situation in any way.

This extension was previously not supported on mach64, mga (G200),
savage (Savage3D and other pre-Savage4), sis, and tdfx (Voodoo
Banshee).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:47 -07:00
Ian Romanick
677743f7d5 mesa: Remove ARB_multitexture extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.  The existing support is already partially
broken in Mesa (e.g., querying GL_CLIENT_ACTIVE_TEXTURE in OpenGL ES
2.x).  This patch does not change the situation in any way.

This extension was previously not supported on i810, mga (G200), or
tdfx (Voodoo Banshee).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-29 10:40:39 -07:00
José Fonseca
1da1044344 llvmpipe: Convert some of the null checks back to asserts.
This turns some of the null check warnings in commit
023ca40d80 back to asserts, as
the underlying cause of fdo bug 40591 should be fixed now.
2011-09-29 17:44:06 +01:00
José Fonseca
8d647247e2 llvmpipe: Also reset the state in lp_scene_bin_reset
Prevents segfaults when a opaque tile is found without state change.
2011-09-29 17:43:39 +01:00
José Fonseca
b8d1242c0b llvmpipe: Prevent segfault during fs variant cache shrinking. 2011-09-29 17:43:38 +01:00
José Fonseca
47ff3f7cc5 tools/trace: Dump NULL literally.
Instead of None.
2011-09-29 17:43:36 +01:00
Brian Paul
1a867385d5 st/mesa: remove some old GetTexImage() code
We can use the core Mesa code for glGetTexImage() since it handles the
image mapping/unmapping now.  We'll keep the decompress_with_blit() path
in the hope that it's faster than core Mesa's software decompression code.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41312
2011-09-29 09:18:24 -06:00
Marek Olšák
a3cd2c6c9b winsys/radeon: remove redundant member radeon_bo::size
It's part of pb_buffer already.
2011-09-29 01:10:18 +02:00
Marek Olšák
798ebc91eb winsys/radeon: simplify updating GEM domains for relocations 2011-09-29 01:10:12 +02:00
Marek Olšák
bfa51dfeac winsys/radeon: simplify passing GEM domains through to GEM_CREATE 2011-09-29 01:10:07 +02:00
Marek Olšák
7b42ed6eb5 r300g: remove useless variables in some structures 2011-09-29 01:09:58 +02:00
Marek Olšák
b2e6ca8ec7 r300g: simplify the immd_is_good_idea function 2011-09-29 01:09:53 +02:00
Marek Olšák
3c79962378 configure.ac: unduplicate gallium directories
It may happen when two drivers share one winsys.
2011-09-29 01:09:35 +02:00
Marek Olšák
4b1e7cf5d9 r600g: convert if (query->type) into switch statements 2011-09-29 01:07:30 +02:00
Marek Olšák
f9ed713158 gallium/docs: update d3d11ddi.txt 2011-09-29 01:06:43 +02:00
Marek Olšák
163761f128 st/mesa: don't compute index buffer bounds for per-instance data 2011-09-29 01:03:36 +02:00
Paul Berry
9c75527299 glsl 1.30: Fix numerical instabilities in asinh
The formula we were previously using for asinh:

    asinh x = ln(x + sqrt(x * x + 1))

is numerically unstable: when x is a large negative value, the quantity

    x + sqrt(x * x + 1)

is a small positive value (on the order of 1/(2|x|)).  Since the
logarithm function is very sensitive in this range, any error in the
computation of the square root manifests as a large error in the
result.

This patch changes to the equivalent formula:

    asinh x = sign(x) * ln(abs(x) + sqrt(x * x + 1))

which is only slightly more expensive to compute, and is numerically
stable for all x.

Fixes piglit tests
spec/glsl-1.30/execution/built-in-functions/[fv]s-asinh-*.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 12:20:25 -07:00
Brian Paul
b79782cbed mesa: fix signed/unsigned sscanf() warning in _mesa_override_glsl_version() 2011-09-28 13:17:11 -06:00
Brian Paul
3bb41e7b2d st/mesa: include version.h and fix _mesa_override_glsl_version() call 2011-09-28 13:17:11 -06:00
Eric Anholt
9f220bd135 glsl: Add support for constant expression evaluation on trunc().
Fixes the glsl-1.30/compiler/built-in-functions/trunc-* tests under 1.30.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
158a585450 i965/vs: Add support for bit-shift operations.
Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
0045a67418 mesa: Add missing _mesa_sizeof_glsl_type() for UNSIGNED_INT.
Somehow we managed to get the unsigned int vectors, but not scalar.
Fixes _mesa_problem complaints in piglit's uint tests.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
7de6e749df i965/fs: Add support for bit-shift operations.
Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
344f94bb00 glsl: Fix assertion checking types of constant bitshift expressions.
Bitshifts are one of the rare places that GLSL allows mixed base types
without an implicit conversion occurring.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Eric Anholt
1d59de1456 ir_to_mesa: Don't assertion fail on remaining GLSL 1.30 ops.
For hardware drivers, we only have ir_to_mesa called for the purposes
of potential swrast fallbacks (basically never on a 1.30 driver),
which we don't really care about.  This will allow 1.30 to be
implemented without rewriting swrast for it.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 12:09:09 -07:00
Paul Berry
f02ed012c9 i965: don't intepolate clip distances on pre-GEN6.
On pre-GEN6 chips, the VUE slots set aside for clip distance aren't
actually used, so there is no reason for the clipper to waste time
interpolating them.

When commit 62bad54727 changed the enum
value used to represent these VUE slots, that caused the clipper to
start interpolating them as an accidental side effect.  This patch
reverts to the old clipper behavior.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:04 -07:00
Paul Berry
64ce64a3f8 i965 new VS: Fix bugs in pre-GEN6 psiz/flags computation
This patch corrects two errors in the computation of the psiz/flags
VUE slot on pre-GEN5 when using the new VS backend:

- The clip flags (which should be stored in the w component of the
  first VUE slot) were being accidentally duplicated in all other
  components of that VUE slot, causing partially clipped triangles to
  sometimes disappear completely.

- The OR instruction wasn't being stored in "inst", causing the
  BRW_PREDICATE_NORMAL flag to be applied to the wrong instruction.

This patch fixes regressions in clipping behavior when using shaders
on GEN4-5.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:04 -07:00
Paul Berry
cc3a699e32 i965 new VS: Fix src_reg(uint32_t) constructor.
This constructor was storing its argument in the wrong field of the
"imm" enum, resulting in it being converted to a float when it should
have remained an unsigned integer.  This was preventing clipping from
working properly on pre-GEN6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:04 -07:00
Paul Berry
e7da40afe8 i965 new VS: don't share clip plane constants in pre-GEN6
In pre-GEN6, when using clip planes, both the vertex shader and the
clipper need access to the client-supplied clip planes, since the
vertex shader needs them to set the clip flags, and the clipper needs
them to determine where to insert new vertices.

With the old VS backend, we used a clever optimization to avoid
placing duplicate copies of these planes in the CURBE: we used the
same block of memory for both the clipper and vertex shader constants,
with the clip planes at the front of it, and then we instructed the
clipper to read just the initial part of this block containing the
clip planes.

This optimization was tricky, of dubious value, and not completely
working in the new VS backend, so I've removed it.  Now, when using
the new VS backend, separate parts of the CURBE are used for the
clipper and the vertex shader.  Note that this doesn't affect the
number of push constants available to the vertex shader, it simply
causes the CURBE to occupy a few more bytes of URB memory.

The old VS backend is unaffected.  GEN6+, which does clipping entirely
in hardware, is also unaffected.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Paul Berry
7e2b23ba85 i965: Fix a hardcoded user clip plane count.
Now that i965 supports 8 clip planes instead of 6, the size of the
brw_vs_compile::userplane array needs to be increased to 8.  Changed
the array size to MAX_CLIP_PLANES so that if the number changes again
in the future, this array size won't be missed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Paul Berry
a864b82a04 i965: allow for nonconsecutive elements of gl_ClipDistance to be enabled.
When using user-defined clipping planes, the i965 driver compacts the
array of clipping planes so that disabled clipping planes do not
appear in it--this saves precious push constant space and makes it
easier to generate the pre-GEN6 clip program.  As a result, when
enabling clipping planes in GEN6+ hardware, we always enable clipping
planes 0 through n-1 (where n is the number of clipping planes
enabled), regardless of which clipping planes the user actually
requested.

However, we can't do this when using gl_ClipDistance, because it would
be prohibitively complex to compact the gl_ClipDistance array inside
the user-supplied vertex shader.  So, when enabling clipping planes in
GEN6+ hardware, if gl_ClipDistance is in use, we need to pass the
user-supplied enable flags directly through to the hardware rather
than just enabling the first n planes.

Fixes Piglit test vs-clip-distance-enables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Paul Berry
e6c8027ccb i965: Use 4 bits to store nr_userclip in brw_clip.h.
Since the i965 driver supports 8 clipping planes now, we need 4 bits
to store the number of user clipping planes, not 3.

In theory this isn't strictly necessary, since brw_clip.h is only used
on pre-GEN6, and pre-GEN6 only advertises support for 6 clipping
planes, but it seems wise to err on the safe side.

In the process I removed the pad0 element of struct
brw_clip_prog_key--it doesn't seem necessary because the compiler
automatically inserts padding if needed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-28 11:38:03 -07:00
Chad Versace
bb3e75d9a5 intel: Remove unused function get_glsl_version()
It was replaced by _mesa_override_glsl_version().

Reviewed-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-28 11:29:53 -07:00
Chad Versace
a1eff5570f mesa: Allow overriding GLSL version with environment variable
Override the context's GLSL version if the environment variable
MESA_GLSL_VERSION_OVERRIDE is set. Valid values for
MESA_GLSL_VERSION_OVERRIDE are integers, such as "130".

MESA_GLSL_VERSION_OVERRIDE has the same behavior as INTEL_GLSL_VERSION,
except that it applies to all drivers, not just Intel's. Since the former
supercedes the latter, this patch disables the latter.

Reviewed-by: Dave Airlie <airlied@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-28 11:29:52 -07:00
Brian Paul
124fc96ddf st/mesa: substitute argument to guess_base_level_size() call
stObj->base.BaseLevel and firstImage->base.Level have the same value
but the later looks more consistent in the function call.
2011-09-28 10:39:10 -06:00
Brian Paul
d1e567fb00 mesa: fix signed/unsigned warning in sscanf() 2011-09-28 10:39:10 -06:00
Brian Paul
d487cc23a1 scons: insert 'git-' into MESA_GIT_SHA1 string
To match makefile build.
2011-09-28 09:51:45 -06:00
Brian Paul
e112287474 scons: fix write_git_sha1_h_file() issue on Windows
Unlike on Unix, os.rename(src, dst) will fail on Windows if the dst file
already exists.  Remove it first.
2011-09-28 09:05:58 -06:00
Christoph Bumiller
ddb5cd0a7b d3d1x: propagate DepthBiasClamp to rasterizer cso 2011-09-28 16:28:58 +02:00
Christoph Bumiller
5def3b7be1 d3d1x: fix uninitialized const color union black
Broken by 6dd284f7c8.
2011-09-28 16:28:58 +02:00
Christoph Bumiller
b3fa0d311e nv50,nvc0: support polygon offset clamp state 2011-09-28 16:28:58 +02:00
Christoph Bumiller
e92348b7f5 r600: support polygon offset clamp state 2011-09-28 16:28:17 +02:00
Christoph Bumiller
16f8308c3d gallium: add polygon offset clamp state
This is required for D3D1x and supported by hardware.
2011-09-28 16:28:17 +02:00
Brian Paul
f83af361a4 scons: generate git_sha1.h file as with Makefile build
So that GL_VERSION includes the git head hash id when building with scons.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-28 08:15:22 -06:00
Kenneth Graunke
83df7fbe62 i965: Allow SIMD16 color writes on Ivybridge.
Again, the check was needlessly specific: this works fine on Gen7.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 00:52:43 -07:00
Kenneth Graunke
79cba4c2b1 i965/fs: Allow SIMD16 with control flow on Ivybridge.
The check was designed to forbid it on old generations (Gen5/Ironlake),
not on new ones.  It just works on Gen7/Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-28 00:52:36 -07:00
Eric Anholt
b095b683f8 intel: Fix compiler warnings from the depth stall flush commit. 2011-09-27 15:17:50 -07:00
Eric Anholt
d1fda903ec radeon: Drop mapping we were doing around glGetTexImage().
It's handled by MapTextureImage() now.
2011-09-27 12:12:07 -07:00
Eric Anholt
6731c6cfb1 nouveau: Drop mapping we were doing around glGetTexImage().
It's handled by MapTextureImage() now.
2011-09-27 12:12:07 -07:00
Eric Anholt
019c9ee220 intel: Drop our custom glGetTexImage() code.
The mesa core code uses MapTextureImage() like we need now.

v2: Drop mapping around _mesa_generate_mipmap for compressed, since
    the whole path ends up going through MapTextureImage(), and the
    meta decompression code ended up causing us to lose track of the
    region that was originally mapped and assertion fail.
2011-09-27 12:12:07 -07:00
Brian Paul
ce62473408 mesa: Finally, convert RGBA glGetTexImage() to using MapTextureImage().
v2: Changes by Brian to MapTexImage in the decompression path.
v3: Changes by anholt to fix srcRowStride for decompression of NPOT.

Tested-by: Brian Paul <brianp@vmware.com> (v2)
2011-09-27 12:12:07 -07:00
Brian Paul
429b45e7c0 mesa: Convert depth glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
59348722b7 mesa: Convert depth/stencil glGetTexImage() to using MapTextureImage().
Note that the implementation before and after appears to be broken in
its handling of Z24_S8 vs S8_Z24.

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
0c513a9c1b mesa: Switch ycbcr glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
440dfb4583 mesa: Switch memcpy fast-path of glGetTexImage() to using MapTextureImage().
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
177110ae32 mesa: Update comments/assertions about buffer mapping for glGetTexImage().
This code is about to stop needing ->Data and using MapTextureImage().

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Brian Paul
8df7ca7112 mesa: Convert GetCompressedTexImage to using MapTextureImage().
This changes drivers to not map the texture on their own before
calling _mesa_get_compressed_teximage().

Tested-by: Brian Paul <brianp@vmware.com>
2011-09-27 12:12:07 -07:00
Dave Airlie
9f61e43b49 gallium: move border color to be a color union
EXT_texture_integer also specifies border color should be a color
union, the values are used according to the texture sampler format.

(update docs)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-27 20:02:02 +01:00
Chad Versace
0527c11d7a mesa: Allow override of GL version with environment variable
It is necessary to manually set the GL version to 3.0 in order to run
Piglit tests that use glGetUniform*().

This patch allows one to override the version of the OpenGL context by
setting the environment variable MESA_GL_VERSION_OVERRIDE.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-27 11:23:17 -07:00
Paul Berry
b565e62a44 mesa: Make enable.c and get.c properly range check clip flags.
This is a follow-up to commit
2d686fe911, which added decoding of
GL_CLIP_DISTANCE[67] to the _mesa_set_enable() function.  This patch
makes the following additional fixes:

- Uses GL_CLIP_DISTANCEi enums consistently within enable.c rather
  than the deprecated GL_CLIP_PLANEi enums.

- Generates an error if the user tries to access a clip flag that is
  unsupported by the hardware.

- Applies the same change to _mesa_IsEnabled(), so that querying clip
  flags using glIsEnabled() works properly.

- Applies corresponding changes to get.c, so that querying clip flags
  using glGet*() works properly.

Fixes piglit test clip-flag-behavior.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-27 10:36:38 -07:00
Brian Paul
4c84fbea9d mesa: fix indentation in mipmap.c (3 spaces) 2011-09-26 20:44:09 -06:00
Eric Anholt
39790b6450 i965/vs: Fix access beyond array bounds for non-GRF operands.
Caught by valgrind.  I never saw a segfault from it (probably because
it's hard to have much more of any other file than GRF).
2011-09-26 15:33:42 -07:00
Eric Anholt
8004a1cb95 intel: Rename region->buffer to region->bo, and remove accessor function.
We call all the other drm_intel_bo pointers in intel/*.h "bo", so this
one was rather out of place.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
b4721bf711 intel: Drop stale comment about CopyTexSubImage.
We get called for TexImage higher up, and in a relatively normal way
(pixels == NULL is common for FBO setup).

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
2ef77d1c74 intel: Rely on AllocTextureImageBuffer for our teximage fallbacks.
It will do a more reliable job at getting the image size for
_mesa_texstore right than us.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
d6b5e32f5f intel: Rely on mesa core for compressed texture image uploading.
There's nothing in our normal texture path we need for this.  We don't
PBO upload blit it.  We don't need to worry about flushing because
MapTextureImage handles it.  hiz scattergather doesn't apply, but MTI
handles it too.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
32fe506ae1 intel: Allow src == NULL and *dst != NULL in intel_miptree_reference().
This makes this API consistent with intel_region_reference, and the
consumers wanted it this way.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
db3ada6055 intel: Drop the "intel" argument to intel_miptree_release().
We don't have it in the other refcounting functions, and it was
totally unused.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
abaebcee78 intel: Drop the immediate validation of the texture object in TFP.
It's totally gratuitous -- the image's miptree will be checked for
binding to the object later, anyway, with zero-copy or blitting as
appropriate.

Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
d430e81c32 intel: Fix improper freeing of texture data in TFP.
If there happened to be ->Data present, we assertion failed instead of
handling it correctly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=35234
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
fdd4961443 intel: Refactor texture_from_pixmap and EGL_image region binding.
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
19cfe1e035 intel: Drop some extra equality checks on reference/release functions.
_mesa_reference_renderbuffer already short-circuits equality, and
intel_miptree_release does nothing on NULL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Eric Anholt
14ae70f793 i965: Set the pre/post-blend color clamp flags.
No change in piglit results on gen6, but the spec demands it so let's
do it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 15:33:42 -07:00
Kenneth Graunke
74e927bcaf i965/fs: Split generate_math into gen4/gen6 and 1/2 operand variants.
This mirrors the structure Eric used in the new VS backend, and seems
simpler.  In particular, the math1/math2 split will avoid having to
figure out how many operands there are, as this is already known by the
caller.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 16:30:07 -07:00
Brian Paul
c5943d6c1c swrast: always call _swrast_choose_texture_sample_func()
_swrast_choose_texture_sample_func() handles null texture object pointers
and will return the "null" sampler function which returns (0,0,0,1).  This
fixes a minor regression from ce82914f5a
2011-09-26 14:43:56 -06:00
Ian Romanick
e0553f6d4b mesa: Remove EXT_abgr extension enable flag
All drivers remaining in Mesa support this extension.  This extension
is required in desktop OpenGL.  The existing support is already partially
broken in Mesa (e.g., using format=GL_ABGR for glTexImage2D in OpenGL ES 2.x).
This patch does not change the situation in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:14 -07:00
Ian Romanick
29386d1f2d mesa: Remove EXT_bgra and EXT_texture_format_BGRA8888 extension enable flags
All drivers remaining in Mesa support this extension.  This extension
is either required or optional features in desktop OpenGL, OpenGL ES
1.x, and OpenGL ES 2.x.

EXT_texture_format_BGRA8888 is mostly a subset of EXT_bgra.  The only
difference seems to be that EXT_texture_format_BGRA8888 allows GL_BGRA
as an internal format to glTexImage2D and friends.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:14 -07:00
Ian Romanick
425284e882 mesa: Remove OES_read_format extension enable flag
This extension is always enabled, and drivers do not have
to option to disable it.

I kept this one separate from the others because I was a little
uncertain about the changes to get.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-09-26 12:14:13 -07:00
Ian Romanick
e5301b82ff mesa: Remove all mention of EXT_vertex_array_set
Mesa has never any portion of this extension, and neither has any
other vendor.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
740a9a4952 mesa: Fix extension year for EXT_texture_env_combine
The year 2006 apparently came from the "Last Modified Date" in the
spec header.  however, the revision history at the bottom say "2/22/00
mjk - added NVIDIA Implementation Details."  From that we can safely
infer that the spec is from at least 2000, and it may even be older.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
34eae1c72a mesa: Remove many extension enable flags
The following extensions are always enabled, and drivers do not have
to option to disable them:

    GL_ARB_multisample
    GL_ARB_texture_compression
    GL_ARB_vertex_buffer_object / GL_OES_mapbuffer
    GL_EXT_copy_texture
    GL_EXT_multi_draw_arrays / GL_SUN_multi_draw_arrays
    GL_EXT_polygon_offset
    GL_EXT_subtexture
    GL_EXT_texture_edge_clamp / GL_SGIS_texture_edge_clamp
    GL_EXT_vertex_array
    GL_SGIS_generate_mipmap

This set was picked because the are all either required or optional
features in desktop OpenGL, OpenGL ES 1.x, and OpenGL ES 2.x.  The
existing support for some is already partially broken in Mesa (e.g.,
proxy texture targets in OpenGL ES).  This patch does not change the
situation in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
2bf30b1ccc intel: Remove redundant GL_ARB_window_pos enable
This extension is enabled by default in _mesa_init_extensions, so
drivers don't need to enable it again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:13 -07:00
Ian Romanick
5e4f42b017 dri: Remove redundant GL_SGIS_texture_edge_clamp enables
This extension is enabled by default in _mesa_init_extensions, so
drivers don't need to enable it again.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-26 12:14:12 -07:00
Kenneth Graunke
8bd27a5b08 i965: Emit depth stalls and flushes before changing depth state on Gen6+.
Fixes OpenArena on Gen7.  Technically, adding only the first depth stall
fixes it, but the documentation says to do all three, and the Windows
driver seems to do it.

Not observed to fix anything on Gen6 yet.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38863
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:54:03 -07:00
Kenneth Graunke
490e6470a0 intel: Introduce a new intel_context::gt field to go along with gen.
It seems that GT1/GT2 sorts of variations are here to stay, and more
special cases will likely be required in the future.  Checking by PCI ID
via the IS_xxx_GTx macros is cumbersome; introducing a new 'gt' field
analogous to intel->gen will make this easier.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:50:31 -07:00
Kenneth Graunke
3f9f1b3659 intel: Remove intel_context::has_xrgb_textures/has_luminance_srgb.
Seeing as they were only used once (in the same function they were
defined), having them as context members seemed rather pointless.

Remove them entirely (rather than using local variables) since the
chipset generation checks are actually just as straightforward.

While we're at it, clean up the remainder of the if-tree that set them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:50:31 -07:00
Kenneth Graunke
01dda0758e i965: Fix incorrect maximum PS thread count shift on Ivybridge.
At one point, the documentation said that max thread count in 3DSTATE_PS
was at bit offset 23, but it's actually 24 on Ivybridge.  Not only did
this halve our thread count, it caused us to write 1 into a bit 23, which
is marked as MBZ (must be zero).  Furthermore, it made us write an even
number into this field, which is apparently not allowed.  Apparently we
were just lucky it worked.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-26 11:48:27 -07:00
Marek Olšák
44afac04ea r600g: add index_bias to index buffer bounds
This fixes ARB_draw_elements_base_vertex with max_index != ~0.

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
60a77cf316 u_vbuf_mgr: fix uploading with a non-zero index bias
Also don't rely on pipe_draw_info being set correctly.

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
21f71b6c05 u_vbuf_mgr: dereference some pointers only once etc. 2011-09-26 15:25:05 +02:00
Marek Olšák
cd9bbb3935 u_vbuf_mgr: rework user buffer uploads
- first determine the buffer range to upload for each buffer by walking over
  vertex elements
- take buffer_offset into account
- take src_offset into account
- take src_format into account in more places
- don't just blindly upload (stride*count) bytes

NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:05 +02:00
Marek Olšák
315300e444 u_vbuf_mgr: remove unused flag U_VBUF_UPLOAD_FLUSHED 2011-09-26 15:25:04 +02:00
Marek Olšák
28fb798911 u_vbuf_mgr: s/u_vbuf_mgr_/u_vbuf_ 2011-09-26 15:25:04 +02:00
Marek Olšák
f214e1c999 u_vbuf_mgr: fix max_index computation for large src_offset
NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:04 +02:00
Marek Olšák
4b5bf5a2a2 u_vbuf_mgr: don't take per-instance attribs into acc. when computing max index
NOTE: This is a candidate for the 7.11 branch.
2011-09-26 15:25:04 +02:00
Marek Olšák
0b3270b9b7 u_vbuf_mgr: cleanup original vs real vertex buffer arrays
It can now override both buffer offsets and strides in additions to resources.
Overriding buffer offsets was kinda hackish and could cause issues with
non-native vertex formats.
2011-09-26 15:25:04 +02:00
Yuanhan Liu
455a19b1b3 intel: fix potential segfault error at intel_(un)map_texture_image
intel_image->mt might be NULL, say with border width set. It then would
trigger a segfault at intel_map/unmap_texture_image function.

This would fix the oglc misctest(basic.textureBorderIgnore) fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-26 09:23:06 +08:00
Marcin Slusarz
65b8eea064 nouveau: fix crash during fence emission
Fence emission can flush the push buffer, which through flush_notify
unreferences recently emitted fence. If ref count is increased after
fence emission, unreference deletes the fence, which causes SIGSEGV.

Backtrace:
nouveau_fence_del
nouveau_fence_ref
nouveau_fence_next
nouveau_pushbuf_flush
MARK_RING
nv50_screen_fence_emit
nouveau_fence_emit
nv50_flush

This bug manifested as an assertion failure in nouveau_fence.c, because
SIGSEGV handler tried to shutdown the application and used messed up
fence.

This issue was reported by Maxim Levitsky.

Note: This is a candidate for the 7.11 branch.
2011-09-25 19:18:45 +02:00
Henri Verbeet
a4d72189b2 mesa: Also set the remaining draw buffers to GL_NONE when updating just the first buffer in _mesa_drawbuffers().
Without this we'd miss the last update in a sequence like {COLOR0, COLOR1},
{COLOR0}, {COLOR0, COLOR1}. I originally had a patch for this that called
updated_drawbuffers() when the buffer count changed, but later realized that
was wrong. The ARB_draw_buffers spec explicitly says "The draw buffer for
output colors beyond <n> is set to NONE.", and this is queryable state.
This fixes piglit arb_draw_buffers-state_change.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-25 15:00:21 +02:00
José Fonseca
4703f50e96 postprocess: Portability fixes. 2011-09-25 12:18:55 +01:00
José Fonseca
785b9e7c78 noop: Always use memory allocation macros. 2011-09-25 12:18:55 +01:00
José Fonseca
6921d4cd57 llvmpipe: Always use memory allocation macros. 2011-09-25 12:18:55 +01:00
José Fonseca
f32c9c2108 softpipe: Use memory allocation macros.
Fixes segfault with memory debugging on.
2011-09-25 12:18:55 +01:00
Emeric Grange
1f23ac8082 st/vdpau: Link vdpau targets with librt to avoid unresolved symbols error related to the use of the clock_gettime() function
This patch fix a "Unresolved Symbols" run time error when using G3DVL
through the VDPAU state tracker, by linking the vdpau targets with librt.
Reported by Arkadiusz Miśkiewicz.

Caused by this commit :
commit e911dbb563
Author: Emeric Grange <emeric.grange@gmail.com>
Date:   Mon Sep 12 23:39:33 2011 +0200

Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-25 12:50:12 +02:00
Christian König
86f97f7dc0 g3dvl: Don't use SCALED types for iDCT
This should bring g3dvl back to work until we figured out
how SCALED types should really work.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-25 12:49:06 +02:00
José Fonseca
102bf6e2a7 draw: Never allocate duplicate extra vertex attribs.
Prevents mismatches when the VS outputs generic attributes not used by
the FS.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-25 11:04:31 +01:00
José Fonseca
fc31f9a3f2 draw: Make copy of the TGSI tokens.
There is no guarantee that the tokens TGSI will persist beyond the
create_fs_state. The pipe driver (and therefore the draw module) is
responsible for making copies of the TGSI tokens when it needs them.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-25 11:04:29 +01:00
Chad Versace
06ae4a62b1 glsl: Fix Android build
Add lower_clip_distance.cpp to list of source files.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-24 19:37:13 -07:00
Kenneth Graunke
d7cdbc3c54 intel: Remove pointless boolean return value from *_miptree_layout.
i915_miptree_layout, i945_miptree_layout, and brw_miptree_layout always
just return GL_TRUE, so there's really no point to it.  Change them to
void functions and remove the (dead) error checking code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-23 22:42:18 -07:00
Kenneth Graunke
0d949a51bb glsl: Free all S-Expressions immediately after reading IR.
For some reason I thought subexpressions were chained off the top-level
one.  This isn't the case, so just create a temporary context and free
it.  All of this memory would be eventually freed, but now is freed
much sooner.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 17:12:47 -07:00
Kenneth Graunke
0fabf8e8dc glsl: Defer initialization of built-in functions until they're needed.
Very simple shaders don't actually use GLSL built-ins.  For example:
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_FragColor = vec4(0.0);
Both of the shaders used by _mesa_meta_glsl_Clear() also qualify.

By waiting to initialize the built-ins until the first time we need to
look for a signature, we can avoid the overhead entirely in these cases.

Makes piglit run roughly 18% faster (255 vs. 312 seconds).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 17:12:47 -07:00
Paul Berry
604173fb1c i965: Increase MaxClipPlanes to 8 for gen6+.
This is necessary for GLSL 1.30 compliance.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:46 -07:00
Paul Berry
2a6d432040 i965: Allow clip distances to be read back in fragment shaders.
Previously, we conditionally set up the SF pipline stage with a
urb_entry_read_offset of 2 when clipping was in use, and 1 otherwise,
causing the clip distance VUE slots to be skipped if present.  This
was an extremely minor savings (it saved the SF unit from reading 2
vec4s out of the URB, but it didn't affect any computation, since we
only instruct the SF unit to perform interpolation on VUE slots that
are actually used by the fragment shader).

GLSL 1.30 requires an interpolated version of gl_ClipDistance to be
available for reading in the fragment shader, so we need the SF's
urb_entry_read_offset to be 1 when the fragment shader reads from
gl_ClipDistance.

This patch just unconditionally sets the urb_entry_read_offset to 1 in
all cases; this is sufficient to make gl_ClipDistance available to the
fragment shader when it is needed, and the performance loss should be
negligible when it isn't.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:42 -07:00
Paul Berry
62bad54727 i965: Set up clip distance VUE slots appropriately for gl_ClipDistance.
When gl_ClipDistance is in use, the contents of the gl_ClipDistance
array just need to be copied directly into the clip distance VUE
slots, so we re-use the code that copies all other generic VUE slots
(this has been extracted to its own method).  When gl_ClipDistance is
not in use, the vertex shader needs to calculate the clip distances
based on user-specified clipping planes.

This patch also removes the i965-specific enum values
BRW_VERT_RESULT_CLIP[01], since we now have generic Mesa enums that
serve the same purpose (VERT_RESULT_CLIP_DIST[01]).

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:39 -07:00
Paul Berry
d9cb683f81 i965: Don't upload clip planes when gl_ClipDistance is in use.
When the vertex shader writes to gl_ClipDistance, we do clipping based
on clip distances rather than user clip planes, so don't waste push
constant space storing user clip planes that won't be used.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:37 -07:00
Paul Berry
b9ef2b85b4 i965: Enable lower_clip_distance.
i965 requires gl_ClipDistance to be formatted as an array of 2 vec4's
(as opposed to an array of 8 floats), so enable the lowering pass that
performs this conversion.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 15:32:33 -07:00
Paul Berry
2d686fe911 mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().
In order to support 8 clip distances, we need to properly decode when
the user sets the GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7 enable
flags.

For clarity, this patch changes the names GL_CLIP_PLANE[0-5] in the
switch statement to the equivalent names GL_CLIP_DISTANCE[0-5], since
the GL_CLIP_PLANE names are deprecated.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:30:08 -07:00
Paul Berry
3d7c5a4f6f mesa: set up gl_vert_result and gl_frag_attrib values for gl_ClipDistance.
This patch assigns enumerated values for gl_ClipDistance in the
gl_vert_result and gl_frag_attrib enums, so that driver back-ends can
assign gl_ClipDistance to the appropriate hardware registers.  It also
adjusts the functions _mesa_vert_result_to_frag_attrib() and
_mesa_frag_attrib_to_vert_result() (which translate between the two
enums) to correctly translate the new enumerated values.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:30:03 -07:00
Paul Berry
1ad54ae0b1 mesa: Add a flag to indicate whether a program uses gl_ClipDistance.
GLSL 1.30 requires us to use gl_ClipDistance for clipping if the
vertex shader contains a static write to it, and otherwise use
user-defined clipping planes.  Since the driver needs to behave
differently in these two cases, we need a flag to record whether the
shader has written to gl_ClipDistance.

The new flag is called UsesClipDistance.  We initially store it in
gl_shader_program (since that is the data structure that is available
when we check to see whethe gl_ClipDistance was written to), and we
later copy it to a flag with the same name in gl_vertex_program, since
that is a more convenient place for the driver to access it (in i965,
at least).

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2011-09-23 13:28:51 -07:00
Paul Berry
c06e325967 glsl: Implement a lowering pass for gl_ClipDistance.
In i965 GEN6+ (and I suspect most other hardware), gl_ClipDistance
needs to be laid out as a pair of vec4's (the first containing clip
distances 0-3, and the second containing clip distances 4-7).
However, it is declared in GLSL as an array of 8 floats.

This lowering pass acts at the GLSL level, modifying the declaration
of gl_ClipDistance so that it is an array of vec4's rather than an
array of floats, and renaming it to gl_ClipDistanceMESA.  In addition,
it modifies all accesses to the array so that they access the
appropiate component of one of the vec4's.

Since some hardware may not internally represent gl_ClipDistance as a
pair of vec4's, this lowering pass is optional.  To enable it, set the
LowerClipDistance flag in gl_shader_compiler_options to true.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 13:28:43 -07:00
Paul Berry
cc81eb09b9 glsl hierarchical visitor: Do not overwrite base_ir for parameter lists.
This patch fixes a bug in ir_hirearchical_visitor: when traversing an
exec_list representing the formal or actual parameters of a function,
it modified base_ir to point to each parameter in turn, rather than
leaving it as a pointer to the enclosing statement.  This was a
problem, since base_ir is used by visitor classes to locate the
statement containing the node being visited (usually so that
additional statements can be inserted before or after it).  Without
this fix, visitors might attempt to insert statements into parameter
lists.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-23 13:28:00 -07:00
Chad Versace
deff7fff49 mesa: Add missing includes to meta.h
Include mtypes.h.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-09-23 10:54:25 -07:00
Brian Paul
be928ecd8d docs: mention VMware svga driver updates in 7.12 release notes 2011-09-23 08:05:36 -06:00
Brian Paul
ea0cedce6a svga: indentation/formatting fixes 2011-09-23 07:59:21 -06:00
Brian Paul
2c308c66e2 svga: remove emit_consts() offset parameter
It was always zero.
2011-09-23 07:59:00 -06:00
Brian Paul
7c6a5134ba svga: s/int/unsigned/ in svga_state_constants.c
Be consistent with other functions in the file.  And add some comments.
2011-09-23 07:59:00 -06:00
Brian Paul
c27f24f6f0 svga: s/unit/shader/ and related clean-ups
'shader' is more intuitive.  Also s/int/unsigned/ and add assertions.
2011-09-23 07:59:00 -06:00
Brian Paul
5f053bf4ae svga: clean up return values and error codes
Previously we were using a hodge podge of int vs. pipe_enum and
0 vs. PIPE_OK.  Some functions that always returned PIPE_OK were
made void.
2011-09-23 07:59:00 -06:00
Brian Paul
681f92140c svga: add format translation for DXT/sRGB formats
Without this, apps/tests that tried to use a DXT/sRGB format would die on
a failed assertion (st_texture.c:80).
2011-09-23 07:58:48 -06:00
Brian Paul
2b2a69e088 svga: test register W component in emit_kil()
Only the XYZ components are checked to be negative by SVGA3DOP_TEXKILL.
GL_ARB_fp requires all four components be checked.  Emit a second texkill
for W if needed.
2011-09-23 07:58:48 -06:00
Brian Paul
7d09df0cbc svga: fix depth/shadow compare for non-projected texcoords
We only need to do the divide by Q step for TXP instructions.
This fixes the incorrectly rendered soft shadow test in Lightsmark.
Along with the previous texture swizzle commit, this also fixes all
the piglit glsl-fs-shadow2d-XX.shader_test failures.
2011-09-23 07:58:48 -06:00
Brian Paul
9bd15aef86 svga: implement texture swizzling
This exposes the GL_EXT_texture_swizzle extension and allows the various
depth texture modes to be implemented properly.  This, plus a follow-on
texture/shadow change fixes quite a few piglit GLSL shadow sampler test
failures.
2011-09-23 07:58:48 -06:00
Brian Paul
49a6f5e68e svga: check that we don't exceed input/ouput register limits 2011-09-23 07:58:47 -06:00
Brian Paul
2f40e4aac7 svga: implement point sprite suppport
Emit the SVGA3D_RS_POINTSPRITEENABLE render state.
When sprite_coord_mode=PIPE_SPRITE_COORD_LOWER_LEFT emit extra frag
shader code to invert the Y coordinate of the incoming texcoord.
2011-09-23 07:58:47 -06:00
Brian Paul
9a41ecaddd svga: add translation for float formats 2011-09-23 07:58:47 -06:00
Brian Paul
73e840ab7d svga: check to avoid writing beyond end of constant buffer
See bug 688394
2011-09-23 07:58:47 -06:00
José Fonseca
974b6413f4 svga: Cleanup format capability checking.
Accurately describe what operations are supported when a format caps
entry is not advertised by the host, and which formats are never
supported, instead of making ad-hoc and often incorrect assumptions.
2011-09-23 07:58:47 -06:00
José Fonseca
ffeed5da6e svga: Don't use the new depth formats for surfaces that will never be sampled from.
Mitigates issues with hosts where support for these new depth formats is
flaky.
2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
8bf3fb4eca svga: Share one texcoord between depth and fog 2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
4f17830b3d svga: Only emit Z depth work if it is actually read 2011-09-23 07:58:46 -06:00
Jakob Bornecrantz
3b32e51cb1 svga: Fix vPos usage 2011-09-23 07:58:45 -06:00
Jakob Bornecrantz
166e9421c8 svga: Wip for passing depth in a texcoord
TODO: Can we pass this as the same texcoord as fog?
2011-09-23 07:58:45 -06:00
José Fonseca
6759ad53e2 svga: Add a comment about depth format selection. 2011-09-23 07:58:45 -06:00
José Fonseca
846a21d352 svga: Consider the new depth formats in svga_texture_from_handle(). 2011-09-23 07:58:45 -06:00
José Fonseca
f74c04c22c svgadump: Dump the new depth format names. 2011-09-23 07:58:45 -06:00
Jakob Bornecrantz
4e0ae3e34f svga: Expose the new depth formats 2011-09-23 07:58:45 -06:00
José Fonseca
fd69fc8744 svga: Coalesce multiple shader constants in a single command.
HWv8 feature.

Tested with GoogleEarth, Mesa demos.
2011-09-23 07:58:44 -06:00
José Fonseca
157309348e svgadump: Update for svga3d_reg.h header changes. 2011-09-23 07:58:44 -06:00
Brian Paul
2b74fb139c svga: updated svga3d_reg.h to latest public version 2011-09-23 07:58:44 -06:00
Alex Corscadden
2883e3c0b5 Allow RBUG to start blocked
It is sometimes useful to examine the first frame or and early frame of a
quickly executing and non-repeating application, this chain introduces a new
environment variable that is checked when creating contexts.  If
GALLIUM_RBUG_START_BLOCKED is set, then each context that is created is started
in a blocked state.  This allows time to connect rbug before anything is
rendered in the context.
2011-09-23 07:58:44 -06:00
Brian Paul
ddfdea88d8 draw/llvm: add additional null pointer checkin draw_pt_fetch_pipeline_or_emit_llvm() 2011-09-23 07:58:44 -06:00
Yuanhan Liu
1a662e7c18 intel: fix the wrong code to detect null texture.
There is already comments show how to detect a null texture. Fix the
code to match the comments.

This would fix the oglc divzero(basic.texQOrWEqualsZero) and
divzero(basic.texTrivialPrim) test case fail.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-23 13:34:26 +08:00
Yuanhan Liu
cd6b8421ca i965: fix the constant interp bitmask for flat mode
Fix the constant interpolation enable bit mask for flat light mode.
FRAG_BIT_COL0 attribute bit might be 0, in which case we need to
shift one more bit right.

This would fix the oglc specularColor test fail on both Sandybridge and
Ivybridge.

v2: move the constant interp bitmask setup code into for(; attr <
FRAG_ATTRIB_MAX; attr++) loop suggested by Eric.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
2011-09-23 10:49:42 +08:00
Stéphane Marchesin
e3c94fac4e i915g: Don't generate useless swizzles before texture accesses.
That helps reduce the number of texture indirections, which are very limited on i915.
2011-09-22 19:26:33 -07:00
Stéphane Marchesin
79a0499369 i915g: Fix whitespace. 2011-09-22 19:26:32 -07:00
Marek Olšák
661b853f11 docs: update relnotes-7.12 with r600g changes 2011-09-23 03:03:45 +02:00
Brian Paul
7276ab2c36 st/mesa: remove unnecessary st_texture_match_image() parameters
We didn't use the face parameter and the level parameter can be found
in the gl_texture_image.
2011-09-22 16:43:45 -06:00
Stéphane Marchesin
687e62a5d7 i915g: Fix peephole optimization for MOVs. 2011-09-22 12:43:24 -07:00
Stéphane Marchesin
7cba40306e i915g: Add unsupported PIPE_CAP_MIN_TEXEL_OFFSET/PIPE_CAP_MAX_TEXEL_OFFSET. 2011-09-22 12:01:19 -07:00
Eric Anholt
86939e05d2 intel: Unindent the blit call in PBO blit uploads.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-22 11:03:26 -07:00
Eric Anholt
275ce9631b intel: Drop gratuitous flush in PBO blit upload.
Since the blit gets sequenced after other batchbuffer rendering like
normal, there's no need to push things out early.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:24 -07:00
Eric Anholt
3bb536e4c7 intel: Clean up check_pbo_format to ignore internalFormat.
All that matters here is the format of the texture, not the
internalformat (which might mean various different pixel formats).  In
one case, the pbo upload for MESA_FORMAT_YCBCR would have swapped the
channels for MESA_FORMAT_YCBCR_REV.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:22 -07:00
Eric Anholt
0ba2390947 intel: Move more of the PBO blit upload logic into that function.
This also improves the debugging output in the failure paths so you
get more than just "failed", and don't get spammed with "failed" when
you didn't even have a PBO to try.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:20 -07:00
Eric Anholt
d58a3182b1 intel: Remove stale comment about non-intel gl_buffer_objects.
This hasn't been true since dd26899ca3
in 2009.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:17 -07:00
Eric Anholt
bc0335fc0e intel: Remove the pbo zero-copy code.
There were notes about the possibility of slowdowns due to zcopy from
a PBO due to thrashing around of the region.  Slowdowns are even more
likely now that textures are generally tiled, which a zcopy wouldn't
get.  Additionally, there were no checks on the buffer size to ensure
that the hardware-required rounding was present, which could result in
GPU hangs on large zcopy PBOs.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:13 -07:00
Eric Anholt
57024e084a intel: Remove extra FreeTextureImageBuffer() from glTexImage*.
The core code does this before calling in to us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 11:03:10 -07:00
Eric Anholt
03e623a27b i965: Add support for GL_EXT_packed_float.
This doesn't cover support for this format as a renderbuffer yet.  The
spec allows implementations to not support it, though it is something
we do want to support.

Only one failure in piglit on gen6, which is texwrap with bordercolor
(as usual).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-22 10:58:34 -07:00
Eric Anholt
2fd8c4e3ed i965: Add support for GL_EXT_texture_shared_exponent.
Only one failure in piglit on gen6, which is texwrap with bordercolor
(as usual).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-22 10:58:34 -07:00
Brian Paul
9e9a76eea1 mesa: remove support for GL_APPLE_client_storage extension
AFAIK, there are few users of this extension and I can see a couple
reasons why this is probably broken in Mesa anyway.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 10:45:09 -06:00
Brian Paul
980f6f1b37 mesa: move gl_texture_image::Width/Height/DepthScale fields to swrast
These fields were only used for swrast so move them into
swrast_texture_image.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 10:44:57 -06:00
Brian Paul
eaf376ba35 mesa: move gl_texture_image::_IsPowerOfTwo into swrast
It's only used by swrast.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-22 10:44:36 -06:00
Michel Dänzer
de414f4915 st/mesa: Finalize texture on render-to-texture.
This makes sure that stObj->pt exists and is up to date.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39193 and piglit
fbo-incomplete-texture-03.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>

NOTE: This is a candidate for the 7.11 branch.
2011-09-22 17:01:18 +02:00
Brian Paul
4beb8f9e9d st/mesa: Convert size assertions to conditionals in st_texture_image_copy.
Prevents potential assertion failures in piglit fbo-incomplete-texture-03 test.

NOTE: This is a candidate for the 7.11 branch.
2011-09-22 17:01:18 +02:00
Christoph Bumiller
0cf1a55568 d3d1x: setup draw info primitive restart parameters 2011-09-22 16:53:54 +02:00
Brian Paul
4465efc3bf draw: add support for guard-band clipping 2011-09-22 08:26:40 -06:00
José Fonseca
a5c0fb51c6 draw: Reduce the number of vertex shader variants per context to 128. 2011-09-22 08:26:40 -06:00
Kurt Daverman
3c56280d33 draw: Respect max_indices from the renderer. 2011-09-22 08:26:40 -06:00
Brian Paul
37ef7c22ab translate: check for PIPE_SUBSYSTEM_EMBEDDED 2011-09-22 08:26:36 -06:00
Jakob Bornecrantz
c8c2fc9a7a tgsi: Check in scan for fs position and depth reads 2011-09-22 08:26:36 -06:00
Brian Paul
379353e16b svga: skip assertion when index_bias < 0
See bug 688383
2011-09-22 08:26:36 -06:00
Brian Paul
1a35fde7c8 svga: fix the test for sRGB texture formats
The pipe_sampler_view::format field should be prefered over the resource/
texture format.  The former is used to override the texture format for
sRGB decode enable/disable, etc.

Also, use new util_format_is_srgb() helper to catch all sRGB formats.

This fixes the piglit tex-srgb test for GL_EXT_texture_sRGB_decode.
2011-09-22 08:26:36 -06:00
Brian Paul
ff6cf60cb8 gallium/util: add util_format_is_srgb() helper 2011-09-22 08:26:36 -06:00
Keith Whitwell
553930424d util: add u_bit_scan helper 2011-09-22 08:26:36 -06:00
José Fonseca
ffb1996f61 util: Allow to make the depth/stencil format queries without repeatedly looking up the format description.
All functions here should take struct util_format_description * IMO, to
incentive efficient code.
2011-09-22 08:26:36 -06:00
Keith Whitwell
c40c1599bb util: single call to util_format_description in fill_rect 2011-09-22 08:26:35 -06:00
José Fonseca
f2a2ba9c6c util: Handle conversion between depth stencil formats. 2011-09-22 08:26:35 -06:00
Stéphane Marchesin
51f641291d i915g: Add an optimization to get rid of useless movs, in particular at the end of some shaders. 2011-09-21 18:01:43 -07:00
Stéphane Marchesin
fc1fbb2dc1 i915g: Fix some whitespace problems. 2011-09-21 18:01:41 -07:00
Stéphane Marchesin
bfe507bcff i915g: Blend equation separate seems to work. 2011-09-21 18:01:41 -07:00
Stéphane Marchesin
ef1fa4467f i915g: Add ifdef'd out code to dump compiled shaders. 2011-09-21 18:01:40 -07:00
Stéphane Marchesin
9a15b1eb95 i915g: Fix bug in shader optimizer. 2011-09-21 18:01:39 -07:00
Stéphane Marchesin
ca8492c284 i915g: Remove stale function prototype. 2011-09-21 18:01:38 -07:00
Brian Paul
559a0cd1fc svga: call u_default_redefine_user_buffer() to fix failed assertion
This fixes a regression from a8cf4b6acf

The problem occured when two successive glDrawArrays calls accessed
subsequent elements in user-space arrays.  The user-space array
from the first call wasn't being grown to accomodate the second
draw call's elements.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-09-21 16:32:00 -06:00
Eric Anholt
a140c3e783 meta: Don't hang on to program refcounts after metaops are done.
Fixes piglit ARB_shader_objects/clear-with-deleted.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39577
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-21 10:17:54 -07:00
Eric Anholt
d4444b8e5b i965/vs: Return a dummy value when visiting ir_texture.
While the program won't successfully link in the end, this avoids
possible assertion failure in the driver during linking if
this->result isn't initialized with something already.
2011-09-21 09:46:39 -07:00
Eric Anholt
d158f6e73b i965/gen6+: When only BFC is written, use BFC as the color.
Fixes piglit vertex-program-two-side enabled back back2
2011-09-21 09:46:39 -07:00
Eric Anholt
447c488d77 i965/gen6+: Respect the VERTEX_PROGRAM_TWO_SIDE flag for shaders.
Fixes piglit:
vertex-program-two-side enabled front back front2 back2
vertex-program-two-side enabled front back
vertex-program-two-side enabled front2 back2
2011-09-21 09:46:39 -07:00
Eric Anholt
b68e3422ed mesa: Add a context flag indicating whether two-sided lighting should happen.
The 965 driver was ignoring the VERTEX_PROGRAM_TWO_SIDE flag and only
looking at fixed-function state.
2011-09-21 09:46:38 -07:00
Brian Paul
169f57255a util: remove stray debug code 2011-09-21 08:26:29 -06:00
Brian Paul
0e6646db32 mesa: check glBegin()/glDrawArrays()/etc mode with _mesa_valid_prim_mode()
We now raise an GL_INVALID_ENUM in glBegin() if mode is illegal, as was
done in Yuanhan Liu's original patch.

Take geometry shaders support into account too.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-21 08:22:07 -06:00
Brian Paul
51002968c9 gallivm: fix build with llvm 3.0svn
https://bugs.freedesktop.org/show_bug.cgi?id=41065
2011-09-21 07:24:03 -06:00
Brian Paul
4ef82cee6d tnl: include swrast/s_chan.h to fix sse build 2011-09-21 06:49:33 -06:00
Chia-I Wu
4a96a02de7 st/vega: fix drawing images with alpha channel
Checking if the paints are opaque in renderer_validate_blend() does not
work.  We could be drawing images.  Remove the check from
renderer_validate_blend() and take image drawing into consideration in
blend_use_shader().

The bug was introduced by 3f0a966807,
which affects the lookup demo.
2011-09-21 12:01:21 +08:00
Chia-I Wu
ceb6d34906 st/vega: fix vg_context_is_object_valid()
vg_context_is_object_valid() checks if a handle is valid by checking if
the handle is a valid key of the object hash table.  However, the keys
of the object hash table were object pointers.

Fix vg_context_add_object() to use the handles as the keys so that
vg_context_is_object_valid() works.  This bug was introduced by
99c67f27d3.
2011-09-21 12:01:03 +08:00
Brian Paul
bdddf1cc26 swrast: s/GLubyte/GLchan/ in a cast 2011-09-20 21:06:19 -06:00
Brian Paul
72648c25e6 llvmpipe: silence a pointer type warning 2011-09-20 20:33:45 -06:00
Brian Paul
de740d7b0a meta: use _mesa_set_enable() in more places
Avoids an extra context lookup.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-20 20:17:42 -06:00
Brian Paul
9e414865a6 meta: use _mesa_set_enable(), fix decompress_texture_image()
Use _mesa_set_enable() to avoid a redudant context lookup.
Need to disable the texture target in decompress_texture_image() so the
unit isn't still enabled after glGetTexImage() returns.  Arguably, the
meta restore code should do this, but it doesn't.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-20 20:17:42 -06:00
Brian Paul
20b92c9d1e st/mesa: specify source mipmap level in decompress_with_blit()
This, along with the previous patch, fixes glGetTexImage() of compressed
textures for level > 0.
2011-09-20 20:17:42 -06:00
Brian Paul
f63dbc600f gallium/util: observe sampler view's first_level in util_blit_pixels_tex()
This lets us blit from a non-zero source level.
2011-09-20 20:17:42 -06:00
Brian Paul
1e939f5374 meta: fix broken sRGB mipmap generation
If we're generating a mipmap for an sRGB texture we need to bypass
sRGB->linear conversion.  Otherwise the destination mipmap level
(drawn with a textured quad) will have the wrong colors.
If we can't turn of sRGB->linear conversion (GL_EXT_texture_sRGB_decode)
we need to use the software fallback for mipmap generation.

Note: This is a candidate for the 7.11 branch.
2011-09-20 20:17:42 -06:00
Brian Paul
4731a598f0 mesa: fix PACK_COLOR_5551(), PACK_COLOR_1555() macros
The 1-bit alpha channel was incorrectly encoded.  Previously, any non-zero
alpha value for the ubyte alpha value would set A=1.  Instead, use the
most significant bit of the ubyte alpha to determine the A bit.  This is
consistent with the other channels and other OpenGL implementations.

Note: This is a candidate for the 7.11 branch.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
2011-09-20 20:17:42 -06:00
Brian Paul
4d53fb525d mesa: move last bits of GLchan stuff into swrast
This removes the last remnants of the GLchan datatype and associated
macros out of core Mesa and into swrast.
2011-09-20 20:17:42 -06:00
Brian Paul
ef275f907c mesa: remove CHAN_TYPE cruft from debug.c 2011-09-20 20:17:41 -06:00
Brian Paul
59e858f462 mesa: remove unused interp/stride chan macros 2011-09-20 20:17:41 -06:00
Brian Paul
460863ace9 mesa: remove unused UNCLAMPED_FLOAT_TO_RGB_CHAN() macro 2011-09-20 20:17:41 -06:00
Brian Paul
499f0685e8 radeon: use _mesa_unclamped_float_rgba_to_ubyte() 2011-09-20 20:17:41 -06:00
Brian Paul
8530d72c4e r200: use _mesa_unclamped_float_rgba_to_ubyte() 2011-09-20 20:17:41 -06:00
Brian Paul
d71c03836e mesa: remove unused <type>_TO_CHAN() macros 2011-09-20 20:17:41 -06:00
Brian Paul
e1d703bec5 mesa: convert _mesa_unpack_color_span_chan() to ubyte 2011-09-20 20:17:41 -06:00
Brian Paul
ae670b58d4 mesa: replace GLchan with GLubyte in texcompress_s3tc.c 2011-09-20 20:17:41 -06:00
Brian Paul
b4e6afbf77 mesa/gallium: remove GLchan from latc, rgtc code 2011-09-20 20:17:41 -06:00
Brian Paul
960694fd2d mesa: remove GLchan in texcompress_fxt1.c 2011-09-20 20:17:41 -06:00
Brian Paul
663f61a3e1 mesa: s/_mesa_make_temp_chan_image()/_mesa_make_temp_ubyte_image()
Another step toward eliminating the GLchan type.
2011-09-20 20:17:41 -06:00
Brian Paul
ece8d6f25c mesa: move _mesa_upscale_teximage2d() to texcompress_fxt1.c
Was used by no other code.
2011-09-20 20:17:41 -06:00
Brian Paul
529b9360f3 mesa: s/GLchan/GLubyte/ in mipmap generation code 2011-09-20 20:17:41 -06:00
Kenneth Graunke
dbae496083 make: Don't use builtin_stubs.cpp for standalone GLSL compiler.
builtin_stubs.cpp is only supposed to be used for builtin_compiler.  It
contains a stub version of _mesa_glsl_initialize_functions() that does
nothing.

libglsl.a already contains builtin_function.cpp, the generated file that
contains a version of _mesa_glsl_initialize_functions() that actually
initializes all the built-in functions.

By mistakenly linking to builtin_stubs, glsl_compiler and glsl_test are
unable to compile any shaders that use built-in functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-09-20 18:21:45 -07:00
Ian Romanick
b152a239b1 GLES2/gl2ext: upgrade to gl2ext.h version 15049 2011-09-20 15:54:52 -07:00
Ian Romanick
011e946cb0 mesa: Don't expose compressed paletted formats via GL_{NUM_,}COMPRESSED_TEXTURE_FORMATS
Fixes a bug introduced by commit faf5d65.  These formats should only
be exposed in OpenGL ES 1.x.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: Xun Fang <xunx.fang@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40860
2011-09-20 15:42:05 -07:00
Brian Paul
977e269c3e gallium: remove trailing comma to silence warning 2011-09-20 16:36:21 -06:00
Paul Berry
8b06b0d19d Gallium: Increase PIPE_MAX_CLIP_PLANES to 8.
Since Mesa is now capable of supporting up to 8 clipping planes
instead of 6, this patch updates Gallium internals to support 8
clipping planes as well.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-20 14:51:16 -07:00
Paul Berry
bc00370832 Gallium: remove unnecessary ifdef for MAX_CLIPPED_VERTICES.
draw_pipe_clip.c contained an ifdef to ensure that its local
definition of MAX_CLIPPED_VERTICES would not take effect if the global
MAX_CLIPPED_VERTICES (defined in src/mesa/main/config.h) was already
defined.  This was unnecessary because draw_pipe_clip.c doesn't
directly or indirectly include src/mesa/main/config.h.  Removed the
ifdef to reduce confusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-20 14:51:16 -07:00
Paul Berry
61b2d01101 Increase MAX_CLIP_PLANES to 8
This will allow drivers to increase ctx->Const.MaxClipPlanes to 8,
which is required for GLSL-1.30 compliance.

No driver behavior should be affected.  However, many data structures
use MAX_CLIP_PLANES as an array size, so these arrays will get
slightly larger.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:13 -07:00
Paul Berry
2dfa33a5e9 Hardcode the default value of ctx->Const.MaxClipPlanes to 6.
Previously this value was set to MAX_CLIP_PLANES, which is defined to
be 6.  But MAX_CLIP_PLANES needs to be increased to 8 to support
GLSL-1.30-compliant drivers.  This patch hard-codes the default value
of ctx->Const.MaxClipPlanes to 6, so that when MAX_CLIP_PLANES is
increased, it won't affect drivers that do not support 8 clip planes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:10 -07:00
Paul Berry
8be653164d i965: Remove bogus assertion on MAX_CLIP_PLANES.
This patch removes the assertion "MAX_CLIP_PLANES == 6" from the i965
driver.  This assertion is unnecessary; nothing in the driver requires
MAX_CLIP_PLANES to be 6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:07 -07:00
Paul Berry
27bdc76eb9 mesa: Update clipping code to use ctx->Const.MaxClipPlanes.
To support GLSL 1.30, we will need to increase MAX_CLIP_PLANES to 8.
To avoid breaking drivers that do not yet support 8 clip planes, this
patch modifies the Mesa core code that pertains to clipping to use
ctx->Const.MaxClipPlanes rather than MAX_CLIP_PLANES, since
ctx->Const.MaxClipPlanes will remain 6 for drivers that only support 6
clip planes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-20 14:51:03 -07:00
José Fonseca
c773de133a scons: Unbreak mingw build. 2011-09-20 20:50:48 +01:00
José Fonseca
f8aeb1c990 scons: MacOSX build fixes. 2011-09-20 20:41:57 +01:00
Bryan Cain
6da8c21124 glsl_to_tgsi: implement ir_binop_all_equal and ir_binop_any_nequal for native integers 2011-09-20 14:39:30 -05:00
Eric Anholt
c662764f4f i965/vs: Add support for compute-to-MRF.
Removes 1.8% of the instructions from 97% of the vertex shaders in
shader-db.
2011-09-20 11:28:56 -07:00
Eric Anholt
0502db1eab i965/vs: Do VUE writes using the MRF file instead of hardware register.
We'll only do compute-to-MRF on accesses to this file.
2011-09-20 11:28:56 -07:00
Eric Anholt
65d46c96c2 i965/vs: Handle destinations in the MRF file.
We've been referencing MRFs through the HW_REG file so far, but that
makes it harder to handle compute-to-MRF and similar optimizations.
2011-09-20 11:28:56 -07:00
Eric Anholt
160848d8ef i965/vs: Add a function for how many MRFs get written as part of a SEND.
This will be used for compute-to-mrf, which needs to know when MRFs
get overwritten.
2011-09-20 11:28:56 -07:00
Eric Anholt
63bc443f8a i965/vs: Remove dead fields of src_reg.
These were copy and pasted from the FS, and are never used.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-20 11:28:56 -07:00
Eric Anholt
f0c04e6c22 i965/vs: Add support for simple algebraic optimizations.
We generate silly code for array access, and it's easier to generally
support the cleanup than to specifically avoid the bad code in each
place we might generate it.

Removes 4.6% of instructions from 41.6% of shaders in shader-db,
particularly savage2/hon and unigine.

v2: Fixes by Ken: Make is_zero/one member functions, and fix a
    progress flag.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-20 11:28:56 -07:00
Eric Anholt
7288d010e0 i965: Fix polygon stipple offset state flagging.
_NEW_WINDOW_POS wasn't a real Mesa state flag, but we were missing
_NEW_BUFFERS to update the stipple offset when FBO binding or window
size changed, and _NEW_POLYGON to update when stippling gets enabled.

Fixes oglconform's tristrip test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-20 10:20:06 -07:00
Eric Anholt
4c9b09d3c2 i965: Add missing _NEW_POLYGON flag to polygon stipple upload.
Because we skip the pattern upload when stippling is disabled, we need
to check again when it might have been turned on.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-20 10:20:06 -07:00
Eric Anholt
c310c35a75 i965: Fix compiler warnings. 2011-09-20 10:20:06 -07:00
Yuanhan Liu
a11b4c1e7a mesa: fix error handling for glMaterial*
Trigger GL_INVALID_ENUM error if the face paramter is not a valid value.

Trigger GL_INVALID_VALUE error if the GL_SHININESS value is out side
[0, ctx->Constant.MaxShiniess].

v2: fix the max shininess value.

v3: suggested by Brian, move the face check into glMaterialfv function
    to reduce code duplicate. Also, refactor the error message.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-20 08:05:34 -06:00
Chia-I Wu
a5f8d37be1 st/egl: add support for null platform
The backend calls null_sw_create() to create sw_winsys.  And that is
pretty much it...
2011-09-20 17:44:20 +08:00
Chia-I Wu
5eca41665b egl: add null platform
The null platform has no window or pixmap surface (but pbuffer surface).
And the only valid display is EGL_DEFAULT_DISPLAY.  It is useful for
offscreen rendering.  It works everywhere becase no window system is
required.
2011-09-20 17:44:15 +08:00
Dave Airlie
fb4ceb9638 configs: remove rest of APP_LIB_DEPS lines
pointed out by GArik_ on #radeon.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-20 08:25:25 +01:00
Kenneth Graunke
47b556fbca i965/fs: Implement texelFetch() on Gen4.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00
Kenneth Graunke
0edf5d63d6 i965/fs: Implement texelFetch() on Ivybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00
Kenneth Graunke
30be2cc6c7 i965/fs: Implement texelFetch() on Ironlake and Sandybridge.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-19 15:30:54 -07:00
Ian Romanick
051c901559 glapi: Update generated file modified by previous commit 2011-09-19 12:02:21 -07:00
Ian Romanick
c78baae796 glapi: Don't emit remap data for individual extensions
All of the extensions actually supported by Mesa have been remapped by
remap.c for a long time.  Emitting all of these data structures is
just clutter.

Drivers that need additional functions remapped, should add
'offset="assign"' to the function definition in the .xml file.

The changes to remap_helper.h are in a follow-on ~8700 line patch that
would surely be rejected by the mailing list.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-09-19 12:02:21 -07:00
Ian Romanick
76e5020e90 mesa: Delete stale comment about MESAX extensions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:21 -07:00
Ian Romanick
2e1cc883b3 mesa: Replace _mesa_rgba_logicop_enabled(ctx) with ctx->Color.ColorLogicOpEnabled
Since GL_EXT_blend_logic_op is removed, _mesa_rgba_logicop_enabled(ctx)
just returns ctx->Color.ColorLogicOpEnabled.  That seems kind of silly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:21 -07:00
Ian Romanick
2836aab203 mesa: Use ColorLogicOpEnabled instead of _LogicOpEnabled
Since GL_EXT_blend_logic_op is removed, _LogicOpEnabled and
ColorLogicOpEnabled always have the same value.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:20 -07:00
Ian Romanick
113e8167de mesa: Remove support for GL_EXT_blend_logic_op
Support is removed for four reasons:

1. The implementation was broken with respect to separate blend
equations.  The GL_EXT_blend_equation_separate spec says:

    "If EXT_blend_logic_op and EXT_blend_equation_separate are both
    supported, the logic op blend equation should be supported separately
    for RGB and alpha as with the other blend equation modes."

But Mesa's implementation of GL_LOGIC_OP specifically forbids this.

2. No hardware supported by Mesa can support separate blend equations
involving GL_LOGIC_OP.

3. No applications could be found that use this extension.

4. No other Linux OpenGL drivers support this extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Cc: Brian Paul <brianp@vmware.com>
2011-09-19 12:02:20 -07:00
Ian Romanick
3538bffa72 st/mesa: Remove support for GL_EXT_blend_logic_op
It was broken, and it isn't really useful anyway.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Cc: Brian Paul <brianp@vmware.com>
2011-09-19 12:02:20 -07:00
Ian Romanick
636dd62131 mesa: Remove unused _mesa_enable_imaging_extensions function
The last user of this function was driInitExtensions, and that function
was removed in a previous commit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-09-19 12:02:20 -07:00
Colin Walters
4d515c2146 autogen.sh: Honor NOCONFIGURE environment variable
See http://people.gnome.org/~walters/docs/build-api.txt

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-19 19:53:49 +01:00
Eric Anholt
fd17de2123 mesa: Throw an error when starting conditional render on an active query.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-while-active.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-19 11:51:53 -07:00
Eric Anholt
7371224c06 mesa: Throw an error instead of asserting for condrender with query == 0.
From the NV_conditional_render spec:

    BeginQuery sets the active query object name for the query type given by
    <target> to <id>.  If BeginQuery is called with an <id> of zero, if the
    active query object name for <target> is non-zero, if <id> is the active
    query object name for any query type, or if <id> is the active query
    object for condtional rendering (Section 2.X), the error INVALID OPERATION
    is generated.

Fixes piglit nv_conditional_render-begin-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-19 11:51:53 -07:00
Eric Anholt
8899f6e93c mesa: Add support for Begin/EndConditionalRender in display lists.
Fixes piglit nv_conditional_render-dlist.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-19 11:51:53 -07:00
Marek Olšák
da90c8fc27 mesa: fix an autoconf build-system bug related to glsl_to_tgsi
st_glsl_to_tgsi.cpp was completely ignored by makedepend because it was
not included in ALL_SOURCES, which caused that the file was not recompiled
when certain header files were changed (like glsl/ir.h).

The first part of this commit is just a consolidation.
The second part is the fix.
2011-09-19 20:27:54 +02:00
Brian Paul
2ce8c3553b mesa: fix format/type check in unpack_image() for bitmaps
Passing type == GL_BITMAP returns 0 while error values return -1.
This fixes glPolygonStipple being compiled into display lists.
2011-09-19 11:39:30 -06:00
Paul Berry
20da49b267 i965 new VS: Fix copy propagation of double negatives.
When copy propagating a value into an instruction that negates its
argument, we need to invert the sense of the value's "negate" flag, so
that -(+x) becomes -x and -(-x) becomes +x.

Previously, we were always setting the value's "negate" flag to true
in this circumstance, so that both -(+x) and -(-x) turned into -x.

Fixes Piglit test vs-double-negative.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-19 10:24:08 -07:00
Ian Romanick
24a113093b mesa: Advertise GL_OES_compressed_paletted_texture in OpenGL ES1.x
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
13757f7080 mesa: Remove redundant compressed paletted texture error checks
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
3ebbfc8372 mesa: Refactor compressed texture error checks to work with paletted textures
This code was really broken before.  A lot of the error checks were
done much later (too late), and some of the error checks would fail.
The underlying problem is that Mesa doesn't ever keep compressed paletted
textures in their original format.  The textures are immediately
converted to some RGB or RGBA format.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39991
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
b433e7ba07 mesa: Add _mesa_cpal_compressed_format_type
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
a2cab751be mesa: Refactor expected texture size check in cpal_get_info
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:47 -07:00
Ian Romanick
fc0fa16be3 mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_base_tex_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:46 -07:00
Ian Romanick
a454c835fa mesa: Add GL_OES_compressed_paletted_texture formats to _mesa_is_compressed_format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Jin Yang <jin.a.yang@intel.com>
2011-09-19 10:04:46 -07:00
Nicholas Miell
4e7079ed54 Update llvmpipe's gitignore
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 10:50:17 -06:00
Yuanhan Liu
099af9e9df mesa: fix error handling for glMapBufferRange
Accroding the man page, GL_INVALID_VALUE would generated if access has any
bits set other than those valid defined bits.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:22:18 -06:00
Brian Paul
386ec5e80e mesa: generate GL_INVALID_OPERATION in glIsEnabledIndex() between Begin/End 2011-09-19 08:13:47 -06:00
Yuanhan Liu
57b8f13aa4 mesa: fix error handling for glSelectBuffer
According the man page, trigger a GL_INVALID_VALUE if size < 0.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:52 -06:00
Yuanhan Liu
7a9a8bbabd mesa: fix error handling for glPixelZoom
According the man page, GL_INVALID_OPERATION should generated if
glPixelZoom is executed between the execution of glBegin and the
corresponding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:52 -06:00
Yuanhan Liu
6a98802243 mesa: fix error handling for glIsEnabled
According the man page, GL_INVALID_OPERATION should be generated if
glIsEnabled is executed betwwen the execution of glBegin and the
correspoding execution of glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:52 -06:00
Yuanhan Liu
b020b111a8 mesa: fix error handling for glTexEnv
Fix error handling while calling glTexEnv with invalid texture
environment parameters.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:51 -06:00
Yuanhan Liu
f1ddde5c16 mesa: fix error handling for some glGet* functions
According to the man page, it should trigger a GL_INVALID_OPERATION
while calling some glGet* functions inside glBegin and glEnd.

This patch dose handle the following functions:
 glGetBooleanv
 glGetFloatv
 glGetIntegerv
 glGetInteger64v
 glGetDoublev

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:51 -06:00
Yuanhan Liu
21b2895bd0 mesa: fix error handling for glEvalMesh1/2D
According man page, trigger error when calling glEvalMesh1/2D inside
glBegin/glEnd.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 08:11:51 -06:00
Matt Turner
f534c13413 Remove unused APP_LIB_DEPS variable
Unused since removal of demos from the repository?

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 07:39:19 -06:00
Matt Turner
75eb92fb28 egl_glx.c: use unsigned instead of uint
We've had a hack to fix this in Gentoo on Solaris for a while.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 07:39:04 -06:00
Matt Turner
116e896aaf Remove unneeded xdamages header from dri2_glx.c.
It's needed for dri1 but not dri2.

Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-19 07:34:46 -06:00
Dave Airlie
f8c190b0ab graw: fix tests to build on msvc again.
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=40997

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-19 10:20:10 +01:00
Tom Stellard
2d1004d9aa r300/compiler: Fix regalloc for values with multiple writers
https://bugs.freedesktop.org/show_bug.cgi?id=40062
https://bugs.freedesktop.org/show_bug.cgi?id=36939

Note: This is a candidate for the 7.11 branch.
2011-09-18 18:00:14 -07:00
Brian Paul
63b5902756 swrast: fix more store_texel() bugs
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40412 on swrast.
2011-09-18 11:24:04 -06:00
Dave Airlie
6dd284f7c8 gallium: move clear paths from rgba to a pointer to a color union (v2)
This moves the gallium interface for clears from using a pointer to 4 floats to a pointer to a union of float/unsigned/int values.

Notes:
1. the value is opaque.
2. only when the value is used should it be interpretered according to
the surface format it is going to be used with.
3. float clears on integer buffers and vice-versa are undefined.

v2: fixed up vega and graw, dropped hunks that shouldn't have been in
patch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-18 15:12:47 +01:00
Brian Paul
78026b8ace mesa: use ctx->Driver.AllocTextureImageBuffer() to alloc texture memory 2011-09-17 14:57:41 -06:00
Brian Paul
e6cf338d01 mesa: plug in swrast texture image alloc/free functions
Use the swrast allocation/free functions instead of core Mesa.
2011-09-17 14:57:40 -06:00
Brian Paul
efc93219a9 swrast: add Alloc/FreeTextureImageBuffer() driver functions
Not called yet.  These will replace the core Mesa functions for allocating
and freeing malloc'd texture memory.
2011-09-17 14:57:40 -06:00
Brian Paul
d1da1c0ca8 mesa: add AllocTextureImageBuffer() driver hook 2011-09-17 14:57:40 -06:00
Brian Paul
a1661dc895 mesa: move gl_texture_image::FetchTexel fields to swrast
This also involves passing swrast_texture_image instead of gl_texture_image
into all the fetch functions.
2011-09-17 14:57:40 -06:00
Brian Paul
20177a620e swrast: plug in _swrast_new/delete_texture_image() functions 2011-09-17 14:57:40 -06:00
Brian Paul
abdfa0b4f1 radeon: make radeon_texture_image a subclass of swrast_texture_image 2011-09-17 14:57:40 -06:00
Brian Paul
fa2c886863 intel: make intel_texture_image a subclass of swrast_texture_image
We need to subclass swrast_texture_image because if we use swrast for
fallback rendering, we'll need to have swrast_texture_image objects.
2011-09-17 14:57:40 -06:00
Brian Paul
1da896803c swrast: introduce new swrast_texture_image struct
No subclass fields yet.  Subsequent patches will add the fields related
to software rendering that are currently in gl_texture_image.
2011-09-17 14:57:40 -06:00
Brian Paul
146f536b33 mesa: add new DeleteTextureImage() driver hook
Matches the NewTextureImage() hook.  With new subclasses of
gl_texture_image coming we need a new hook to properly delete objects of
those subclasses.
2011-09-17 14:57:40 -06:00
Brian Paul
baeefef2c0 mesa: move software texel fetch code into swrast
It's only used by swrast now so move it out of core Mesa.
2011-09-17 14:57:40 -06:00
Brian Paul
ce82914f5a mesa: move _mesa_update_fetch_functions() calls into swrast
Do it during swrast state validation since the FetchTexel() functions
are only called from swrast now and not core Mesa.
Remove assertions in mipmap.c since they're no longer appropriate.
2011-09-17 14:57:40 -06:00
Brian Paul
f0f28548c2 mesa: implement unpack_SIGNED_GR1616 in format_unpack.c 2011-09-17 13:36:58 -06:00
Brian Paul
6e423253e7 meta: fix/add checks for GL_EXT_framebuffer_sRGB
This fixes spurious GL errors when the GL_EXT_framebuffer_sRGB extension
is not supported.

Note: This is a candidate for the 7.11 branch
2011-09-17 11:14:21 -06:00
Brian Paul
3b29631c33 mesa: s/short/ushort/ in unpack_SIGNED_RGBA_16() 2011-09-17 10:50:42 -06:00
Christoph Bumiller
ee09c1e1c3 d3d1x: fix parsing of SM4 relative addressing register op 2011-09-17 12:11:44 +02:00
Christoph Bumiller
4a06248281 d3d1x: set flatshade_first in rasterizer state
D3D10 specifies the first vertex as the leading/provoking one.
2011-09-17 12:09:03 +02:00
Christoph Bumiller
e27d72d6c3 d3d1x: initialize point size and line width to 1
Otherwise lines would never be visible since the width cannot be
specified in D3D10.
Wireframe mode is also affected by line width.
2011-09-17 12:07:42 +02:00
Tom Stellard
e945fb04d0 r300/compiler: Add support for the output modifier (OMOD) 2011-09-16 17:35:46 -07:00
Tom Stellard
1e5aaaa138 r300/compiler: Move some helper functions to radeon_compiler_util.c 2011-09-16 17:19:56 -07:00
Tom Stellard
96620d2275 r300/compiler: Don't unroll loops that conditionally increment the counter 2011-09-16 17:19:56 -07:00
Vinson Lee
79b162ba45 nouveau: Fix typos of ParseSourceList in SConscript files.
Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-09-16 14:07:20 -07:00
Brian Paul
88625e6e65 scons: fix incorrect test for embedded build
This was missed back in commit 4175010749.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-16 10:13:14 -06:00
Marek Olšák
34f4bd8190 winsys/radeon: use the cache bufmgr for buffers with PIPE_BIND_CUSTOM
so that we don't abuse PIPE_BIND_VERTEX_BUFFER all the time.
2011-09-16 17:25:12 +02:00
Brian Paul
81c688babe softpipe: use pipe_get_tile_rgba_format()
Pass an explicit surface format as we do with pipe_put_tile_rgba_format().
This fixes the piglit fbo-srgb-blit test.  With GL_EXT_framebuffer_sRGB we
override the resource's format with an explicit format (linear vs. sRGB).
We need to do so both when getting and putting tiles.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40402

Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-16 07:38:53 -06:00
Brian Paul
89999204ec softpipe: use util_format_is_depth_or_stencil()
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-16 07:38:53 -06:00
Dave Airlie
2b47d2bce1 r600g: fixup missing scaled r600 types.
I was still missing a couple of types on r600/r700 codepaths.

Fixes these up.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 14:09:16 +01:00
Dave Airlie
f2bae9456f r600g: interpret integer texture types as ints.
For signed/unsigned with no normalisation or srgb, assume its an INT
type texture.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:26:57 +01:00
Dave Airlie
2dfabdd0a4 r600g: take constantly interpolated values into a/c
We could constant interpolated values now and set have_perspective
if nothing else is set to avoid a GPU hang.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:26:57 +01:00
Dave Airlie
21c5607e64 r600g: add flat non-interpolation support.
TGSI CONSTANT interpolation is just flat, and we just read the values
direct from the LDS into the GPR without doing any interpolation on them.

This is needed to pass integer types into the fragment shader.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:25:48 +01:00
Dave Airlie
de3218664a r600g: set number type correctly for color buffers.
If we get a scaled type assume its a real integer type (as textures are).

Also fixup the blend bypass and blend clamp flags on evergreen as per the
docs.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:25:48 +01:00
Dave Airlie
b205f53c7f r600g: add missing formats to color buffer setup.
just playing with EXT_texture_integer, and this was first bug.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-16 09:25:48 +01:00
Brian Paul
3edbce32fb softpipe: use consistent indentation in sp_quad_blend.c 2011-09-15 16:18:14 -06:00
Tobias Droste
1795372fee gallivm: fix build with LLVM 3.0svn
LLVM 3.0svn added SubtargetInfo as additional parameter to
createMCDisassembler() and createMCInstPrinter().
See revision 139237 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-09-15 15:53:04 -06:00
Eugeni Dodonov
72e0a9226d Change strerror(ret) to strerror(-ret). 2011-09-15 15:12:02 -03:00
Brian Paul
a7109a3199 softpipe: fix blending for luminance/intensity surfaces
If we're drawing to a luminance, luminance/alpha or intensity surface
we have to adjust (rebase) the fragment/quad colors before writing them
to the tile cache.  The tile cache always stores RGBA colors but if
we're caching a L/A surface (for example) we need to be sure that R=G=B
so that subsequent reads from the surface cache appear to return L/A

We previously had a special case for RGB (no alpha) surfaces.  This
change generalizes that for the other base formats.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40408, but sRGB
formats are still failing.  That'll be addressed in a later patch.
2011-09-15 11:31:55 -06:00
Brian Paul
ba6f1f2c29 util: add util_format_is_luminance/intensity/rgb(), etc
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-15 11:31:55 -06:00
Jørgen Lind
0763b978ee wayland: Flush before blocking in swapbuffers.
Make sure that we've sent the frame request that we're going to block on.
2011-09-15 11:53:39 -04:00
Brian Paul
6fd6efa7bf mesa: fix error handling for dlist image unpacking
When compiling glDrawPixels, glTexImage(), etc. and we're copying
the user's image we need to be careful about GL error checking.
Previously, we were incorrectly generating GL_OUT_OF_MEMORY in
unpack_image() if width <= 0 or height <= 0 or for invalid format/type
values.  We now check those arguments in unpack_image() and return NULL
if there's a bad value.  The command will get compiled with the
arguments as-is and image=NULL.  Later, when the command is executed the
correct errors will be generated.

This issue was reported by Yuanhan Liu <yuanhan.liu@linux.intel.com>

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
2011-09-15 09:39:13 -06:00
Brian Paul
b0524e49fc st/mesa: rewrap a long line 2011-09-15 09:05:15 -06:00
Brian Paul
4e58e56f6f mesa: add missing ')' in error message 2011-09-15 08:02:57 -06:00
Dave Airlie
41f3773c1d uniforms: accept all int/unsigned int sampler types in uniform checks.
I'm not 100% sure about this, it may need a version check or it might
be completely wrong.

added multisample ones as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-15 09:33:45 +01:00
Paul Berry
00792e3586 glsl: Remove field array_lvalue from ir_variable.
The array_lvalue field was attempting to enforce the restriction that
whole arrays can't be used on the left-hand side of an assignment in
GLSL 1.10 or GLSL ES, and can't be used as out or inout parameters in
GLSL 1.10.

However, it was buggy (it didn't work properly for built-in arrays),
and it was clumsy (it unnecessarily kept track on a
variable-by-variable basis, and it didn't cover the GLSL ES case).

This patch removes the array_lvalue field completely in favor of
explicit checks in ast_parameter_declarator::hir() (this check is
added) and in do_assignment (this check was already present).

This causes a benign behavioral change: when the user attempts to pass
an array as an out or inout parameter of a function in GLSL 1.10, the
error is now flagged at the time the function definition is
encountered, rather than at the time of invocation.  Previously we
allowed such functions to be defined, and only flagged the error if
they were invoked.

Fixes Piglit tests
spec/glsl-1.10/compiler/qualifiers/fn-{out,inout}-array-prohibited*
and
spec/glsl-1.20/compiler/assignment-operators/assign-builtin-array-allowed.vert.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-14 10:58:56 -07:00
Michel Dänzer
373234ce17 r600g: Initialize multi VGT related register on Cayman.
Prevents lockups with piglit tests draw-elements and draw-vertices using large
numbers of vertices.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alex.deucher@amd.com>
2011-09-14 18:40:16 +02:00
Michel Dänzer
d8c443ddde glx/dri2: Don't call X server for SwapBuffers when there's no back buffer.
As already done in dri2CopySubBuffer().

Should fix:

https://bugs.freedesktop.org/show_bug.cgi?id=36371
https://bugs.freedesktop.org/show_bug.cgi?id=40533

Might fix:

https://bugs.freedesktop.org/show_bug.cgi?id=32589

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-09-14 18:40:16 +02:00
Andrew Deason
48510d6856 DRI: Log something if we don't support legacy DRI
If we are called via the legacy DRI interface, and we don't support
legacy DRI (InitScreen is NULL), print a debug message, so it is easy
to see why the driver fails to initialize.

See https://bugs.freedesktop.org/show_bug.cgi?id=40437
2011-09-14 18:39:45 +02:00
Andrew Deason
45e0a7a51d GLX: Say something if we cannot connect via DRI2
See https://bugs.freedesktop.org/show_bug.cgi?id=40437
2011-09-14 18:37:48 +02:00
Christoph Bumiller
7744e867b7 nvc0: implement resource_resolve 2011-09-14 18:30:53 +02:00
José Fonseca
9cae933f4a llvmpipe: Remove dead lp_tile_shuffle_mask.py script.
Broken, and we now shuffle tiles with pack/unpack instructions, instead
of shuffle masks.
2011-09-14 16:48:17 +01:00
José Fonseca
f87be0bae9 scons: Remove dead MSVC SDK/DDK/WINCE tools.
Not really used anymore.
2011-09-14 16:45:44 +01:00
Christoph Bumiller
d2d19ea51f nv50/ir: add missing license headers 2011-09-14 16:50:23 +02:00
Brian Paul
ec4b823f67 st/mesa: fix/update comment on st_translate_color() 2011-09-14 08:32:30 -06:00
Christoph Bumiller
c57c7a86ae nvc0: emit tessellation mode and patch size in TCP/TEP validation 2011-09-14 16:19:52 +02:00
Christoph Bumiller
d53c49bcd4 nv50,nvc0: handle PIPE_CAP_MIN/MAX_TEXEL_OFFSET 2011-09-14 16:19:52 +02:00
Christoph Bumiller
2dc6f74077 nvc0: remove old shader backend files 2011-09-14 16:19:52 +02:00
Christoph Bumiller
3afabfb929 nvc0: hook up to new shader code generator
Also includes loading of shared shader library code (used for f64
and integer division) and setting up the immediate array buffer
which is appended to the code.
2011-09-14 16:19:52 +02:00
Christoph Bumiller
57594065c3 nv50/ir: import new shader backend code 2011-09-14 16:19:52 +02:00
Christoph Bumiller
a42eca84c5 nvc0: prevent interruption of m2mf push
M2MF will trap if the data stream is interrupted by a QUERY fence
and report too much or not enough data.
2011-09-14 16:19:52 +02:00
Christoph Bumiller
150bb0fb34 nouveau: make data argument of nouveau_context::push_data const 2011-09-14 16:19:51 +02:00
Brian Paul
ec22b75be1 softpipe: implement blend color clamping
Per the GL spec, clamp incoming colors prior to blending depending on
whether the destination buffer stores normalized (non-float) values.
Note that the constant blend color needs to be clamped too (we always
get the unclamped color from Mesa).

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40412
2011-09-14 08:15:59 -06:00
Brian Paul
4fc50d4570 mesa: minor clean-up on _mesa_unclamped_float_rgba_to_ubyte()
Add a comment and reformat to be under 80 columns.
2011-09-14 08:15:59 -06:00
Brian Paul
4d21ecde77 mesa: white space, comment fixes in mtypes.h
"vale" was a typo.  Fix that and do some other minor clean-ups.
2011-09-14 08:15:59 -06:00
Emeric Grange
e911dbb563 st/vdpau: Preliminary support for timestamped output surface into the presentation queue
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:29 +02:00
Emeric Grange
6cf0581159 st/vdpau: Output surfaces that are too large to fit into the display target will be clipped
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
85534e6f48 st/vdpau: Add get_clear_color capability
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
fa2a8316ce st/vdpau: Add documentation from the VDPAU API and update some traces
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
c24bc6f868 st/vdpau: Various whitespace cleanups found while reading some code
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:16 +02:00
Emeric Grange
87e84a2dbf nouveau: Add max_references parameter to vl_create_decoder()
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-14 15:49:16 +02:00
Emeric Grange
82e8bf36d8 g3dvl: Add max_references parameter to vl_create_decoder()
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-14 15:49:15 +02:00
Emeric Grange
42fddacaba g3dvl: Add get_clear_color capability
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
Reviewed-by: Christian König <deathsimple@vodafone.de>
2011-09-14 15:49:15 +02:00
Emeric Grange
02e191cb6a g3dvl: Various whitespace cleanups found while reading some code
Signed-off-by: Emeric Grange <emeric.grange@gmail.com>
2011-09-14 15:49:15 +02:00
Dave Airlie
81a86aea4f mesa/colormac: introduce inline helper for 4 unclamped float to ubyte.
This introduces an UNCLAMPED_FLOAT_TO_UBYTE x 4 inline function, as
suggested by Brian. It uses it in a few places I noticed from previous
color changes, and also some core mesa places. I haven't updated other places
yet.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-14 11:18:08 +01:00
Dave Airlie
093dc9e548 mesa: introduce a clear color union to be used for int/unsigned buffers
This introduces a new gl_color_union union and moves the current
ClearColorUnclamped to use it, it removes current ClearColor completely and
renames CCU to CC, then all drivers are modified to expected unclamped floats instead.

also fixes st to use translated color in one place it wasn't.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-14 11:18:07 +01:00
Brian Paul
b06613c6cc st/mesa: fix incorrect debug output
format and type are not GL enums here.
2011-09-13 09:30:33 -06:00
Brian Paul
0ebf83b731 gallivm: remove unused vars 2011-09-13 08:16:01 -06:00
Brian Paul
52b9ec727b gallium: minor comments for util_format_channel_description fields 2011-09-13 08:14:31 -06:00
Marcin Slusarz
f626d99edf nv50/nvc0: add support for R4A4_UNORM and A4R4_UNORM formats
R4A4 is needed by OSD in mplayer's xvmc output
2011-09-13 15:28:00 +02:00
Marek Olšák
8dbf9d70d3 r600g: fix typo in "r600g: simplify deducing chip family" 2011-09-13 13:09:17 +02:00
Dave Airlie
1ab4e221fd mesa/pack: don't apply transfer operations to integer format buffers. (v3)
The EXT_texture_integer issues says:

Should pixel transfer operations be defined for the integer pixel
path?

RESOLVED: No.  Fragment shaders can achieve similar results
with more flexibility.  There is no need to aggrandize this
legacy mechanism.

v2: fix comments, fix unpack paths, use same comment/code
v3: fix last comment

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-13 09:43:23 +01:00
Marek Olšák
f97acf4015 r600g: remove unused function r600_buffer_from_handle 2011-09-12 22:03:03 +02:00
Marek Olšák
12325b7962 r600g: remove an irrelevant XXX comment 2011-09-12 22:03:03 +02:00
Marek Olšák
9f0dc855b2 r600g: remove r600_resource_buffer struct
This subclass of r600_resource doesn't contain any useful members,
so let's just use r600_resource.
2011-09-12 22:03:03 +02:00
Marek Olšák
ac028b20e5 r600g: set the return type of radeon_destroy to void 2011-09-12 22:03:03 +02:00
Marek Olšák
b87bc2eb44 r600g: remove r600_drm_public.h 2011-09-12 22:03:03 +02:00
Marek Olšák
1a532ca79a r600g: inline some of the winsys r600_get functions 2011-09-12 22:03:03 +02:00
Marek Olšák
915227b0aa r600g: simplify deducing chip family 2011-09-12 22:03:03 +02:00
Marek Olšák
3603d15788 r600g: compute tiling info in the pipe, not in the winsys
The winsys doesn't need it.
2011-09-12 22:03:02 +02:00
Marek Olšák
a94e33a8ef r600g: remove unused ioctl definitions 2011-09-12 22:03:02 +02:00
Marek Olšák
d26b49f87f r600g: do not loop in radeon_family_from_device
Also move that function to r600_drm.c
2011-09-12 22:03:02 +02:00
Marek Olšák
85f5d7ceee r600g: cleanup build include dirs and dependencies
The scons build still depended on libdrm_radeon.
2011-09-12 22:03:02 +02:00
José Fonseca
fb5995cf53 scons: Don't use gstabs on mingw-64. 2011-09-12 17:23:47 +01:00
Marek Olšák
f37a5081b2 st/mesa: clamp Max program param limits
Setting just MAX_PROGRAM_ENV_PARAMS to 4096 breaks everything,
so let's do this instead.

This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=40767

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-12 16:55:21 +02:00
Marek Olšák
4682e70601 pb_buffer: inline 'base' sub-struct 2011-09-11 18:29:27 +02:00
Marek Olšák
2154c672b3 r300g: handle the new CAPs 2011-09-11 15:47:23 +02:00
Emil Velikov
f0bfc0daa8 tgsi: fix typo in commit 324ac982d8
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-09-10 14:09:29 -05:00
Maarten Lankhorst
1465dc26a5 nouveau: Add support for XvMC acceleration
Try to use the PMPEG where available

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-09-10 14:22:11 -04:00
Bryan Cain
10dbd02927 glsl_to_tgsi: use UARL instead of I2F and ARL
Since TGSI now has a UARL opcode that takes an integer as the source, it is
no longer necessary to hack around the lack of an integer ARL opcode using I2F.
UARL is only emitted when native integers are enabled; ARL is still used
otherwise.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-10 12:46:47 -05:00
Bryan Cain
324ac982d8 gallium: add TGSI opcodes UARL and UCMP
They are needed by glsl_to_tgsi for an efficient implementation using native
integers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-10 12:46:41 -05:00
Marek Olšák
9222c497f9 mesa: fix more valgrind warnings
==27540== Invalid read of size 4
==27540==    at 0x96277B7: _mesa_make_extension_string (string3.h:144)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???
==27540==  Address 0xad35b30 is 3,688 bytes inside a block of size 3,691 alloc'd
==27540==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==27540==    by 0x9627641: _mesa_make_extension_string (extensions.c:910)
==27540==    by 0x9604E78: _mesa_make_current (context.c:1514)
==27540==    by 0x9602A8B: st_api_make_current (st_manager.c:789)
==27540==    by 0x45406E7: ???

And:

==28351== Invalid write of size 2
==28351==    at 0x4C087CC: _mesa_make_extension_string (string3.h:144)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f3 is 19 bytes inside a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==
==28351== Invalid read of size 4
==28351==    at 0x4C087EC: _mesa_make_extension_string (extensions.c:806)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)
==28351==  Address 0x48dd1f4 is 0 bytes after a block of size 20 alloc'd
==28351==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==28351==    by 0x4C08711: _mesa_make_extension_string (extensions.c:778)
==28351==    by 0x4BE6198: _mesa_make_current (context.c:1514)
==28351==    by 0x4BD4CAB: st_api_make_current (st_manager.c:789)

The first part adds 2, because ' ' and '\0' may be written at the end
of the buffer.
2011-09-10 19:40:36 +02:00
Brian Paul
aa77df1355 draw/llvm: combine draw_llvm_generate() and draw_llvm_generate_elts()
These two functions were nearly the same with lots of duplicated code.
Now pass in a boolean 'elts' flag and use a few conditionals to implement
the linear vs. indexed cases.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-10 10:34:44 -06:00
Tom Stellard
3d32e58987 r300/compiler: Implement ROUND
According to the GLSL spec, the implementor can decide which way to round
when the fraction is .5.  The r300 compiler will round down.
2011-09-10 06:36:53 -07:00
Marek Olšák
2a5cbc5306 mesa: fix a valgrind warning
==5715== Invalid read of size 4
==5715==    at 0x4AA590B: _mesa_make_extension_string (extensions.c:908)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)
==5715==  Address 0x4795730 is 0 bytes inside a block of size 1 alloc'd
==5715==    at 0x4025315: calloc (vg_replace_malloc.c:467)
==5715==    by 0x4AA5B4C: _mesa_make_extension_string (extensions.c:772)
==5715==    by 0x4A83198: _mesa_make_current (context.c:1514)
==5715==    by 0x4A71CAB: st_api_make_current (st_manager.c:789)
2011-09-10 15:12:54 +02:00
Marek Olšák
7e30216879 st/dri: remove the call to driInitExtensions
The function no longer exists. This fixes Gallium build.
2011-09-10 12:33:02 +02:00
Marek Olšák
6b9a36cc3f r600g: fix shadow rect samplers 2011-09-10 08:53:29 +02:00
Marek Olšák
c8b0b13d40 r600g: use SAMPLE_LB for OPCODE_TXB 2011-09-10 08:53:29 +02:00
Marek Olšák
b37931f69b r600g: enable texture arrays 2011-09-10 08:53:29 +02:00
Marek Olšák
929ad43b11 r600g: add support for shadow array samplers
I had to guess & verify how some of the SAMPLE instructions work.
2011-09-10 08:53:29 +02:00
Marek Olšák
23b4ad4626 r600g: implement texture arrays for evergreen 2011-09-10 08:53:29 +02:00
Marek Olšák
840ad139af r600g: always decompress all mipmaps and layers, slices, or faces of zbuffers
This fixes piglit/fbo-depth-array.

Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-10 08:53:29 +02:00
Marek Olšák
c4519c3aec r600g: fix texture array filtering
This fixes piglit/fbo-generatemipmap-array.

It looks like SQ_TEX_SAMPLER_WORD0_0.TEX_ARRAY_OVERRIDE should be set
for array textures in order to disable filtering between slices,
which adds a dependency between sampler views and sampler states.

This patch reworks sampler state updates such that they are postponed until
draw time. TEX_ARRAY_OVERRIDE is updated according to bound sampler views.

This also consolidates setting the texture state between vertex and
pixel shaders.
2011-09-10 08:53:29 +02:00
Marek Olšák
9edd0b5ddf glsl_to_tgsi: fix shadow2DArray comparison
v2: adjust the assertion, add a comment
2011-09-10 08:53:29 +02:00
Marek Olšák
da7233840f ir_to_mesa: fix shadow2DArray comparison
The depth should be in W.

v2: adjust the assertion, add a comment
2011-09-10 08:53:29 +02:00
Marek Olšák
274768856d u_blitter: add texture array support
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-09-10 08:53:29 +02:00
Marek Olšák
19ff7666f3 st/mesa: convert shadow array samplers to TGSI 2011-09-10 08:53:29 +02:00
Marek Olšák
d8452a0be8 gallium: add shadow 1D and 2D array samplers to TGSI
And filling in all the switch statements in auxiliary. Mostly untested.
2011-09-10 08:53:29 +02:00
Marek Olšák
3794291372 gallium: add PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS
v2: remove PIPE_CAP_ARRAY_TEXTURES in favor of the new CAP.
2011-09-10 08:53:29 +02:00
Ian Romanick
5a175127f3 dri: Remove all extension enabling utility functions
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:20 -07:00
Ian Romanick
67d9063492 swrast-dri: Remove call to driInitExtensions
The only purpose this call served in the DRI swrast driver was to
initialize the remap table.  Core Mesa already does the dispatch
offset remapping for every function that could possibly ever be
supported.  There's no need to continue using that cruft in the
driver.
2011-09-09 14:02:20 -07:00
Ian Romanick
6fb32b4a5f radeon: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_logic_op,
and EXT_blend_minmax are no longer advertised.  These all resulted in
software fallbacks, so their loss will not be mourned.
EXT_blend_subtract is, however, explicitly added to the list.
GL_FUNC_SUBTRACT is fully accelerated, but GL_FUNC_REVERSE_SUBTRACT
(still) results in a software fallback.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
4b43eea1b3 r600: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
2b7848b79f r300: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added to
the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
bd67f8617d r200: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color is explicitly added
with a dependency on the drmSupportsBlendColor flag.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.
Based on feedback from Roland Scheidegger.

Cc: Alex Deucher <alexdeucher@gmail.com>
Cc: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2011-09-09 14:02:20 -07:00
Ian Romanick
8a99ec8e05 nouveau: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_minmax, and
EXT_blend_subtract are explicitly added to the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: Viktor Novotný <noviktor@seznam.cz>
2011-09-09 14:02:20 -07:00
Ian Romanick
0a5478c1d9 intel: Move S3TC extension enable bits to intel_extensions.c
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:20 -07:00
Ian Romanick
71ceccad7e intel: Enable extensions by just setting the flags
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 14:02:19 -07:00
Brian Paul
023ca40d80 llvmpipe: add some null pointer checks
It's not clear if these are acceptable cases so issue a one-time warning
in debug builds when we hit them.

Fixes segfault in piglit fbo-mipmap-copypix test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-09-09 14:00:55 -06:00
Ian Romanick
e12b4752ef nvprogram: Silence "warning: unused parameter ‘ctx’" 2011-09-09 12:01:52 -07:00
Ian Romanick
8b3096cfa4 swrast: Silence many "warning: unused parameter ‘ctx’"
Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
2011-09-09 12:01:52 -07:00
Ian Romanick
076d609aa3 tnl_dd: Silence "tnl_dd/t_dd_tritmp.h:292:3: warning: suggest braces around empty body in an ‘if’ statement" 2011-09-09 12:01:52 -07:00
Ian Romanick
0075510400 spantmp2: Silence many "warning: unused parameter ‘ctx’"
Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to
all the function templates to make GCC happy.
2011-09-09 12:01:51 -07:00
Ian Romanick
aaa305215c mesa: Silence "main/teximage.h:148:72: warning: unused parameter ‘texObj’" 2011-09-09 12:01:51 -07:00
Ian Romanick
2d4b8e296f swrast-dri: Silence several "warning: unused parameter" 2011-09-09 12:01:51 -07:00
Ian Romanick
559ed1a41d dri: Silence several "warning: unused parameter" 2011-09-09 12:01:51 -07:00
Ian Romanick
17d898d5b9 dri_util: Silence several "warning: unused parameter"
The parameters can't be removed because they are part of the DRI ABI.
2011-09-09 12:01:51 -07:00
Ian Romanick
1a8111aea4 intel: Silence "intel/intel_fbo.h:105:4: warning: comparison of unsigned expression < 0 is always false"
The test was of an enum, attIndex, which should be unsigned.  The
explicit check for < 0 was replaced with a cast to unsigned in an
assertion that attIndex is less than the size of the array it will be
used to index.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
ed3040f3ba intel: Silence several "warning: unused parameter"
Trivially silence the compiler by adding '(void) foo;' for each unused
parameter.  These parameters could not be removed.  They are part of
interface used elsewhere in Mesa, and some of the other customers
actually use these parameters.
2011-09-09 12:01:51 -07:00
Ian Romanick
4d5c820b4f intel: Silence several "warning: unused parameter"
The internalFormat, format, and type parameters were not used by
either try_pbo_upload or try_pbo_zcopy, so remove them.  The width
parameter was also not used by try_pbo_zcopy (because it doesn't
actually copy anything), so remove it too.

Eric Anholt notes:

    The current structure of this code is so hateful I can't bring
    myself to say anything about whether changing the current code is
    good or bad.

    I have a dream that one call would try to make a surface
    (miptree/region) out of the PBO, then we'd see about whether it
    matches up nicely and zero-copy/blit using that.  That would be
    reusable for texsubimage, which is currently awful in this
    respect.

At some point we should revisit this code with pitchforks and torches.
2011-09-09 12:01:51 -07:00
Ian Romanick
6f23d9b637 intel: Silence "warning: unused parameter ‘depth0’"
The depth0 parameter was not used in intel_miptree_create_for_region,
so remove it.  All of the places that call this function, pass 1 for
that parameter, and the place where it looks like it should have been
used (the call to intel_miptree_create_internal) also had 1 hard
coded.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
bd817215c8 intel: Silence "warning: unused parameter ‘target’"
The GLenum target parameter was not used in intel_copy_texsubimage, so
remove it.  Also remove the GLenum internalFormat parameter.  Each
caller just copied this out of the intel_texture_image that is already
passed to intel_copy_texsubimage.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:51 -07:00
Ian Romanick
36a91e45f7 intel: Silence several "warning: unused parameter"
The intel_context and tiling parameters were not used by any if the
i9[14]5_miptree_layout or the functions they call, and the tiling parameter was
not used by brw_miptree_layout.  Remove the unnecessary parameters.
2011-09-09 12:01:51 -07:00
Ian Romanick
17fa6772d7 intel: Silence "warning: unused parameter ‘fb’"
The gl_framebuffer was not used in intel_draw_buffer, so remove it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
5b6264b42e intel: Silence "warning: unused parameter ‘intel’"
The intel_context was not used in any of these functions, so remove it.
2011-09-09 12:01:50 -07:00
Ian Romanick
fccbcb5ceb intel: Silence several "warning: unused parameter"
Also clean-up some of the naming, etc. in
intel_buffer_object_purgeable.  'intel' is usually used as the name of
an intel_context pointer, and intel_obj is usually used as the name of
an intel_*_obj pointer.  These changes were suggested by Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
2a6a1c4bc2 intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between signed and unsigned integer expressions"
v2: Remove the assertion in intel_batchbuffer_space:

   assert((intel->batch.state_batch_offset - intel->batch.reserved_space)
	  >= intel->batch.used*4);

After reviewing all the places where this is called, I'm (fairly)
comfortable that this assertion was redundant.  Having the assertion
adds ~20KiB to a driver build:

   text	   data	    bss	    dec	    hex	filename
 903173	  26392	   1552	 931117	  e352d	i965_dri.so
 924093	  26392	   1552	 952037	  e86e5	i965_dri.so

Based on feedback from Eric Anholt.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-09 12:01:50 -07:00
Ian Romanick
f0dd21ac88 glsl: Silence "ast_to_hir.cpp:1984:25: warning: comparison of unsigned expression >= 0 is always true"
ast_type_qualifier::location should have been a signed integer from
the beginning, and the giant comment in
apply_type_qualifier_to_variable explains why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-09 12:01:50 -07:00
Ian Romanick
9a3bd5e045 glsl: Silence several "warning: unused parameter" 2011-09-09 12:01:50 -07:00
Brian Paul
681d432f81 nouveau: remove target parameter from nouveau_bufferobj_map_range()
This was missed back when the target parameter was removed from all
the buffer-related driver hooks.
2011-09-09 12:19:11 -06:00
Brian Paul
b94a926f39 st/mesa: init program MaxLocalParams, MaxEnvParams limits
Use the same limit for all parameter classes.
2011-09-09 08:10:50 -06:00
Chia-I Wu
8adaed9347 d3d1x: fix a build error
Fix for the st/egl interface change since
08e1076fd2.
2011-09-09 15:48:10 +08:00
Eric Anholt
29361e14df i965/vs: Allow copy propagation on GRFs.
Further reduces instruction count by 4.0% in 40.7% of the vertex
shaders.
2011-09-08 21:40:39 -07:00
Eric Anholt
6d0c018776 i965/vs: Clear tracked copy propagation values whose source gets overwritten.
This only occurs for GRFs, and hasn't mattered until now because we
only copy propagated non-GRFs.
2011-09-08 21:40:39 -07:00
Eric Anholt
cc9eb936c2 i965/vs: Add support for copy propagation of the UNIFORM and ATTR files.
Removes 2.0% of the instructions from 35.7% of vertex shaders in shader-db.
2011-09-08 21:40:39 -07:00
Eric Anholt
42ce13195b i965/vs: Add constant propagation to a few opcodes.
This differs from the FS in that we track constants in each
destination channel, and we we have to look at all the swizzled source
channels.  Also, the instruction stream walk is done in an O(n) manner
instead of O(n^2).

Across shader-db, this reduces 8.0% of the instructions from 60.0% of
the vertex shaders, leaving us now behind the old backend by 11.1%
overall.
2011-09-08 21:40:39 -07:00
Eric Anholt
87b51fc4a8 i965/vs: Keep track of indices into a per-register array for virtual GRFs.
Tracking virtual GRFs has tension between using a packed array per
virtual GRF (which is good for register allocation), and sparse arrays
where there's an element per actual register (so the first and second
column of a mat2 can be distinguished inside of an optimization pass).

The FS mostly avoided the need for this second sparse array by doing
virtual GRF splitting, but that meant that instances where virtual GRF
splitting didn't work, instructions using those registers got much
less optimized.
2011-09-08 21:40:39 -07:00
Eric Anholt
d7c6c8428c i965/vs: Switch to the new VS backend by default.
Now instead of env INTEL_NEW_VS=1 to get it, you need INTEL_OLD_VS=1
to not get it.  While it's not quite to the same codegen efficiency as
the old backend, it is not regressing piglit on G965 and G45, and
actually fixing bugs on gen6, and the remaining codegen quality
regressions all appear tractable.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
df35d69180 i965/vs: Add support for overflowing the number of available push constants.
Fixes glsl-vs-uniform-array-4.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33742

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
f3ed973f53 i965/vs: Pack uniform registers before optimization
We don't expect uniform accesses to generally go away from being dead
code at this point, and we will want to have uniforms packed before
spilling them out to pull constants when we are forced to do that.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
1408169513 i965/vs: When failing due to lack of spilling, don't continue on.
Fixes assertion failure from double-free in oglc
glsl-arrayobject constructor.declaration.structure

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
27c03cb86a i965/vs: Fix variable indexed array access with more than one array.
The offset to the arrays after the first was mis-scaled, so we'd go
access off the end of the surface and read 0s.  Fixes
glsl-vs-uniform-array-3.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Eric Anholt
6af968b673 i965/vs: Add annotation to more of the URB write.
While we had nice debug output for most of the instruction stream, it
was terminated by a series of anonymous MOVs and a send.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-08 21:34:03 -07:00
Chia-I Wu
48eb1fe6f9 egl_dri2: add support for RGBA_8888 android native buffer
HAL_PIXEL_FORMAT_RGBA_8888 maps to __DRI_IMAGE_FORMAT_ABGR8888.
2011-09-09 12:06:17 +08:00
Chia-I Wu
4f341ee65a st/dri: add support for __DRI_IMAGE_FORMAT_ABGR8888
It maps to PIPE_FORMAT_R8G8B8A8_UNORM.
2011-09-09 12:06:17 +08:00
Chia-I Wu
9fe197c626 intel: add support for __DRI_IMAGE_FORMAT_ABGR8888
It maps to MESA_FORMAT_RGBA8888_REV.  Surfaces of the format can only be
sampled from but not render to.

Only i915 is tested.

Reviewed-by: Eric Anholt <eric@anholt.net>

[olv: add a check in intel_image_target_renderbuffer_storage]
2011-09-09 12:06:17 +08:00
Chia-I Wu
e3cf7b69f2 dri2: add __DRI_IMAGE_FORMAT_ABGR8888 to __DRI_IMAGE
Add a new format token, __DRI_IMAGE_FORMAT_ABGR8888, to __DRI_IMAGE.  It
maps to MESA_FORMAT_RGBA8888_REV in core mesa or
PIPE_FORMAT_R8G8B8A8_UNORM in gallium.  The format is used by
translucent surfaces on Android.
2011-09-09 12:06:16 +08:00
Eric Anholt
60df737ad5 glsl: Don't do structure splitting until link time.
We were splitting on each side of an unlinked program, and the two
sides lost track of which variables they referenced, resulting in
assertion failure during validation.  Fixes piglit
link-struct-uniform-usage.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
525cec98a5 glsl: Clarify error message about whole-array assignment in GLSL 1.10.
Previously, it would produce:

    Failed to compile FS: 0:6(7): error: non-lvalue in assignment

and now it produces:

    Failed to compile FS: 0:5(7): error: whole array assignment is not
    allowed in GLSL 1.10 or GLSL ES 1.00.

Also, add spec quotation to the two places we have code for array
lvalues in GLSL 1.10.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
407a1001ae glsl: When assiging from a whole array, mark it as used.
Fixes piglit link-uniform-array-size.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Eric Anholt
d00deae3ef glsl: Fix setting of OutputsWritten for whole array dereference.
We just want to mark the whole thing used, not mark from each element
the whole size in use.  Fixes undefined URB entry writes on i965,
which blew up with debugging enabled.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 20:20:49 -07:00
Brian Paul
ce64b6d612 mesa: remove unneeded #include of texfetch.h 2011-09-08 20:54:58 -06:00
Brian Paul
c6ca3ca552 mesa: use _mesa_unpack_float_z_row in get_tex_depth()
Removes another use of the gl_texture_image::FetchTexelf() function.
2011-09-08 20:16:18 -06:00
Brian Paul
0386d9ac77 mesa: use ctx->Driver.GetTexImage() to decompress base texture image
This is a simple way to do the job and it removes one more use of
the soon-to-be-removed gl_texture_image::FetchTexelc() function.
2011-09-08 20:16:18 -06:00
Brian Paul
c1b3faefc0 mesa: handle compressed images in get_tex_rgba()
Uses the new _mesa_decompress_image() function.  Unlike the meta path
that uses textured quad rendering to do decompression, this works with
signed formats as well.
2011-09-08 20:16:18 -06:00
Brian Paul
3370ba802f mesa: new _mesa_decompress_image() function
Use the old texture fetch functions to decompress a whole image.
To be used by glGetTexImage().
2011-09-08 20:16:18 -06:00
Brian Paul
9a5b2899e0 mesa: added _mesa_get_uncompressed_format(), _mesa_format_num_components() 2011-09-08 20:16:18 -06:00
Brian Paul
730952aa12 mesa: add new pixel format unpacking code
This will be used instead of the texel fetch code to unpack images
in various formats.
2011-09-08 20:16:18 -06:00
Brian Paul
e3dc78e57a meta: added _mesa_meta_GetTexImage()
If the texture is compressed, call the meta decompress_texture_image()
function.  Otherwise, call the core _mesa_get_teximage() function.
2011-09-08 20:16:18 -06:00
Brian Paul
8e9485870b meta: move texcoord setup into setup_texture_coords() 2011-09-08 20:16:18 -06:00
Marcin Slusarz
96054375b1 nouveau: fix nouveau_fence leak
Note: This is a candidate for the 7.11 branch.
2011-09-08 23:00:31 +02:00
Marcin Slusarz
d8035fe173 nv50: fix screen->blitctx memory leak 2011-09-08 23:00:31 +02:00
Adam Jackson
faf5d6584b gles: Fix glGet(GL_{NUM_,}COMPRESSED_TEXTURE_FORMATS_ARB)
We'd still accept the GL_PALETTE[48]_* formats in glCompressedTexImage2D,
but they wouldn't be listed if you queried whether they were supported.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-08 13:40:06 -04:00
Paul Berry
b453ba2c9f glsl: Make sure gl_ClipDistance and gl_ClipVertex are not both written.
From section 7.1 (Vertex Shader Special Variables) of the GLSL 1.30
spec:

  "It is an error for a shader to statically write both
  gl_ClipVertex and gl_ClipDistance."

Fixes piglit test mixing-clip-distance-and-clip-vertex-disallowed.c.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:38:03 -07:00
Paul Berry
37bb1c4de2 glsl: Check that gl_ClipDistance[] is not sized too large.
Fixes piglit tests
clip-distance-explicit-too-large-with-access.{frag,vert} and
clip-distance-explicit-too-large.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:45 -07:00
Paul Berry
93b9758d01 glsl: Rework oversize array check for gl_TexCoord.
The check now applies both when explicitly declaring the size of
gl_TexCoord and when implicitly setting the size of gl_TexCoord by
accessing it using integral constant expressions.

This is prep work for adding similar size checks to gl_ClipDistance.

Fixes piglit tests texcoord/implicit-access-max.{frag,vert}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:24 -07:00
Paul Berry
36c4b1a3da glsl: Add constant gl_MaxClipDistances.
Fixes piglit tests {vs,fs}-clip-distance-sizeable-to-max.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:37:12 -07:00
Paul Berry
af243b55ac glsl: Make gl_ClipDistance[] implicitly sized.
From the GLSL 1.30 spec, section 7.1 (Vertex Shader Special Variables):

  The gl_ClipDistance array is predeclared as unsized and must be
  sized by the shader either redeclaring it with a size or indexing it
  only with integral constant expressions.

Fixes piglit tests clip-distance-implicit-length.vert,
clip-distance-implicit-nonconst-access.vert, and
{vs,fs}-clip-distance-explicitly-sized.shader_test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-08 09:36:13 -07:00
José Fonseca
2864f723d1 scons: Use -g instead of -g3.
-g3 causes binaries to be 3x - 10x bigger, not only on MinGW w/ dwarf
debugging info, but linux as well.

Stick with -g, (which defaults to -g2), like autoconf does.
2011-09-08 09:59:01 +01:00
José Fonseca
221a04fa8e st/egl: Fix GDI build. 2011-09-08 09:32:10 +01:00
José Fonseca
1cf808c86e Define INLINE macro in terms of inline. 2011-09-08 09:17:42 +01:00
Benjamin Franzke
7645c49e07 st/egl: add premultiplied alpha support to wayland
Return true for NATIVE_PARAM_PREMULTIPLIED_ALPHA when all formats with
alpha support premultiplied alpha.

(Based on Chia-I Wu's patch)

[olv: remove the use of param_premultiplied_alpha from the original
      patch]
2011-09-08 16:05:41 +08:00
Benjamin Franzke
1191d20363 st/egl: correctly return configs under wayland
Handle "format" events and return configs for the supported formats.

(Based on Chia-I Wu's patch)

[olv: update and explain why PIPE_FORMAT_B8G8R8A8_UNORM should not be
      enabled without HAS_ARGB32]
2011-09-08 16:05:40 +08:00
Chia-I Wu
ee0e6ae2bb Revert "st/egl: correctly return configs under wayland"
This reverts commit 95b445699d.
2011-09-08 16:05:32 +08:00
Chia-I Wu
93a96abe16 Revert "st/egl: add premultiplied alpha support to wayland"
This reverts commit 23aa978a9d.
2011-09-08 16:05:22 +08:00
Chia-I Wu
23aa978a9d st/egl: add premultiplied alpha support to wayland
Return true for NATIVE_PARAM_PREMULTIPLIED_ALPHA when all formats with
alpha support premultiplied alpha.  Currently, it means when argb32 and
argb32_pre are both supported.
2011-09-08 11:16:12 +08:00
Chia-I Wu
95b445699d st/egl: correctly return configs under wayland
When wl_drm is avaiable and enabled, handle "format" events and return
configs for the supported formats.  Otherwise, assume all formats of
wl_shm are supported.
2011-09-08 11:16:12 +08:00
Chia-I Wu
41f5d2e8ac st/egl: overload NATIVE_PARAM_PREMULTIPLIED_ALPHA
EGL does not export this capability of a display server.  But wayland
makes use of EGL_VG_ALPHA_FORMAT to achieve it.

So, when the native display returns true for the parameter, st/egl will
set EGL_VG_ALPHA_FORMAT_PRE_BIT for all EGLConfig's with non-zero
EGL_ALPHA_SIZE.  EGL_VG_ALPHA_FORMAT attribute of a surface will affect
how the surface is presented.

Because st/vega does not support EGL_VG_ALPHA_FORMAT_PRE_BIT,
EGL_OPENVG_BIT will be cleared.
2011-09-08 11:16:12 +08:00
Chia-I Wu
f4c37d6ab2 st/egl: add NATIVE_PARAM_PREMULTIPLIED_ALPHA
Return TRUE if the display supports premultiplied alpha.
2011-09-08 11:16:12 +08:00
Chia-I Wu
08e1076fd2 st/egl: add native_present_control
Replace the parameters of native_surface::present by a struct,
native_present_control.  Using a struct allows us to add more control
options without having to update each backend every time.
2011-09-08 11:16:11 +08:00
Brian Paul
c0470bf77a glsl: s/int/unsigned/ to silence warning 2011-09-07 16:47:14 -06:00
Stéphane Marchesin
c1cac8feec st/mesa: Remove unused renderbuffer fields and functions.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-09-07 15:42:39 -07:00
Kenneth Graunke
4bc5bfb641 i965/fs: Implement ir_u2f opcode.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-07 10:43:09 -07:00
Kenneth Graunke
8de3314f63 i965: Fix disassembly for intdiv/intmod math functions.
The opcodes and strings were reversed.  Quotient means division, and
modulus means remainder.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-07 10:43:09 -07:00
Chia-I Wu
6b52e82768 st/egl: track changes to drop wl_visual in wayland
Follow a subset of changes in 7b1d94e5d1.
There are known issues, but it works to a certain degree.  Non-working
demos also fail gracefully.  More importantly, it fixes the build.
2011-09-08 01:26:24 +08:00
Chia-I Wu
b89bca6d8b st/egl: track server side wayland changes
Follow changes in c661ecce10.
2011-09-08 01:23:51 +08:00
Chia-I Wu
287278352e st/egl: use new wl_callback mechanism in wayland
Follow the changes in 6602bda23b.
2011-09-08 01:23:48 +08:00
Kenneth Graunke
477b74e85b i965: Use proper texture alignment units for cubemaps on Gen5+.
In particular, S3TC compressed textures need align_h == 4.

Fixes skybox errors in Quake 4 and FEAR.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34628
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-07 07:49:55 -07:00
Kenneth Graunke
8ceb235c9c glsl/ir_reader: Make sure constants have the right number of components.
The list of numbers in (constant type (<numbers>)) needs to contain
exactly type->components() numbers (16 for a mat4, 3 for a vec3, etc.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:49:32 -07:00
Kenneth Graunke
6afce988a9 glsl/builtins: Fix invalid float constant in noise4 built-in.
Throwing away the extra numbers ought to match the existing behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:48:56 -07:00
Kenneth Graunke
f6481be298 glsl/builtins: Fix invalid vecN constants in hyperbolic functions.
Each of these vecN constants only provided one component, which is
illegal.  The printed IR is meant to contain exactly as many components
as are necessary; the IR reader does not splat single values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-09-07 07:46:57 -07:00
Dave Airlie
99c1a58b30 varray.c: fix logic around BGRA with ARB_vertex_type_2_10_10_10_rev.
I introduced a regression in here, I've just split the logic ot now, so
its easier to read/understand.

Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=40664

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-07 10:20:47 +01:00
Vinson Lee
6edef25a4b mesa/vbo: s/inline/INLINE/
MSVC does not support inline keyword.
2011-09-06 21:43:51 -07:00
Eric Anholt
9bd8d90646 i965/vs: Fix point size handling on gen4.
Fixes glsl-vs-point-size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:02:00 -07:00
Eric Anholt
9367960ea6 i965/vs: Use write commits on scratch writes in pre-gen6.
This is required to ensure ordering between reads and writes within a
thread.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:57 -07:00
Eric Anholt
838bfe0c46 i965/vs: Fix setup of scratch space pointer on pre-gen6.
We were failing to relocate, so on the first draw run our scratch
would tend to get written to 0x0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:54 -07:00
Eric Anholt
ddf8e602a7 i965/vs: Fix message setup for array read/writes on pre-gen6.
We were passing an MRF as the source argument, instead of using the
implied move and putting the MRF number in the proper place in the
instruction encoding.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:51 -07:00
Eric Anholt
88612e2c1b i965/vs: Fix constant-indexed array read/write addresses on pre-gen6.
The second vertex was getting a garbage index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:48 -07:00
Eric Anholt
bba910373f i965/vs: Add support for vector comparison ops resulting in bool cond codes.
Fixes a giant pile of VS tests on gen4.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:43 -07:00
Eric Anholt
9f84288607 i965/vs: Make pre-gen6 math operate in vector mode instead of scalar.
On the old backend, we used scalar mode because Mesa IR math is
result.xyzw = math(op0.xxxx), which matched up well.  However, in GLSL
IR we do things like result.xy = math(op0.xy), so we want vector mode.
For the common case of result.x = math(op0.x), performance will be the
same (no cost for un-executed channels), though result.xyzw =
math(op0.xxxx) would be worse.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:23 -07:00
Eric Anholt
87be0ac96c i965/vs: Fix copy-and-paste disaster in pre-gen6 POW support.
Fixes vs-pow-float-float and friends.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:20 -07:00
Eric Anholt
2ffc5ac1da i965/vs: Fix gen4 comparisons used for predication.
When we tried to retype a brw_null_reg() in CMP(), the retyping didn't
take effect because HW_REG just ignores the type field.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:01:17 -07:00
Eric Anholt
8adcad213e i965/vs: Fix GPU hangs in shaders with large virtual GRFs pre-gen6.
If you get your total GRF count wrong, you write over some other
shader's g0, and the GPU fails shortly thereafter.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 18:00:57 -07:00
Brian Paul
23eec54bb0 i965: add casts to silence int/enum conversion warnings 2011-09-06 16:50:27 -06:00
Stéphane Marchesin
02f1b50987 state_trackers/dri/sw: Implement texture_from_pixmap.
Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
2011-09-06 15:03:01 -07:00
Stéphane Marchesin
569bde1fa7 Duplicate state_tracker/dri/sw/dri_drawable.c
We need this for the upcoming fix for sw texture_from_pixmap.

Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
2011-09-06 15:03:00 -07:00
nobled
55e763c86d Enable GLX_EXT_texture_from_pixmap in software.
Signed-off-by: nobled <nobled@dreamwidth.org>
Signed-off-by: Stuart Abercrombie <sabercrombie@chromium.org>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
2011-09-06 15:03:00 -07:00
Brian Paul
a4adc88a2d st/mesa: remove unneeded #include 2011-09-06 15:44:44 -06:00
Brian Paul
1a65d098ce mesa: whitespace fixes, just to be consistent 2011-09-06 15:31:26 -06:00
Brian Paul
51e7b05875 mesa: put _mesa_ prefix on vert_result_to_frag_attrib() 2011-09-06 15:29:24 -06:00
Brian Paul
a794ad3709 mesa: fix vert_result_to_frag_attrib() parameter type 2011-09-06 15:24:14 -06:00
Brian Paul
37afceeee9 mesa: s/inline/INLINE/ to fix MSVC build 2011-09-06 15:20:33 -06:00
Adam Jackson
7826067bd1 Drop some Glide remnants
Apparently the x11 driver had a hack for glide passthrough.  Who knew?

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
Adam Jackson
7f379df401 Remove an AmiWin leftover
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
Adam Jackson
c7cc61fea9 Remove dead glfbdev.h
This belonged to the now-dead swrast-on-fbdev driver.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
Adam Jackson
f6f2f59818 Drop documentation references for deleted backends
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-09-06 16:23:50 -04:00
José Fonseca
f4dd099171 rtasm,translate: Disable on Mingw-w64.
Causes crash and stack corruption.

Needs more investigation. Disable for now.
2011-09-06 20:40:44 +01:00
Ian Romanick
5812b24845 docs: skeleton file for 7.12 release notes
Current just the items that have been removed from Mesa are mentioned
in the release notes.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:36 -07:00
Ian Romanick
3602fbb201 mesa: Remove support for unpacking from client memory to color-index pixels
Mesa hasn't supported color-index rendering for a long time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:32 -07:00
Ian Romanick
d7cb905a5a swrast: Use GL_STENCIL_INDEX for address calculations
GL_COLOR_INDEX produced the same result (because GL_BITMAP is always
used for stencil glDrawPixels), but it was confusing to read.  I spent
about 15 minutes wondering, "WTF?"

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:28 -07:00
Ian Romanick
e174b5d483 mesa: Remove GL_COLOR_INDEX from _mesa_{dest,source}_buffer_exists
Mesa hasn't supported color-index rendering for a long time.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:24 -07:00
Ian Romanick
559241d48c mesa: Remove GL_COLOR_INDEX from base format assertions
_mesa_make_temp_float_image can't work on color-index textures, but
there is no such thing as a color-index texture anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:20 -07:00
Ian Romanick
ede7d9fff5 swrast: Remove GL_COLOR_INDEX from assertions
These sampling functions don't work on color-index textures, but there
is no such thing as a color-index texture anymore.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:16 -07:00
Ian Romanick
960f37a57a mesa: Remove unused struct gl_color_table
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:12 -07:00
Ian Romanick
81a6cf9ddf mesa: Remove unused functions _mesa_lookup_rgba_{float,ubyte}
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:09 -07:00
Ian Romanick
0b6dd75058 mesa: Remove all mention of GL_COLOR_INDEX*_EXT
These enums were only valid with the paletted texture extensions.
This allows a couple other trivial clean-ups.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:05 -07:00
Ian Romanick
eb805a5182 mesa: Remove dd_function_table::CopyColorTable, ::CopyColorSubTable, and ::UpdateTexturePalette
There's nothing left that can call any of these functions.  This also
removes the meta-ops code that implemented the first two.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:09:00 -07:00
Ian Romanick
eba527bf9f mesa: Remove API facing bits of EXT_paletted_texture and EXT_shared_texture_palette
This was also discussed at XDS 2010.  However, actually making the
change was delayed because several drivers still exposed these
extensions to significant benefit (e.g., tdfx).  Now that those
drivers have been removed, this code can be removed as well.

v2: A lot of bits that were missed in the previous patch have been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-09-06 12:08:25 -07:00
Paul Berry
becd54eedb i965: Remove two_side_color from brw_compute_vue_map().
Since we now lay out the VUE the same way regardless of whether
two-sided color is enabled, brw_compute_vue_map() no longer needs to
know whether two-sided color is enabled.  This allows the two-sided
color flag to be removed from the clip, GS, and VS keys, so that fewer
GPU programs need to be recompiled when turning two-sided color on and
off.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:48 -07:00
Paul Berry
f2b09257ba i965: For GEN6+, always make front/back colors adjacent in VUE.
When doing two-sided color on GEN6+, we use the SF unit's
INPUTATTR_FACING mode to cause front colors to be used on front-facing
triangles, and back colors to be used on back-facing triangles.  This
mode requires that the front and back colors be adjacent in the VUE.

Previously, we would only place front and back colors adjacent in the
VUE when two-sided color was enabled.  Now we place them adjacent in
the VUE whether two-sided color is enabled or not.  (We still only
swizzle the colors when two-sided color is enabled, so there should be
no user-visible change).

This simplifies the implementation of the VUE map and reduces the
amount of code that is dependent on two-sided color mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:44 -07:00
Paul Berry
18dcda2dcf i965: GS: Use the VUE map to compute URB size.
The previous computation had two bugs: (a) it used a formula based on
Gen5 for Gen6 and Gen7 as well. (b) it failed to account for the fact
that PSIZ is stored in the VUE header.  Fortunately, both bugs caused
it to compute a URB size that was too large, which was benign.  This
patch computes the URB size directly from the VUE map, so it gets the
result correct in all circumstances.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:41 -07:00
Paul Berry
78be5bcb22 i965: clip: Remove no-longer-needed variables.
The variables offset[], idx_to_attr[], nr_bytes, nr_attrs, and
header_regs were all serving purposes which are now served by the VUE
map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:38 -07:00
Paul Berry
4efb32c642 i965: clip: Remove assumption about VUE header from brw_clip_interp_vertex()
Previously, brw_clip_interp_vertex() iterated only through the
"non-header" elements of the VUE when performing interpolation
(because header elements don't need interpolation).  This code now
refers exclusively to the VUE map to figure out which elements need
interpolation, so that brw_clip_interp_vertex() doesn't need to know
the header size.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:34 -07:00
Paul Berry
71cb82f63a i965: clip: Change computation of nr_regs to use VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:31 -07:00
Paul Berry
2ef1fa6b3c i965: clip: Convert computations to ..._to_offset() for clarity.
This patch replaces some ad-hoc computations using ATTR_SIZE and the
offset[] array to use the VUE map functions
brw_vert_result_to_offset() and brw_vue_slot_to_offset().

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:28 -07:00
Paul Berry
54a62f8806 i965: clip: Add a function to determine whether a vert_result is in use.
Previously we would examine the offset[] array (since an offset of 0
meant "not in use").  This paves the way for removing the offset[]
array.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:25 -07:00
Paul Berry
620f06b126 i965: clip: Rework brw_clip_interp_vertex() to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:23 -07:00
Paul Berry
c46be4273c i965: clip: Modify brw_clip_interp_vertex() to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:20 -07:00
Paul Berry
5a93019a87 i965: clip: Move header_regs into brw_clip_compile.
This makes header_regs available for computing VUE offsets within clip code.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:17 -07:00
Paul Berry
2bc421845e i965: clip: Modify brw_clip_tri_alloc_regs() to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:14 -07:00
Paul Berry
62b0c8561e i965: clip: Move hpos_offest and ndc_offset into local functions.
The offsets within the VUE of HPOS and NDC are needed only in a few
auxiliary clipping functions.  This patch moves computation of those
offsets into the functions that need them, and does the computation
using the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:11 -07:00
Paul Berry
eae5b5c44e i965: clip: rename header_position_offset to the more correct ndc_offset.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:08 -07:00
Paul Berry
514eeca32c i965: clip: Add VUE map computation to clip stage for Gen4-5.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:05 -07:00
Paul Berry
9660e3b788 i965: SF: Change gen{6,7}_sf_state.c to compute URB read length based on VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:05:03 -07:00
Paul Berry
fc60a07d88 i965: SF: Move outputs_written to a local variable for clarity.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:59 -07:00
Paul Berry
2d909f431c i965: SF: New implementation of get_attr_override using the VUE map.
This patch changes get_attr_override() (which computes the
relationship between vertex shader outputs and fragment shader inputs)
to use the VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:56 -07:00
Paul Berry
bbc53d6285 i965: SF: Remove unnecessary variables.
This patch removes the variables nr_attrs and nr_setup_attrs, whose
purpose is now being served by the VUE map.  nr_attr_regs and
nr_setup_regs are still needed, however they are now computed using
the VUE map rather than by counting the number of vertex shader
outputs (which caused subtle bugs when gl_PointSize was written).

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:53 -07:00
Paul Berry
58d9c95b3c i965: SF: Stop using nr_setup_attrs in compute_masks.
Previously, the SF used nr_setup_attrs to determine whether it was
looking at the last element of the VUE.  Changed this code to use the
VUE map.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:50 -07:00
Paul Berry
08f030baec i965: SF: Remove attr_to_idx and idx_to_attr.
These data structures were serving the same purpose as the VUE map,
but were buggy.  Now that the code has been transitioned to use the
VUE map, they are not needed.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:47 -07:00
Paul Berry
84e7d04e1d i965: SF: Change calculate_masks to use the VUE map.
Previously, SF code used the idx_to_attr[] array to compute the
location of entries in the VUE map.  This array didn't properly
account for gl_PointSize.  Now we use the VUE map directly.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:44 -07:00
Paul Berry
aafe2cdf86 i965: SF: Change the flags that refer to "attr" to be based on gl_vert_result.
Previously, some of the code in SF erroneously used bitfields based on
the gl_frag_attrib enum when actually referring to vertex results.
This worked, because coincidentally the particular enum values being
used happened to match between gl_frag_attrib and gl_vert_result.  But
it was fragile, because a future change to either gl_vert_result or
gl_frag_attrib would have made the enum values stop matching up.  This
patch switches the SF code to use the correct enum.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:41 -07:00
Paul Berry
8b362477d9 i965: SF: change get_vert_attr to use the VUE map, and rename it.
The new function, called get_vert_result(), uses the VUE map to find
the register containing a given vertex attribute.  Previously, we used
the attr_to_idx[] array, which served the same purpose but didn't
account for gl_PointSize correctly.

This fixes a bug on pre-Gen6 wherein the back side of a triangle would
be rendered incorrectyl if the vertex shader wrote to gl_PointSize.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:37 -07:00
Paul Berry
4a1fb81902 i965: SF: Modify calculate_point_sprite_mask to use the VUE map.
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-09-06 11:04:34 -07:00
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
Brian Paul
afaf024f57 docs: more info about non-subscriber list postings 2011-09-06 09:19:36 -06:00
Brian Paul
2efc093d2c docs: update link, remove dead links 2011-09-06 08:45:44 -06:00
José Fonseca
129ace49f4 scons: Set -static-libstdc++ on mingw-w64
To avoid depending on libstdc++-xxx.dll
2011-09-06 13:18:58 +01:00
José Fonseca
0646246cae scons: Move MinGW flags from crossmingw.py to gallium.py
So that they are used by native MinGW compilers too.
2011-09-06 13:18:58 +01: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
2957e44664 docs: update gl3.txt for ARB_vertex_type_2_10_10_10_rev 2011-09-06 10:18:36 +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
Chia-I Wu
47ba5c482f i915: factor our source lists into Makefile.sources
In preparation for porting i915 to Android, factor its source lists into
a shared makefile. This prevents duplication of source lists, and hence
prevents the Android build from breaking as often.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00
Chia-I Wu
05fdb44dd7 i965: fix Android build
Use $(TARGET_CC) instead of $(CC).  Correctly name and set LOCAL_CFLAGS.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-09-01 10:53:30 +08:00
Bryan Cain
488fe51cf8 mesa: Replace the EmitNoIfs compiler flag with a MaxIfDepth flag.
This is a better, more fine-grained way of lowering if statements.  Fixes the
game And Yet It Moves on nv50.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 21:49:26 -05:00
Kristian Høgsberg
7b1d94e5d1 wayland: Track changes to drop wl_visual 2011-08-31 18:33:47 -04:00
Kristian Høgsberg
447bb454d8 egl_dri2: Only clear EGL_PIXMAP_BIT if DRI config is double buffered
We don't want to set the pixmap bit in the EGL config if the DRI
config we're adding is a double buffered config.  However, don't clear
any other bits the platform might pass in in the surface_type
argument.
2011-08-31 18:33:36 -04:00
Kristian Høgsberg
c661ecce10 wayland: Track server side wayland changes 2011-08-31 18:20:40 -04:00
Kristian Høgsberg
6602bda23b wayland: Use new wl_callback mechanism 2011-08-31 16:50:50 -04:00
Brian Paul
82fff5f3ed mesa: fix comment typo: s/GL_SIGNED_NORMALED/GL_SIGNED_NORMALIZED/ 2011-08-31 14:34:48 -06:00
Bryan Cain
478034f34a glsl: Use a separate div_to_mul_rcp lowering flag for integers.
Using multiply and reciprocal for integer division involves potentially
lossy floating point conversions.  This is okay for older GPUs that
represent integers as floating point, but undesirable for GPUs with
native integer division instructions.

TGSI, for example, has UDIV/IDIV instructions for integer division,
so it makes sense to handle this directly.  Likewise for i965.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 12:02:18 -07:00
Brian Paul
87679e2ea1 mesa: bump max program local params, max uniforms limit
Some driver support more than 1024.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 12:57:38 -06:00
Brian Paul
e26e9f77e7 swrast: initialize program native limits
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-31 12:57:01 -06:00
Eric Anholt
0c9ae24dbd i965/vs: Avoid the emit(), remove(), insert_before() for array instructions.
v2: Add generator instructions for the scratch opcodes.
    Add emit_before() for handling ->ir and ->annotation inheritance.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:30:33 -07:00
Eric Anholt
e45d0270c9 i965/vs: Move logic for weird CMP type handling to CMP generators.
v2: Don't bother with the no-dst-reg version of CMP()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:16:10 -07:00
Eric Anholt
a8e29987f5 i965/vs: Convert emit() calls to the new instruction generators.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:54 -07:00
Eric Anholt
ead7ffc62a i965/vs: Convert gen6 userclip handling to new generators.
This DP4 had one of its operands missing, so we were generating
garbage clip distances.  Using the per-opcode instruction generators
made it obvious.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:54 -07:00
Eric Anholt
2f12be5c95 i965/vs: Create instruction generators outside of the emit() functions.
v2: Fixed gen6 IF().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-31 11:15:49 -07:00
Benjamin Franzke
f811c1e6d6 egl_dri2: Drop dri2_surface_type enum
Was only used in platform_wayland, and the remaining egl stack
uses _EGLSurface::Type with one of EGL_{WINDOW,PIXMAP,PBUFFER}_BIT.
2011-08-31 11:45:34 +02:00
Chia-I Wu
93d5963744 egl_dri2: add pbuffer support to platform_android
This is a simple change thanks to allocateBuffer.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 12:06:26 +08:00
Chia-I Wu
c8e18f85da egl_dri2: check the surface type in platform_android
Check the surface type is EGL_WINDOW_BIT before doing anything, in
preparation for pbuffer support.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:58:34 +08:00
Chia-I Wu
384f228a25 egl_dri2: refactor droid_get_buffers_with_format
Move the loop to parse attachments to its own function.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:51:54 +08:00
Chia-I Wu
357d3f30f3 egl_dri2: set ctx->WindowRenderBuffer
Set ctx->WindowRenderBuffer to EGL_BACK_BUFFER.  As EGL_WINDOW_BIT of a
config is set only when there is dri_double_buffer, that makes sure
window surfaces are always double-buffered and contexts will render to
the back buffer.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-31 11:51:42 +08:00
Christoph Bumiller
66e8d223b6 nv50,nvc0: fix multisample format hack
Advertising different format support based on sample count was a
bad idea, it made resolve to window work, but resolve to anything
else would fail.

See 9f4998639c.
2011-08-31 00:06:22 +02:00
Eric Anholt
0b96b3ffa9 intel: Restructure TexSubImage as just the 2D implementation and blit func.
Fixes a segfault in piglit copyteximage where I accidentally removed
the dst_bo setup in the previous cleanup.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40474
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Sean McNamara <gm.potato.ul@gmail.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 14:58:52 -07:00
Eric Anholt
b26a08402f intel: Remove the passthrough TexSubImage[13]D functions.
All we need for these is _mesa_store_texsubimage[13]d(), since we
don't do the blit path.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 14:58:47 -07:00
Eric Anholt
81a0b21669 i965/vs: Fix GL_FIXED setup when a writemask is present.
By emitting code before generate_code(), we ended up in align1 mode
where writemasks don't exist, so we rescaled gl_Vertex.w and things
went badly.  By moving GL_FIXED support to the visitor, we end up with
normal codegen, and as a bonus the GL_FIXED setup ends up getting
printed appropriately in debug output.

Fixes gtf/GL2Tests/fixed_data_type

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
72cfc6f377 i965/vs: Pack live uniform vectors together in the push constant upload.
At some point we need to also move uniform accesses out to pull
constants when there are just too many in use, but we lack tests for
that at the moment.

Fixes glsl-vs-large-uniform-array.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
7c84b9d303 i965/vs: Track uniforms as separate vectors once we've done array access.
This will make it easier to figure out which elements are totally
unused and not upload them.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
ddca4592a7 i965/vs: Don't lower uniform array indexing.
This avoids the massive conditional move array access, and brings code
generation quality for the new VS backend into the realm of efficiency
of the old backend (roughly 20% more instructions generated than
before across shader-db, instead of assertion failing for generating
over 10,000 instructions on many shaders!).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
483f5b348b i965/vs: Add support for pull constant loads for uniform arrays.
v2: reworked the instruction emit and made use of gen6_resolve_implied_move,
    from Ken's review
2011-08-30 12:09:40 -07:00
Eric Anholt
88e08de801 i965/vs: Restructure emit() functions around a vec4_instruction constructor.
We sometimes want to put an instruction somewhere besides the end of
the instruction stream, and we also want per-opcode instruction
generation to enable compile-time checking of operands.
2011-08-30 12:09:40 -07:00
Eric Anholt
8654931d11 i965: Make the old VS backend record pull constant references in pull_params[].
We'll be using that to track things for the new VS backend, and this will
avoid cluttering brw_vs_surface_state.c for it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
9fa41f0742 mesa: Fix glGetUniform() type conversions.
We were primarily failing to convert in the NativeIntegers case, which
this fixes.  However, we were also just truncating float uniforms when
converting to integer, which does not appear to be the correct
behavior.  Note, however, that the NVIDIA drivers also truncate
instead of rounding.

GL_DOUBLE return type is dropped because it was never used and
completely broken.  It can be added when there's test code.

Fixes piglit ARB_shader_objects/getuniform

v2: This is a rewrite of my previous glGetUniform patch, which Ken
    pointed out missed storage_type-based conversions to integer,
    which was totally broken still thanks to a typo in the testcase.
v3: Quote the spec justifying the rounding behavior.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-30 12:09:40 -07:00
Eric Anholt
7708b25e2b mesa: Make the gl_constant_value's bool occupy the same space as float/int.
At least for Intel, all our uniform components are of uint32_t size, either
float or signed or unsigned int.  For uploading uniform data in the driver,
it's much easier to upload a full dword per uniform element instead of trying
to pick out the bool byte and then fill in the top 3 bytes of pad with 0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
55b7fbb70f i965: Use native integer uniforms when the new VS backend is in use.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Eric Anholt
2f82c33dee i965/vs: Move the flag for whether to use the new backend to the context.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-30 12:09:40 -07:00
Chad Versace
1995d1e207 i965: Build i965_dri.so for Android
Compile tested only.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
2f0edc60f4 i965: Fix Android build by removing relative includes
Replace each occurence of
    #include "../glsl/*.h"
with
    #include "glsl/*.h"

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
34349d4431 dri: Build libmesa_dri_common for Android
libmesa_dri_common is a static library that contains the sources in
src/mesa/drivers/dri/common. Each DRI driver should link to it.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
05049e709e make: Document imported variables
In src/mesa/Android.mk, it is non-trivial to determine which variables are
imported by `include sources.mak`. So document them.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Chad Versace
3758173149 mesa: Build libmesa_dricore.a for Android
libmesa_dricore.a is analogous to the libmesa.a built by the Autoconf
build.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:32:04 -07:00
Brian Paul
5d9e242c3e tnl: fix regression in bind_indices()
Commit 2ea1ff3816 caused the regression.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40413
2011-08-30 10:17:53 -06:00
Brian Paul
788d9bf121 tnl: add const qualifier to silence warning 2011-08-30 10:17:53 -06:00
Brian Paul
642bbc6f59 tnl: use buffer helper functions to improve readbility 2011-08-30 10:17:52 -06:00
Chad Versace
16f442e9d5 make: Factor out source lists from drivers/dri/common into Makefile.sources
In order that the Autoconf and Android build can share the same source
lists, move the lists from
    src/mesa/drivers/dri/Makefile.defines
into
    src/mesa/drivers/dri/common/Makefile.sources

I would like for Android to just reuse Makefile.defines, but the file is
unsuitable for reuse.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Chad Versace
e4a6ebdd87 make: Remove duplicate occurence of driverfuncs.c
driverfuncs.o is already contained in libmesa.a, so remove it from the
following source lists:
    src/mesa/drivers/dri/Makefiles.defines:COMMON_SOURCES.
    src/mesa/drivers/dri/swrast/Makefile:SWRAST_COMMON_SOURCES

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Chad Versace
08701b6c95 make: Remove duplicate defintion of COMMON_SOURCES in Radeon makefiles
Remove defintion of COMMON_SOURCES from {r300,r660}/Makefile. The
defintion is a duplicate of that found in
src/mesa/drivers/dri/Makefile.defines.

Reviewed-by: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-30 09:11:28 -07:00
Christian König
8f4ec55f77 r600g: Make unaligned 3D textures work on +evergreen
The layersize calculation is slightly different on +evergreen.
This makes mpeg2 video decoding and piglits texture-packed-formats
test work correctly on this hardware.
2011-08-30 15:33:51 +02:00
Christoph Bumiller
d49525d0c5 nouveau: use PRIu64 for printing uint64_t 2011-08-30 14:52:17 +02:00
Christoph Bumiller
8476232b08 nouveau/mm: move slabs to correct list on memory release
Should get rid of "destroying GPU memory cache with some buffers
still in use" message.
2011-08-30 14:52:17 +02:00
Maarten Lankhorst
210ddf0819 winsys/radeon: Create async thread only once
I noticed that a thread was created for every time async flush was called, so I moved it and used some semaphores to synch.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-08-30 14:01:57 +02:00
Christoph Bumiller
3b3d2e53bc nvfx: use common NOUVEAU_RESOURCE_FLAG_LINEAR define 2011-08-30 13:55:08 +02:00
Christoph Bumiller
0a3f0ff264 nv50: add support for linear textures and render targets 2011-08-30 13:55:07 +02:00
Christoph Bumiller
55bab45a7c nv50: align pitch of linear surfaces correctly 2011-08-30 13:55:07 +02:00
Christoph Bumiller
eabb9b0fd9 nv50: handle TGSI_OPCODE_ROUND
Will round to nearest-even.
2011-08-30 13:55:07 +02:00
Christoph Bumiller
222b3ea653 nv50,nvc0: add states mask to state validation function
This prevents null dereferences in validation of interdependent
state after a switch to a pipe context where we mark all state
as dirty but where not all state is valid / set yet.
2011-08-30 13:55:07 +02:00
Christoph Bumiller
9f4998639c nv50,nvc0: reject R8G8B8A8/X8_UNORM for multisample surfaces
The window system buffer will be BGRA and applications will try to
directly resolve to it, which would trigger an INVALID_OPERATION in
BlitFramebuffer if the multisample renderbuffer is RGBA.
2011-08-30 13:55:07 +02:00
Christoph Bumiller
fb92fc25b0 mesa: update multisample state on _NEW_BUFFERS
A change in sampleBuffers affects the final enable value.
2011-08-30 13:55:07 +02:00
José Fonseca
0b263aeb8b glu: Avoid defining conflicting DEBUG NDEBUG macros. 2011-08-30 09:42:01 +01:00
José Fonseca
15465949e0 glu: Fix build on mingw-w64. 2011-08-30 09:42:01 +01:00
José Fonseca
99a8150a1a Remove dead Makefiles. 2011-08-30 09:42:01 +01:00
José Fonseca
282ecaf82c docs: Update scons info regarding mingw. 2011-08-30 09:42:01 +01:00
José Fonseca
3ab19bf82a Remote *.mgw stuff.
Totally broken, and deprecated by scons.
2011-08-30 09:42:01 +01:00
José Fonseca
a68ba5e0f0 libgl-gdi: Fix mingw-w64 build.
Mingw-w64 actually seems to be closer to MSVC in terms of .DEF parsing.
2011-08-30 09:42:01 +01:00
José Fonseca
ec759b3755 st/wgl: Fix build on mingw-w64
Which already declares wglSwapMultipleBuffers and WGLSWAP.
2011-08-30 09:42:01 +01:00
José Fonseca
d290febdc8 gdi: Remove mesa_wgl.h
All commonly used windows toolchains define wgl entrypoints in the windows
headers, and mesa_wgl.h not only is unnecessary but actually often stands
in the waydue to slight inconsistencies.

So remove it.
2011-08-30 09:42:01 +01:00
José Fonseca
191428ccb8 scons: Prefer x86_64-w64-mingw32- prefix.
This allows to use mingw-w64 binaries on debian systems which already
include a (typically incomplete) 64 cross compiler.
2011-08-30 09:42:01 +01:00
Maarten Lankhorst
f5cf4ec90d xorg/xvmc: Only set decode buffer when available
The nouveau xvmc decoder doesn't need it.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-08-29 19:39:22 -04:00
Marek Olšák
b2064ff311 glsl_to_tgsi: fix a reference leak on an error path 2011-08-29 22:31:10 +02:00
Kenneth Graunke
dc7f449d1a i965: Avoid generating MOVs for most ir_assignment handling.
This is a port of vec4_visitor::try_rewrite_rhs_to_dst to fs_visitor.

Not only is this technique less invasive and more robust, it also
generates better code.  Over and above the previous technique, this
reduced instruction count in shader-db by 0.28% on average and 1.4% in
the best case.

In no case did this technique result in more code than the prior method.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
2011-08-29 11:39:41 -07:00
Kenneth Graunke
d28a3bd4bf i965/fs: Revert "Avoid generating MOVs for assignments for expressions."
This reverts commit 53c89c67f3, along with
the subsequent this->result = reg_undef additions it required.

Both Eric and I agree that the way he did this is really fragile; if you
forget to add this->result = reg_undef before calling accept(), it may
end up using the same register for two separate things, breaking things
in strange and mysterious ways.

The next commit will port over the new VS backend's method for solving
this problem, which is simpler, less intrusive, and still manages to
avoid MOVs in the common case.
2011-08-29 11:39:41 -07:00
Ian Romanick
55d232a815 mesa: Remove all mention of MESA_FORMAT_CI8
Nothing in Mesa supports color-index textures, and most of the other
infrastructure that could allow such support has already been removed.
This puts the final nail in the coffin.

Also clean out some GL_COLOR_INDEX comments in formats.c.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-29 11:07:49 -07:00
Ian Romanick
0c1b716654 dri: Remove MESA_FORMAT_CI8 bits from drivers that don't do paletted textures
This came from the "kill it with fire" discussion at XDS 2010.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-29 11:07:49 -07:00
Brian Paul
6f1846e392 scons: add swrast/s_texture.c to the build 2011-08-29 11:37:13 -06:00
Eric Anholt
336f87d5d5 intel: Rely on Mesa core for the non-blit glTexSubImage* implementation.
It uses MapTextureImage() now, so we don't need our own mapping.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Brian Paul
b8950c2225 mesa: Convert texture debug dump function to using MapTextureImage().
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Eric Anholt
bad53f3ba5 intel: Remove our custom _mesa_store_compressed_texsubimage2d().
Now that Mesa core knows how to map teximages, we no longer needed the
compressed paths here.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Brian Paul
81430ab54f mesa: Convert texstore.c to accessing textures using MapTextureImage.
This continues to allocate texImage->Data as before, so
drivers calling these functions need to use that when present.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:14:19 -07:00
Eric Anholt
5b257442a8 nouveau: Add MapTextureImage() implementation.
This is untested, but should be close to working since it's basically
a copy of nouveau_teximage_map().

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
587fdf07da radeon: Add MapTextureImage() implementation.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
ff68e3d304 radeon: Refactor the common texture hook setup to common code.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Brian Paul
e10337da21 swrast: Add implementation of MapTextureImage/UnmapTextureImage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
bfc09e92ff intel: Add implementation of MapTextureImage/UnmapTextureImage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Brian Paul
0abb2659dd st/mesa: Add implementation of MapTextureImage.
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Brian Paul
570016cef2 mesa: Add driver hooks for texture image mapping/unmapping.
ctx->Driver.MapTextureImage() / UnmapTextureImage() will be called by
the glTex[Sub]Image(), glGetTexImage() functions, etc. when we're
accessing texture data, and also for software rendering when accessing
texture data.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
68f8cf7263 mesa: Don't check for image->Data when freeing an image's contents.
All driver implementations of FreeTextureImageBuffer already check
that Data != NULL and free it.  However, this means that we will also
free driver storage if the driver storage wasn't in the form of a Data
pointer.

This was produced by the following semantic patch:

@@
expression C;
expression T;
@@
- if (T->Data) {
- C->Driver.FreeTextureImageBuffer(C, T);
+ C->Driver.FreeTextureImageBuffer(C, T);
- }

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
5401590815 Rename some driver FreeTextureImageData functions to FreeTextureImageBuffer.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-29 10:10:03 -07:00
Eric Anholt
0bb29949ba mesa: Rename FreeTexImageData to FreeTextureImageBuffer.
This was produced by sed, except for one hunk in driverfuncs.c where
trailing whitespace was dropped.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-29 10:09:41 -07:00
Brian Paul
beca3316fb i915g: remove unused var in i915_flush_heuristically() 2011-08-29 08:11:50 -06:00
Kai Wasserbäch
d4e8f38477 winsys/g3dvl: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:06 -06:00
Kai Wasserbäch
066875f340 tests/unit: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:04 -06:00
Kai Wasserbäch
a546acdaf4 targets/xorg-vmwgfx: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:03 -06:00
Kai Wasserbäch
7ea550621e st/xorg: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:03:01 -06:00
Kai Wasserbäch
28f8ff6b62 vdpau: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
8bc7ccede1 va: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
92bc1111f3 d3d1x: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
51ecb33c6b include/pipe: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
8fb7f1a8a4 r600g: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:55 -06:00
Kai Wasserbäch
625593fde2 noop: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:54 -06:00
Kai Wasserbäch
19bcd21ed1 vl: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:54 -06:00
Kai Wasserbäch
137ba91aad util: Fix include style
As explained in the thread starting at [0], the internal include style
should be »#include "path/to/header.h"« for non-system includes.

[0]
<http://news.gmane.org/find-root.php?message_id=%3c4E5802BE.6020206%40vmware.com%3e>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:49 -06:00
Kai Wasserbäch
e106d4c731 docs: Fix minor typos.
dbec3a5d introduced minor typos, this should fix them.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-29 08:02:46 -06:00
Christian König
d4bbdbd038 g3dvl: Fix a bug not decoding the last 32-64 bits of an mpeg2 bitstream.
Another bug found by Andy Furniss.
2011-08-29 10:36:06 +02:00
Christian König
ddd25cfbb0 st/vdpau: Respect source_rect in VideoMixerRender
Fixing a bug reported by Andy Furniss.
2011-08-29 10:16:56 +02:00
Benjamin Franzke
efb4872a9d egl: Use gbm/wayland flags regardless of egl_dri2
Since they are needed for display autodetection.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40443
2011-08-29 09:34:20 +02:00
Maarten Lankhorst
110f846c25 xvmc tests: Clean up test_rendering slightly
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
2011-08-28 12:12:59 -04:00
Chia-I Wu
099faeef33 android: add support for egl_dri2
Add rules to build egl_dri2 and make it a built-in EGL driver of
libGLES_mesa.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-28 21:56:23 +08:00
Chia-I Wu
9779f6f5c1 egl_dri2: add support for Android
Add platform_android.c that supports _EGL_PLAFORM_ANDROID.  It works
with drm_gralloc, where back buffers of windows are backed by GEM
objects.

In Android a native window has a queue of back buffers allocated by the
server, through drm_gralloc.  For each frame, EGL needs to

  dequeue the next back buffer
  render to the buffer
  enqueue the buffer

After enqueuing, the buffer is no longer valid to EGL.  A window has no
depth buffer or other aux buffers.  They need to be allocated locally by
EGL.

Reviewed-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>

[olv: with assorted minor changes, mostly suggested during the review]
2011-08-28 21:56:23 +08:00
Chia-I Wu
58911b86a1 egl_dri2: allow RGBA masks to be specified for matching
Add rgba_masks to dri2_add_config.  When it is non-NULL, the DRI config
is accepted only when the offsets and sizes of the its channels match
rgba_mask.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-28 21:56:22 +08:00
Marek Olšák
c8fed01c73 glsl_to_tgsi: remove unused code 2011-08-27 19:26:14 -05:00
Chia-I Wu
09b5f1fd61 android: make DRM optional
For BOARD_GPU_DRIVERS=swrast build, DRM is not needed.
2011-08-27 18:02:11 +08:00
Chia-I Wu
534df79187 android: add support for nouveau
Compile tested only.
2011-08-27 17:29:13 +08:00
Chia-I Wu
c696d65793 android: add support for r300g
Compile tested only.
2011-08-27 17:29:12 +08:00
Chia-I Wu
99be968e99 android: add support for i915g
Quickly tested with 945GME.  SurfaceFlinger (the display server and
compositor) works.  2D apps with RGB or RGBA visuals work.  As for 3D
apps, some work and some do not.
2011-08-27 17:29:09 +08:00
Chia-I Wu
04dbb37eaa android: add support for vmwgfx
Quickly tested with VMWare Workstation 7.1.4 on Linux with GeForce
GT220.  SurfaceFlinger (the display server and compositor) works.  2D
apps with RGB visual works.  However, due to missing
PIPE_FORMAT_R8G8B8A8_UNORM support, those with RGBA visual do not.
2011-08-27 17:28:32 +08:00
Chia-I Wu
0cc0889007 winsys/i915: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:32 +08:00
Chia-I Wu
f9b55e23af winsys/svga: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:32 +08:00
Chia-I Wu
11a56c430b nouveau: share the source lists
For each driver, factor out C_SOURCES from Makefile to Makefile.sources,
and let Makefile and SConscript share it.
2011-08-27 17:28:31 +08:00
Chia-I Wu
1025f11327 r300g: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.

Note that

  $(TOP)/src/glsl/ralloc.c and
  $(TOP)/src/mesa/program/register_allocate.c

are removed from C_SOURCES in Makefile.sources and added back in
Makefile and SConscript.  The idea is that they are not part of r300g.
But having them in libr300.a makes build non-GL targets such as the
compiler tests or g3dvl much easier.  Also, for practical reason, TOP
would be an undefined variable in Makefile.sources.
2011-08-27 17:28:31 +08:00
Chia-I Wu
a558bf69cb i915g: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:31 +08:00
Chia-I Wu
d2f10d8267 svga: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let Makefile
and SConscript share it.
2011-08-27 17:28:31 +08:00
Chia-I Wu
822fad64f8 targets/egl-static: fix nouveau and vmwgfx for Android
drmVersion and driver specific ioctls are used to get the PCI ID from a
DRM fd.  Eexpand the mechanism to nouveau and vmwgfx, except that for
nouveau, only the vendor ID is needed, and for vmwgfx, always assume
SVGA II.
2011-08-27 17:28:31 +08:00
Chia-I Wu
d074acb4fa pci_ids: add vmwgfx pci id list
There is only one chipset

 15ad:0405 VMware SVGA II Adapter
2011-08-27 17:28:30 +08:00
Ian Romanick
3a1ed4eaf2 mapi: Commit generated files modified by previous commit
Some of the changes are spurious because somebody forgot to do this
when adding glFramebufferTextureLayerARB.
2011-08-26 23:33:23 -07:00
Ian Romanick
f40c291ed6 mapi: Silence many "warning: unused parameter"
When generating dispatch templates, emit the '(void) blah;' magic to
make GCC happy.  This reduces a lot of warning spam if you build with
-Wunused-parameter or -Wextra.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-08-26 23:33:12 -07:00
Ian Romanick
5266c87c87 mesa/tnl_dd: Remove unused source tree mesa/tnl_dd/imm
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:24 -07:00
Ian Romanick
5dd6626a7a mesa/tnl_dd: Remove unused header file t_dd_vbtmp.h
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:24 -07:00
Ian Romanick
6118bbd0a6 mesa/tnl_dd: Remove unused header file t_dd_rendertmp.h
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:24 -07:00
Ian Romanick
93db12a721 mesa: Remove support for BeOS
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:23 -07:00
Ian Romanick
c30181c7c3 dri: Remove unused header files mmx.h and spantmp.h
These header files were only used by drivers removed in a previous commit.

Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:23 -07:00
Ian Romanick
dd10e7e0c3 dri: Remove driRenderbuffer::backBuffer field
The tdfx driver was the only user.

Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:22 -07:00
Ian Romanick
e4344161bd dri: Remove all DRI1 drivers
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:22 -07:00
Ian Romanick
117042b46f mesa: Remove obsolete Windows gldirect and ICD drivers
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:21 -07:00
Ian Romanick
17645103aa mesa: Remove obsolete linux-fbdev software driver
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:21 -07:00
Ian Romanick
5070903653 mesa: Remove stray, unused file
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Dave Airlie <airlied@redhat.com>
Build-Tested-by: Jakob Bornecrantz <jakob@vmware.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
2011-08-26 23:31:20 -07:00
Chad Versace
f55a9a481f i965: Factor our source lists into Makefile.sources
In preparation for porting i965 to Android, factor its source lists into
a shared makefile. This prevents duplication of source lists, and hence
prevents the Android from breaking as often.

Acked-by: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-26 18:44:06 -07:00
Stéphane Marchesin
f8e6d19f3f Merge branch 'master' of git://anongit.freedesktop.org/mesa/mesa 2011-08-26 17:37:25 -07:00
Brian Paul
e3b0e37766 g3dvl: use pointer_to_uintptr() to silence a cast warning 2011-08-26 14:16:20 -06:00
Lauri Kasanen
50da22ceb1 docs: Add a page on post-processing
With edits by Brian.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-26 14:05:28 -06:00
Brian Paul
0295ac9c8e svga: include LLVM in name string in debug builds 2011-08-26 13:57:23 -06:00
Christoph Bumiller
7ed14bec11 pp: initialize the sample mask
We cannot rely on pipe drivers to default to non-zero.

Fixes pp being a no-op on nv50.

Reviewed-by: Lauri Kasanen <cand@gmx.com>
2011-08-26 21:45:26 +02:00
Michel Dänzer
3bcb9a858f st/xorg: Fix solid fills for formats other than PICT_a8r8g8b8.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-08-26 18:22:07 +02:00
Michel Dänzer
433c740c1a r600g: Hook up xorg state tracker.
Mostly copied from r300g.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:21:38 +02:00
Michel Dänzer
702838a706 r600g: Handle PIPE_TRANSFER_MAP_DIRECTLY.
If the state tracker tries to map the resource directly but we can't or don't
want to do that, fail to create a transfer.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:21:18 +02:00
Michel Dänzer
f5a4e04cdb st/xorg: Disable dirty throttling by default.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:20:59 +02:00
Michel Dänzer
751f0ce773 st/xorg: Only damage non-front source in DRI2 CopyRegion hook.
Based on a vmwgfx xa/saa fix.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-26 18:18:35 +02:00
Brian Paul
005aea891e g3dvl: s/inline/INLINE/ to fix MSVC build 2011-08-26 08:24:01 -06:00
Brian Paul
b59715b13a g3dvl: fix compilation failure on MSVC
I assume the intention of "mb = {}" was to zero-initialize it.
2011-08-26 08:11:50 -06:00
Brian Paul
cdb7396390 scons: don't compile some files with -gstabs if using mingw32
Compiling some (large) files with i686-pc-mingw32-gcc 4.2.2 (at least)
and the -gstabs option triggers a compiler error.  Use this work-around
to simply compile the effected files without -gstabs.
2011-08-26 08:05:36 -06:00
Brian Paul
3d1af78fdc scons: add more LIBS for compiling with LLVM 2.9 on Windows
These extra libs shouldn't hurt with LLVM 2.8 or older.
2011-08-26 08:05:35 -06:00
Christian König
9765dede75 g3dvl: Rewrite the mpeg 1&2 bitstream parser
Based on work of Maarten Lankhorst this time.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:35 +02:00
Christian König
31096e13f8 g3dvl: Use a single texture for luma and chroma data
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:35 +02:00
Christian König
2e62b30826 g3dvl: Rework the decoder interface part 5/5
Make setting the quant matrixes a generic interface.
Also removes setting the quant matrix from the XvMC interface

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
835ea8480f g3dvl: Rework the decoder interface part 4/5
Make the picture_structure enum spec complient.
Also remove it from the compositor.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
d3770d6229 g3dvl: Rework the decoder interface part 3/5
Revert back to a macroblock based interface. The structure used
tries to keep as close to the spec as possible.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
231fce7d63 g3dvl: Rework the decoder interface part 2/5
Implement PIPE_CAP_NUM_BUFFERS_DESIRED giving the decoder control over
the number of buffers a state tracker should allocate.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Christian König
1d1d038c85 g3dvl: Rework the decoder interface part 1/5
First of all get ride of the decode_buffer structure, while still giving
the decoder the ability to organize it's buffers depending on the needs
of the state tracker.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Younes Manton <younes.m@gmail.com>
2011-08-26 12:10:34 +02:00
Dave Airlie
6fb12bf031 tgsi: update tgsi.rst for TXQ
add some info on the TXQ opcode.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-26 11:04:15 +01:00
David Reveman
a2c467c054 i915g: Fix off-by-one in scissors. 2011-08-25 22:57:48 -07:00
Stéphane Marchesin
3d9000393b i915g: Fix case where texcoords can overlap with fragpos/frontface. 2011-08-25 22:57:48 -07:00
Stéphane Marchesin
b97889f543 i915g: Improve the flush heuristic by using the previous frame's number of vertices. 2011-08-25 22:57:48 -07:00
Vadim Girlin
fdb62ef3f5 r600g: fix replace_gpr_with_pv_ps
Instructions with 3 source operands have no write mask, so we may replace their
destinations with PV/PS in the next group even if their dst.write is 0.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-25 16:59:10 -04:00
Vadim Girlin
6ba68c7654 r600g: fix check_and_set_bank_swizzle
Need to do full check when not all bank swizzles in the group are forced
(e.g. when trying to merge interp_* group with the next instruction)

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-25 16:58:06 -04:00
Kenneth Graunke
778ecc9283 glcpp: Add GL_ARB_conservative_depth #define.
Forgotten in the patch that enabled the extension.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-25 13:14:24 -07:00
Ian Romanick
116680ddc2 i965: Remove all bits of NRM3 and NRM4 code
Nothing in Mesa generates these opcodes, and i965 hardware cannot
support it natively.  If support were ever added for this opcode in
Mesa, there had better be a lowering pass for hardware that doesn't
support it natively.
2011-08-25 13:12:21 -07:00
Dave Airlie
8ce716257a glsl: fix crash when a const is passed to texelFetchOffset
while debugging texelFetchOffset we kept hitting the assert.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-25 21:07:42 +01:00
Kenneth Graunke
c25b494332 glsl: Bail after reporting an error for non-constant const_in parameters.
Otherwise we continue and hit the "Illegal formal parameter mode"
assertion.

Fixes negative compile test texelFetchOffset.frag in piglit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-25 21:07:42 +01:00
Brian Paul
27395cb5b6 pp: add files to Makefile.sources 2011-08-25 10:36:59 -06:00
Brian Paul
6571c0774a Merge branch 'kasanen-post-process-v2'
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
2011-08-25 10:12:12 -06:00
Brian Paul
e3a7cb4a6c softpipe: add const qualifier to silence warnings 2011-08-25 10:08:15 -06:00
Dave Airlie
5f3de17ef0 glsl_to_tgsi: add TXF support. (v2)
This adds texelFetch support to translate from GLSL to TGSI TXF opcode.

I've tested this works with an r600g and softpipe backend.

v2: drop comments, fix title,

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-08-25 16:54:20 +01:00
Dave Airlie
62ad6e66a5 softpipe: implement TXF support via get_texel callback
This just calls the texel fetch functions directly bypassing the sampling,

notes:
1: loops inside switch should be more optimal.
2: borders can be sampled though only up to border depth, outside that
its undefined.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-25 16:54:20 +01:00
Dave Airlie
d562f97bef tgsi: add TXF support.
This is a straight texel fetch with no filtering or clamping. It uses
integers to specify the i/j/k (from EXT_gpu_shader4).

To enable this I had to add another hook into the tgsi sampler so that
we could easily bypass all the filtering sample does.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-25 16:54:20 +01:00
Dave Airlie
515d9e8880 glsl_to_tgsi: implement TXS/TXQ. (v2)
GLSL uses TXS, call the gallium TXQ opcode.

v2: fix indent from 4->3.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
2011-08-25 16:49:20 +01:00
Dave Airlie
461646f539 softpipe: add get_dims callback for TXQ support. (v2)
This adds the get_dims callback that is called from the tgsi exec_txq.

It returns values as per EXT_gpu_program4.

v2: fix one indent + use a switch (slighty modified from Brian)

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-25 16:49:20 +01:00
Dave Airlie
7f1b9ddd12 tgsi: add TXQ support. (v2)
this adds another callback in the sampler struct containing get_dims
entry point. This is used to query the driver for the texture resource
dimensions for the resource bound to the current sampler.

v2: remove unusued variable, fix indent

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-25 16:49:20 +01:00
Kenneth Graunke
b9eb4d8a59 glsl: Implement the GL_ARB_conservative_depth extension.
It's the same as GL_AMD_conservative_depth.  The specs have slight
differences in wording, but don't differ in content or behavior.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-25 08:07:21 -07:00
Kai Wasserbäch
dbec3a5daf Document the return type coding style.
As per discussion at [0] methods shouldn't use OpenGL return types, if
they're not part of the GL API.

[0] <http://marc.info/?l=mesa3d-dev&m=130754488901774&w=2>

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-25 07:21:00 -07:00
Kai Wasserbäch
79a486ead9 Change return type of try_emit_* methods to bool.
Ian Romanick explained (Message-Id: <4E528973.6080902@freedesktop.org>),
that the return type of non-API methods shouldn't use GLboolean but a
standard C++ bool.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Bryan Cain <bryancain3@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
2011-08-25 07:21:00 -07:00
Christoph Bumiller
55592d9da1 d3d1x: save to correct slot in xs_set_constant_buffers 2011-08-25 12:52:35 +02:00
Christoph Bumiller
974412d7b9 d3d1x: fix xs_set_samplers 2011-08-25 12:34:23 +02:00
Chia-I Wu
7b1972d7be android: add support for r600g
Tested with a Radeon HD 6250.  SurfaceFlinger (the display server and
compositor) works.  2D apps with RGB or RGBA visuals work.  As for 3D
apps, some work but some don't (with serious rendering defects).

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu
689b45fb27 winsys/radeon: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu
027a45e5cf winsys/r600: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Chia-I Wu
8dda3f2bcb r600g: share the source list
Factor out C_SOURCES from Makefile to Makefile.sources, and let
Makefile and SConscript share it.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-25 08:54:16 +08:00
Ian Romanick
707d614d10 glsl: Make sure that Extensions.dummy_true is set to true
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-08-24 14:33:31 -07:00
Brian Paul
038d654bcb vbo: remove unused var, remove unneeded local var 2011-08-24 14:50:28 -06:00
Brian Paul
473cf06339 llvmpipe: add more restrict keywords
Put restrict in the function definitions to silence MSVC warnings
about incompatible assignments in "func = lp_tile_foobar;" when func
was declared with restrict keywords but the rhs function wasn't.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2011-08-24 14:45:02 -06:00
Paul Berry
43968261e4 docs: Document coding style conventions
This patch documents some Mesa coding style conventions that came up
during the discussion of commit 67b5a32 (Perform implicit type
conversions on function call out parameters).
2011-08-24 10:55:12 -07:00
Brian Paul
ddd6e5b8bc swrast: Remove swrast eject/validate texture image code.
No driver used the eject function, or set the validate hook that made
that function do anything.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Eric Anholt
4990e7e9fb radeon: Fix flushing before writing a teximage's BO when !t->bo.
Before, if we ended up here without a BO for our image, but did choose
a miptree that had active rendering in the command buffer, our
teximage data would jump ahead of the rendering using the old texture
contents.

This showed up as breakage in gen-teximage and friends in the
following commit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Brian Paul
6dbad425bc st/mesa: remove st_texture_image::face,level fields
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Brian Paul
7dae1aaf14 intel: use new gl_texture_image:Face, Level fields
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:20 -07:00
Brian Paul
a231d24551 mesa: add gl_texture_image::Face, Level fields
Several drivers have these fields in their subclasses of gl_texture_image.
They'll be useful for core Mesa too...

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-24 10:43:19 -07:00
Brian Paul
c3ad95ed40 x11: add missing comma to fix compilation 2011-08-24 07:55:04 -06:00
Dave Airlie
cc9a8915f0 r600g: fill out missing entries in opcode tables.
this just adds the missing opcodes as unsupported.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-08-24 13:30:53 +01:00
Chia-I Wu
1284d5b255 winsys/svga: use os_mmap() for memory mapping
os_mmap() guarantees large file support across OSes.
2011-08-24 10:57:12 +08:00
Chia-I Wu
70b1837dfb winsys/radeon: use os_mmap() for memory mapping
os_mmap() guarantees large file support across OSes.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-08-24 10:57:12 +08:00
Chia-I Wu
9bda86c355 auxiliary/os: add wrappers for mmap/munmap
The use of mmap() in winsys requires large file support.  Not all OSes
have LFS so a wrapper should be used.  In particular, os_mmap() should
call __mmap2() on Android.
2011-08-24 10:57:12 +08:00
Ian Romanick
0d636213d4 i965: Only map the necessary buffer range in brw_prepare_indices
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:12 -07:00
Ian Romanick
2ea1ff3816 tnl: Only map the necessary buffer range in bind_indices
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:12 -07:00
Ian Romanick
655c7d7498 mesa: Only map the necessary buffer range in vbo_get_minmax_index
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:11 -07:00
Ian Romanick
28249bd260 mesa: Eliminate dd_function_table::MapBuffer
Replace all calls to dd_function_table::MapBuffer with appropriate
calls to dd_function_table::MapBufferRange, then remove all the cruft.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:11 -07:00
Ian Romanick
cccc7412c2 radeon: Hack up an implementation of MapBufferRange
This doesn't implement any of the "cool" features of MapBufferRange.
Adding this function is necessary for the next commit in the series.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Cc: Maciej Cencora <m.cencora@gmail.com>
2011-08-23 14:52:11 -07:00
Ian Romanick
b2184da684 mesa: Fix incorrect access parameter passed to MapBuffer
The code previously passed GL_DYNAMIC_DRAW for the access parameter.
By inspection, I believe that all drivers would treat this as
GL_READ_WRITE because it's not GL_READ_ONLY and it's not
GL_WRITE_ONLY.

It appears the i965 code wants GL_WRITE_ONLY (it's about to write a
bunch of data in, never read data), while the arrayelt code is
GL_READ_ONLY (just dereffed as arguments to CALL_Whatever*v).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Whitwell <keithw@vmware.com>
2011-08-23 14:52:10 -07:00
Ian Romanick
6183edc070 mesa: Remove target parameter from dd_function_table::FlushMappedBufferRange
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:10 -07:00
Ian Romanick
f973be59fa intel: Correctly check for read-only mappings in intel_bufferobj_map_range
The old code was an obvious cut-and-paste fail from intel_bufferobj_map.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2011-08-23 14:52:10 -07:00
Ian Romanick
4ddae2fb66 mesa: Remove target parameter from dd_function_table::MapBufferRange
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:10 -07:00
Ian Romanick
6c8aa3491a mesa: Remove target parameter from dd_function_table::GetBufferSubData
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
92f3fca0ea mesa: Remove target parameter from dd_function_table::BufferSubData
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
12d924c5ae mesa: Remove target parameter from dd_function_table::MapBuffer
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:09 -07:00
Ian Romanick
56f0c00f12 mesa: Remove target parameter from dd_function_table::UnmapBuffer
No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-23 14:52:08 -07:00
José Fonseca
0457655035 make: Add missing source file. 2011-08-23 19:50:54 +01:00
Eric Anholt
abbb8fc3a7 i965: Fix typo in 2b224d66a0
Unfortunately, since a previous efficiency improvement, we no longer
have any open-source testcases producing register spilling, so this
code was untested in the fragment shader path.  That should change
when we get proper temporary array support in the fragment shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40194
2011-08-23 11:23:04 -07:00
Eric Anholt
9d4b98eb9e i965/gen6+: Use non-normalized coordinates for GL_TEXTURE_RECTANGLE.
Improves performance of a GL_TEXTURE_RECTANGLE microbenchmark by 1.84%
+/- .15% (n=3)
2011-08-23 11:23:04 -07:00
Kenneth Graunke
4eeb4c1505 i965: Implement textureSize (TXS) on Gen4.
Also, remove the BRW_SAMPLER_MESSAGE_SIMD8_RESINFO #define because
there totally isn't a SIMD8 variant.

Unfortunately, resinfo returns FLOAT32 on Broadwater/Crestline, unlike
G45 which returns a proper UINT32.  This turns out to be simple,
however: when we emit MOVs to select the desired half of the SIMD16
result, we can simply override the register type to be float so it's
converted to an integer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:26 -07:00
Kenneth Graunke
ecf8963754 i965/fs: Implement textureSize (TXS) on Gen5+.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:25 -07:00
Kenneth Graunke
b6bdcf2a90 i965/fs: Rudimentary support for non-floating point texture results.
Not all texturing operations return floating point data.  For example,
the resinfo message (textureSize or TXS) returns integer data.  In the
future, we'll also add integer texture support.

ir_texture's type field contains this information; use its base type to
appropriately type the destination register.  We want to keep it as a
four component vector, however, since SIMD8 samplers always have a
response length of 4.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:18:08 -07:00
Kenneth Graunke
2054652796 glsl/builtins: Uncomment textureSize prototypes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-08-23 11:18:03 -07:00
Kenneth Graunke
583b295bbf texture_builtins.py: Add support for textureSize (txs).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-23 11:17:35 -07:00
Kenneth Graunke
1e3bcbdf31 glsl: Add a new ir_txs (textureSize) opcode to ir_texture.
One unique aspect of TXS is that it doesn't have a coordinate.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
2011-08-23 11:16:30 -07:00
Maarten Lankhorst
8f26b59f53 st/xorg: Advertise support for XvMC
Formats were based on a patch sent to xf86-video-nouveau by Bryan Cain

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>

[Michel Dänzer: Add xorg_xvmc.c to SConscript.]
2011-08-23 12:13:03 +02:00
Chia-I Wu
29d7a0bb16 mesa: call _mesa_set_vp_override in glDrawTex*
The driver may install its own vertex shader.  _mesa_set_vp_override
must be called so that core mesa can generate correct fragment program..

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-23 09:12:12 +08:00
Chia-I Wu
dd250e6045 auxiliary: share the source lists
Factor out source lists from Makefile to Makefile.sources, and let
Makefile, SConscript, and Android.mk share it.

Note that files in $(GENERATED_SOURCES) are removed from $(C_SOURCES).

Acked-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-23 09:12:08 +08:00
Chia-I Wu
582b5d869c scons: add ParseSourceList method
ParseSourceList() can be used to parse a source list file and returns
the source files defined in it.  It is supposed to be used like this

  # get the list of source files from C_SOURCES in Makefile.sources
  sources = env.ParseSourceList('Makefile.sources', 'C_SOURCES')

The syntax of a source list file is compatible with GNU Make.  This
effectively allows SConscript and Makefile to share the source lists.

Acked-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-23 09:11:58 +08:00
Kenneth Graunke
6c8ea1eed6 glsl: Make ir_validate actually visit ir_if nodes.
There is no ir_hierarchical_visitor::visit(ir_if *) method, since ir_if
is not a leaf node.  Instead, there are visit_enter and visit_leave
methods.  Use visit_enter arbitrarily (either would work fine, though
visit_enter will catch errors sooner).

Found thanks to a warning emitted by Clang.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-22 10:30:47 -07:00
Chad Versace
69595283b6 intel: Abort when DRI2 separate stencil handshake fails
When intel_context requires separate stencil but the DRI2 separate stencil
handshake fails, then abort and emit an error instructing the user to
upgrade the DDX to 2.16.0.

CC: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-22 07:27:05 -07:00
Kenneth Graunke
7a5d28908c glsl_to_tgsi: Fix a few more struct vs. class warnings.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-21 23:07:14 -07:00
Bryan Cain
5379a70d3f glsl_to_tgsi: emit a MAD(b, -a, b) for !a && b
This is a port of commit ff2cfb8989 to glsl_to_tgsi.
2011-08-20 14:43:25 -05:00
Bryan Cain
c721d7b7bc glsl_to_tgsi: fix typo 2011-08-20 14:17:52 -05:00
Bryan Cain
9098953ee6 glsl_to_tgsi: implement ir_binop_all_equal using DP4 w/SGE
This is a port of commit ba01df11c4 to glsl_to_tgsi with integer support
added.
2011-08-20 14:15:03 -05:00
Bryan Cain
f3dce133f0 glsl_to_tgsi: implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLT
Implement the any() part of the operation the same way regular ir_unop_any
is implemented.

This is a port of commit e7bf096e8b to glsl_to_tgsi, with added integer
support.
2011-08-20 14:00:41 -05:00
Bryan Cain
a43f68810a glsl_to_tgsi: implement ir_unop_any using DP4 w/saturate or DP4 w/SLT
This is a port of commit 92ca560d68 to glsl_to_tgsi, with integer support
added.
2011-08-20 14:00:41 -05:00
Bryan Cain
c15eb5569b glsl_to_tgsi: make glsl_to_tgsi_visitor::emit_dp return the instruction 2011-08-20 14:00:40 -05:00
Bryan Cain
691cc0e3a8 glsl_to_tgsi: implement ir_binop_logic_or using an add w/saturate or add w/SLT
Logical-or is implemented using addition (followed by clamping to [0,1]) on
values of 0.0 and 1.0. Replacing the logical-or operators with addition gives
a + b which has a result on the range [0, 2].

Previously a SNE instruction was used to clamp the resulting logic value to
[0,1]. In a fragment shader, using a saturate on the add has the same effect.
Adding the saturate to the add is free, so (at least) one instruction is
saved. In a vertex shader, using an SLT on the negation of the add result has
the same effect. Many older shader architectures do not support the SNE
instruction. It must be emulated using two SLT instructions and an ADD. On
these architectures, the single SLT saves two instructions.

Note that SNE is still used when integers are used for boolean values, since
there is no such thing as an integer saturate, and older shader architectures
without SNE don't support integers.

This is a port of commit 41f8ffe5e0 to glsl_to_tgsi with integer support
added.
2011-08-20 14:00:40 -05:00
Bryan Cain
8c31bc7048 glsl_to_tgsi: implement ir_unop_logic_not using 1-x
Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x accurately
implements logical not.

This is a port of commit 6ad08989d7 to glsl_to_tgsi.
2011-08-20 14:00:40 -05:00
Chia-I Wu
112e68c503 st/egl: add a missing include
Reported by cwhuang.
2011-08-21 02:01:50 +08:00
Chia-I Wu
b71a7a2f37 st/egl: improve error logging
This helps diagnose problems in EGL initialization.
2011-08-21 02:01:50 +08:00
Chia-I Wu
5ce2dc692f st/egl: add buffer preserving support to Android
Use a staging color buffer when buffer preserving is enabled.
2011-08-21 02:01:50 +08:00
Chia-I Wu
4c222ff4fe st/egl: improve buffer cache for Android
There may be more than two back buffers.  Clean up and prepare the
buffer cache for that.
2011-08-21 02:01:50 +08:00
Chia-I Wu
62c7c2fca4 st/egl: swapping without a buffer is not an error
This fixes Kwaak3.
2011-08-21 02:01:49 +08:00
Chia-I Wu
8ccafbbbcc st/egl: use HAL formats for Android backend
Native buffers use HAL formats, not UI formats.
2011-08-21 02:01:49 +08:00
Chia-I Wu
9650483acd winsys/sw/android: use HAL formats
Native buffers use HAL formats, not UI formats.
2011-08-21 02:01:49 +08:00
Chia-I Wu
f496d8b86d winsys/sw/android: set bo usage correctly
Since this is the software path, set GRALLOC_USAGE_SW_WRITE_OFTEN when
PIPE_BIND_RENDER_TARGET, and set GRALLOC_USAGE_SW_READ_OFTEN when
PIPE_BIND_SAMPLER_VIEW.
2011-08-21 02:01:49 +08:00
Chia-I Wu
327de226ae android: make libGLES_mesa real
libGLES_mesa with swrast should link in these libraries

  libmesa_egl
  libmesa_egl_gallium
  libmesa_st_egl
  libmesa_st_mesa
  libmesa_glsl
  libmesa_glsl_utils
  libmesa_pipe_softpipe
  libmesa_winsys_sw_android
  libmesa_gallium

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
ee41fc898d android: build shared glapi
This builds the shared library libglapi from shared glapi.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
b81b82df95 android: build glsl
This builds the static library libmesa_glsl and executable glsl_compiler
from glsl.  glsl_compiler is only installed for engineering build.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
ee40f18054 android: build core mesa
This builds the static library libmesa_st_mesa from core mesa.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
2a77dc0c0d android: build core EGL
This builds the static library libmesa_egl from core EGL.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:49 +08:00
Chia-I Wu
faf9d580f5 android: build softpipe
This builds the static library libmesa_pipe_softpipe from softpipe.
2011-08-21 02:01:49 +08:00
Chia-I Wu
15576344f7 android: build android sw winsys
This builds the static library libmesa_winsys_sw_android from winsys/sw.
2011-08-21 02:01:49 +08:00
Chia-I Wu
b38da5f0a1 android: build targets/egl-static
This builds the static library libmesa_egl_gallium from
targets/egl-static.
2011-08-21 02:01:49 +08:00
Chia-I Wu
98345cf1b5 android: build st/egl with android backend
This builds the static library libmesa_st_egl from st/egl.
2011-08-21 02:01:48 +08:00
Chia-I Wu
688db6e8dc android: build gallium auxiliaries
This builds the static library libmesa_gallium from gallium auxiliaries.
2011-08-21 02:01:48 +08:00
Chia-I Wu
c9b21d986e android: build libGLES_mesa
This is the first step to integrate Mesa into Android(-x86) build
system.  You can git clone mesa under the external/ directory of Android
source tree and build Android with

 $ make BOARD_GPU_DRIVERS=swrast

It will build libGLES_mesa that will be loaded by Android runtime.

libGLES_mesa is still a stub in this commit.
2011-08-21 02:01:48 +08:00
Chia-I Wu
4b2b0b9fb8 targets/egl-static: do not rely on libudev on Android
There is no libudev on Android.  Use DRM to get the PCI ID directly.

Reviewed-by: Benjamin Franzke <benjaminfranzke@googlemail.com>
2011-08-21 02:01:48 +08:00
Chia-I Wu
15418a8505 st/egl: add android backend
Both HW and SW rendering are supported for Android.  For SW rendering,
we use the generic gralloc lock/unlock for mapping and unmapping color
buffers (in winsys/android).

For HW rendering, we need to know the real type of color buffers.  This
backend works with drm_gralloc, where a color buffer is backed by a GEM
object.
2011-08-21 02:01:48 +08:00
Chia-I Wu
8e54c47a61 winsys/android: new SW winsys for Android
On Android, color buffers are passed between server and clients as
opaque buffer_handle_t.  This winsys makes use of gralloc, which
provides a generic way to map and unmap buffer_handle_t for CPU access.
2011-08-21 02:01:48 +08:00
Chia-I Wu
00b365bc78 egl: add Android-specific extensions
Add EGL_ANDROID_image_native_buffer and EGL_ANDROID_swap_rectangle.
There is no spec for them though.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
b0945c14df egl: add _EGL_PLATFORM_ANDROID
This is Android Gingerbread platform.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
504f92c739 mesa: android has no log2f nor ffs
Define log2f(v) to be logf(v) / M_LN2 and ffs to __builtin_ffs.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
b34770d834 ralloc: include limits.h for SIZE_MAX on Android
Android does not define SIZE_MAX in stdint.h.  We have to include
limits.h for it.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:48 +08:00
Chia-I Wu
cd893ccba9 gallium: add PIPE_OS_ANDROID support
Android uses Linux kernel and its own C runtime.  It resembles
PIPE_OS_LINUX a lot with some minor exceptions.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-21 02:01:48 +08:00
Chia-I Wu
31753b50f3 glsl: remove an unnecessary header include
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:47 +08:00
Chia-I Wu
a40008ac64 mesa: fix !FEATURE_GL build
Move vbo_exec_FlushVertices_internal out of FEATURE_beginend.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-21 02:01:47 +08:00
Kenneth Graunke
f7d2dcae3b i965/gen7: Use align1 mode to set URB_WRITE_HWORD channel enables.
Makes the new vertex shader backend work on Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-20 00:17:55 -07:00
Kenneth Graunke
e98ee06776 i965/fs: Don't double-convert integer/boolean uniforms.
When ctx->Const.NativeIntegers is set, Core Mesa loads integer/boolean
uniforms directly, rather than loading the floating point equivalent.
So, when that's set, we don't need to perform any conversions.

Unfortunately, we can't properly support native integers with the old
vertex shader backend, so this patch leaves them disabled for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-19 23:32:50 -07:00
Kenneth Graunke
01d81dedc7 mesa, glsl_to_tgsi: Add new gl_context::NativeIntegers flag.
Previously, native integer support was based on whether the driver
advertised GLSL 1.30 or not.  However, drivers that natively support
integers may wish to do so for older GLSL versions as well.  Adding this
new opt-in flag allows them to do so.

Currently disabled by default on all drivers, which was the existing
behavior (no drivers currently implement GLSL 1.30).

Fixes piglit tests on i965 with INTEL_GLSL_VERSION=130 set:
- spec/glsl-1.10/fs-uniform-int-110.shader_test
- spec/glsl-1.30/fs-uniform-int-130.shader_test
(it was doubly converting the data)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-19 23:30:45 -07:00
Kenneth Graunke
07e9b9049f ir_to_mesa: Remove incorrect usage of the 'struct' keyword on classes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-19 23:29:24 -07:00
Kenneth Graunke
eb86bb55f5 i965/fs: Change incorrect use of 'struct fs_reg' to simply 'fs_reg'.
It's actually a class.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-19 23:29:24 -07:00
Kenneth Graunke
64f11db558 glsl: Remove unused variable. 2011-08-19 23:29:23 -07:00
Eric Anholt
f4db75547f i965/vs: Implement proper register allocation instead of 1:1 mapping.
Fixes vs-atan-* and several others.  This is not the real solution we
eventually want, which will pack floats, vec2s, and vec3s into vec4
registers, but this code should provide the framework for that.
2011-08-19 17:06:29 -07:00
Eric Anholt
8174945d33 i965/vs: Add simple dead code elimination.
This is copied right from the fragment shader.  It is needed for real
register allocation to work correctly.
2011-08-19 17:06:29 -07:00
Eric Anholt
3dadc1e3cc i965/vs: Copy the live intervals calculation over from the FS.
This is a rather pessimistic calculation, since it doesn't distinguish
individual channels of a vec4, or elements of an array, but should be
a minimum start for register allocation.
2011-08-19 16:55:02 -07:00
Eric Anholt
eb5454f20a i965/vs: Remove stale comment about compressed instructions.
This was copy'n'paste from the fragment shader, and didn't make sense
here.
2011-08-19 16:55:02 -07:00
Lauri Kasanen
88bc4eda0f pp/main queue: Add the PP headers
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:16 -06:00
Lauri Kasanen
85d2ee59d9 pp/main queue: Add pp_program.[ch]
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:16 -06:00
Lauri Kasanen
0d383d4790 pp/main queue: Add pp_init.c
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:16 -06:00
Lauri Kasanen
de43cd310c pp/main queue: Add pp_run.c
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:06 -06:00
Lauri Kasanen
caeb3cdf2f pp: Add Jimenez' MLAA
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:06 -06:00
Lauri Kasanen
f951550d3f pp: Add the MLAA areamap
The areamap contains precomputed data on different aliasing types.
It is necessary for good performance.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:06 -06:00
Lauri Kasanen
6ff00c1afa pp: Cel-shade filter
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:05 -06:00
Lauri Kasanen
e453289a77 pp: Color filters
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:05 -06:00
Lauri Kasanen
e86e4cf128 pp: Docs
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:51:05 -06:00
Lauri Kasanen
d2fdc58fe7 aux/Makefile,SConscript: Build PP
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:50:46 -06:00
Lauri Kasanen
421235d42a st/dri: Bind the post-processing queue to dri
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:49:33 -06:00
Lauri Kasanen
6a6441fc03 driconf: Add the PP descriptions
Signed-off-by: Lauri Kasanen <cand@gmx.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-19 16:47:23 -06:00
Marek Olšák
db71537f01 r600g: don't allocate separate depth and stencil for transfer textures on EG
The state tracker expects depth and stencil pixels interleaved.
Evergreen can bind an interleaved depth-stencil resource as a colorbuffer,
but not as a zbuffer.

The hardware can do the interleaving for us when decompressing.
2011-08-19 23:12:15 +02:00
Marek Olšák
754ea4ea76 r600g: finally enable float depth buffers on evergreen 2011-08-19 23:12:11 +02:00
Marek Olšák
565f39bdb2 r600g: rename resource -> view in create_sampler_view
The sampler view is not a resource.
Also remove the unused desc variable.
2011-08-19 23:12:11 +02:00
Marek Olšák
751a6ed893 r600g: hack around a problem with texture alignment 2011-08-19 23:12:11 +02:00
Marek Olšák
98a87a594b r600g: simplify the conditionals determining array mode 2011-08-19 23:12:11 +02:00
Marek Olšák
7f29824fd5 r600g: put depth and stencil into one backing buffer
For DRI2 sharing.
2011-08-19 23:12:11 +02:00
Marek Olšák
68c54abb2c r600g: fix depth-stencil on evergreen
Such that it actually works in apps which use both.

A separate buffer is allocated for stencil. The only exception is
the window-system-provided depth-stencil buffer, where depth and stencil
share the same buffer.

This fixes:
- fbo-depthstencil-GL_DEPTH24_STENCIL8-clear
- fbo-depthstencil-GL_DEPTH24_STENCIL8-drawpixels-FLOAT-and-USHORT
- fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-24_8
- fbo-depthstencil-GL_DEPTH24_STENCIL8-readpixels-FLOAT-and-USHORT
2011-08-19 23:12:11 +02:00
Brian Paul
3e9dc51f82 mesa: handle array textures in GenerateMipmap(), FramebufferTexture1/2D()
This was an unfinished to-do item before.
With this patch and the two preceeding patches, piglit's
fbo-generatemipmap-array test runs and passes instead of generating
a GL error and dying on an assertion.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:11 -06:00
Brian Paul
0f8c43c34f meta: use fallback mipmap generation for 1D/2D texture arrays
We could do 1D/2D arrays with textured quad rendering, but it'll take
some work (as with 3D textures).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:11 -06:00
Brian Paul
0eb18ee557 mesa: set Q=1 for OPCODE_TEX execution
Q should not be significant for OPCODE_TEX, but it winds up getting
passed to the compute_lambda() function.  Make sure it's 1.0 to
prevent garbage values, which is effectively what we get when the
swizzle is coord.xyzz (which is what GLSL gives us).

Part of the fix for piglit's fbo-generatemipmap-array test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:10 -06:00
Brian Paul
352cab498a mesa: restructure error checking in _mesa_FramebufferTexture1D/2DEXT()
In anticipation of adding more texture targets.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-08-19 13:31:10 -06:00
Chad Versace
f23c3ebecc mesa: Declare _mesa_meta_begin()/end() as public
Declare _mesa_meta_begin()/end() in meta.h so that drivers can write
custom meta-ops (such as HiZ resolves for i965).

This necessitates moving the the META_* macros into meta.h. To prevent
naming collisions, this commit renames each macro to be MESA_META_*.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-19 10:49:59 -07:00
Christoph Bumiller
778997f9df nv50: fix potential null deref in insn modifer optimization pass
Bug introduced in 34980cd153.
2011-08-19 16:57:30 +02:00
Brian Paul
e975e18beb glx: use a block to fix declarations after code warning 2011-08-19 08:36:22 -06:00
Marek Olšák
e330d90e91 r600g: fix a possible crash in r600_adjust_gprs 2011-08-19 14:46:25 +02:00
Brian Paul
ccecc08f79 mesa: fix incorrect error code in _mesa_FramebufferTexture1D/3DEXT()
The spec says GL_INVALID_OPERATION is generated when texture!=0 and
textarget is not a legal value.  We had this right for the 2D function.
2011-08-18 11:51:53 -06:00
Paul Berry
e9ae4cadf5 glapi: update .gitignore for generated ES dispatch headers
Commit 6eff33dc (glapi: generate ES dispatch headers from core mesa)
replaced the autogenerated files
src/mapi/es1api/main/{dispatch,remap_helper}.h with new autogenerated
files src/mesa/main/api_exec_es{1,2}_{dispatch,remap_helper}.h.  This
patch updates the .gitignore files to properly ignore the new
autogenerated files, and stop ignoring the old autogenerated files.

Reviewed-by: Chia-I Wu <olv@lunarg.com>
2011-08-18 10:18:22 -07:00
José Fonseca
762bf931ca llvmpipe: Don't build lp_test_arit on MSVC.
Several issues due to expf/logf/etc either not being declared,
or being defined as a macro.
2011-08-18 18:04:44 +01:00
José Fonseca
a7f67b1c50 llvmpipe: snprintf->util_snprintf.
For MSVC.
2011-08-18 17:58:02 +01:00
José Fonseca
09042e08cb llvmpipe: Add u_math.h include.
Necessary on platforms with incomplete math.h
2011-08-18 16:06:00 +01:00
José Fonseca
7be4cf9c63 scons: Add support for LLVM-2.9 on Windows.
MinGW & MSVC, although I've only tested the former.
2011-08-18 16:00:59 +01:00
Kristian Høgsberg
4a7667b96b glx: Don't flush twice if we fallback to dri2CopySubBuffer
The flush extensions flush call indicates end of frame and should only
be called once per frame.  However, in the dri2SwapBuffer fallback
path, we call flush and then call dri2CopySubBuffer, which also calls
flush.  Refactor the code to only call flush once.
2011-08-18 09:46:06 -04:00
Marek Olšák
01680ce2f3 r600g: implement NV_primitive_restart functionality (v2)
Needed for GL3.

v2: evergreen support

I don't set PA_SU_SC_MODE_CNTL.MULTI_PRIM_IB_ENA.
piglit/primitive-restart does pass though. Tested on RV730 and EG-REDWOOD.
2011-08-18 00:25:07 +02:00
Marek Olšák
17867f06b1 r600g: fix scons build 2011-08-17 23:24:33 +02:00
Eric Anholt
3f78f71973 i965/fs: Fix 32-bit integer multiplication.
The MUL opcode does a 16bit * 32bit multiply, and we need to do the
MACH to get the top 16bit * 32bit added in.

Fixes fs-op-mult-int-*, fs-op-mult-ivec*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-17 11:51:01 -07:00
Christoph Bumiller
34980cd153 nv50: don't drop flags definition when merging SAT with ADD/MAD 2011-08-17 20:40:43 +02:00
Brian Paul
718b894dbb st/mesa: fix incorrect loop over instruction src regs
The array of src regs is of size 3, not 4.
2011-08-17 08:12:54 -06:00
Lauri Kasanen
65bdb878a0 st/dri: Indent driconf options 2011-08-17 00:39:17 -07:00
Lauri Kasanen
59e56957cc xmlpool.h: fix a typo 2011-08-17 00:39:17 -07:00
Lauri Kasanen
b629d5ba24 xmlconfig: Make the error message more informative 2011-08-17 00:39:17 -07:00
Ian Romanick
7125f1e87d mesa: Bump instruction execution limit to 65536
Shader Model 3.0[1] requires that shaders be able to execute at least
65536 instructions.  Bump Mesa maxExec to that limit.  This allows
several vertex shaders in the OpenGL ES 2.0 conformance test suite to
run to completion.

1: http://en.wikipedia.org/wiki/High_Level_Shader_Language

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:38:44 -07:00
Ian Romanick
54c48a95e6 mesa: Add partial constant propagation pass for Mesa IR
This cleans up some code generated by the IR-to-Mesa pass for i915.
In particular, some shaders involving arrays of constant matrices
result in really bad code.

v2: Silence several warnings from merging the gl_constant_value work.
Fix DP[23] folding.  Add support for a bunch more opcodes that appear
in piglit runs on i915.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:38:39 -07:00
Ian Romanick
ff2cfb8989 ir_to_mesa: Emit a MAD(b, -a, b) for !a && b
!a && b occurs frequently when nexted if-statements have been
flattened.  It should also be possible use a MAD for (a && b) || c,
though that would require a MAD_SAT.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:44 -07:00
Ian Romanick
ba01df11c4 ir_to_mesa: Implement ir_binop_all_equal using DP4 w/SGE
The operation ir_binop_all_equal is !(a.x != b.x || a.y != b.y || a.z
!= b.z || a.w != b.w).  Logical-or is implemented using addition
(followed by clampling to [0,1]) on values of 0.0 and 1.0.  Replacing
the logical-or operators with addition gives !bool((int(a.x != b.x) +
int(a.y == b.y) + int(a.z == b.z) + int(a.w == b.w)).  This can be
implemented using a dot-product with a vector of all 1.0.  After the
dot-product, the value will be an integer on the range [0,4].

Previously a SEQ instruction was used to clamp the resulting logic
value to [0,1] and invert the result.  Using an SGE instruction on the
negation of the dot-product result has the same effect.  Many older
shader architectures do not support the SEQ instruction.  It must be
emulated using two SGE instructions and a MUL.  On these
architectures, the single SGE saves two instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:43 -07:00
Ian Romanick
e7bf096e8b ir_to_mesa: Implement ir_binop_any_nequal using DP4 w/saturate or DP4 w/SLT
The operation ir_binop_any_nequal is (a.x != b.x) || (a.y != b.y) ||
(a.z != b.z) || (a.w != b.w), and that is the same as any(bvec4(a.x !=
b.x, a.y != b.y, a.z != b.z, a.w != b.w)).  Implement the any() part
the same way the regular ir_unop_any is implemented.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:43 -07:00
Ian Romanick
92ca560d68 ir_to_mesa: Implement ir_unop_any using DP4 w/saturate or DP4 w/SLT
This is just like the ir_binop_logic_or case.  The operation
ir_unop_any is (a.x || a.y || a.z || a.w).  Logical-or is implemented
using addition (followed by clampling to [0,1]) on values of 0.0 and
1.0.  Replacing the logical-or operators with addition gives (a.x +
a.y + a.z + a.w).  This can be implemented using a dot-product with a
vector of all 1.0.

Previously a SNE instruction was used to clamp the resulting logic
value to [0,1].  In a fragment shader, using a saturate on the
dot-product has the same effect.  Adding the saturate to the
dot-product is free, so (at least) one instruction is saved.

In a vertex shader, using an SLT on the negation of the dot-product
result has the same effect.  Many older shader architectures do not
support the SNE instruction.  It must be emulated using two SLT
instructions and an ADD.  On these architectures, the single SLT saves
two instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:42 -07:00
Ian Romanick
7f4c65256c ir_to_mesa: Make ir_to_mesa_visitor::emit_dp return the instruction
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:41 -07:00
Ian Romanick
41f8ffe5e0 ir_to_mesa: Implement ir_binop_logic_or using an add w/saturate or add w/SLT
Logical-or is implemented using addition (followed by clampling to
[0,1]) on values of 0.0 and 1.0.  Replacing the logical-or operators
with addition gives a + b which has a result on the range [0, 2].

Previously a SNE instruction was used to clamp the resulting logic
value to [0,1].  In a fragment shader, using a saturate on the add has
the same effect.  Adding the saturate to the add is free, so (at
least) one instruction is saved.

In a vertex shader, using an SLT on the negation of the add result has
the same effect.  Many older shader architectures do not support the
SNE instruction.  It must be emulated using two SLT instructions and
an ADD.  On these architectures, the single SLT saves two
instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:40 -07:00
Ian Romanick
6ad08989d7 ir_to_mesa: Implement ir_unop_logic_not using 1-x
Since our logic values are 0.0 (false) and 1.0 (true), 1.0 - x
accurately implements logical not.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-16 14:09:40 -07:00
Chad Versace
3c9f172fe8 mesa: Add Android to list of platforms that define fpclassify()
This is a fix for the Android build.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-16 14:03:48 -07:00
Chad Versace
bd064a49f1 mesa: Fix Android build by #ifdef'ing out locale support
Bionic does not support locales. This commit #ifdef's out the locale usage
in _mesa_strtof().

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-16 13:43:15 -07:00
Chad Versace
eb0ff1a1c0 mesa: Remove use of fpu_control.h
Remove the inclusion of fpu_control.h from compiler.h.  Since Bionic lacks
fpu_control.h, this fixes the Android build.

Also remove the sole use of the fpu_control bits, which was in debug.c.
Those were brianp's debug bits, and he approved of their removal.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-16 13:34:33 -07:00
Eric Anholt
0ddf0f1c34 i965/vs: Fix multiplies to actually do 32-bit multiplies.
Fixes vs-op-mult-int-int and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt
7bf70c29ad i965/vs: Add support for conversion of FIXED_HW_REG src_reg to/from dst_reg.
This was quietly occurring in some emit code I produced, and failed.
2011-08-16 13:04:43 -07:00
Eric Anholt
e9a86ae337 i965/vs: Fix memory leak of ralloc context for the visitor. 2011-08-16 13:04:43 -07:00
Eric Anholt
feff7c62ce i965/vs: Fix condition code for scalar expression all_equals.
Fixes vs-op-eq-bool-bool.
2011-08-16 13:04:43 -07:00
Eric Anholt
8a649277cb i965/vs: Don't assertion fail on vertex texturing.
The linker will reject the program, but we need to survive until then.
Fixes abort in glsl1-2D Texture lookup with explicit lod (Vertex
shader)
2011-08-16 13:04:43 -07:00
Eric Anholt
d0c595ac80 i965/gen6: Force WHILE exec size to 8.
We can't just look at the instruction that happens to appear at the
start of the loop, because it might be some other exec size and cause
us to only loop on the first N channels.  We always want 8 in our
current code (since 16 doesn't work so we don't do 16-wide fragment in
that case).

Fixes loop-03.vert, which was triggering the assertions.
2011-08-16 13:04:43 -07:00
Eric Anholt
905f3d0309 i965/vs: Remove remaining use of foreach_iter. 2011-08-16 13:04:43 -07:00
Eric Anholt
54e66a0a63 i965/vs: Fix abs/negate handling on attributes.
Fixes glsl-vs-neg-attribute and glsl-vs-abs-attribute.
2011-08-16 13:04:43 -07:00
Eric Anholt
7642c1de6b i965/vs: Avoid generating a MOV for most ir_assignment handling.
Removes an average of 11.5% of instructions in 54% of vertex shaders
in shader-db.
2011-08-16 13:04:43 -07:00
Eric Anholt
7fbe7fe133 i965/vs: Run the shader backend at link time and return compile failures.
Link failure is something that shouldn't happen, but we sometimes want
it during development.  The precompile also allows analysis of shader
codegen with shader-db.
2011-08-16 13:04:43 -07:00
Eric Anholt
d376fa8e84 i965: Fix assertion failure on a loop consisting of while (true) { break }.
On enabling the precompile step in the VS, we tripped over this
assertion failure in glsl-link-bug-30552.
2011-08-16 13:04:43 -07:00
Eric Anholt
e8980c61b2 i965/vs: Fix the trivial register allocator's failure path. 2011-08-16 13:04:43 -07:00
Eric Anholt
193a9a209d i965/vs: Add support for if(any(bvec)) on gen6. 2011-08-16 13:04:43 -07:00
Eric Anholt
072d64121e i965/vs: Add support for GL_FIXED attributes.
Fixes arb_es2_compatibility-fixed-type
2011-08-16 13:04:43 -07:00
Eric Anholt
aed5e353e9 i965/vs: Clamp vertex color outputs when required by ARB_color_buffer_float.
Fixes glsl-vs-vertex-color.
2011-08-16 13:04:43 -07:00
Eric Anholt
a55fbbc1a2 i965/vs: Fix access of attribute arrays.
By leaving out the column index, we were reading an unallocated
attribute on glsl-mat-attribute.
2011-08-16 13:04:43 -07:00
Eric Anholt
fea7d34b35 i965/vs: Fix builtin uniform setup.
I want to intelligently pack them at some point, but for now we have
the params set up in groups of 4.  Fixes glsl-vs-normalscale.
2011-08-16 13:04:43 -07:00
Eric Anholt
0b359e3ea0 i965/vs: Add support for loops.
This is copied from brw_fs.cpp, instead of doing the temporary IR
generation that ir_to_mesa does.  Fixes glsl-vs-loop and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt
abf843a797 i965/vs: Add support for ir_binop_pow.
Fixes vs-pow-float-float.
2011-08-16 13:04:43 -07:00
Eric Anholt
250770b74d i965/vs: Respect the gen6 limitation that math opcodes can't be align16.
Fixes vs-acos-vec3 and friends.
2011-08-16 13:04:43 -07:00
Eric Anholt
6408b0295f i965/vs: Fix implementation of ir_unop_any.
We were inheriting whatever previous predicate existed.
2011-08-16 13:04:42 -07:00
Eric Anholt
7b91eefe7c i965/vs: Slightly improve the trivial reg allocator to skip unused regs.
This fixes most of the regressions in the vs array test set from the
varying array indexing work, since the giant array that was originally
allocated in virtual GRF space never gets used and is only ever
read/stored from scratch space.
2011-08-16 13:04:42 -07:00
Eric Anholt
e94bdbe04a i965: Add gen6 disassembly for DP render cache messages. 2011-08-16 13:04:42 -07:00
Eric Anholt
54fa706d6f i965/vs: Enable variable array indexing in the VS. 2011-08-16 13:04:42 -07:00
Eric Anholt
584ff40748 i965/vs: Add support for scratch read/write codegen. 2011-08-16 13:04:42 -07:00
Eric Anholt
0f22f98ccd i965: Make some EU emit code for DP read/write messages non-static.
We keep building these strange interfaces for DP read/write where
there's a helper function with some partially-specific,
partially-general controls, which is used in exactly one place in code
generation.  Making these public will let us set up those instructions
in the one place they're to be generated.
2011-08-16 13:04:42 -07:00
Eric Anholt
d0e4d71070 i965/vs: Move virtual GRFs with array accesses to them to scratch space. 2011-08-16 13:04:42 -07:00
Eric Anholt
758c3c2b45 i965/vs: Reserve MRF 14/15 for array loads/register unspilling. 2011-08-16 13:04:42 -07:00
Eric Anholt
1ff4f11dd9 i965/vs: Track the variable index of array accesses.
This isn't used currently, as we lower all array accesses.
2011-08-16 13:04:42 -07:00
Eric Anholt
314c2574ff i965: Add remaining scratch space setup emit to unit states. 2011-08-16 13:04:42 -07:00
Eric Anholt
2b224d66a0 i965: Set up allocation of a VS scratch space if required. 2011-08-16 13:04:42 -07:00
Eric Anholt
e355b179b2 i965: Remove dead brw->wm.max_threads field. 2011-08-16 13:04:42 -07:00
Eric Anholt
160a5a3ff0 i965/vs: Add support for VUEs larger than a single URB write.
Fixes glsl-max-varyings.
2011-08-16 13:04:42 -07:00
Eric Anholt
31ef2e3ec2 i965/vs: Avoid generating extra moves when setting up large ir_constants.
We were also screwing up the types in the process, and just not
emitting moves was easier.
2011-08-16 13:04:42 -07:00
Eric Anholt
aba9801996 i965/vs: Fix types of varying outputs.
For structs/arrays/matrices, they were ending up as uint because we
forgot to set them.  All varyings in GLSL 1.20 are of base type float,
so just force the matter here (which gets inherited at
emit_urb_writes() time).

Fixes vs-varying-array-mat2-col-rd.
2011-08-16 13:04:42 -07:00
Eric Anholt
9790726131 i965/vs: Handle assignment of structures/arrays/matrices better.
This gets the right types on the instructions, as well as emitting
minimal swizzles/writemasks.
2011-08-16 13:04:42 -07:00
Eric Anholt
930afd1774 i965/vs: Don't forget to set up assignment condition code for arrays/structs.
Fixes vs-uniform-array-mat2-index-col-rd.
2011-08-16 13:04:42 -07:00
Eric Anholt
cda28bca0d i965/vs: Apply the gen6 math workaround for math1 instructions.
Fixes glsl-vs-masked-cos.
2011-08-16 13:04:42 -07:00
Eric Anholt
2b7632aeaa i965/vs: Add support for if(any_nequal()) and if(all_equal()) on gen6.
Fixes vs-temp-array-mat2-col-rd.shader_test.
2011-08-16 13:04:42 -07:00
Eric Anholt
c3752b399a i965/vs: Add support for dot product opcodes.
Fixes glsl-vs-dot-vec2.
2011-08-16 13:04:42 -07:00
Eric Anholt
8e947c2546 i965/vs: Fix the types of array/struct dereferences.
Fixes glsl-vs-arrays-3.
2011-08-16 13:04:42 -07:00
Eric Anholt
814a9bef30 i965/vs: Drop the assertion about dst.reg_offset == 0.
Adding the offset is the right thing to do here, and fixes
glsl-vs-mat-add-1.
2011-08-16 13:04:42 -07:00
Eric Anholt
e5363c7fd2 i965/vs: Use an appropriate swizzle on src regs from variables.
Fixes glsl-vs-if-bool.
2011-08-16 13:04:42 -07:00
Eric Anholt
eca762d831 i965/vs: Fix support for zero uniforms in use.
We were looking for attributes in the wrong place, and pointlessly
doing the work on gen6 at all.
2011-08-16 13:04:42 -07:00
Eric Anholt
164ccd2778 i965/vs: Fix support for "IF" instructions by copying brw_fs_visitor.cpp.
Fixes glsl-vs-if-greater.
2011-08-16 13:04:41 -07:00
Eric Anholt
aa753c5a14 i965/vs: Disable loops for now until rendering is generally correct. 2011-08-16 13:04:41 -07:00
Eric Anholt
bb468fc1ed i965/vs: Fix ir_swizzle handling.
I decided to refactor it a bit in adapting ir_to_mesa.cpp code, and
mangled it.  Fixes glsl-vs-cross-2.
2011-08-16 13:04:41 -07:00
Eric Anholt
78fac1892a i965/vs: Allocate storage for "auto" variables just like temps.
Fixes segfault in glsl-vs-cross-2.
2011-08-16 13:04:41 -07:00
Eric Anholt
82aa9299fb i965/vs: Allow scalar values in assignments, too.
Fixes glsl-vs-all-02 and many other tests.
2011-08-16 13:04:41 -07:00
Eric Anholt
c0f334a3ed i965/vs: Don't emit an extra copy of the vertex position.
Fixes glsl-vs-abs-neg, glsl-vs-all-01, and probably many other tests.
2011-08-16 13:04:41 -07:00
Eric Anholt
4a4857246c i965/vs: Port the fix for clip plane writemasks from brw_vs_emit.c. 2011-08-16 13:04:41 -07:00
Eric Anholt
83d5850518 i965/vs: Fix constant vector construction.
Fixes some issues noticed in glsl-vs-all-01.
2011-08-16 13:04:41 -07:00
Eric Anholt
a070d5f363 i965/vs: Start adding support for uniforms
There's no clever packing here, no pull constants, and no array support.
2011-08-16 13:04:41 -07:00
Eric Anholt
af3c9803d8 i965: Start adding the VS visitor and codegen.
The low-level IR is a mashup of brw_fs.cpp and ir_to_mesa.cpp.  It's
currently controlled by the INTEL_NEW_VS=1 environment variable, and
only tested for the trivial "gl_Position = gl_Vertex;" shader so far.
2011-08-16 13:04:41 -07:00
Eric Anholt
65b5cbbcf7 i965: Rename math FS_OPCODE_* to SHADER_OPCODE_*.
I want to just use the same enums in the VS.
2011-08-16 13:04:41 -07:00
Eric Anholt
6034b9a512 i965: Create a shared enum for hardware and compiler-internal opcodes.
This should make gdbing more pleasant, and it might be used in sharing
part of the codegen between the VS and FS backends.
2011-08-16 13:04:41 -07:00
Eric Anholt
c1f00731fd i965: Generate driver-specific IR for non-fragment shaders as well.
This will be used by the new vertex shader backend.  The scalarizing
passes are skipped for non-fragment, since vertex and geometry threads
are based on vec4s.
2011-08-16 13:04:41 -07:00
Brian Paul
11e4ea0010 mesa: ChooseTextureFormat() returns gl_format, not GLuint 2011-08-16 13:05:34 -06:00
Paul Berry
af501e2b29 glsl: Fix type error when lowering integer divisions
This patch fixes a bug when lowering an integer division:

  x/y

to a multiplication by a reciprocal:

  int(float(x)*reciprocal(float(y)))

If x was a plain int and y was an ivecN, the lowering pass
incorrectly assigned the type of the product to be float, when in fact
it should be vecN.  This caused mesa to abort with an IR validation
error.

Fixes piglit tests {fs,vs}-op-div-int-ivec{2,3,4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-16 11:00:46 -07:00
Marek Olšák
9e8f556b19 softpipe: fix an obvious copy-paste error in get_query_result
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-16 19:56:29 +02:00
Marek Olšák
5e7713caa9 st/dri: remove an unused-but-set variable 2011-08-16 19:39:59 +02:00
Marek Olšák
4a47662bea r600g: rename bc -> bytecode
It took me a while to figure out what it stands for.
2011-08-16 19:39:59 +02:00
Benjamin Franzke
61d2dfbe48 egl: Add include paths for platform autodetection
Needed since commit 85fe9484.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40145
2011-08-16 19:28:07 +02:00
Cooper Yuan
f272117def dri2: check if context is valid before flushing the pipe 2011-08-16 20:37:13 +08:00
Marek Olšák
e3be513118 r600g: expose ARB_ES2_compatibility by claiming fixed-point format support
I also needed to make some changes in u_vbuf_mgr in order to override
the caps from the driver and enable the fallback even though the driver
claims the format is supported.
2011-08-16 09:15:11 +02:00
Marek Olšák
21c5d11b7e noop: redirect the get_param/is_format.. queries to the underlying driver 2011-08-16 09:15:11 +02:00
Marek Olšák
363295d720 u_blitter: restore some states conditionally 2011-08-16 09:15:11 +02:00
Marek Olšák
233dd4953e u_blitter: rename util_blitter_copy_region -> util_blitter_copy_texture 2011-08-16 09:15:11 +02:00
Marek Olšák
a77431b3b0 r600g: consolidate two files r600d.h 2011-08-16 09:15:11 +02:00
Marek Olšák
47dcfb8dab r600g: set read/write usage flags for each relocation
This takes advantage of the new GEM_WAIT ioctl when mapping buffers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
ebfcc58b93 winsys/radeon: take advantage of the new ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
1e3c81a068 winsys/radeon: hook up the new DRM_RADEON_GEM_WAIT ioctl
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
296b899095 winsys/radeon: remove broken bo-is-busy-for-write guessing
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
c79e9f0ed5 r600g: enable thread offloading
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
0bbbd82488 r600g: undefine RADEON_CTX_MAX_PM4
winsys/radeon has its own definition.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
d6da5185f9 r600g: don't include radeon_drm.h and xf86drm.h
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
efbccfeca0 winsys/radeon: remove the device file descriptor from the interface
r600g doesn't need it anymore.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
041ed559e1 r600g: remove an unused parameter from r600_bo_destroy
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
c6fec83726 r600g: merge radeon_bo with r600_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
5229ba494b r600g: remove radeon_bo::handle
This should be private to radeon_winsys.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
ab630b5768 r600g: use buffer_map/unmap from radeon_winsys
This also drops the unneeded bo_busy/wait functions.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
e2e1dc9e66 r600g: set the flush callback in radeon_winsys
I have also renamed the winsys function.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
7ee65800c3 r600g: get tiling flags using radeon_winsys
Also remove some unused fence-related leftovers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
ecfcf25387 r600g: get winsys_handle using radeon_winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
1b542aca6e r600g: move more DRM queries into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:11 +02:00
Marek Olšák
03b25ad8ff winsys/radeon: consolidate the add_reloc function
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
e6fb62594f r600g: emit CS using radeon_winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
685b8345a8 r600g: remove struct r600_reloc
That is really private to winsys/radeon.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
1acaf09778 r600g: don't use RADEON_GEM_DOMAIN_CPU
Also staging resources shouldn't be allocated with the initial domain
being VRAM.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
3e57972216 r600g: remove reloc-related variables from radeon_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
638d75185e r600g: let radeon_winsys maintain the list of relocations
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
9865b1ec8c r600g: remove now-unused r600_context::fenced_bo
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
591d8c3350 r600g: remove the fences which were used for the cache buffer manager
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
cdbb8a195a r600g: remove now-unused r600_bo::size
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
60ff68ad00 r600g: remove the cache buffer manager from winsys/r600
As we've just started using the one from winsys/radeon.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
11daa7e325 r600g: allocate/destroy buffers using radeon_winsys
We use the cache buffer manager from radeon_winsys now, but we don't use
anything else yet.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
edca57e533 r600g: remove unused function declarations
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
39db886548 r600g: remove unused r600_bo::tiling_flags
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
c092e236cc r600g: remove unused r600_bo::kernel_pitch
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
2ce783d8dd r600g: put radeon_winsys in screen::winsys, don't include drm_driver in the pipe
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
354f76f386 r600g: cleanup includes in winsys
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
fb8cf51eeb r600g: move some queries into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Marek Olšák
ce12f82692 r600g: first step into winsys/radeon
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-16 09:15:10 +02:00
Benjamin Franzke
8c40940321 dri2: Add __DRI_BUFFER_COUNT token
Remove definition from egl_dri2.
Defining this is egl_dri2.h breaks as soon as
a new dri2 buffer token is added like with commit
4501a5d6e8.
2011-08-16 09:06:41 +02:00
Cooper Yuan
9b784069ce dri2: add code to dri2_Flush extension.
It's going to flush client's commands in eglWaitClient(). Before this,
egl applications using pixmap or pbuffer flicker because of no flush.

Reviewed-by: Alan Hourihane
2011-08-16 09:32:10 +08:00
Eric Anholt
a313c29c77 glsl: When assigning to a whole array, mark the array as accessed.
The vs-varying-array-mat2-col-row-wr test writes a mat2[3] constant to
a mat2[3] varying out array, and also statically accesses element 1 of
it on the VS and FS sides.  At link time it would get trimmed down to
just 2 elements, and then codegen of the VS would end up generating
assignments to the unallocated last entry of the array.  On the new
i965 VS backend, that happened to land on the vertex position.

Some issues remain in this test on softpipe, i965/old-vs and
i965/new-vs on visual inspection, but i965 is passing because only one
green pixel is probed, not the whole split green/red quad.
2011-08-15 17:54:27 -07:00
Eric Anholt
5880a9a4a7 radeon: Explain to the user what went wrong when built without libdrm.
Before this commit, even LIBGL_DEBUG=verbose would just fail with:
libGL error: failed to create dri screen
2011-08-15 17:54:27 -07:00
Paul Berry
303e05cc24 glsl: Add validations for ir_call.
This patch extends ir_validate.cpp to check the following
characteristics of each ir_call:

- The number of actual parameters must match the number of formal
  parameters in the signature.

- The type of each actual parameter must match the type of the
  corresponding formal parameter in the signature.

- Each "out" or "inout" actual parameter must be an lvalue.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-15 17:23:02 -07:00
Paul Berry
a52b53b56e glsl: Make is_lvalue() and variable_referenced() const.
These functions don't modify the target instruction, so it makes sense
to make them const.  This allows these functions to be called from ir
validation code (which uses const to ensure that it doesn't
accidentally modify the IR being validated).

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-15 17:23:02 -07:00
Paul Berry
67b5a3267d glsl: Perform implicit type conversions on function call out parameters.
When an out parameter undergoes an implicit type conversion, we need
to store it in a temporary, and then after the call completes, convert
the resulting value.  In other words, we convert code like the
following:

void f(out int x);
float value;
f(value);

Into IR that's equivalent to this:

void f(out int x);
float value;
int out_parameter_conversion;
f(out_parameter_conversion);
value = float(out_parameter_conversion);

This transformation needs to happen during ast-to-IR convertion (as
opposed to, say, a lowering pass), because it is invalid IR for formal
and actual parameters to have types that don't match.

Fixes piglit tests
spec/glsl-1.20/compiler/qualifiers/out-conversion-int-to-float.vert and
spec/glsl-1.20/execution/qualifiers/vs-out-conversion-*.shader_test,
and bug 39651.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39651

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-08-15 17:23:01 -07:00
Kenneth Graunke
c548192caf docs: Remove GLw from the documentation except for a new FAQ entry.
Also remove an outdated reference to GLEW being in tree.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-15 13:37:27 -07:00
Kenneth Graunke
63720114b4 glw: Remove GLw source.
libGLw is an old OpenGL widget library with optional Motif support.
It almost never changes and very few people actually still care about
it, so we've decided to ship it separately.

The new home for libGLw is: git://git.freedesktop.org/mesa/glw/

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-15 13:37:09 -07:00
Ian Romanick
a352e2d08e glsl: Modify strategy for accumulating conditions when lowering if-statements
Previously if-statements were lowered from inner-most to outer-most
(i.e., bottom-up).  All assignments within an if-statement would have
the condition of the if-statement appended to its existing condition.
As a result the assignments from a deeply nested if-statement would
have a very long and complex condition.

Several shaders in the OpenGL ES2 conformance test suite contain
non-constant array indexing that has been lowered by the shader
writer.  These tests usually look something like:

    if (i == 0) {
        value = array[0];
    } else if (i == 1) {
        value = array[1];
    } else ...

The IR for the last assignment ends up as:

    (assign (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition) ) (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition@20) ) (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition@22) ) (expression bool && (expression bool ! (var_ref if_to_cond_assign_condition@24) ) (var_ref if_to_cond_assign_condition@26) ) ) ) )  (x) (var_ref value) (array_ref (var_ref array) (constant int (5)))

The Mesa IR that is generated from this is just as awesome as you
might expect.

Three changes are made to the way if-statements are lowered.

1. Two condition variables, if_to_cond_assign_then and
if_to_cond_assign_else, are created for each if-then-else structure.
The former contains the "positive" condition, and the later contains
the "negative" condtion.  This change was implemented in the previous
patch.

2. Each condition variable is added to a hash-table when it is created.

3. When lowering an if-statement, assignments to existing condtion
variables get the current condition anded.  This ensures that nested
condition variables are only set to true when the condition variable
for all outer if-statements is also true.

Changes #1 and #3 combine to ensure the correctness of the resulting
code.

4. When a condition assignment is encountered with a condition that is
a dereference of a previously added condition variable, the condition
is not modified.

Change #4 prevents the continuous accumulation of conditions on
assignments.

If the original if-statements were:

    if (x) {
        if (a && b && c && d && e) {
            ...
        } else {
            ...
        }
    } else {
        if (g && h && i && j && k) {
            ...
        } else {
            ...
        }
    }

The lowered code will be

    if_to_cond_assign_then@1 = x;
    if_to_cond_assign_then@2 = a && b && c && d && e
        && if_to_cond_assign_then@1;
    ...
    if_to_cond_assign_else@2 = !if_to_cond_assign_then
        && if_to_cond_assign_then@1;
    ...

    if_to_cond_assign_else@1 = !if_to_cond_assign_then@1;
    if_to_cond_assign_then@3 = g && h && i && j;
        && if_to_cond_assign_else@1;
    ...
    if_to_cond_assign_else@3 = !if_to_cond_assign_then
        && if_to_cond_assign_else@1;
    ...

Depending on how instructions are emitted, there may be an extra
instruction due to the duplication of the '&&
if_to_cond_assign_{then,else}@1' on the nested else conditions.  In
addition, this may cause some unnecessary register pressure since in
the simple case (where the nested conditions are not complex) the
nested then-condition variables are live longer than strictly
necessary.

Before this change, one of the shaders in the OpenGL ES2 conformance
test suite's acos_float_frag_xvary generated 348 Mesa IR instructions.
After this change it only generates 124.  Many, but not all, of these
instructions would have also been eliminated by CSE.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:27 -07:00
Ian Romanick
4a026d6ba5 glsl: Slight change to the code generated by if-flattening
Now the condition (for the then-clause) and the inverse condition (for
the else-clause) get written to separate temporary variables.  In the
presence of complex conditions, this shouldn't result in more code
being generated.  If the original if-statement was

    if (a && b && c && d && e) {
        ...
    } else {
        ...
    }

The lowered code will be

   if_to_cond_assign_then = a && b && c && d && e;
   ...
   if_to_cond_assign_else = !if_to_cond_assign_then;
   ...

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:26 -07:00
Ian Romanick
13df36ecb6 glsl: Replace foreach_iter with foreach_list_safe
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:26 -07:00
Ian Romanick
5c84378541 glsl: Make move_block_to_cond_assign not care which branch it's processing
This will make some future changes a bit easier to digest.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-15 11:44:26 -07:00
Benjamin Franzke
2e71c7d4ff egl: Log (debug) native platform type
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-08-15 09:42:16 +02:00
Benjamin Franzke
85fe948494 egl: Native Display autodetection
EGL doesnt define howto manage different native platforms.
So mesa has a builtime configurable default platform,
whith non-standard envvar (EGL_PLATFORM) overwrites.
This caused unneeded bugreports, when EGL_PLATFORM was forgotten.

Detection is grouped into basic types of NativeDisplays (which itself
needs to be detected).  The final decision is based on characteristcs
of these basic types:

  File Desciptor based platforms (fbdev):
    - fstat(2) to check for being a fd that belongs to a character device
    - check kernel subsystem (todo)

  Pointer to structuctures (x11, wayland, drm/gbm):
    - mincore(2) to check whether its valid pointer to some memory.
    - magic elements (e.g. pointers to exported symbols):
      o wayland display stores interface type pointer (first elm.)
      o gbm stores pointer to its constructor (first elm.)
      o x11 as a fallback (FIXME?)

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-08-15 09:42:16 +02:00
Cooper Yuan
f5e757ea60 Destroy context in dri2/glx driver when apps call eglDestroyContext 2011-08-14 15:14:17 +08:00
Chia-I Wu
e09b706c9e glapi: remove gen-es
Not used anymore.
2011-08-13 15:14:24 +08:00
Chia-I Wu
6eff33dc7f glapi: generate ES dispatch headers from core mesa
GLESv1 and GLESv2 have their own dispatch.h and remap_helper.h.  These
headers are only used by api_exec_es1.c and api_exec_es2.c in core mesa.
Move the rules to generate them from glapi to core mesa.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: updated after reviewing to fix SCons build]
2011-08-13 15:14:00 +08:00
Chia-I Wu
786e5a2fb4 glapi: add glapi_gen.mk to help header generation
glapi_gen.mk is supposed to be included by glapi users to simplify
header generation.  This commit also makes es1api, es2api, and
shared-glapi use it.

Reviewed-by: Brian Paul <brianp@vmware.com>

[olv: updated after reviewing to prefix all variables in glapi_gen.mk by
 glapi_gen]
2011-08-13 13:57:10 +08:00
Chia-I Wu
5076561b35 glapi: use gl_and_es_API.xml to generate GLES headers
glapi/gen-es/ defines two sets of GLAPI XMLs for OpenGL ES 1.1
(es1_API.xml) and 2.0 (es2_API.xml) respectively.  They are used to
generate dispatch.h and remap_helper.h for GLES.  Together with
gl_and_es_API.xml, we have to maintain three sets of GLAPI XMLs.

This commit makes dispatch.h and remap_helper.h for GLES be generated
from gl_and_es_API.xml.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-13 13:54:57 +08:00
Chia-I Wu
b8202b3d44 glapi: add methods to filter functions
add gl_api::filter_functions and gl_function::filter_entry_points to
filter out unwanted functions and entry points.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-13 13:54:54 +08:00
Chia-I Wu
281947b351 glapi: add gles_api.py
Move the list of entry points belong to GLES from mapi_abi.py to a new
file.

Until we figure out how to describe the APIs an entry point belongs to
in the XML file, and how to handle the case where an entry point others
alias is missing in some APIs, this is an easier solution than
maintaining another two sets of XMLs in glapi/gen-es/.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-13 13:54:30 +08:00
Michel Dänzer
3ce243879a gallium/gbm: Add dependencies for libraries linked into pipe_*.so.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2011-08-12 11:10:56 +02:00
Chad Versace
9cd64ec35a x86-64: Fix compile error with clang
Remove the 'f' suffix from a float literal.
    - .float 0.0f+1.0
    + .float 1.0

This fixes the following compile error with clang:
    error: unexpected token in directive
    .float 0.0f+1.0
              ^

Note: This is a candidate for the stable branches.
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-11 09:33:41 -07:00
Brian Paul
099aad2fb0 mesa: fix initialization of GL_FOG_MODE in _mesa_init_driver_state() 2011-08-11 09:05:53 -06:00
Brian Paul
9b8287f8f5 mesa: fix ColorMask array index in _mesa_init_driver_state()
This doesn't really make any difference because all the colormasks
are the same upon context set-up, but it makes more sense.
2011-08-11 09:04:48 -06:00
Brian Paul
37a64baea8 swrast: don't try to do depth testing if there's no depth buffer
Fixes piglit hiz-depth-stencil-test-fbo-d0-s8 crash.
See http://bugs.freedesktop.org/show_bug.cgi?id=37907

NOTE: This is a candidate for the 7.11 branch.
2011-08-11 08:53:17 -06:00
Andreas Fänger
e411cd7b0a swrast: initial multi-threaded span rendering
Optional parallel rendering of spans using OpenMP.
Initial implementation for aa triangles. A new option for scons is
also provided to activate the openmp support (off by default).

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-11 08:33:59 -06:00
Ben Widawsky
fa351bd2e0 intel: GetBuffer fix
After copy buffer on preGEN6, it is necessary to wait for the blit to
complete before returning data to the user.

This should fix the piglit test: copy_buffer_coherency (pre-GEN6).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-10 16:07:40 -07:00
Lauri Kasanen
df7859be6b r600g: Add support for ROUND, v2
This is a GLSL 1.3 feature, but also used by MLAA.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
2011-08-10 16:08:59 -04:00
Carl Simonson
09eeb0ff27 i830: Add missing vtable entry for i830 from the hiz work. 2011-08-10 11:10:43 -07:00
Eric Anholt
c9e81fe14f i965: Drop the reg/hw_reg distinction.
"reg" was set in only one case, virtual GRFs pre register allocation,
and would be unset and have hw_reg set after allocation.  Since we
never bothered with looking at virtual GRF number after allocation
anyway, just use the same storage and avoid confusion.
2011-08-10 11:03:48 -07:00
Eric Anholt
b1f0bffd39 i965/fs: Factor out the register allocator setup to a separate function.
Besides separating out a logical step of the giant register allocator
function, this now communicates a bunch of the allocator information
through entries in brw_context, which will make this code partially
reusable for caching the expensive allocator setup.
2011-08-10 11:03:48 -07:00
Eric Anholt
4e10d5825b i965/fs: Simplify the register allocator using a map from RA reg to GRF.
It's fewer pointers to track, and when we start caching the register
set, should be algorithmically better in the cache hit case (lookup in
a byte-per-register array, instead of a linear walk through
desctiption of register classes to find how to translate that class).
2011-08-10 11:03:48 -07:00
Eric Anholt
b76378d46a i965/fs: Eliminate the magic nature of virtual GRF 0.
This was a debugging aid at one point -- virtual grf 0 should never be
allocated, and it would be used if undefined register access occurred
in codegen.  However, it made the confusing register allocation code
even more confusing by indexing things off of 1 all over.
2011-08-10 11:03:48 -07:00
Eric Anholt
bbcf13adbe i965/fs: Use the new convenience interface for setting up reg conflicts.
That code I wrote was impenetrable, and hard to write the first time.
This makes things a lot more obvious.
2011-08-10 11:03:48 -07:00
Eric Anholt
fa43477fa3 mesa: Add a convenience interface for register allocator conflicts setup. 2011-08-10 11:03:48 -07:00
Henri Verbeet
e6c64800cc glsl_to_tgsi: improve assignment hack
Fixes StarCraft 2 and Fallout 3 in Wine.
2011-08-09 12:35:26 -05:00
Brian Paul
32faaea743 r300g: silence some warnings about uninitialized variables 2011-08-09 09:04:10 -06:00
Brian Paul
971905bf39 svga: add missing switch case for PIPE_SHADER_CAP_INTEGERS 2011-08-09 08:58:47 -06:00
Brian Paul
e0496b63ff glx: move declarations before code 2011-08-09 08:58:20 -06:00
Fabio Pedretti
afd1d85775 swrast: silence unused var warnings
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-08-09 08:08:59 -06:00
Dave Airlie
36291173c2 docs: update GL3.txt with new GL 4.2 extensions 2011-08-09 10:39:52 +01:00
Paul Berry
c148ef6ddb glsl: validate IR after linking (debug builds only)
At least one of the invariants verified by IR validation concerns the
relative ordering of toplevel constructs in the IR: references to
global variables must come after the declarations of those global
variables.

Since linking affects the ordering of toplevel constructs in the IR,
it's possible that a bug in the linker will cause invalid IR to be
generated, even if all the pre-linked shaders are valid.  (In fact,
such a bug was fixed by the previous commit.)

Bugs like this are easily masked by further optimization passes,
particularly inlining.  So to make them easier to track down, this
patch addes an IR validation step right after linking, and before
final optimization occurs.  The validation only occurs on debug
builds.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:44:02 -07:00
Paul Berry
01a851c296 glsl: When linking, emit functions at the tail of the final linked program.
When link_functions.cpp adds a new function to the final linked
program, it needs to add it after any global variable declarations
that the function refers to, otherwise the IR will be invalid (because
variable declarations must occur before variable accesses).  The
easiest way to do that is to have the linker emit functions to the
tail of the final linked program.

The linker used to emit functions to the head of the final linked
program, in an effort to keep callees sorted before their callers.
However, this was not reliable: it didn't work for functions declared
or defined in the same compilation unit as main, for diamond-shaped
patterns in the call graph, or for some obscure cases involving
overloaded functions.  And no code currently relies on this sort
order.

No Piglit regressions with i965 Ironlake.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:57 -07:00
Paul Berry
d4144a123b glsl: Check array size is const before asserting that no IR was generated.
process_array_type() contains an assertion to verify that no IR
instructions are generated while processing the expression that
specifies the size of the array.  This assertion needs to happen
_after_ checking whether the expression is constant.  Otherwise we may
crash on an illegal shader rather than reporting an error.

Fixes piglit tests array-size-non-builtin-function.vert and
array-size-with-side-effect.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:53 -07:00
Paul Berry
789ee6516b glsl: Constant-fold built-in functions before outputting IR
Rearranged the logic for converting the ast for a function call to
hir, so that we constant fold before emitting any IR.  Previously we
would emit some IR, and then only later detect whether we could
constant fold.  The unnecessary IR would usually get cleaned up by a
later optimization step, however in the case of a builtin function
being used to compute an array size, it was causing an assertion.

Fixes Piglit test array-size-constant-relational.vert.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38625
2011-08-08 12:43:45 -07:00
Paul Berry
0d81b0e184 glsl: Emit function signatures at toplevel, even for built-ins.
The ast-to-hir conversion needs to emit function signatures in two
circumstances: when a function declaration (or definition) is
encountered, and when a built-in function is encountered.

To avoid emitting a function signature in an illegal place (such as
inside a function), emit_function() checked whether we were inside a
function definition, and if so, emitted the signature before the
function definition.

However, this didn't cover the case of emitting function signatures
for built-in functions when those built-in functions are called from
inside the constant integer expression that specifies the length of a
global array.  This failed because when processing an array length, we
are emitting IR into a dummy exec_list (see process_array_type() in
ast_to_hir.cpp).  process_array_type() later checks (via an assertion)
that no instructions were emitted to the dummy exec_list, based on the
reasonable assumption that we shouldn't need to emit instructions to
calculate the value of a constant.

This patch changes emit_function() so that it emits function
signatures at toplevel in all cases.

This partially fixes bug 38625
(https://bugs.freedesktop.org/show_bug.cgi?id=38625).  The remainder
of the fix is in the patch that follows.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:38 -07:00
Paul Berry
482338842d Revert "glsl: Skip processing the first function's body in do_dead_functions()."
opt_dead_functions contained a shortcut to skip processing the first
function's body, based on the assumption that IR functions are
topologically sorted, with callees always coming before their callers
(therefore the first function cannot contain any calls).

This assumption turns out not to be true in general.  For example, the
following code snippet gets translated to IR that violates this
assumption:

    void f();
    void g();
    void f() { g(); }
    void g() { ... }

In practice, the shortcut didn't cause bugs because of a coincidence
of the circumstances in which opt_dead_functions is called:

(a) we do inlining right before dead function elimination, and
    inlining (when successful) eliminates all calls.

(b) for user-defined functions, inlining is always successful, because
    previous optimization passes (during compilation) have reduced
    them to a form that is eligible for inlining.

(c) the function that appears first in the IR can't possibly call a
    built-in function, because built-in functions are always emitted
    before the function that calls them.

It seems unnecessarily fragile to have opt_dead_functions depend on
these coincidences.  And the next patch in this series will break (c).
So I'm reverting the shortcut.  The consequence will be a slight
increase in link time for complex shaders.

This reverts commit c75427f4c8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-08 12:43:04 -07:00
Bryan Cain
ffb7d02154 st/mesa: inline st_prepare_fragment_program in st_translate_fragment_program
This reverts an unnecessary part of commit 4683529048 and fixes misrendering
and an assertion failure in Cogs.

Fixes freedesktop.org bug 39888.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-08 10:28:59 -05:00
Brian Paul
506de19549 glext: upgrade to version 72 2011-08-08 09:01:13 -06:00
Brian Paul
75a9874021 glsl: silence warning about trailing comma in enum list 2011-08-08 09:00:57 -06:00
Brian Paul
7d4d8a8de7 gallium: silence warnings about trailing commas in enum lists 2011-08-08 09:00:06 -06:00
Brian Paul
8488112d20 mesa: whitespace changes 2011-08-08 08:26:49 -06:00
Christoph Bumiller
4dd3272df9 d3d1x: adapt to resource_resolve interface change 2011-08-07 15:34:34 +02:00
Christoph Bumiller
9e466e87e6 nv50,nvc0: never convert in resource copy when format sizes match
If there are any cases left where the st thinks that RGBA -> BGRA
will swap components, it will get what it deserves.

Now the GPU's 2D engine goes unused. What a shame.
2011-08-07 15:34:34 +02:00
Christoph Bumiller
425b179faf st/mesa: don't resolve stencil twice 2011-08-07 15:34:34 +02:00
Marek Olšák
1554e69e00 winsys/radeon: disable use of the buffer busy-for-write flag 2011-08-06 05:45:19 +02:00
Kenneth Graunke
db726b048e mesa: In validate_program(), initialize errMsg for safety.
validate_program relies on validate_shader_program to fill in errMsg;
empirically, there exist cases where that doesn't happen.

While tracking those down may be worthwhile, initializing the string so
we don't try to ralloc_strdup random garbage also seems wise.

Fixes issues caught by valgrind while running some test case.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-05 14:19:39 -07:00
Eric Anholt
a9e97d022c intel: Fix warnings from gl_constant_parameter changes. 2011-08-05 12:56:12 -07:00
Bryan Cain
5164244df0 glsl_to_tgsi: replace open-coded swizzle_for_size()
This is a port of commit 4c7e215c7b to glsl_to_tgsi.
2011-08-05 14:39:18 -05:00
Bryan Cain
b44648c918 glsl_to_tgsi: try to avoid emitting a MOV_SAT to saturate an expression tree
This is a port of commit 62722d9 to glsl_to_tgsi, with minor aesthetic
changes (moved the declaration and assignment of new_inst inside the if block).
2011-08-05 14:39:18 -05:00
Eric Anholt
4c7e215c7b ir_to_mesa: Replace open-coded swizzle_for_size() 2011-08-05 10:37:15 -07:00
Christopher James Halse Rogers
fbc2fcf685 glx/dri2: Paper over errors in DRI2Connect when indirect
DRI2 will throw BadRequest for this when the client is not local, but
DRI2 is an implementation detail and not something callers should have
to know about.  Silently swallow errors in this case, and just propagate
the failure through DRI2Connect's return code.

Note: This is a candidate for the stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2011-08-05 10:11:05 -07:00
Eric Anholt
62722d90af ir_to_mesa: Try to avoid emitting a MOV_SAT to saturate an expression tree.
Fixes a regression in codegen quality for ff_fragment_shader
conversion to GLSL -- glean texCombine produces 7.5% fewer Mesa IR
instructions.
2011-08-05 10:08:31 -07:00
Eric Anholt
6bd5f43f21 prog_optimize: Add support for saturates to _mesa_merge_mov_into_inst.
This fixes the remaining regression from ff_fragment_shader in Mesa IR
instruction count, to now being a 1.9% win overall.
2011-08-05 10:08:31 -07:00
Eric Anholt
9998df36c2 i965: Add dumping for gen6 WM constants too.
This looks just like the VS dump for now.
2011-08-05 10:08:31 -07:00
Eric Anholt
69dc529da2 mesa: Remove dead "MemPool" field of gl_shader_state. 2011-08-05 10:08:31 -07:00
Eric Anholt
ee0373b833 i965/fs: Don't upload unused uniform components.
This saves both register space and upload bandwidth for unused values.

Note that previously we were relying on the visitor not initially
generating references to different sets of uniforms between the 8-wide
and 16-wide code generation, and now we're relying on them dead-code
eliminating the same stuff, too.
2011-08-05 10:08:31 -07:00
Eric Anholt
0722edc59c i965/fs: Don't allocate the old backend's compile structs for our compile.
This saves some 35MB when the program only uses GLSL shaders.
2011-08-05 10:08:31 -07:00
Marek Olšák
5b005ecc2b winsys/radeon: do the CS cleanup in the CS ioctl thread 2011-08-05 07:08:18 +02:00
Marek Olšák
64ab39b035 winsys/radeon: fix space checking
We should remove the relocations which caused a validation failure
from the list, so that the kernel receives only the validated ones.

NOTE: This is a candidate for the 7.11 branch.
2011-08-05 07:08:18 +02:00
Marek Olšák
115651241b st/dri: remove an unused-but-set variable 2011-08-05 07:08:18 +02:00
Marek Olšák
a3cde50eff st/dri: remove a dummy function dri2_create_context
It does nothing besides calling dri_create_context with the same parameters.
2011-08-05 07:05:24 +02:00
Marek Olšák
6e7942936c st/mesa: remove unused-but-set variables in st_glsl_to_tgsi.cpp 2011-08-05 07:05:24 +02:00
Marek Olšák
d99c8e191b r300g: handle new CAPs 2011-08-05 07:05:24 +02:00
Marek Olšák
6b3bbf52b8 r300g: adapt to the resource_resolve interface change 2011-08-05 07:05:24 +02:00
Marek Olšák
c251d83d91 vbo: do not call _mesa_max_buffer_index in debug builds
That code drops performance in Unigine Heaven and Tropics
by a factor of 10. That's too crazy even for a debug build.

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-08-05 07:05:24 +02:00
Chia-I Wu
547212d963 glsl: empty declarations should be valid
Unlike C++, empty declarations such as

  float;

should be valid.  The spec is not explicit about this actually.

Some apps that generate their shader sources may rely on this.  This was
noted when porting one of them to Linux from Windows.

Reviewed-by: Chad Versace <chad@chad-versace.us>

Note: this is a candidate for the 7.11 branch.
2011-08-05 12:14:24 +09:00
Vinson Lee
a48118e510 mesa: Remove MSVC stdint typedefs from compiler.h.
MSVC can now include the stdint.h at include/c99/stdint.h.
2011-08-04 18:06:18 -07:00
Brian Paul
bf8d06c518 mesa: pass correct constant type to _mesa_fetch_state()
Fixes assorted warnings about float vs. gl_constant_value pointers.
2011-08-04 16:02:08 -06:00
Brian Paul
324857599b mesa: use gl_constant_value type in ARB program parser 2011-08-04 16:00:06 -06:00
Brian Paul
a0eb83401e mesa: use gl_constant_value type in _mesa_[Get]ProgramNamedParameter4fNV() 2011-08-04 15:55:50 -06:00
Brian Paul
d7f2e38fca mesa: add st_glsl_to_tgsi.cpp to Sconscript 2011-08-04 15:55:13 -06:00
Brian Paul
1c8d079e20 mesa: fix out of bounds array access in rtgc debug code
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39841
This would only be hit if someone set RGTC_DEBUG=1.
2011-08-04 15:33:39 -06:00
Brian Paul
d6a0692f9d mesa: don't use K&R style function pointer calls 2011-08-04 15:33:39 -06:00
Bryan Cain
4683529048 Merge branch 'glsl-to-tgsi'
Conflicts:
	src/mesa/state_tracker/st_atom_pixeltransfer.c
	src/mesa/state_tracker/st_program.c
2011-08-04 15:43:34 -05:00
Bryan Cain
9adcab9cd4 st/mesa: replace duplicated create_color_map_texture() function with shared function 2011-08-04 13:52:09 -05:00
Bryan Cain
b7e8911531 glsl_to_tgsi: remove debugging printf 2011-08-04 13:52:06 -05:00
Brian Paul
50073563b2 st/mesa: silence int/float and double/float conversion warnings 2011-08-04 08:22:31 -06:00
Brian Paul
09ba2527e8 st/mesa: move declaration before code 2011-08-04 08:22:31 -06:00
Brian Paul
192baaac0f mesa: minor comment updates in enable.c 2011-08-04 08:22:31 -06:00
Brian Paul
1e89a526c6 mesa: whitespace, formatting fixes in GetTexParameter() code 2011-08-04 08:22:31 -06:00
Brian Paul
02d81dfcaf mesa: add null ptr checks in GetTexParameterI[u]iv() functions 2011-08-04 08:22:31 -06:00
Brian Paul
1254a2b2e4 mesa: condense GL_TEXTURE_RESIDENT query code 2011-08-04 08:22:31 -06:00
Brian Paul
88a4f2fe54 mesa: make error handling in glGetTexParameter() a bit more concise 2011-08-04 08:22:30 -06:00
Christoph Bumiller
e9d84dab88 nv50: implement resource_resolve with custom blit 2011-08-04 15:38:49 +02:00
Christoph Bumiller
f253d83bc7 st/mesa: implement multisample resolve via BlitFramebuffer 2011-08-04 15:38:49 +02:00
Christoph Bumiller
94822c6d83 gallium: extend resource_resolve to accommodate BlitFramebuffer
Resolve via glBlitFramebuffer allows resolving a sub-region of a
renderbuffer to a different location in any mipmap level of some
other texture, and, with a new extension, even scaling. Therefore,
location and size parameters are needed.

The mask parameter was added because resolving only depth or only
stencil of a combined buffer is possible as well.

Full information about the blit operation allows the drivers to
take the most efficient path they possibly can.
2011-08-04 15:38:49 +02:00
Christoph Bumiller
57590e173b st/mesa: determine Const.MaxSamples in init_extensions
v2: Check for non-pow2 sample counts as well.
2011-08-04 15:38:49 +02:00
Benjamin Franzke
32f4cf3808 egl/gbm: Fix EGL_DEFAULT_DISPLAY 2011-08-04 14:09:34 +02:00
Benjamin Franzke
ca6bbfd769 gbm: link gbm_gallium_drm.so against math library
This avoids the following runtime error with EGL on platforms that
require linking with libm for nontrivial math functions:

failed to load module: /xorg/lib64/gbm/gbm_gallium_drm.so: undefined
symbol: powf

(Based on Kristóf RALOVICHs patch and Ian's suggestions in
http://lists.freedesktop.org/archives/mesa-dev/2011-August/010036.html)
2011-08-04 14:09:34 +02:00
RALOVICH, Kristóf
eeed782ecb gbm/dri: avoid crash in dri_screen_create 2011-08-04 14:09:34 +02:00
Marek Olšák
babb26776f r600g: remove more of unused code
This is a follow-up to f6df430a85.
2011-08-04 03:25:18 +02:00
Stephane Marchesin
974c49ed17 i915g: Fix whitespace. 2011-08-04 02:46:18 +02:00
Stephane Marchesin
d476d7ce5a i915g: fix whitespace. 2011-08-03 23:18:30 +02:00
Vadim Girlin
2bde0cc95d r600g: take into account force_add_cf in pops
When we have two ENDIFs in a row, we shouldn't modify the pop_count
for the same alu clause twice.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38163

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-03 10:17:50 -04:00
Vadim Girlin
6eb94fc344 r600g: use backend mask for occlusion queries
Use backend_map kernel query if supported, otherwise analyze ZPASS_DONE
results to get the mask.

Fixes lockups with predicated rendering due to incorrect query buffer
initialization on some cards.

Note: this is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-08-03 10:17:44 -04:00
Marek Olšák
2664980760 winsys/radeon: remove dummy function pb_buffer 2011-08-03 01:18:10 +02:00
Marek Olšák
b5e3940583 util: fix a typo in util_format_swizzle_4f
Reported by Gustaw Smolarczyk.
2011-08-03 01:15:41 +02:00
Eric Anholt
e0e4c2e305 radeon: Remove some remaining set-but-unused variables.
These looked more like copy-and-paste to me than the others (which
looked more like possibly someone forgot to write some code in a
refactor), so I didn't verify where they came from.
2011-08-02 13:58:42 -07:00
Eric Anholt
8de1d42f24 radeon: Remove set-but-unused variables in radeon_lock.c
These have been unused since this function's introduction in the FBO
support development around 2009.
2011-08-02 13:58:42 -07:00
Eric Anholt
f5e612ab59 radeon: Remove set-but-unused variables in radeonSetTexBuffer2() variants.
These have been unused since 2009.
2011-08-02 13:58:42 -07:00
Eric Anholt
25fffa9364 radeon: Remove set-but-unused log2depth variable.
r100 doesn't support 3D GL_EXT_texture3D.
2011-08-02 13:51:14 -07:00
Eric Anholt
7cf799d472 radeon: Remove set-but-unused color_mask variable.
This has been around since the initial import in 2003 and never used.
2011-08-02 13:51:14 -07:00
Eric Anholt
0f1aae3ae7 intel: Fix unused variable warning. 2011-08-02 13:33:49 -07:00
Stephane Marchesin
e49c36b8d9 Fix trailing whitespace. 2011-08-02 19:40:26 +02:00
Marek Olšák
e69dde5233 r600g: remove dummy function r600_bo_offset
Always returned 0.
2011-08-02 18:52:17 +02:00
Marek Olšák
f6df430a85 r600g: remove unused code 2011-08-02 18:52:17 +02:00
Marek Olšák
be7407b75b gallium/util: add functions for manipulating swizzles
Some of those have been in drivers already.
2011-08-02 18:49:30 +02:00
Ian Romanick
0290a018a5 i915: Only emit program errors when INTEL_DEBUG=wm or INTEL_DEBUG=fallbacks
This makes piglit a lot more happy.  The errors are logged when
INTEL_DEBUG=fallbacks because the application is about to hit a big
software fallback.  We frequently ask people to run applications that
are hitting software fallbacks with INTEL_DEBUG=fallbacks so the we
can help them debug the reason for the software fallback.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
3bb2f0dde1 i915: Fail without crashing if a Mesa IR program uses too many registers
This can only happen in GLSL shaders because assembly shaders that use
too many temps are rejected by core Mesa.  It is easiest to make this
happen with shaders that contain flow-control that could not be lowered.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
322c3bf9dc ir_to_mesa: Emit warnings instead of errors for IR that can't be lowered
Rely on the driver to do the right thing.  This probably means falling
back to software.  Page 88 of the OpenGL 2.1 spec specifically says:

    "A shader should not fail to compile, and a program object should
    not fail to link due to lack of instruction space or lack of
    temporary variables. Implementations should ensure that all valid
    shaders and program objects may be successfully compiled, linked
    and executed."

There is no provision for saying "No" to a valid shader that is
difficult for the hardware to handle, so stop doing that.

On i915 this causes a large number of piglit tests to change from FAIL
to WARN.  The warning is because the driver still emits messages to
stderr like "i915_program_error: Unsupported opcode: BGNLOOP".

It also fixes ES2 conformance CorrectFull_frag and CorrectParse1_frag
on i915 (and probably other hardware that can't handle loops).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
8aadd89d07 ir_to_mesa: Use Add linker_error instead of fail_link
The functions were almost identical.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
89193933cb mesa: Ensure that gl_shader_program::InfoLog is never NULL
This prevents assertion failures in ralloc_strcat.  The ralloc_free in
_mesa_free_shader_program_data can be omitted because freeing the
gl_shader_program in _mesa_delete_shader_program will take care of
this automatically.

A bunch of this code could use a refactor to use ralloc a bit more
effectively.  A bunch of the things that are allocated with malloc and
owned by the gl_shader_program should be allocated with ralloc (using
the gl_shader_program as the context).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:15 -07:00
Ian Romanick
379a32f42e linker: Make linker_{error,warning} generally available
linker_warning is a new function.  It's identical to linker_error
except that it doesn't set LinkStatus=false and it prepends "warning: "
on messages instead of "error: ".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:23:01 -07:00
Ian Romanick
586e741ac1 linker: Make linker_error set LinkStatus to false
Remove the other places that set LinkStatus to false since they all
immediately follow a call to linker_error.  The function linker_error
was previously known as linker_error_printf.  The name was changed
because it may seem surprising that a printf function will set an
error flag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-08-02 08:21:43 -07:00
Kenneth Graunke
81b036b4d7 i965/gen5+: Fix incorrect miptree layout for non-power-of-two cubemaps.
For power-of-two sizes, h0 == mt->height0 since it's already a multiple
of two.  However, for NPOT, they're different; h1 should be computed
based on the original size.

Fixes piglit test "cubemap npot" and oglconform test "textureNPOT".

NOTE: This is a candidate for stable release branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-08-01 23:57:37 -07:00
Stephane Marchesin
f9b2107da6 i915g: Proper indentation of func parameters. 2011-08-02 03:33:02 +02:00
Stephane Marchesin
019c6ccbb4 i915g: Remove heuristic flushing. 2011-08-02 03:31:21 +02:00
Bryan Cain
189e9f12c7 glsl_to_tgsi: copy reladdr in st_src_reg(st_dst_reg) constructor
This is a glsl_to_tgsi port of commit f7cd9a858c.
2011-08-01 17:59:10 -05:00
Bryan Cain
3e7fce9773 glsl_to_tgsi: add each relative address to the previous
This is a glsl_to_tgsi port of commit d6e1a8f714.
2011-08-01 17:59:10 -05:00
Bryan Cain
10d31cb307 glsl_to_tgsi: lower all ir_quadop_vector expressions
Unlike Mesa IR, TGSI doesn't have a SWZ opcode.
2011-08-01 17:59:10 -05:00
Bryan Cain
3354a5b563 glsl_to_tgsi: rework immediate tracking to not use gl_program_parameter_list 2011-08-01 17:59:10 -05:00
Bryan Cain
f751730ad0 glsl_to_tgsi: update comments 2011-08-01 17:59:10 -05:00
Bryan Cain
a2c3b9f38d glsl_to_tgsi: make coding style more consistent 2011-08-01 17:59:10 -05:00
Bryan Cain
0da994a9f1 glsl_to_tgsi: make assignment hack safer
Fixes an assertion failure in piglit test glsl-texcoord-array.
2011-08-01 17:59:10 -05:00
Bryan Cain
7732822c83 glsl_to_tgsi: separate immediates from array constants during IR translation
Before, if any uniform or constant array was accessed with indirect
addressing, st_translate_program() would emit uniform constants in the place
of immediates.  This behavior was unavoidable with ir_to_mesa/mesa_to_tgsi, but
glsl_to_tgsi can work around it since the GLSL IR backend and the TGSI
emission are both inside the state tracker.
2011-08-01 17:59:09 -05:00
Bryan Cain
87f8d8547d glsl_to_tgsi: fix mistakes in get_pixel_transfer_visitor()
I noticed these issues while working on get_bitmap_visitor().
2011-08-01 17:59:09 -05:00
Bryan Cain
5f0b4b0e9d st/mesa, glsl_to_tgsi: support glBitmap with a GLSL fragment shader active 2011-08-01 17:59:09 -05:00
Bryan Cain
c0dcab2882 st/mesa, glsl_to_tgsi: support glDrawPixels/glCopyPixels with a GLSL fragment shader active
Since this was previously implemented using Mesa IR and _mesa_combine_programs,
this commit adds a new code path that works with glsl_to_tgsi.
2011-08-01 17:59:09 -05:00
Bryan Cain
33e0c47b05 glsl_to_tgsi: replace MAX_PROGRAM_TEMPS (256) with MAX_TEMPS (4096) 2011-08-01 17:59:09 -05:00
Bryan Cain
54db6e618e r200, r600c, i965: fix build 2011-08-01 17:59:09 -05:00
Bryan Cain
9c2810103d glsl_to_tgsi: always run copy_propagate() and eliminate_dead_code_advanced()
These two passes are written to handle indirect addressing properly.
2011-08-01 17:59:09 -05:00
Bryan Cain
4c8b6a2868 glsl_to_tgsi: fix mistake in new dead code elimination pass
The conditions of IF opcodes were not being counted as reads, which sometimes
led to the condition register being wrong or undefined.
2011-08-01 17:59:09 -05:00
Bryan Cain
f00406b68c glsl_to_tgsi: improve assignment handling
This is a hack, but it's better than emitting an unnecessary MOV instruction
and hoping the optimization passes clean it up.
2011-08-01 17:59:09 -05:00
Bryan Cain
71cbc9e3c4 glsl_to_tgsi: improve eliminate_dead_code_advanced() 2011-08-01 17:59:09 -05:00
Bryan Cain
3bd06e5b82 glsl_to_tgsi: use the correct writemask in try_emit_mad() and try_emit_sat() 2011-08-01 17:59:09 -05:00
Bryan Cain
194732fd72 glsl_to_tgsi: use a more specific condition for gl_FragDepth hack in generating assignments
This reduces the number of instructions in the fragment shader of
glsl-fs-atan-2 from 174 to 146 with EmitNoIfs enabled.
2011-08-01 17:59:09 -05:00
Bryan Cain
41472f7809 glsl_to_tgsi: add a better, more advanced dead code elimination pass 2011-08-01 17:59:08 -05:00
Bryan Cain
7ec7dd4fb6 glsl_to_tgsi: remove handling of XPD opcode in compile_tgsi_instruction()
The opcode is never emitted by the glsl_to_tgsi_visitor, so its special case in
compile_tgsi_instruction() was dead code.
2011-08-01 17:59:08 -05:00
Bryan Cain
8b881ad1c3 glsl_to_tgsi: use swizzle_for_size for src reg in conditional moves
This prevents the copy propagation pass from being confused by undefined
channels and thus missing optimization opportunities.
2011-08-01 17:59:08 -05:00
Emil Velikov
8c50f18b29 glsl_to_tgsi: execute merge_registers() after eliminate_dead_code()
Fixes a regression unintentionally introduced by "glsl_to_tgsi: fix shaders with
indirect addressing of temps" that caused missing leaves in 3dmark01 test 4 (Nature)
and missing/displaced textures on human models in Counter-Strike: Source.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Bryan Cain <bryancain3@gmail.com>
2011-08-01 17:59:08 -05:00
Bryan Cain
29d21417e3 glsl_to_tgsi: implement simplify_cmp pass needed by r300g 2011-08-01 17:59:08 -05:00
Bryan Cain
552cc48fca glsl_to_tgsi: fix compile error with g++ 4.6 2011-08-01 17:59:08 -05:00
Bryan Cain
1141c3f4c4 glsl: remove glsl_type::get_vec4_type()
Thanks to Kenneth Graunke for pointing out that glsl_type::get_instance(base, 4, 1)
is the same as glsl_type::get_vec4_type(base).

The function was only used in st_glsl_to_tgsi, and this commit replaces that usage
with get_instance.
2011-08-01 17:59:08 -05:00
Bryan Cain
b30bbd7436 glsl_to_tgsi: silence compiler warning 2011-08-01 17:59:08 -05:00
Bryan Cain
bf1cee9f24 glsl_to_tgsi: finish some loose ends 2011-08-01 17:59:08 -05:00
Bryan Cain
b2c067e307 glsl-to-tgsi: fix piglit tests
This commit fixes all of the piglit tests regressed by "mesa, glsl_to_tgsi: add
native support for integers in shaders" on softpipe.
2011-08-01 17:59:08 -05:00
Bryan Cain
b191382c60 mesa, glsl_to_tgsi: add native support for integers in shaders
Disabled by default on all drivers.  To enable it, change ctx->GLSLVersion to 130
in st_extensions.c.  Currently, softpipe is the only driver with integer support.
2011-08-01 17:59:08 -05:00
Bryan Cain
f95169deb4 tgsi: add support for TGSI_OPCODE_MOD in tgsi_exec 2011-08-01 17:59:08 -05:00
Bryan Cain
6d89abadbc mesa: support boolean and integer-based parameters in prog_parameter
The functionality is not used by anything yet, and the glUniform functions will
need to be reworked before this can reach its full usefulness.  It is
nonetheless a step towards integer support in the state tracker and classic drivers.
2011-08-01 17:59:07 -05:00
Bryan Cain
17b695e6e7 gallium: add PIPE_SHADER_CAP_INTEGERS 2011-08-01 17:59:07 -05:00
Bryan Cain
16d7a717d5 glsl_to_tgsi: fix shaders with indirect addressing of temps
Fixes several Piglit tests, although it's a step backwards for optimization.
2011-08-01 17:59:07 -05:00
Bryan Cain
56dc2c176c glsl_to_tgsi: use TGSI opcodes when converting from GLSL IR
Before, the translator used Mesa IR opcodes (a holdover from ir_to_mesa) and
converted them to TGSI opcodes during TGSI emission.
2011-08-01 17:59:07 -05:00
Bryan Cain
3b0858f1ae glsl_to_tgsi: support DDY (ir_unop_dFdy) 2011-08-01 17:59:07 -05:00
Bryan Cain
a6705aa5ca glsl_to_tgsi: lower noise opcodes when converting from GLSL IR, not when generating TGSI 2011-08-01 17:59:07 -05:00
Bryan Cain
5768ed6429 glsl_to_tgsi: define the sampler objects used
Fixes the Nexuiz title screen and the water in 0 A.D.
2011-08-01 17:59:07 -05:00
Bryan Cain
556bd82ce1 glsl_to_tgsi: remove a bad assertion
It was triggered by Alien Arena.
2011-08-01 17:59:07 -05:00
Bryan Cain
c341d3cfd0 glsl_to_tgsi: remove reads to output registers
Fixes a regression in 0 A.D. introduced by 809a11c77073e999fd47.
2011-08-01 17:59:07 -05:00
Bryan Cain
44867da354 glsl_to_tgsi: stop generating Mesa IR
Before, it was still generating unused Mesa IR as a remnant of ir_to_mesa, and
depended on some of the information from it.
2011-08-01 17:59:07 -05:00
Bryan Cain
1e5fd8e480 mesa: fix segfault when no Mesa IR is generated 2011-08-01 17:59:07 -05:00
Bryan Cain
f379d8f730 st/mesa: Add a GLSL IR to TGSI translator.
It is still a work in progress at this point, but it produces working and
reasonably well-optimized code.

Originally based on ir_to_mesa and st_mesa_to_tgsi, but does not directly use
Mesa IR instructions in TGSI generation, instead generating TGSI from the
intermediate class glsl_to_tgsi_instruction.  It also has new optimization
passes to replace _mesa_optimize_program.
2011-08-01 17:59:07 -05:00
Paul Berry
b1b4ea0b36 glsl: improve the accuracy of the atan(x,y) builtin function.
The previous formula for atan(x,y) returned a value of +/- pi whenever
|x|<0.0001, and used a formula based on atan(y/x) otherwise.  This
broke in cases where both x and y were small (e.g. atan(1e-5, 1e-5)).

This patch modifies the formula so that it returns a value of +/- pi
whenever |x|<1e-8*|y|, and uses the formula based on atan(y/x)
otherwise.
2011-08-01 14:37:38 -07:00
Paul Berry
d4c80f5f85 glsl: improve the accuracy of the asin() builtin function.
The previous formula for asin(x) was algebraically equivalent to:

sign(x)*(pi/2 - sqrt(1-|x|)*(A + B|x| + C|x|^2))

where A, B, and C were arbitrary constants determined by a curve fit.

This formula had a worst case absolute error of 0.00448, an unbounded
worst case relative error, and a discontinuity near x=0.

Changed the formula to:

sign(x)*(pi/2 - sqrt(1-|x|)*(pi/2 + (pi/4-1)|x| + A|x|^2 + B|x|^3))

where A and B are arbitrary constants determined by a curve fit.  This
has a worst case absolute error of 0.00039, a worst case relative
error of 0.000405, and no discontinuities.

I don't expect a significant performance degradation, since the extra
multiply-accumulate should be fast compared to the sqrt() computation.

Fixes piglit tests {vs,fs}-asin-float and {vs,fs}-atan-*
2011-08-01 14:37:38 -07:00
Chad Versace
5541920e0a glsl: Remove duplicate comment
Remove duplicate doxgen comment for
ir_function.cpp:parameter_lists_match().

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-08-01 09:37:06 -07:00
Jeremy Huddleston
5b3c719983 darwin: Use machine/endian.h to determine endianness
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 09:43:52 -07:00
Jeremy Huddleston
e737a99a6f Fix PPC detection on darwin
Fixes regression introduced by 7004582c18

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 09:24:35 -07:00
Chad Versace
5081d31a0e glsl: Clarify ir_function::matching_sigature()
The function used a variable named 'score', which was an outright lie.
A signature matches or it doesn't; there is no fuzzy scoring.

Change the return type of parameter_lists_match() to an enum, and
let ir_function::matching_sigature() switch on that enum.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:38 -07:00
Chad Versace
a5ab9398e3 glsl: Fix conversions in array constructors
Array constructors obey narrower conversion rules than other constructors
[1] --- they use the implicit conversion rules [2] instead of the scalar
constructor conversions [3].  But process_array_constructor() was
incorrectly applying the broader rules.

[1] GLSL 1.50 spec, Section 5.4.4 Array Constructors, page 52 (58 of pdf)
[2] GLSL 1.50 spec, Section 4.1.10 Implicit Conversions, page 25 (31 of pdf)
[3] GLSL 1.50 spec, Section 5.4.1 Conversion, page 48 (54 of pdf)

To fix this, first check (with glsl_type::can_be_implicitly_converted_to)
if an implicit conversion is legal before performing the conversion.

Fixes:
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bool-float.vert
piglit:spec/glsl-1.20/compiler/structure-and-array-operations/array-ctor-implicit-conversion-bvec*-vec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:30 -07:00
Chad Versace
6efe1a8495 glsl: Remove ir_function.cpp:type_compare()
The function is no longer used and has been replaced by
glsl_type::can_implicitly_convert_to().

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:25 -07:00
Chad Versace
8b3627fd7b glsl: Fix implicit conversions in non-constructor function calls
Context
-------
In ast_function_expression::hir(), parameter_lists_match() checks if the
function call's actual parameter list matches the signature's parameter
list, where the match may require implicit conversion of some arguments.
To check if an implicit conversion exists between individual arguments,
type_compare() is used.

Problems
--------
type_compare() allowed the following illegal implicit conversions:
    bool -> float
    bvecN -> vecN

    int -> uint
    ivecN -> uvecN

    uint -> int
    uvecN -> ivecN

Change
------
type_compare() is buggy, so replace it with glsl_type::can_be_implicitly_converted_to().
This comprises a rewrite of parameter_lists_match().

Fixes piglit:spec/glsl-1.20/compiler/built-in-functions/outerProduct-bvec*.vert

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:27:14 -07:00
Chad Versace
200e4972c1 glsl: Add method glsl_type::can_implicitly_convert_to()
This method checks if a source type is identical to or can be implicitly
converted to a target type according to the GLSL 1.20 spec, Section 4.1.10
Implicit Conversions.

The following commits use the method for a bugfix:
    glsl: Fix implicit conversions in non-constructor function calls
    glsl: Fix implicit conversions in array constructors

Note: This is a candidate for the 7.10 and 7.11 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-07-30 07:26:59 -07:00
Brian Paul
120d71a45c mesa: minor comment changes in teximage.c 2011-07-29 16:49:55 -06:00
Brian Paul
dc1f32deae mesa: add missing breaks for GL_TEXTURE_CUBE_MAP_SEAMLESS queries
And fix indentation.

NOTE: This is a candidate for the 7.11 branch.
2011-07-29 16:49:55 -06:00
Eric Anholt
f710b8c750 i965/fs: Allow register coalescing where the source is a uniform.
Removes 0.8% of the fragment shader instructions on Unigine Tropics.
2011-07-29 12:17:03 -07:00
Eric Anholt
a8b86459a1 i965/fs: Optimize a * 1.0 -> a.
This appears in our instruction stream as a result of the
brw_vs_constval.c handling.
2011-07-29 12:17:03 -07:00
Eric Anholt
6d8d6b41b8 i965/fs: If we see a RCP of a constant, try to constant fold it. 2011-07-29 12:17:03 -07:00
Eric Anholt
eb30820f26 i965/fs: Port texture projection avoidance optimization from the old backend.
This is part of fixing a ~1% performance regression in OpenArena when
changing the fixed function fragment shader to using the new backend.
Right now this just avoids the LINTERP of the projector, not the math
using it.
2011-07-29 12:17:03 -07:00
Eric Anholt
652ef8569c Revert "i965: Don't compute brw->wm.input_size_masks when it's unused."
This reverts commit 3412069e23.  We're
about to start using it in fragment shaders to handle avoiding
projection for fixed function.
2011-07-29 12:17:03 -07:00
Eric Anholt
44ffb4ae20 i965/fs: Stop using the exec_list iterator.
The old style has gone out of favor in the project, but I kept copy
and pasting from existing iterator code.
2011-07-29 12:17:03 -07:00
Alex Deucher
dc1c0ca22a r600g: fix up vs export handling
Certain attributes (position, psize, etc.) don't
count as params; they are handled separately by the hw.
However, the VS is required to export at least one param
and r600_shader_from_tgsi() takes care of adding a dummy
export if there is none.  Make sure the VS param export
count in the SPI properly accounts for this.

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-07-29 11:34:02 -04:00
Chia-I Wu
5c9e0ad5fd st/egl: create pbuffers with PIPE_BIND_SAMPLER_VIEW
So that eglBindTexImage works.
2011-07-29 14:16:51 +09:00
Eric Anholt
4fdd289805 i965/fs: Respect ARB_color_buffer_float clamping.
This was done in the old codegen path, but not the new one.  Caught by
piglit fbo tests after the conversion to GLSL ff_fragment_shader.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 20:58:18 -07:00
Eric Anholt
ef1854d090 mesa: Fix ff fragment shader inputs calculation when enabling a VS.
The FF VS generation happens just after the FF FS generation in
state.c, so the ctx->VP._Current value is for the previous state
update's vertex shader, not the one that will be chosen as a result of
this state update.  The vertexShader and vertexProgram variables
should be accurately telling us whether there's going to be a
ctx->VP._Current (except on _MaintainTnlProgram drivers, where it's
always true).

The glsl-vs-statechange-1 test was created to test for this, but it
turns out that the bug is hidden by the fact that we call
_mesa_update_state() twice per draw call -- once from
_mesa_valid_to_render() and once from vbo_draw_arrays(), and the
second one was fixing up the first one.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-28 20:51:53 -07:00
Chia-I Wu
96ca6a6262 targets/{egl,gbm}: omit unneeded libdrm_radeon 2011-07-29 10:24:45 +09:00
Chia-I Wu
d6a9564854 egl: EGL_MATCH_NATIVE_NATIVE_PIXMAP cannot be EGL_DONT_CARE 2011-07-29 10:24:45 +09:00
Chia-I Wu
a5ab46909e egl: make pixmaps and pbuffers EGL_BUFFER_PRESERVED
eglSwapBuffers is no-op to these surface types anyway.
2011-07-29 10:24:39 +09:00
Eric Anholt
83f5d5e6aa Add dependency generation for Mesa and GLSL dricore objects.
Reviewed-By: Christopher James Halse Rogers
	     <christopher.halse.rogers@canonical.com>
2011-07-28 17:32:42 -07:00
Eric Anholt
f79e3518b4 softpipe: When doing write_all_cbufs, don't stomp over the color.
We have to make it through this loop processing the color multiple
times, so we can't go overwriting it on our first color buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-28 17:32:42 -07:00
Brian Paul
e4fdc95277 mesa: fix format selection for meta CopyTexSubImage()
When we do a glReadPixels into the temporary buffer, we don't want to
use GL_LUMINANCE, GL_LUMINANCE_ALPHA or GL_INTENSITY since they will
compute L=R+G+B which is not what we want.

This bug has existed all along but was only exposed by the elimination
of the driver hook for glCopyTexImage() in
5874890c26.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39604
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-28 17:29:36 -06:00
Brian Paul
26684e0b1a mesa: test against MESA_FORMAT_NONE in _mesa_GetTexLevelParameteriv() 2011-07-28 17:24:57 -06:00
Brian Paul
58d6aa8287 st/mesa: fix comment language 2011-07-28 17:24:56 -06:00
Vadim Girlin
95ee961f77 r600g: fix vs export count
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39572

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-28 18:58:40 -04:00
Kenneth Graunke
f73caddd33 i965: Remove the now unused intel_renderbuffer::draw_offset field.
The previous commit removed the last use of this field.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 14:04:39 -07:00
Kenneth Graunke
15c0bc5eef i965: Check actual tile offsets in Gen4 miptree workaround.
The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure
that we don't have XYy offsets into a tile, since Gen4 hardware doesn't
support that.  However, it's insufficient: there are cases where
draw_offset & 4095 is 0 but we still have a Y-offset.  This leads to an
assertion failure in brw_update_renderbuffer_surface with tile_y != 0.

Instead, simply call intel_renderbuffer_tile_offsets to compute the
actual X/Y offsets and check if either are non-zero.  This makes both
the workaround and the assertion check the same things.

Fixes piglit test fbo-generatemipmap-formats, and should also fix
bugs #34009 and #39487.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad@chad-versace.us>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 14:04:39 -07:00
Kenneth Graunke
3e1fd13f60 i965/gen4: Fix message parameter loading for 1D TXD sampling.
We were neglecting to load dvdx and dvdy.  v is not optional.

Fixes glslparsertests tex-grad-0[12345].frag on Broadwater/Crestline.
(We still need an execution test using sampler1D.)

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 14:04:39 -07:00
Paul Berry
fe33c886a7 glsl: improve the accuracy of the radians() builtin function
The constant used in the radians() function didn't have enough
precision, causing a relative error of 1.676e-5, which is far worse
than the precision of 32-bit floats.  This patch reduces the relative
error to 1.14e-9, which is the best we can do in 32 bits.

Fixes piglit tests {fs,vs}-radians-{float,vec2,vec3,vec4}.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-28 10:41:39 -07:00
Marek Olšák
0aed27ee37 configure.ac: add DLOPEN_LIBS to xlib build
Otherwise xlib-based llvmpipe fails to link.

NOTE: This is a candidate for the 7.11 branch.
2011-07-28 00:25:28 +02:00
Marek Olšák
c6f59fcd00 configure.ac: fix xlib-based softpipe build
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>

NOTE: This is a candidate for the 7.11 branch.
2011-07-28 00:25:12 +02:00
Ian Romanick
f622c6d7a2 glsl: Add source location tracking to TODO list 2011-07-27 11:41:14 -07:00
Ian Romanick
5e1b7097f3 glsl: Remove completed items from the TODO list 2011-07-27 11:41:14 -07:00
Christoph Bumiller
58c04435b1 mesa: don't forget about sampleBuffers in framebuffer visual update
Otherwise multisample will never been enabled for multisample
renderbuffers.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-27 12:13:37 +02:00
Benjamin Franzke
79dcfb266a wayland-drm: Add copyright notice to protocol
Fixes build since wayland 986703ac7365bc87a5501714adb9fc73157c62b7.
2011-07-27 10:07:14 +02:00
Tobias Droste
d4d5e3a336 egl/gallium: fix build without softpipe and llvmpipe
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Acked-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-07-27 09:35:46 +02:00
Marek Olšák
1c2c4ddbd1 r300g: copy the compiler from r300c
What a beast.

r300g doesn't depend on files from r300c anymore, so r300c is now left
to its own fate. BTW 'make test' can be invoked from the gallium/r300
directory to run some compiler unit tests.
2011-07-26 22:35:49 +02:00
Bryan Cain
860c51d827 util: enable S3TC support when the force_s3tc_enable env var is set to "true"
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 12:54:42 -05:00
Bryan Cain
95739f19cc st/mesa: respect force_s3tc_enable environment variable
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-26 12:54:40 -05:00
Ian Romanick
b189d1635d mesa: Make _mesa_get_compressed_formats match the texture compression specs
The implementation deviated slightly from the GL_EXT_texture_sRGB spec
and from other implementations.  A giant comment block was added to
justify the somewhat odd behavior of this function.

In addition, the interface had unnecessary cruft.  The 'all' parameter
was false at all callers, so it has been removed.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 19:57:24 -07:00
Ian Romanick
143b65f761 mesa: Return the correct internal fmt when a generic compressed fmt was used
If an application requests a generic compressed format for a texture
and the driver does not pick a specific compressed format, return the
generic base format (e.g., GL_RGBA) for the GL_TEXTURE_INTERNAL_FORMAT
query.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=3165
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 19:57:17 -07:00
Ian Romanick
09916e877f mesa: Add utility function to get base format from a GL compressed format
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 19:57:14 -07:00
Eric Anholt
3daa2d97eb i965/fs: Fix MRT drawing since the m0->m2 move for shader debug.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-25 19:42:18 -07:00
Ian Romanick
c1e591eed4 glsl: Correctly return progress from lower_variable_index_to_cond_assign
lower_variable_index_to_cond_assign runs until it can't make any more
progress.  It then returns the result of the last pass which will
always be false.  This caused the lowering loop in
_mesa_ir_link_shader to end before doing one last round of
lower_if_to_cond_assign.  This caused several if-statements (resulting
from lower_variable_index_to_cond_assign) to be left in the IR.

In addition to this change, lower_variable_index_to_cond_assign should
take a flag indicating whether or not it should even generate
if-statements.  This is easily controlled by
switch_generator::linear_sequence_max_length.  This would generate
much better code on architectures without any flow contol.

Fixes i915 piglit regressions glsl-texcoord-array and
glsl-fs-vec4-indexing-temp-src.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-25 18:45:46 -07:00
Marek Olšák
99fba503b1 configure.ac: do not check for llvm-config if llvm is disabled
NOTE: This is a candidate for the 7.11 branch.
2011-07-25 23:47:22 +02:00
Tobias Droste
84f8548dfc r300/compiler: simplify code in peephole_add_presub_add
Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-25 23:47:07 +02:00
Marek Olšák
f170555a18 winsys/radeon: fix typos in the driver interface 2011-07-25 23:10:40 +02:00
Marek Olšák
533e228923 winsys/radeon: manage constant buffers by the cache bufmgr too 2011-07-25 23:10:40 +02:00
Marek Olšák
7db148d3a5 winsys/radeon: remove usage parameter from buffer_create 2011-07-25 23:10:40 +02:00
Marek Olšák
e22a1005c0 winsys/radeon: fix int->boolean conversion in radeon_bo_is_referenced_by_any_cs 2011-07-25 23:10:40 +02:00
Marek Olšák
67c995e0f1 winsys/radeon: little change in radeon_bo_is_referenced_by_cs 2011-07-25 23:10:40 +02:00
Marek Olšák
ce9daf6f0b winsys/radeon: add R300 infix to winsys feature names 2011-07-25 23:10:39 +02:00
Marek Olšák
28a336dc38 winsys/radeon: simplify how value queries work
This drops the get_value query and adds a function query_info, which returns
all the values in one nice structure.
2011-07-25 23:10:39 +02:00
Eric Anholt
818db3848b i965: Fix many of the trivial WebGL demos that broke due to IB optimization.
The index buffer state emit only occurred if there was an IB in place
and we were in either a new batch or a new IB state.  But because we
only flagged new IB state if IB state changed from the last IB state
we calculated, we could simply never emit IB state after batchbuffer
wraps if the first draw didn't use the IB and we didn't actually
change the IB.

Fixes piglit glx-multi-context-ib-1.
2011-07-25 13:47:18 -07:00
Eric Anholt
a0e5affb22 i965: Use 3D clears on gen6+ to avoid inter-ring synchronization.
Improves firefox-talos-gfx around 5%.
2011-07-25 13:47:18 -07:00
Eric Anholt
8080246892 meta: Also save/restore clip planes for GLSL.
Fixes user-clip on 965 with 3D clears enabled.  I created a separate
flag because I wanted to avoid the overhead of the matrix operations
in this path.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-25 13:47:18 -07:00
Eric Anholt
185868c9c2 i965: Emit texture cache flushes on gen6 along with render cache flushes.
It turns out that internally the texture cache gets flushed in a
couple of cases, particularly around 2D operations mixed with 3D.  In
almost all cases one of those happens between rendering to an
FBO-attached texture and rendering from that texture.  However, as of
the next patch, glean tfbo (and the new fbo-flushing-2 test) would
manage to get stale texture values because one of those flushes didn't
occur.  The intention of this code was always to get the render cache
cleared and ready to be used from the sampler cache (and it does on <=
gen4), so this just catches gen5 up.

This patch was also tested to fix fbo-flushing on gen7.
2011-07-25 13:47:01 -07:00
Paul Berry
d92463d5dc i965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()
When emitting a MAC instruction in a vertex shader, brw_vs_emit()
calls accumulator_contains() to determine whether the accumulator
already contains the appropriate addend; if it does, then we can avoid
emitting an unnecessary MOV instruction.

However, accumulator_contains() wasn't checking the val.negate or
val.abs flags.  As a result, if the desired value was the negation, or
the absolute value, of what was already in the accumulator, we would
generate an incorrect shader.

Fixes piglit test vs-refract-vec4-vec4-float.

Tested on Gen5 and Gen6.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-25 11:40:53 -07:00
Kenneth Graunke
572f631895 i965/gen7: Fix shadow sampling in the old brw_wm_emit backend.
On Ivybridge, the shadow comparitor goes in the first slot, rather than
at the end.  It's not necessary to send u, v, and r.

Fixes tests texturing/texdepth and glean/fbo.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-25 10:45:56 -07:00
Kenneth Graunke
156cef0fba i965/fs: Clear result before visiting shadow comparitor and LOD info.
Commit 53c89c67f3 ("i965: Avoid generating
MOVs for assignments of expressions.") added the line "this->result =
reg_undef" all over the code.  Unfortunately, since Eric developed his
patch before I landed Ivybridge support, he missed adding it to
fs_visitor::emit_texture_gen7() after rebasing.

Furthermore, since I developed TXD support before Eric's patch, I
neglected to add it to the gradient handling when I rebased.

Neglecting to set this causes the visitor to use this->result as storage
rather than generating a new temporary.  These missing statements
resulted in the same register being used to store several different
values.

Fixes the following piglit tests on Ivybridge:
- glsl-fs-shadow2dproj.shader_test
- glsl-fs-shadow2dproj-bias.shader_test

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-25 10:45:56 -07:00
Emeric
7746b7d4bf vdpau: enable mpeg1 hw decoding, using the exact same code path as mpeg2
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39307

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-07-25 19:22:35 +02:00
Christian König
4f90b89961 gallium: change formats merged with pipe-video to type "other"
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39276
2011-07-25 18:20:22 +02:00
Benjamin Franzke
42cdf4074e configure: Move gbm before egl in SRC_DIRS
egl_dri2 built into libEGL depends on libgbm.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39515
2011-07-25 09:37:02 +02:00
Christian König
4c84acc86f g3dvl: remove unused vs output from create_ref_vert_shader
The position of the quad vertex is calculated in calc_position,
so we don't need the output here any more.
2011-07-25 01:32:39 +02:00
Christian König
4d23c6df81 r600g: use file_max instead of file_count to determine reg offset
Otherwise shaders with skipped inputs/outputs doesn't work correctly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-07-24 19:17:27 +02:00
Younes Manton
ac6455e9a2 gallium/softpipe: Don't clobber dest color/alpha before masking.
The blend_quad function clobbers the actual render target color/alpha
values while applying the destination blend factor, which results in
restoring the wrong value during the masking stage for write-disabled
channels.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-23 17:13:44 -04:00
Ian Romanick
6c8f1f483a glsl: Compare vector indices in blocks
Just like the non-constant array index lowering pass, compare all N
indices at once.  For accesses to a vec4, this saves 3 comparison
instructions on a vector architecture.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
90cc372400 glsl: Factor out code that generates block of index comparisons
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
156f85336f glsl: Treat ir_dereference_array of non-var as a constant for lowering
Previously the code would just look at deref->array->type to see if it
was a constant.  This isn't good enough because deref->array might be
another ir_dereference_array... of a constant.  As a result,
deref->array->type wouldn't be a constant, but
deref->variable_referenced() would return NULL.  The unchecked NULL
pointer would shortly lead to a segfault.

Instead just look at the return of deref->variable_referenced().  If
it's NULL, assume that either a constant or some other form of
anonymous temporary storage is being dereferenced.

This is a bit hinkey because most drivers treat constant arrays as
uniforms, but the lowering pass treats them as temporaries.  This
keeps the behavior of the old code, so this change isn't making things
worse.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
1d3f09f159 i965: When emitting a src/dst read of an output, keep the swizzle and neg
Fixes i965 piglit vs-varying-array-mat[234]-row-rd.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
337e2dfad0 i965: When emitting a src/dst write of an output, keep the write mask
Fixes i965 piglit:

    vs-varying-array-mat[234]-col-row-wr
    vs-varying-array-mat[234]-index-col-row-wr
    vs-varying-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-row-wr
    vs-varying-mat[234]-col-row-wr
    vs-varying-mat[234]-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-23 01:24:18 -07:00
Ian Romanick
fbeb68e880 prog_optimize: Set unused regs to PROGRAM_UNDEFINED after CMP->MOV conversion
Leaving the unused registers with other values caused assertion
failures and other problems in places that blindly iterate over all
sources.

brw_vs_emit.c:1381: get_src_reg: Assertion `c->regs[file][index].nr !=
0' failed.

Fixes i965 piglit:

    vs-uniform-array-mat[234]-col-row-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-uniform-array-mat[234]-index-row-rd
    vs-uniform-mat[234]-col-row-rd

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
f7cd9a858c ir_to_mesa: Copy reladdr in src_reg(dst_reg) constructor
Fixes i965 piglit:

    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Fixes swrast piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-row-wr
    fs-temp-mat[234]-col-row-wr
    vs-temp-array-mat[234]-col-row-wr
    vs-temp-array-mat[234]-index-col-row-wr
    vs-temp-array-mat[234]-index-row-wr
    vs-temp-mat[234]-col-row-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
d6e1a8f714 ir_to_mesa: Add each relative address to the previous
This fixes many cases of accessing arrays of matrices using
non-constant indices at each level.

Fixes i965 piglit:

    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd

Fixes swrast piglit:

    fs-temp-array-mat[234]-index-col-rd
    fs-temp-array-mat[234]-index-col-row-rd
    fs-temp-array-mat[234]-index-col-wr
    fs-uniform-array-mat[234]-index-col-rd
    fs-uniform-array-mat[234]-index-col-row-rd
    fs-varying-array-mat[234]-index-col-rd
    fs-varying-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-rd
    vs-temp-array-mat[234]-index-col-row-rd
    vs-temp-array-mat[234]-index-col-wr
    vs-uniform-array-mat[234]-index-col-rd
    vs-uniform-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-rd
    vs-varying-array-mat[234]-index-col-row-rd
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
601428d2bb glsl: When lowering non-constant vector indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
5f83dfe5b7 glsl: When lowering non-constant array indexing, respect existing conditions
If the non-constant index was in the LHS of an assignment, any
existing condititon on that assignment would be lost.

Fixes i965 piglit:

    fs-temp-array-mat[234]-col-row-wr
    fs-temp-array-mat[234]-index-col-row-wr
    fs-temp-array-mat[234]-index-col-wr
    fs-temp-array-mat[234]-index-row-wr
    vs-varying-array-mat[234]-index-col-wr

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
1731ac3086 glsl: Rework lowering of non-constant array indexing
The previous implementation could easily get tricked if the LHS of an
assignment included a non-constant index that was "inside" another
dereference.  For example:

    mat4 m[2];
    m[0][i] = vec4(0.0);

Due to the way it tracked whether the array was being assigned, it
would think that the non-constant index was in an r-value.  The new
code fixes that by tracking l-values and r-values differently.  The
index is also replaced by cloning the IR and replacing the index
variable instead of the odd way it was done before.

v2: Apply some simplifications suggested by Eric Anholt.  Making
assignment_generator::rvalue be ir_dereference instead of ir_rvalue
simplified the code a bit.

Fixes i965 piglit fs-temp-array-mat[234]-index-wr and
vs-varying-array-mat[234]-index-wr.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34691
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
d2296e784a glsl: Split out part of variable_index_to_cond_assign_visitor::needs_lowering
Other code will soon need to know if an array needs lowering based
exclusively on the storage mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
Ian Romanick
8d5f3cef79 glsl: Move is_array_or_matrix outside visitor class
There's no reason for it to be there, and another class that may not
have access to the visitor will need it soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-23 01:24:18 -07:00
José Fonseca
5161aff48a gallivm: Add a note about log2 computation and denormalized numbers. 2011-07-22 18:52:09 -07:00
José Fonseca
af82ff556c gallivm: Fix lp_build_exp2 order 4-5 polynomial coefficients and bump order.
Not sure how I computed these, but they were wrong (which explains why
bumping the polynomial order before never improved precision).

This allows to pass the EXP test cases of PSPrecision/VSPrecision DCTs.
2011-07-22 18:52:09 -07:00
José Fonseca
47d6d44a23 gallivm: Increase lp_build_rsqrt() precision.
Add an iteration step, which makes rqsqrt precision go from 12bits to
24, and fixes RSQ/NRM test case of PSPrecision/VSPrevision DCTs.

There are no uses of this function outside shader translation.
2011-07-22 18:52:09 -07:00
José Fonseca
ef1a2765a4 gallivm: Update minimax comments. 2011-07-22 18:52:09 -07:00
José Fonseca
1ac86e249e gallivm: Fix lp_build_exp/lp_build_log.
Never used so far -- we only used the base 2 variants -- which is why
it went unnoticed so far.
2011-07-22 18:52:09 -07:00
José Fonseca
0a1d49504d llvmpipe: Unit tests for arithmetic functions.
Conflicts:

	src/gallium/drivers/llvmpipe/SConscript
2011-07-22 18:52:08 -07:00
José Fonseca
eb7590f677 util: Store alpha value too. 2011-07-22 18:52:08 -07:00
Vinson Lee
edaadd94cb glsl: Add standalone_scaffolding.cpp to SConscript. 2011-07-22 10:38:05 -07:00
Paul Berry
659cdedb53 glsl: Add unit tests for lower_jumps.cpp
These tests invoke do_lower_jumps() in isolation (using the glsl_test
executable) and verify that it transforms the IR in the expected way.

The unit tests may be run from the top level directory using "make
check".

For reference, I've also checked in the Python script
create_test_cases.py, which was used to generate these tests.  It is
not necessary to run this script in order to run the tests.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-07-22 09:45:11 -07:00
Paul Berry
f1f76e157e glsl: Create a standalone executable for testing optimization passes.
This patch adds a new build artifact, glsl_test, which can be used for
testing optimization passes in isolation.

I'm hoping that we will be able to add other useful standalone tests
to this executable in the future.  Accordingly, it is built in a
modular fashion: the main() function uses its first argument to
determine which test function to invoke, removes that argument from
argv[], and then calls that function to interpret the rest of the
command line arguments and perform the test.  Currently the only test
function is "optpass", which tests optimization passes.
2011-07-22 09:45:11 -07:00
Paul Berry
f129f618fe glsl: Move functions into standalone_scaffolding.cpp for later reuse.
This patch moves the following functions from main.cpp (the main cpp
file for the standalone executable that is used to create the built-in
functions) to standalone_scaffolding.cpp, so that they can be re-used
in other standalone executables:

- initialize_context()*
- _mesa_new_shader()
- _mesa_reference_shader()

*initialize_context contained some code that was specific to main.cpp,
so it was split into two functions: initialize_context() (which
remains in main.cpp), and initialize_context_from_defaults() (which is
in standalone_scaffolding.cpp).
2011-07-22 09:45:11 -07:00
Paul Berry
12c22cab77 mesa: Add an ifndef guard around the definition of the INLINE macro
Several Mesa headers redundantly define the INLINE macro.  Adding this
guard prevents the compiler from complaining about macro redefinition.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-22 09:45:11 -07:00
Younes Manton
a87afba505 Revert "g3dvl: Preserve previously rendered components for MC output."
This reverts commit b56daf71d2.

The bug is actually in softpipe's blend and writemask interaction.
2011-07-21 20:09:11 -04:00
Marek Olšák
50e32fefb1 configure.ac: check for libdrm_radeon only when building classic 2011-07-21 22:31:24 +02:00
Brian Paul
636d01bd61 Merge branch 'gallium-polygon-stipple' 2011-07-21 10:38:21 -06:00
Brian Paul
57aa597b3d softpipe: use the polygon stipple utility module
This is an alternative to the draw module's polygon stipple stage.
The softpipe implementation here is just a test.  The advantange of
using the new polygon stipple utility module (with other drivers)
is we can avoid software vertex processing in the draw module and
get much better performance.
Polygon stipple doesn't require special vertex processing like
the other draw module stage.
2011-07-21 10:32:15 -06:00
Brian Paul
c534f11164 softpipe: implement fragment shader variants
We'll need shader variants to accomodate the new polygon stipple utility.
2011-07-21 09:57:37 -06:00
Brian Paul
3dde6be908 util: assorted updates to polygon stipple helper 2011-07-21 09:57:37 -06:00
Brian Paul
4736c0ba86 softpipe: use tgsi_shader_info fields for fragcoord origin, center, etc. 2011-07-21 09:57:37 -06:00
Brian Paul
2253906da3 tgsi: add info fields for fragcoord origin, center, etc 2011-07-21 09:57:33 -06:00
Brian Paul
9c1319d31d softpipe: remove obsolete comment 2011-07-21 09:55:22 -06:00
Brian Paul
f16d97feaa softpipe: rename a function 2011-07-21 09:55:22 -06:00
Brian Paul
ecc6a26a3d Merge branch 'remove-copyteximage-hook' 2011-07-21 08:46:02 -06:00
Chia-I Wu
afc160e1c8 u_vbuf_mgr: restore buffer offsets
u_vbuf_upload_buffers modifies the buffer offsets.  If they are not
restored, and any of the vertex formats is not supported natively, the
next u_vbuf_mgr_draw_begin call will translate the vertex buffers with
incorrect buffer offsets.
2011-07-21 21:20:37 +08:00
Marek Olšák
000896c0bb mesa: GLES2 should return different error enums for invalid fbo queries
ES 2.0.25 page 127 says:

  If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
  querying any other pname will generate INVALID_ENUM.

See also:
b9e9df78a0

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-21 14:16:43 +02:00
Christoph Bumiller
ea316c5e06 nouveau: hook up video decoding with nouveau_context
This doesn't include nvfx since its context struct is not derived
from common nouveau_context (yet).
2011-07-21 10:39:41 +02:00
Vinson Lee
76bccaff0c glsl: Add ir_function_detect_recursion.cpp to SConscript. 2011-07-20 20:16:27 -07:00
Ian Romanick
02c5ae1b3f glsl: Reject shaders that contain static recursion
The GLSL 1.20 and later specs say:

    "Recursion is not allowed, not even statically. Static recursion is
    present if the static function call graph of the program contains
    cycles."

Recursion is detected and rejected both a compile-time and at
link-time.  The complie-time check happens to detect some cases that
may be removed by various optimization passes.  The spec doesn't seem
to allow this, but other vendors (e.g., NVIDIA) appear to only check
at link-time after all optimizations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33885
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 18:20:59 -07:00
Ian Romanick
1ad3ba4ad9 glsl: Make prototype_string publicly available
Also clarify the documentation for one of the parameters.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 18:20:59 -07:00
Marek Olšák
2d960d3f4e g3dvl: remove unused vertex shader inputs
See also comments in the code.
2011-07-20 22:55:24 +02:00
Eric Anholt
3e5d36267d i965: Apply a homebrew workaround for GPU hang in OGLC api-texcoord.
The behavior of flushes in the hardware is a maze of twisty passages,
and strangely the VS constants appear to be loaded during a pipeline
flush instead of at the time of the packet emit according to the
simulator.  On moving the STATE_BASE_ADDRESS packet to where it really
needed to live (in order for data loads by other packets to be
correct), we sometimes no longer got a flush between those packets
where we apparently needed it.  This replicates the flushes implied by
a STATE_BASE_ADDRESS update, fixing the GPU hangs in OGLC and the
"engine" demo.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36821
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39257
Tested-by: Keith Packard <keithp@keithp.com> (bzflag and etracer fixed)
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 11:42:53 -07:00
Eric Anholt
407785d0e9 i965: Enable the PIPE_CONTROL workaround workaround out of paranoia.
There's scary stuff going on in PIPE_CONTROL internals, and if the
BSpec says to do this to make PIPE_CONTROL work, I'll go ahead and do
it because we'll probably never be able to debug it after the fact.

v2: Use stall at scoreboard instead of depth stall, as noted by Ken.
2011-07-20 11:12:38 -07:00
Eric Anholt
dc7422405f i965: Avoid kernel BUG_ON if we happen to wait on the pipe_control w/a BO.
For this and occlusion queries, we're trying to avoid setting
I915_GEM_DOMAIN_RENDER for the write domain, because the data written
is definitely not going through the render cache, but we do need to
tell the kernel that the object has been written.  However, with using
I915_GEM_DOMAIN_GTT, the kernel on retiring the batchbuffer sees that
the w/a BO has a write domain of GTT, and puts it on the flushing
list.  If something tries to wait for that BO to finish rendering
(such as the AUB dumper reading the contents of BOs), we get into
wait_request (since obj->active) but with a 0 seqno (since the object
is on the flushing list, not actually on a ringbuffer), and BUG_ONs.

To avoid the kernel bug (which I'm hoping to delete soon anyway), just
use I915_GEM_DOMAIN_INSTRUCTION like occlusion queries do.  This
doesn't result in more flushing, because we invalidate INSTRUCTION on
every batchbuffer now that we're state streaming, anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 11:10:00 -07:00
Eric Anholt
540e66b3be intel: Use the GLSL-based meta clear when available.
Improves firefox-talos-gfx performance under GL when 3D clears are
enabled:
[  0]       gl-before     firefox-talos-gfx   20.193   20.251   0.27%    3/3
[  0]       gl-after      firefox-talos-gfx   18.013   18.040   0.19%    3/3
2011-07-20 11:03:26 -07:00
Eric Anholt
eee570290a meta: Add a GLSL-based _mesa_meta_Clear() variant.
This cuts out a large portion of the overhead of glClear() from
resetting the texenv state and recomputing the fixed function
programs.  It also means less use of fixed function internally in our
GLES2 drivers, which is rather bogus.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-20 11:03:20 -07:00
Younes Manton
b56daf71d2 g3dvl: Preserve previously rendered components for MC output.
Fixes xvmc-softpipe MC entrypoint, amongst others.
2011-07-20 13:52:45 -04:00
Younes Manton
8082816e27 g3dvl: Init/clean pipe fully when a shader-based decoder isn't used.
Fixes VDPAU CSC-only mode.
2011-07-20 13:52:45 -04:00
Kenneth Graunke
3875526926 glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.
When parsing S-Expressions, we need to store nul-terminated strings for
Symbol nodes.  Prior to this patch, we called ralloc_strndup each time
we constructed a new s_symbol.  It turns out that this is obscenely
expensive.

Instead, copy the whole buffer before parsing and overwrite it to
contain \0 bytes at the appropriate locations.  Since atoms are
separated by whitespace, (), or ;, we can safely overwrite the character
after a Symbol.  While much of the buffer may be unused, copying the
whole buffer is simple and guaranteed to provide enough space.

Prior to this, running piglit-run.py -t glsl tests/quick.tests with GLSL
1.30 enabled took just over 10 minutes on my machine.  Now it takes 5.

NOTE: This is a candidate for stable release branches (because it will
      make running comparison tests so much less irritating.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-20 10:42:43 -07:00
Brian Paul
8d044047f1 mesa: remove depend files from tarballs 2011-07-19 21:11:53 -06:00
Brian Paul
4470ff2ebf glsl: silence warning in linker.cpp 2011-07-19 21:10:25 -06:00
Brian Paul
d5e3239776 st/mesa: get rid of redundant clipping code in st_copy_texsubimage() 2011-07-19 20:03:05 -06:00
Brian Paul
1c1fc62e38 mesa: remove unused dd_function_table::CopyTexImage1D/2D() hooks 2011-07-19 20:03:05 -06:00
Brian Paul
774311fb54 meta: remove _mesa_meta_CopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul
0823ef84a5 st/mesa: remove st_CopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul
9ed87c4463 radeon: remove radeonCopyTexImage2D() 2011-07-19 20:03:05 -06:00
Brian Paul
fbe6836043 intel: remove intelCopyTexImage1D/2D() 2011-07-19 20:03:05 -06:00
Brian Paul
1da28fa959 mesa: remove comments referring to Driver.TexImage1D/2D 2011-07-19 20:03:05 -06:00
Brian Paul
5874890c26 mesa: stop using ctx->Driver.CopyTexImage1D/2D() hooks 2011-07-19 20:03:05 -06:00
Jørgen Lind
496bf3822a Make it possible to use gbm with c++
NOTE: This is a candiate for 7.11
2011-07-19 16:30:07 -07:00
Fredrik Höglund
d84791a72b st/mesa: fix the texture format in st_context_teximage
Commit 1a339b6c71 made
st_ChooseTextureFormat map GL_RGBA with type GL_UNSIGNED_BYTE
to PIPE_FORMAT_A8B8G8R8_UNORM.

The image format for ARGB pixmaps is PIPE_FORMAT_B8G8R8A8_UNORM
however. This mismatch caused the texture to be recreated in
st_finalize_texture.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39209
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-19 15:28:43 -06:00
Brian Paul
f0e306c343 mesa: update, shorten some comments in dd.h 2011-07-19 15:28:43 -06:00
Henri Verbeet
0f20e2e18f glx: Avoid calling __glXInitialize() in driReleaseDrawables().
This fixes a regression introduced by commit
a26121f375 (fd.o bug #39219).

Since the __glXInitialize() call should be unnecessary anyway, this is
probably a nicer fix for the original problem too.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: padfoot@exemail.com.au
2011-07-19 23:27:46 +02:00
Chad Versace
f7dbcba280 intel: Fix stencil buffer to be W tiled
Until now, the stencil buffer was allocated as a Y tiled buffer, because
in several locations the PRM states that it is. However, it is actually
W tiled. From the PRM, 2011 Sandy Bridge, Volume 1, Part 2, Section
4.5.2.1 W-Major Format:
    W-Major Tile Format is used for separate stencil.

The GTT is incapable of W fencing, so we allocate the stencil buffer with
I915_TILING_NONE and decode the tile's layout in software.

This fix touches the following portions of code:
    - In intel_allocate_renderbuffer_storage(), allocate the stencil
      buffer with I915_TILING_NONE.
    - In intel_verify_dri2_has_hiz(), verify that the stencil buffer is
      not tiled.
    - In the stencil buffer's span functions, the tile's layout must be
      decoded in software.

This commit mutually depends on the xf86-video-intel commit
    dri: Do not tile stencil buffer
    Author: Chad Versace <chad@chad-versace.us>
    Date:   Mon Jul 18 00:38:00 2011 -0700

On Gen6 with separate stencil enabled, fixes the following Piglit tests:
    bugs/fdo23670-drawpix_stencil
    general/stencil-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX16-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX1-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX4-readpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-copypixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-drawpixels
    spec/EXT_framebuffer_object/fbo-stencil-GL_STENCIL_INDEX8-readpixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-copypixels
    spec/EXT_packed_depth_stencil/fbo-stencil-GL_DEPTH24_STENCIL8-readpixels
    spec/EXT_packed_depth_stencil/readpixels-24_8

Note: This is a candidate for the 7.11 branch.

Signed-off-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-19 13:12:19 -07:00
Eric Anholt
fb5ff51f42 i965: Fix regression in 29a911c50e.
The previous define was the full 32-bit header, while the new define
was just the top 16 bits.
2011-07-19 12:20:14 -07:00
Brian Paul
b38c26f19f llvmpipe: include LLVM version number in name string 2011-07-19 08:42:46 -06:00
Tobias Droste
3143e95353 llvmpipe: fix build with LLVM 3.0svn
LLVM 3.0svn introduced a new type system. It defines a new way to create
named structs and removes the (now not needed) LLVMInvalidateStructLayout
function.  See revision 134829 of LLVM.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-19 08:23:28 -06:00
Emil Velikov
c2426bbf86 configure.ac: Check for the respective libdrm_* when building gallium drivers
In a rare case of building gallium only, we need to
check if the required packages are available

libdrm_[intel|nouveau] - gallium[i915 i965|nouveau]

v2: r300g and r600g do not need libdrm_radeon

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-19 03:13:35 +02:00
Marek Olšák
8c47a5da9f xvmc-softpipe: remove LLVM_LIBS
this is added conditionally in Makefile.xmvc

Spotted by Chris Rankin.
2011-07-18 23:41:45 +02:00
Kenneth Graunke
348bdaa529 i965: Rename CMD_VF_STATISTICS_(965|GM45) to include "3DSTATE".
Including the full "3DSTATE_VF_STATISTICS" should make it easier to
cross-reference the code and documentation.

Also, move the 965/GM45 suffix to the beginning for consistency with
newer #defines.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Kenneth Graunke
797522f1c9 i965: Rename CMD_VERTEX_(BUFFER|ELEMENT) to 3DSTATE_VERTEX_...S.
This makes our code use the same names as the documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Kenneth Graunke
29a911c50e i965: Rename 3DSTATE_DRAWRECT_INFO_I965 to 3DSTATE_DRAWING_RECTANGLE.
The documentation uses 3DSTATE_DRAWING_RECTANGLE, and we already had it
defined in brw_defines.h; we were simply using an old #define from
intel_reg.h.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-18 14:14:36 -07:00
Eric Anholt
cb5e0ba2aa i915: Simplify intel_wpos_* with a helper function. 2011-07-18 11:26:34 -07:00
Eric Anholt
fceda4342c i915: Include gl_FragCoord.w data, not just xyz.
Fixes piglit fragcoord_w test.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34323
2011-07-18 11:26:33 -07:00
Eric Anholt
af9548d335 i915: Add support for HW rendering with no color draw buffer.
This is useful for shadow map generation.  Tested with glsl-bug-22603,
which rendered the depth textures with fallbacks before.

Acked-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
debf751aea i915: Fix incorrect depth scaling when enabling/disabling depth buffers.
We were updating our new viewport using the old buffers' _WindowMap.m.
We can do less math and avoid using that deprecated matrix by just
folding the viewport calculation right in to the driver.

Fixes piglit fbo-depthtex.
2011-07-18 11:26:33 -07:00
Eric Anholt
79fee3a76b i915: Make stencil test for no-stencil handling match depth test.
i915_update_draw_buffers() already handles the fallback bit for
missing stencil region, so here we just need to handle whether the GL
thinks we have stencil data or not (and disable the test if so).
2011-07-18 11:26:33 -07:00
Eric Anholt
fc4fba52cf i915: Disable the depth test whenever we don't have a depth buffer.
We were disabling it once at the moment we changed draw buffers, but
later enabling of depth test could turn it back on.  Fixes
fbo-nodepth-test.

Note that ctx->DrawBuffer has to be checked because during context
create we get called while it's still unset.  However, we know we'll
get an intel_draw_buffer() after that, so it's safe to make a silly
choice at this point.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30080
2011-07-18 11:26:33 -07:00
Eric Anholt
4c47fce92e i915: Remove i965 paths from i915_update_drawbuffer() and i830's too.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
94efc350b4 i965: Remove i915 paths from brw_update_draw_buffers().
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
c68270a26b i965: Remove unused region calculations in brw_update_draw_buffer().
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
15af0f54b8 i965: Remove empty brw_set_draw_region.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
dd898c3e89 i965: Remove FALLBACK() from brw_update_draw_region().
The 965 driver doesn't use these for deciding on fallbacks.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
f34ec6169d intel: Move intel_draw_buffers() code into each driver.
The illusion of shared code here wasn't fooling anybody.  It was
tempting to keep i830 and i915 still shared, but I think I actually
want to make them diverge shortly.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
8cf2741d2b intel: Clarify the depthRb == stencilRb logic.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-18 11:26:33 -07:00
Eric Anholt
96cdbf4340 intel: Use the post-execution batchbuffer contents for dumping.
We were missing out on all the relocation changes by dumping what we
subdata()ed in instead of what's there after the kernel finished with
it.
2011-07-18 11:26:33 -07:00
Paul Berry
f07221056e glsl: Ensure that sampler declarations are always uniform or "in" parameters.
This brings us into compliance with page 17 (page 22 of the PDF) of
the GLSL 1.20 spec:

    "[Sampler types] can only be declared as function parameters or
    uniform variables (see Section 4.3.5 "Uniform"). ... [Samplers]
    cannot be used as out or inout function parameters."

The spec isn't explicit about whether this rule applies to
structs/arrays containing shaders, but the intent seems to be to
ensure that it can always be determined at compile time which sampler
is being used in each texture lookup.  So to avoid creating a
loophole, the rule needs to apply to structs/arrays containing shaders
as well.

Fixes piglit tests spec/glsl-1.10/compiler/samplers/*.frag, and fixes
bug 38987.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38987
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-18 10:48:27 -07:00
Paul Berry
ddc1c96390 glsl: Move type_contains_sampler() into glsl_type for later reuse.
The new location, as a member function of glsl_type, is more
consistent with queries like is_sampler(), is_boolean(), is_float(),
etc.  Placing the function inside glsl_type also makes it available to
any code that uses glsl_types.
2011-07-18 10:48:27 -07:00
Vadim Girlin
9b3ec69cf4 r600g: fix corner case checks for the queries 2011-07-18 08:53:47 -04:00
Henri Verbeet
3093cbaad9 r600g: Get rid of leftover PB_USAGE_* flags.
These happen to work because their values are the same as the equivalent
PIPE_TRANSFER_* flags, but it's still misleading.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-18 01:36:07 +02:00
Ian Romanick
66f4ac988d linker: Only over-ride built-ins when a prototype has been seen
The GLSL spec says:

    "If a built-in function is redeclared in a shader (i.e., a
    prototype is visible) before a call to it, then the linker will
    only attempt to resolve that call within the set of shaders that
    are linked with it."

This patch enforces this behavior.  When a function call is processed
a flag is set in the ir_call to indicate whether the previously seen
prototype is the built-in or not.  At link time a call will only bind
to an instance of a function that matches the "want built-in" setting
in the ir_call.

This has the odd side effect that first call to abs() in the shader
below will call the built-in and the second will not:

float foo(float x) { return abs(x); }
float abs(float x) { return -x; }
float bar(float x) { return abs(x); }

This seems insane, but it matches what the spec says.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31744
2011-07-17 13:02:49 -07:00
Jeremy Huddleston
7eed3d4808 darwin: Include glxhash.c in libGL on darwin
Fixes a build regression introduced by 4df137691e

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-16 22:02:55 -07:00
Emil Velikov
55b415ff77 xvmc-nouveau: Resolve build
The following resolves the build issues and missing symbols
Add "xvmc-nouveau/target.c" - missing symbol "driver_description"
Add "drivers/nvc0/libnvc0.a" - missing symbol "nvc0_screen_create"
Remove "drivers/softpipe/libsoftpipe.a" - unnessecary dependency
resolves build (when building without swrast)
Add "drivers/trace/libtrace.a" in Makefile

Note: With/without those patches xvmc-nouveau still segfaults
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2011-07-16 11:21:48 -04:00
Christoph Bumiller
56503fd138 nv50: fix bogus error message about 3d surfaces 2011-07-16 13:00:52 +02:00
Vinson Lee
9228bfb375 gallivm: Rename createAsmInfo to createMCAsmInfo with llvm-3.0.
llvm-3.0svn r135219 renamed createAsmInfo to createMCAsmInfo in
include/llvm/Target/TargetRegistry.h.
2011-07-16 00:17:46 -07:00
Marek Olšák
7854b8cb16 xmlconfig: remove an unused-but-set variable
I hate gcc 4.6 already.
2011-07-15 21:48:29 +02:00
Marek Olšák
036fb07908 r600g: print to stderr that a CS has been rejected by the kernel
Just fixing the warning that r is unused.
2011-07-15 21:48:29 +02:00
Marek Olšák
dade65505b prog_optimize: fix a warning that a variable may be uninitialized 2011-07-15 21:48:28 +02:00
Marek Olšák
ed5e95ada6 r300/compiler: remove an unused-but-set variable and simplify the code 2011-07-15 21:48:28 +02:00
Marek Olšák
2ce6c3ea6e r300/compiler: fix a warning that a variable may be uninitialized 2011-07-15 21:48:28 +02:00
Marek Olšák
2f02c2fe56 st/mesa: remove unused-but-set variables in st_program.c 2011-07-15 21:48:28 +02:00
Marek Olšák
3032d064fb swrast: remove an unused-but-set variable 2011-07-15 21:48:28 +02:00
Marek Olšák
eca3152de0 mesa: fix unused-but-set-variable warnings in dlist.c 2011-07-15 21:48:28 +02:00
Vadim Girlin
ef29bfee03 r600g: fix queries and predication
Use all zpass data for predication instead of the last block only.
Use query buffer as a ring instead of reusing the same area
for each new BeginQuery. All query buffer offsets are in bytes
to simplify offsets math.
2011-07-15 15:42:46 -04:00
Marc Pignat
cfec000e75 drisw: Fix 24bpp software rendering, take 2
This patch add the support for 24bpp in the dri/swrast implementation.
See http://bugs.freedesktop.org/show_bug.cgi?id=23525

Signed-off-by: Marc Pignat <marc at pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-15 10:09:14 -06:00
Christian König
0d082390d9 g3dvl: no need for flushing inside the compositor any more
Move that also inside the state tracker where needed.
2011-07-15 17:54:06 +02:00
Christian König
2cbf532ae1 g3dvl: correctly distinct dst area and clip area in the compositor
Otherwise xine won't scale correctly.
2011-07-15 17:36:02 +02:00
Alex Deucher
a3d23a4868 r600c/g: add new NI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-07-15 10:55:02 -04:00
Christian König
1cf06218e4 g3dvl: link r300 and r600 targets width libdrm instead of libdrm_radeon 2011-07-15 10:45:31 +02:00
Marek Olšák
a2381665d5 gallium/targets: link vdpau, va, and xvmc with LLVM libs when requested
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-07-15 10:31:07 +02:00
Christian König
13da00f07c g3dvl: change picture parameter of decode_bitstream to general version
Using pipe_mpeg12_picture_desc was unintentional here.
2011-07-15 10:22:51 +02:00
Younes Manton
d4be170e8b g3dvl: Build softpipe when needed. 2011-07-15 01:30:21 -04:00
Younes Manton
b97816ddee g3dvl: Build the right winsys dependencies when needed. 2011-07-15 01:12:14 -04:00
José Fonseca
864eb844ff make: Fix program/lex.yy.c & friends generation.
Not sure how this ever worked before, given that the Makefile is in
src/mesa, not src/mesa/program.
2011-07-14 17:35:05 +01:00
José Fonseca
9a7f84d6b2 Squashed commit of the following:
commit 1856230d9fa61710cce3e152b8d88b1269611a73
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Tue Jul 12 23:41:27 2011 +0100

    make: Use better var names on packaging.

commit d1ae72d0bd14e820ecfe9f8f27b316f9566ceb0c
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Tue Jul 12 23:38:21 2011 +0100

    make: Apply several of Dan Nicholson's suggestions.

commit f27cf8743ac9cbf4c0ad66aff0cd3f97efde97e4
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 14:18:20 2011 +0100

    make: Put back the tar.bz2 creation rule.

    Removed by accident.

commit 34983337f9d7db984e9f0117808274106d262110
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 11:59:29 2011 +0100

    make: Determine tarballs contents via git ls-files.

    The wildcards were a mess:
    - lots of files for non Linux platforms missing
    - several files listed and archived twice

    Using git-ls-files ensures things are not loss when making the tarballs.

commit 34a28ccbf459ed5710aafba5e7149e8291cb808c
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 11:07:14 2011 +0100

    glut: Remove GLUT source.

    Most distros ship freeglut, and most people don't care one vs the other,
    and it hasn't been really maintained.

    So it is better to have Mesa GLUT be revisioned and built separately
    from Mesa.

commit 5c26a2c3c0c7e95ef853e19d12d75c4f80137e7d
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 10:31:02 2011 +0100

    Ignore the tarballs.

commit 26edecac589819f0d0efe2165ab748dbc4e53394
Author: José Fonseca <jose.r.fonseca@gmail.com>
Date:   Sat Jul 9 10:30:24 2011 +0100

    make: Create the Mesa-xxx-devel symlink automatically.

    Also actually remote the intermediate uncompressed tarballs.
2011-07-14 17:35:05 +01:00
Marcin Baczyński
ff2efdf599 configure: allow C{,XX}FLAGS override
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-14 10:34:02 -06:00
Marcin Baczyński
fa013419de configure: fix gcc version check
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-14 09:54:51 -06:00
Dave Airlie
b6df603e65 vbo: minor optimisation in vbo_exec_DrawRangeElements
this moves getting the context into the debug in this function,

just spotted it trawling callgrind traces for other things.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-07-14 15:22:58 +01:00
Brian Paul
e5f7e09210 gallium: don't use enum bitfields in p_video_state.h
Silences many warnings about "type of bit-field ‘field_select’ is a
GCC extension".

Since the field sizes were 8 and 16 bits, just use basic types.
2011-07-14 08:14:14 -06:00
Brian Paul
a5a9422561 gallium: put video-related enums in separate header
The forward references to video enum types in p_context.h causes
a massive number of compiler warnings (ISO C forbids forward references
to ‘enum’ types).

By putting the new video enums in a separate header that can be included
by p_context.h and p_screen.h we can avoid this.

Acked-by Christian König <deathsimple@vodafone.de>
2011-07-14 08:14:14 -06:00
Brian Paul
9726947b68 i915g: move declaration before code 2011-07-14 08:14:13 -06:00
Brian Paul
db0f2b3637 mesa: use inline function wrapper for _mesa_reference_texobj() 2011-07-14 08:14:13 -06:00
Brian Paul
74142f1bf2 mesa: use inline function wrapper for _mesa_reference_renderbuffer() 2011-07-14 08:14:13 -06:00
Brian Paul
5db7723ada mesa: use inline function wrapper for _mesa_reference_framebuffer() 2011-07-14 08:14:08 -06:00
Brian Paul
6214963c00 main: use inline function wrapper for _mesa_reference_buffer_object() 2011-07-14 08:09:38 -06:00
Dave Airlie
323e4bff79 mesa: split _mesa_reference_program() into hot/cold paths.
inline the hotpath of the reference remaining the same. This shouldn't
penalise the slow path at all but improve the hot path so we don't have
to jump to the function.

It also moves some assert checks under an #ifndef NDEBUG.

Minor clean-ups added by Brian.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-14 08:09:38 -06:00
Christian König
8619aa5683 g3dvl: check for existense of VA API header/libs
Building the VA state tracker only works when the header/libs are available.
Also add a warning that the state tracker is currently undmaintained.
2011-07-14 15:36:34 +02:00
Christian König
33bf410ace g3dvl: check for existense of VDPAU header/libs
Building the VDPAU state tracker only works when the header/libs are available.
2011-07-14 15:36:24 +02:00
Christian König
a8ae8cf3f1 g3dvl: check for existense of XvMC header/libs
Building the XvMC state tracker only works when the header/libs are available.
2011-07-14 15:36:14 +02:00
Christoph Bumiller
7e2827fad9 nv50,nvc0: extensive surface format renaming to get consistency
Now the component ordering is consistent and matches gallium again.
2011-07-14 12:51:06 +02:00
Christoph Bumiller
b2dcf880e8 nv50,nvc0: add support for multi-sample resources 2011-07-14 12:51:06 +02:00
Christoph Bumiller
c011f94b7b nv50,nvc0: add correct storage type for Z32_FLOAT 2011-07-14 12:51:06 +02:00
Christoph Bumiller
cad17554c4 nv50,nvc0: unify nvc0_miptree and nv50_miptree structs
Share some functions and restructure miptree creation a little.
Prepare for multi-sample resources.
2011-07-14 12:51:06 +02:00
Christoph Bumiller
ebeec1d43a nv50,nvc0: don't advertise unaligned texture format support
Because we don't support them.
For instance, R32G32B32 is not R32G32B32X32 as was assumed.

Add support for R8G8B8X8_UNORM instead of R8G8B8_UNORM surfaces.
2011-07-14 12:51:06 +02:00
Vinson Lee
3cf22a0c6e g3dvl: Remove non-constant expression array initializers.
The array initializer must be a constant expression in MSVC.
2011-07-13 21:57:50 -07:00
Marek Olšák
02c8ee202f configure.ac: don't build gallium driver libs just to see if there are no errors
I think the past are those times when the gallium interface was changed all
the time. Now it is not, so there is no reason to always compile the libs
if they are not needed.
2011-07-14 03:03:26 +02:00
Marek Olšák
67aba799bc gallium/targets: do not link every driver with libllvmpipe.a
Only some targets need that, the others don't.
2011-07-14 03:03:26 +02:00
Marek Olšák
5fe54df58f Rename swrastg_dri to swrast_dri
I prefer it this way and it has been suggested earlier by others too.
Opinions?
2011-07-14 03:03:26 +02:00
Brian Paul
b82db9a3c0 softpipe: fix various warnings about int/float/double conversions, etc 2011-07-13 18:54:31 -06:00
Vinson Lee
f292d07b47 g3dvl: Remove designated initializers.
MSVC does not support designated initializers.
2011-07-13 17:00:26 -07:00
Vinson Lee
49967950a5 g3dvl: s/inline/INLINE/
The inline keyword is not available in MSVC C.
2011-07-13 15:59:08 -07:00
Emil Velikov
88d647d83b utils: Add missing parentheses
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-13 16:37:29 -06:00
Vinson Lee
3e58345794 softpipe: Remove sp_video_context.c from SConscript.
sp_video_context.c was added to SConscript in commit
ed24e19070 (pipe-video merge) but no file
of that name was added.
2011-07-13 14:50:12 -07:00
Christian König
d4cbd1272b [g3dvl] don't upload all quant buffer layers at once
There seems to be a bug in r600g when uploading more than one layer of a
3D resource at once with a hardware blit.

So just do them one at a time to workaround this.
2011-07-13 23:33:20 +02:00
Christian König
ed24e19070 Merge branch 'pipe-video' 2011-07-13 22:56:06 +02:00
Stéphane Marchesin
85e1fa5506 i915g: don't try to check if a NULL buffer is busy. 2011-07-13 11:59:10 -07:00
Stéphane Marchesin
f7a85f603b Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa 2011-07-13 11:56:44 -07:00
Vadim Girlin
4f4855b249 st/mesa: flush bitmap cache on query and conditional render boundaries
Bitmap caching shouldn't affect the results of the queries and
conditional render.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-13 11:58:29 -06:00
Christian König
a2a6799fbe [g3dvl] remove some unneeded Makefiles 2011-07-13 19:37:28 +02:00
Christian König
211887c92b r600g: reenable hardware blits for STATIC and IMMUTABLE resources
Getting the driver in sync with mainline.
2011-07-13 17:05:58 +02:00
Christian König
a0a22fead5 r600g: prevent hardware blitting based on resource usage
It doesn't make much sense for STAGING and STREAM resources to be
hardware blitted into VRAM.
2011-07-13 16:37:15 +02:00
Christian König
c5110a1bfa [g3dvl] implement workaround for missing blender clamp control
It's about 20% slower, but should at least work with every hardware.
2011-07-13 16:07:30 +02:00
Christian König
c8dd301b6f r600g: revert "set BLEND_CLAMP depending on clamp_fragment_color"
BLEND_CLAMP doesn't seems to be the right way to implement "ARB_color_buffer_float".
2011-07-13 15:54:28 +02:00
Christian König
7c48575402 [g3dvl] keep a pointer in idct buffer to idct object
So we always know to which idct object a buffer belongs
2011-07-13 15:01:40 +02:00
Chia-I Wu
5fe5d236c2 targets/egl-static: fix a linking error
rbug is always linked in and it needs libpthread.
2011-07-13 15:26:34 +08:00
Eric Anholt
556a47a262 i915: Add support for gl_FragData[0] for output color.
We advertised ARB_draw_buffers, but either fell back to software when
using this output, or assertion failed.  Fixes glsl-fs-fragdata-1, and
failures in some webgl conformance tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39024
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34906
2011-07-12 16:01:21 -07:00
Daniel Vetter
ed570cb5e5 i915g: fixup context desdruction
Reported-by: Christopher Egert <cme3000@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-07-13 00:09:36 +02:00
Eric Anholt
f2fd0d6304 i915: Fix NPOT compressed textures on 915.
We were failing at rounding, misplacing the non-baselevels.  Fixes:
3DFX_texture_compression_FXT1/fbo-generate-mipmaps
ARB_texture_compression/fbo-generate-mipmaps
EXT_texture_compression_s3tc/fbo-generate-mipmaps

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:41:04 -07:00
Eric Anholt
898be7d5ac mesa: Fix assertion failure in X8_Z24/Z24_X8 texfetch.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:41:01 -07:00
Eric Anholt
6aae729d6e i915: Fix depth texturing since 86e62b2357
The 965 driver already had the X8_Z24 case, but 915 was missing it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:40:52 -07:00
Eric Anholt
9a82d89a8f i915: Use _mesa_get_format_name to describe translate_tex_format() fail.
I don't want to go count up to what format number 29 is.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-12 14:40:43 -07:00
Eric Anholt
6e6b388604 i915: Fix map/unmap mismatches from leaving INTEL_FALLBACK during TNL.
The first rendering after context create didn't know of the color
buffer yet, triggering a sw fallback.  The intel_prepare_render() from
intelSpanRenderStart then found the buffer and turned off fallbacks,
but intelSpanRenderFinish was never called and things were left
mapped.  By checking buffers before making the call on whether to do
the fallback pipeline or not, we avoid the fallback change inside of
the rendering pipeline.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31561
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:40:39 -07:00
Eric Anholt
aceb66951d intel: Use _mesa_tex_target_to_face() helper function instead of our own.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-12 14:40:31 -07:00
Alex Deucher
5d0d8366f9 r600g: emit SQ_LDS_RESOURCE_MGMT
Need to be initialized to a reasonable value as
compute code may change it.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=39119

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-12 12:01:25 -04:00
Brian Paul
8f6c207024 u_upload_mgr: add missing offset to src map in u_upload_buffer()
Fixes regression from dda8d7ac3f
2011-07-12 09:48:01 -06:00
Emil Velikov
1ab5e15242 st/mesa: check if _mesa_create_context() returns NULL
In some cases _mesa_create_context() can return NULL an in the mesa
state tracker, we do not concider the case, which may cause issues
within st_create_context_priv()

This patch adds a simple check (similar to the one in the dri drivers)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-12 08:30:15 -06:00
Christian König
5e5d7acc2f vaapi: cleanup the source and let the st at least compile again 2011-07-12 11:08:12 +02:00
Emil Velikov
4ef9c3d21b autoconf: Do not select Xlib when building DRI
As Chia-I Wu said 'There are two libGL providers, Xlib and DRI based
they cannot coexist'

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <maraeo@gmail.com>
2011-07-12 01:38:28 +02:00
Marek Olšák
c369fb42ee st/mesa: choose a matching depth internal format for DrawPixels
This makes it easier to hit the fast path and get a float format
when we ask for it.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-12 01:32:23 +02:00
Christian König
efc7fda462 [g3dvl] add some more PIPE_VIDEO_CAPs 2011-07-12 00:12:12 +02:00
Ian Romanick
db311b45be configure.ac: Make --{without,with}-gallium-drivers work as expected
This version is mostly Dan's post to the mesa-dev mailing list on
6/22/2011.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-07-11 15:02:16 -07:00
Marek Olšák
2df4b6117b st/mesa: get rid of unnecessary 'goto' in DrawPixels
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-11 23:45:01 +02:00
Marek Olšák
ab4d629613 st/mesa: derive a stencil sampler format from the actual texture format
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-11 23:45:01 +02:00
Vinson Lee
1844ae7e7e gallivm: Re-enable LLVMUnionTypeKind case for llvm-2.7 only.
LLVMUnionTypeKind is not in llvm-2.6, llvm-2.8, llvm-2.9, or llvm-3.0svn.
2011-07-11 14:08:24 -07:00
Andrew Randrianasulu
a09b7f7f15 dri/nouveau: nv10: fix vertex format for GL_UNSIGNED_BYTE
Broken accidentally in f4efc256fd,
the switch to rnn headers.

NV10TCL_VTXFMT_TYPE_BYTE_RGBA became U8_UNORM but B8G8R8A8_UNORM
was used instead.
2011-07-11 22:12:13 +02:00
David Heidelberger
278b832b78 nvfx: handle PIPE_CAP_SM3
Signed-off-by: David Heidelberger <d.okias@gmail.com>
2011-07-11 21:52:24 +02:00
Vinson Lee
e4189f2e2e gallivm: Remove LLVMOpaqueKindType case with llvm-3.0.
llvm-3.0svn r134829 removed LLVMOpaqueKindType from enum LLVMTypeKind in
include/llvm-c/Core.h.
2011-07-11 12:48:06 -07:00
Kenneth Graunke
7304909d65 glsl: Reject ambiguous function calls (multiple inexact matches).
According to the GLSL 1.20 specification, "it is a semantic error if
there are multiple ways to apply [implicit] conversions [...] such that
the call can be made to match multiple signatures."

Fixes a regression caused by 60eb63a855,
which implemented the wrong policy of finding a "closest" match.
However, this is not a revert, since the original code failed to
continue looking for an exact match once it found two inexact matches.

It's OK to have multiple inexact matches if there's also an exact match.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38971
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 10:53:28 -07:00
Kenneth Graunke
186e37c754 i965/gen7: Add support for gl_PointCoord.
This is exactly analogous to Eric's Gen6 change in commit
6861a70177.  His explanation:

"This is just like PointSprite overrides, but it's always on for that
 attribute."

Fixes glsl-fs-pointcoord and gtf/point_sprites.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 10:46:35 -07:00
Kenneth Graunke
147d010295 i965/gen7: Fix point sprite texture coordinate overrides.
This is exactly analogous to Eric's Gen6 change in commit
f304bb8a5d.  His explanation:

"We were assuming that the input attribute n to the FS was
 FRAG_ATTRIB_TEXn, which happened to be true often enough for our
 testcases."

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 10:46:35 -07:00
Kenneth Graunke
5edb3ddf41 i965/gen7: Refactor SF setup a bit to handle overrides in one place.
This is exactly analogous to Eric's Gen6 change in commit
e7280b16d6.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 10:46:35 -07:00
Eric Anholt
f07cfebebe i965/gen4: Add a stub dumper for CC unit state, which is different from gen6.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
f7f03fb588 i965/gen4: Add state dumping for unit state using state_batch_list[].
This is just barely more pretty-printing than we previously had, but
at least it doesn't leave out unit states in the log.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
a1226bcd20 i965/gen6: Add state dumping for the VS constants.
This is quite a bit of spam, but I think it's useful to have in a full
INTEL_DEBUG=batch dump.  And a lot of this spam on glxgears is just
because we're awful at handling our constants :/

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
6e17a01e42 i965/gen6: Add state dumping for the scissor packet.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:27 -07:00
Eric Anholt
93c7a5da11 i965: When dumping programs, dump the whole cache. But don't by default.
The previous brw_state_dump output was rather useless -- last used
program per batch, and just the hex.  Now we dump all programs (since
we don't know which were used), and disassemble them.  But that's a
ton of spam, and usually when looking into program contents we use
INTEL_DEBUG={vs,wm,misc,other} and when looking into state updates we
use INTEL_DEBUG=batch, so this dump usually just massively clutters up
the output.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
6bbaa7c0e5 i965: Dump the binding table using state_batch_list[].
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
13e82ece6d i965: Dump the surface, sampler, and sdc state using state_batch_list[].
Now, for example, INTEL_DEBUG=batch tex-border-1 shows all the
texturing state involved.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
709a7af2af i965: Dump brw_state_batch data in an easier format for cross-referencing.
Now that we're using state base addresses for most things, we're less
interested in the absolute address of the state, and more in its
offset from the state base address (start of batchbuffer).  Also,
reorder the printout so it looks more like the batchbuffer dump.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
d484667423 i965: Map the batch once for dumping all our state batch structs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
00f07b33ec i965: Move the new gen6 state structs to using state_batch_list[].
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
fbfeff73f3 i965: Move the SF VP state dump to using the state_batch_list[]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
2a8d744345 i965: Move CLIP VP state dump to using the state_batch_list[].
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
65c6de000e i965: Track the brw_state_batch() data while under INTEL_DEBUG=batch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
d375df220f i965: Add a type argument to brw_state_batch().
I want to make brw_state_dump.c handle more than just the last
statechange, so I want to keep track of what's in the batch state.  By
using AUB file numbering for most of these packets, this may be
reusable for aub dumping.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Eric Anholt
35d5d5df72 intel: Make our context structure be a ralloc context.
This will let me hang cached compiler structs off of the context
without having to worry about cleaning them up at destroy time.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-11 09:27:26 -07:00
Brian Paul
be8551220c configs: do not let llvm-config define NDEBUG in debug builds
Following the examples of Marek and Jose for autoconf and scons.
2011-07-11 10:07:43 -06:00
Eric Anholt
a166720f2d ir_to_mesa: typo fix in a comment. 2011-07-11 08:58:37 -07:00
Eric Anholt
46a7639174 i965: Fix fp-dst-aliasing-[12].vpfp.
There's no pretty way to avoid the overwriting of the src operands, so
just use a temporary destination and rely on the MOV optimization.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-11 08:58:37 -07:00
Eric Anholt
e3ea5bc08e i965: Fix fp-lit-src-equals-dst.
We were stomping over the source for the body of the LIT instruction
when doing the MOV of 1.0 to the uninteresting channels.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-11 08:58:37 -07:00
Marek Olšák
be039d296d configure.ac: do not let llvm-config define NDEBUG in debug builds
Re-enables assertions in src/mesa.
2011-07-11 17:32:06 +02:00
José Fonseca
acf82194ce scons: Filter-out NDEBUG define from llvm-config.
Based on a similar autoconf change from Marek.
2011-07-11 15:38:06 +01:00
Christian König
df5e0b9435 [g3dvl] fix a whole bunch of memory leaks 2011-07-11 16:29:02 +02:00
Brian Paul
d60880db35 glx: add a few missing glXChooseFBConfig() attributes
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38842

NOTE: This is a candidate for the 7.11 branch.
2011-07-11 08:02:49 -06:00
Brian Paul
bb0d5cae00 glext.h: update to version 71 2011-07-11 08:02:48 -06:00
Marek Olšák
6c53d75e7d mesa: fix assertion failure in delete_wrapper 2011-07-11 15:32:34 +02:00
Marek Olšák
ceb04b32ba mesa: add a comment in _mesa_test_formats 2011-07-11 15:18:14 +02:00
Christian König
a7ec477ebc [g3dvl] revert some unintended white space changes 2011-07-11 14:36:03 +02:00
Marek Olšák
e134eaa2c5 mesa: fix assertion failure in _mesa_test_formats
Z32_FLOAT_X24S8 has DataType of GL_NONE.
2011-07-11 14:32:32 +02:00
Christian König
3d1057f243 [g3dvl] sync SConscript with Makefile 2011-07-11 13:55:56 +02:00
Christian König
96718d98de [g3dvl] softpipe is no longer needed for dri-nouveau 2011-07-11 12:31:54 +02:00
Christian König
358795bc0b r600g: revert "support textures with scaled number formats"
We should add those probably when merged to master.
2011-07-11 11:39:11 +02:00
Christian König
d6eb1f8257 pipe-video: merge fixes 2011-07-11 11:28:23 +02:00
Christian König
e45d895824 [g3dvl] remove some stale nv40 files 2011-07-11 11:08:45 +02:00
Christian König
f8898a70df [g3dvl] remove pipe_video_context from nouveau 2011-07-11 11:06:05 +02:00
Christian König
f919547f37 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state_inlines.h
2011-07-11 10:48:59 +02:00
Marek Olšák
12265d26dd Revert "WIP r600g: depth_buffer_float renderbuffer support on evergreen"
This reverts commit 91a52dae97.

Pushed accidentally.
2011-07-11 04:17:45 +02:00
Marek Olšák
dc9d789d1b r600g: more valgrind fixes 2011-07-11 04:13:35 +02:00
Marek Olšák
daf6604435 r600g: zero memory of ioctl parameters
Fixes valgrind warning.
2011-07-11 04:01:06 +02:00
Marek Olšák
01f48a979d mesa: implement packing of DEPTH_STENCIL & FLOAT_32_UNSIGNED_INT_24_8_REV combo
Tested with the new piglit fbo-depthstencil test.
2011-07-11 03:04:17 +02:00
Marek Olšák
91a52dae97 WIP r600g: depth_buffer_float renderbuffer support on evergreen 2011-07-10 21:47:20 +02:00
Marek Olšák
d1214cca08 swrast: fix depth/stencil blits when there's no colorbuffer
NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-07-10 21:47:20 +02:00
Marek Olšák
83478e5d59 mesa: return early if mask is cleared to zero in BlitFramebuffer
From ARB_framebuffer_object:
    If a buffer is specified in <mask> and does not exist in both the
    read and draw framebuffers, the corresponding bit is silently
    ignored.
2011-07-10 21:47:20 +02:00
Marek Olšák
3414447011 docs: update GL3 status 2011-07-10 21:41:17 +02:00
Marek Olšák
89954723bf r600g: depth_buffer_float support on r600-r700 2011-07-10 21:41:17 +02:00
Marek Olšák
d9ab6712cc gallium/util: handle Z32F_FLOAT_S8X24_USCALED in pipe_tile_raw_to_rgba
And make pipe_put_tile_rgba_format no-op like the other Z formats.
2011-07-10 21:41:17 +02:00
Marek Olšák
e860cb64db gallium/util: implement software Z32F_S8X24 depth-stencil clear 2011-07-10 21:41:17 +02:00
Marek Olšák
8ff6f90c3f gallium/util: implement pack functions for Z32F and Z32F_S8X24 2011-07-10 21:41:17 +02:00
Marek Olšák
e517e5ac7c st/mesa: implement read/draw/copypixels for Z32F and Z32F_S8X24 2011-07-10 21:41:17 +02:00
Marek Olšák
adea7ea0bc st/mesa: initial ARB_depth_buffer_float support 2011-07-10 21:41:17 +02:00
Marek Olšák
ba15e8260e mesa: implement depth/stencil renderbuffer wrapper accessors for Z32F_X24S8
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
bde6a04458 mesa: implement generatemipmap for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
b2f087cd87 mesa: implement texstore for DEPTH32F_STENCIL8
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
bc878c7f8b mesa: implement texstore for DEPTH_COMPONENT32F
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
bfb63b7d62 mesa: implement depth unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
ec6fbbe36e mesa: implement stencil unpacking for GL_FLOAT_32_UNSIGNED_INT_24_8_REV
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:17 +02:00
Marek Olšák
4843c7b24a mesa: implement texfetch functions for depth_buffer_float
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:16 +02:00
Marek Olšák
1165280cbd mesa: initial ARB_depth_buffer_float support
Using GL_NONE as DataType of Z32_FLOAT_X24S8, not sure what I should put there.
The spec says the type is n/a.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-10 21:41:16 +02:00
Vadim Girlin
f0a7e28e29 r600g: LIT: clamp negative src.y to 0
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39083

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-07-10 13:19:38 -04:00
Marek Olšák
d644a50dc3 st/dri: remove unused variables 2011-07-10 17:40:38 +02:00
Christian König
cd4f18089e vdpau: make capabilities query more sane 2011-07-10 14:13:08 +02:00
Christian König
3d769619e2 vdpau: implement VdpOutputSurfaceGetParameters 2011-07-10 13:48:37 +02:00
Chia-I Wu
95f9e118fe st/egl: fix linking errors
Add symbols referenced by src/glx/dri2.c.
2011-07-10 15:11:15 +08:00
Kenneth Graunke
440224ab73 intel: Recognize all depth formats in get_teximage_readbuffer.
The existing code was missing GL_DEPTH_COMPONENT32, resulting in it
wrongly returning the color buffer instead of the depth buffer.

Fixes an issue in PlaneShift 0.5.7 when casting spells.  The game calls
CopyTexSubImage2D on buffers with a GL_DEPTH_COMPONENT32 internal
format, which (prior to this patch) resulted in an attempt to copy
ARGB8888 to X8_Z24.

Instead of adding the missing enumeration directly, convert the code to
use _mesa_is_depth_format() and _mesa_is_depthstencil_format() as these
should catch any newly added depth formats in the future.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-09 10:37:42 -07:00
Henri Verbeet
7e591111bf r600g: Get rid of some superfluous braces.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
2e53725bbc r600g: Check for Evergreen chip class instead of Cedar family in r600_context_flush().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
2b5b289a57 r600g: Store the chip class directly in r600_bc.
Instead of deriving it from the family again.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
89dc31a28d r600g: Replace the CHIPREV_* defines with the chip_class enum.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
4f7dfd8ad3 r600g: Get rid of the superfluous family field from r600_shader.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
b3b946b0ab r600g: Store the chip class in r600_pipe_context.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Henri Verbeet
949896b82f r600g: Fix the type of the family field in r600_pipe_context.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-09 18:12:50 +02:00
Eric Anholt
d03fdc4cde i965/gen4: Fix GPU hangs since the program streaming change.
This was tricky.  We were doing a use-before-initialize of
grf_reg_count, but the value usually got overwritten anyway -- when we
didn't have to do a relocation (typical), or on gen5 when we didn't
have relocations at all.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38771
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-09 07:45:48 -07:00
Kenneth Graunke
57b57f6d1c i965/gen7: Remove gratuitous dirty flags from WM and PS state.
Commit b46dc45cee claimed that
NEW_POLYGONSTIPPLE is gratuitous, but somehow just changed comments
and whitespace instead of actually removing the flag.

While we're at it, 3DSTATE_PS doesn't appear to need NEW_LINE or
NEW_POLYGON either (those are in 3DSTATE_WM).  Also, 3DSTATE_WM
doesn't appear to need BRW_NEW_NR_WM_SURFACES or BRW_NEW_CURBE_OFFSETS
either (those are in 3DSTATE_PS).

NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 23:24:55 -07:00
Christian König
3ed8182c76 [g3dvl] stop calling dri2DestroyDrawable
When switching channels with xine it sometimes happens that xine
destroys the drawable before we get a chance to call
DRI2DestroyDrawable, resulting in an x error.
2011-07-09 00:00:10 +02:00
Vadim Girlin
3efb47f0b0 r600g: introduce r600_bc_src_toggle_neg helper and fix SUB & LRP
SUB & LRP instructions should toggle NEG bit instead of setting it,
otherwise e.g. "SUB a,b,-1" is translated as "ADD a,b,-1"

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin
f87d566f4b r600g: introduce r600_bc_src_set_abs helper and fix LOG
LOG instruction should use absolute values of source operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin
b693787fdf r600g: RSQ: clear NEG for operand
Need to clear NEG bit because it applies after ABS, e.g. "RSQ ..., -1"
uses -|1| as operand.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Vadim Girlin
86f8b4117f r600g: LIT: swap MUL_LIT operands to fix 0^0
For 0^0 case result of "LOG_CLAMPED ...,0" is -MAX_FLOAT, and then result of
"MUL_LIT ...,0,-MAX_FLOAT,..." is -MAX_FLOAT instead of 0 because of special
src1 checks for -MAX_FLOAT. So swap src0/1:
"MUL_LIT ...,-MAX_FLOAT,0,..." to get expected 0, then result of
"EXP_IEEE ...,0" is 1 as expected for LIT.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-07-08 17:21:32 -04:00
Jesse Barnes
4df137691e GLX/DRI2: handle swap event swap count wrapping
Create a new GLX drawable struct to track client related info, and add a
wrap counter to it drawable and track it as we receive events.  This
allows us to support the full 64 bits of the event structure we pass to
the client even though the server only gives us a 32 bit count.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-07-08 12:38:20 -07:00
Jesse Barnes
1e39fc784b DRI2/GLX: use new swap event types
Use the new swap event type so we get valid SBC values.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-07-08 12:31:13 -07:00
Christian König
34145ecdad vdpau: add implementation of VdpDecoderGetParameters 2011-07-08 20:53:39 +02:00
Christian König
ea78480029 [g3dvl] and finally remove pipe_video_context 2011-07-08 19:22:43 +02:00
Paul Berry
067c9d7bd7 glsl: Lower break instructions when necessary at the end of a loop.
Normally lower_jumps.cpp doesn't need to lower a break instruction
that occurs at the end of a loop, because all back-ends can produce
proper GPU instructions for a break instruction in this "canonical"
location.  However, if other break instructions within the loop are
already being lowered, then a break instruction at the end of the loop
needs to be lowered too, since after the optimization is complete a
new conditional break will be inserted at the end of the loop.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_breaks_6.
2011-07-08 09:59:30 -07:00
Paul Berry
e71b4ab8a6 glsl: In lower_jumps.cpp, lower both branches of a conditional.
Previously, lower_jumps.cpp would break out of its loop after lowering
a jump instruction in just the then- or else-branch of a conditional,
and it would fail to lower a jump instruction occurring in the other
branch.

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Fixes unit test test_lower_returns_4.
2011-07-08 09:59:30 -07:00
Paul Berry
382cee91a4 glsl: Use foreach_list in lower_jumps.cpp
The visitor class in lower_jumps.cpp never removes or replaces the
instruction being visited, but it frequently alters or removes the
instructions that follow it.  Therefore, to make sure the altered IR
is visited, it needs to iterate through exec_lists using foreach_list
rather than visit_exec_list().

Without this patch, lower_jumps.cpp may require multiple passes in
order to lower all jumps.  This results in sub-optimal output because
lower_jumps.cpp produces a brand new set of temporary variables each
time it is run, and the redundant temporary variables are not
guaranteed to be eliminated by later optimization passes.

Also, certain invariants assumed by lower_jumps.cpp may fail to hold,
causing assertion failures.

Fixes unit tests test_lower_pulled_out_jump,
test_lower_unified_returns, test_lower_guarded_conditional_break,
test_lower_return_non_void_at_end_of_loop, and test_lower_returns_3.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:30 -07:00
Paul Berry
03145ba655 glsl: lower unconditional returns and continues in loops.
Previously, lower_jumps.cpp would only lower return and continue
statements that appeared inside conditionals.  This patch makes it
lower unconditional returns and continue statements that occur inside
a loop.

Such unconditional flow control statements would be unlikely to be
explicitly coded by a reasonable user, however they might arise as a
result of other optimizations.

Without this patch, lower_jumps.cpp might not lower certain return and
continue statements, causing some backends to fail.

Fixes unit tests test_lower_return_void_at_end_of_loop and
test_remove_continue_at_end_of_loop.
2011-07-08 09:59:30 -07:00
Paul Berry
afc9a50fba glsl: Lower unconditional return statements.
Previously, lower_jumps.cpp only lowered return statements that
appeared inside of an if statement.

Without this patch, lower_jumps.cpp might not lower certain return
statements, causing some back-ends to fail (as in bug #36669).

Fixes unit test test_lower_returns_1.
2011-07-08 09:59:30 -07:00
Paul Berry
dbaa2e627e glsl: Refactor logic for determining whether to lower return statements.
Previously, do_lower_jumps.cpp determined whether to lower return
statements in ir_lower_jumps_visitor::should_lower_jumps().  Moved
this logic to ir_lower_jumps_visitor::visit(ir_function_signature *),
so that it can be used in determining whether to lower a return
statement at the end of a function.
2011-07-08 09:59:30 -07:00
Paul Berry
e2c748aec5 glsl: Add explanatory comments to lower_jumps.cpp.
No functional change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:30 -07:00
Paul Berry
f4830be938 glsl: Make ir_reader able to read plain (return) statements.
Previously ir_reader was only able to handle return of non-void.

This patch is necessary in order to allow optimization passes to be
tested in isolation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-08 09:59:29 -07:00
Paul Berry
5fb79fc69f glsl: Remove unused function prototypes.
No functional change.  Remove prototypes for do_mod_to_fract() and
do_sub_to_add_neg(), which haven't existed since November 2010.
2011-07-08 09:59:29 -07:00
Christian König
4e837f557b [g3dvl] move video buffer creation out of video context 2011-07-08 16:56:11 +02:00
Gustaw Smolarczyk
fc98444bd5 gallivm: Fix build with llvm-3.0
LLVM 3.0svn changes pretty rapidly. The change in
Target->createMCInstPrinter() signature which inspired commits
40ae214067 and
92e29dc5b0 has been reverted.

Signed-off-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-07-08 07:57:27 -06:00
Christian König
3bb33c911b [g3dvl] remove the unused priv member from pipe_video_context 2011-07-08 15:07:39 +02:00
Christian König
bd5fd67a3e [g3dvl] move compositor creation and handling directly into the state trackers 2011-07-08 14:44:19 +02:00
Marek Olšák
7de28e80dc st/mesa: handle float formats in st_format_datatype
NOTE: This is a candidate for the 7.11 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-08 13:02:27 +02:00
Marek Olšák
292148dc4b st/mesa: use the first non-VOID channel in st_format_datatype
Otherwise PIPE_FORMAT_X8B8G8R8_UNORM and friends would fail.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-07-08 13:02:22 +02:00
Christian König
10fd45114d [g3dvl] remove sampler view handling from video context 2011-07-08 12:47:52 +02:00
Christian König
06ddbc3b8e [g3dvl] remove create_surface from video context 2011-07-08 12:15:48 +02:00
Christian König
2ec350ff1d [g3dvl] make pipe_context mandatory for creation pipe_video_context 2011-07-08 12:03:13 +02:00
Christian König
7eca76952b [g3dvl] rename is_format_supported to is_video_format_supported and move it into screen object 2011-07-08 11:20:39 +02:00
Thomas Hellstrom
a65e970603 mesa/st: Fix piglit read-front with new drawable invalidation v2
When the state tracker adds a front buffer, nothing triggers a validate
drawable call, since the state tracker manager is never notified.

Force a validate drawable call by invalidating the framebuffer's stamp, so
that the window system's renderbuffer (if any) is picked up.

This fixes bug 38988
https://bugs.freedesktop.org/show_bug.cgi?id=38988

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-08 08:37:42 +02:00
Stéphane Marchesin
8c1a2e128e i915g: Make the optimizer more generic. 2011-07-07 21:59:09 -07:00
Brian Paul
d8f65c07e9 intel: add null src pointer check in intel_region_reference()
Fixes segfault when running cubemap demo on i945.  This happened
when intel_region_reference() was called in i915_set_draw_region()
with depth_region=NULL.

Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 19:22:06 -06:00
Stéphane Marchesin
9baad92660 i915g: Make optimization more generic. 2011-07-07 16:57:37 -07:00
Stéphane Marchesin
3c0c624879 Revert "i915: Eliminate redundant CONSTANTS updates"
This reverts commit 87641cffd9.
2011-07-07 16:57:37 -07:00
Brian Paul
7eb7d67d50 glsl: use casts to silence warning 2011-07-07 17:28:48 -06:00
José Fonseca
61efad6865 scons: Generate libGL.so.1.5 and libGL.so.1 symlinks.
In build/xxx/src/gallium/targets/libgl-xlib/SConscript
2011-07-07 23:41:06 +01:00
Eric Anholt
066bee64e1 intel: Fix use of freed buffer if glBitmap is called after a swap.
Regions looked up from the framebuffer are invalid after
intel_prepare_render().

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30266
Tested-by: Thomas Jones <thomas.jones@utoronto.ca>
2011-07-07 14:43:44 -07:00
Eric Anholt
a7a2704ab4 intel: Remove dead comment about software clears -- it's handled just above. 2011-07-07 14:43:44 -07:00
John
f39476b234 i915: Fix leak of ViewportMatrix data on context destroy.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
2011-07-07 14:43:44 -07:00
Eric Anholt
007c2d6cd2 intel: Remove gratuitous context checks in intel_delete_renderbuffer().
Even if we don't have a current context, if we're freeing the rb we
should free its region (and BO).  The renderbuffer unreference checks
appear to be just cargo-cult from the region unreference code.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30217
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:43:44 -07:00
Eric Anholt
c7ef5e8498 intel: Remove now trivial intel_renderbuffer_set_{hiz_,}region().
As a result of this cleanup, a bug in
intel_process_dri2_buffer_no_separate_stencil() became quite apparent.
We were associating the NULL pointer after an unreference with the
STENCIL attachment -- clarify the logic and attach the right region.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:42:47 -07:00
Eric Anholt
b904321ed0 intel: Rely on intel_region_reference()'s support of *dst != NULL.
Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:05:20 -07:00
Eric Anholt
036b74a7f8 intel: Allow intel_region_reference() with *dst != NULL.
This should help us avoid leaking regions in region reference code by
making the API more predictable.

Reviewed-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:05:20 -07:00
Eric Anholt
86e62b2357 intel: Mark MESA_FORMAT_X8_Z24 as always supported.
This prevents developer surprise at seeing a GL_DEPTH_COMPONENT
texture have stencil bits, and avoids the metaops path accidentally
copying stencil bits around in glCopyTexImage(GL_DEPTH_COMPONENT) (and
being broken because swrast's glReadPixels(GL_UNSIGNED_INT_24_8) is
broken).

Acked-by: Chad Versace <chad@chad-versace.us>
2011-07-07 14:05:20 -07:00
Christian König
f265a19426 [g3dvl] rename get_param to get_video_param and move into screen object 2011-07-07 22:51:45 +02:00
Kenneth Graunke
3de9405763 i965: Remove unused structures for command packets.
We simply emit these using OUT_BATCH and bitshifting, as it results in
better compiled code than packed structures.  Since our documentation
is public, it's not terribly useful to keep these around for reference.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
247e4c69ce i965: Convert system instruction pointer to OUT_BATCH style.
Also rename it from CMD_STATE_INSN_POINTER to CMD_STATE_SIP to match the
documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
87de78523a i965: Convert PIPELINE_SELECT to OUT_BATCH style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
473a519d20 i965: Emit 3DSTATE_VF_STATISTICS in OUT_BATCH style.
This is a little different from most because it's a single DWord;
there's no length field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Kenneth Graunke
a68c5e6b71 i965: Convert 3DSTATE_GLOBAL_DEPTH_OFFSET_CLAMP to OUT_BATCH style.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-07-07 13:31:41 -07:00
Henri Verbeet
e01e30b916 mesa: Fix the BindSampler unit limit.
I'm not sure about this one. The current code actually follows the spec, but
considering the spec is supposed to be written against GL 3.2 I'd say the spec
is broken. I filled out a spec feedback form over a month ago, but either the
form is broken, or nobody cares.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
bfe284fd26 mesa: Fix a couple of TexEnv unit limits.
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
4744195628 mesa: Use the Elements macro for the sampler index assert in validate_samplers().
This is probably nicer if the array size ever changes.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
86adc2b29e mesa: Allow sampling from units >= MAX_TEXTURE_UNITS in shaders.
The total number of units used by a shader is limited to MAX_TEXTURE_UNITS,
but the actual indices are only limited by MAX_COMBINED_TEXTURE_IMAGE_UNITS,
since they're shared between vertex and fragment shaders.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Henri Verbeet
2e35d90fb9 mesa: Check the texture against all units in unbind_texobj_from_texunits().
NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-07-07 20:30:13 +02:00
Christoph Bumiller
3069a7eaa5 nv50,nvc0: use screen instead of context for flush notifier
Context may become NULL and we still have to be able to flush
pending fences.
2011-07-07 15:00:12 +02:00
Christoph Bumiller
e54354e885 nv50: more formats for nv50_resource_copy_region conversion path
It's not supposed to do conversion, but st sometimes asks us to.
Sometimes conversion is even wrong (e.g. between UNORM and SRGB).

This should now include all formats the 2D engine supports.
2011-07-07 15:00:12 +02:00
Stéphane Marchesin
f934c80faf i915g: Apply optimization to ADDS/MUL and only if we're not saturating. 2011-07-07 01:47:33 -07:00
Thomas Hellstrom
1b23d4c9a5 st/xa: Fix up error reporting. Disable component alpha.
Component alpha is temporarily disabled since it seems a bit buggy.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-07 10:21:48 +02:00
Thomas Hellstrom
568d99cc6c st/xa: Fix render to xa_format_a8, which is backed by a gallium L8 texture
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-07 10:21:48 +02:00
Brian Paul
7a10976adb i915g: move code after declaration 2011-07-06 18:10:00 -06:00
Ian Romanick
d32d4f780f linker: Assign locations for fragment shader output
Fixes an assertion failure in the piglib out-01.frag
ARB_explicit_attrib_location test.  The locations set via the layout
qualifier in fragment shader were not being applied to the shader
outputs.  As a result all of these variables still had a location of
-1 set.

This may need some more work for pre-3.0 contexts.  The problem is
dealing with generic outputs that lack a layout qualifier.  There is
no way for the application to specify a location
(glBindFragDataLocation is not supported) or query the location
assigned by the linker (glGetFragDataLocation is not supported).

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
2011-07-06 16:59:34 -07:00
Ian Romanick
174cef7fee glsl: Don't choke when printing an anonymous function parameter
NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-06 16:41:34 -07:00
Ian Romanick
dbda466fc0 ir_to_mesa: Allocate temporary instructions on the visitor's ralloc context
And don't delete them.  Let ralloc clean them up.  Deleting the
temporary IR leaves dangling references in the prog_instruction.  That
results in a bad dereference when printing the IR with MESA_GLSL=dump.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-07-06 16:41:34 -07:00
Ian Romanick
0eb9797958 glsl: Track initial mask in constant propagation live set
The set of values initially available (before any kills) must be
tracked with each constant in the set.  Otherwise the wrong component
can be selected after earlier components have been killed.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=37383
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Matthias Bentrup <matthias.bentrup@googlemail.com>
2011-07-06 16:41:34 -07:00
Stéphane Marchesin
31484b068d i915g: Fix optimize so that it actually gets used. 2011-07-06 14:18:24 -07:00
Brian Paul
b786db0654 mesa: fix texstore addressing bugs for depth/stencil formats
Using GLuint pointers worked when the pixel size was four bytes
or the row stride was a multiple of four but was otherwise broken.
Fixes failures found with the piglit fbo-stencil test.

This helps to fix https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch.
2011-07-06 15:14:47 -06:00
Brian Paul
057a107d44 softpipe: add missing stencil format case in convert_quad_stencil()
Part of the fix for https://bugs.freedesktop.org/show_bug.cgi?id=38729

NOTE: This is a candidate for the 7.11 branch
2011-07-06 15:14:27 -06:00
Brian Paul
2ea7b374f6 tgsi: add some debug/print code in exec_tex(), disabled 2011-07-06 15:14:27 -06:00
Brian Paul
88349255ce softpipe: minor clean-ups in sp_quad_depth_test.c 2011-07-06 15:14:27 -06:00
Stéphane Marchesin
053af6ac8c i915g: Fix optimization, also make it more generic. 2011-07-06 12:00:47 -07:00
Eric Anholt
07e5295b6f mesa: Don't error on glFeedbackBuffer(size = 0, buffer = NULL)
The existing error result doesn't appear in the GL 2.1 or 3.2
compatibility specs, and triggers an unexpected GL error in Intel's
oglconform when it tries to reset the feedback state after usage so
that the "diff the state at error time vs. context init time" code
doesn't generate spurious diffs.  The unexpected GL error then
translates into testcase failure.  Brian wants the safety check on
buffer = NULL, though, so that people can't as easily set up a broken
buffer.
2011-07-06 11:17:20 -07:00
Eric Anholt
c9aac11713 mesa: Don't skip glGetProgramLocalParam4dvARB if there was already an error.
Like the previous commit, but fixes
ARB_vertex_program/getlocal4d-with-error.

v2: Move the success case line into the conditional, use ASSIGN_4V more.
2011-07-06 11:17:19 -07:00
Eric Anholt
e9d563e3ff mesa: Don't skip glGetProgramEnvParam4dvARB if there was already an error.
Fixes a bug caught by oglconform, and now piglit
ARB_vertex_program/getenv4d-with-error.  The wrapping of an existing
GL function made it so that we couldn't distinguish an error in
looking up our arguments from an existing error.  Instead, make a
helper function to choose the param, and use it from multiple callers.

v2: Move the success case line into the conditional, use COPY_4V more.
2011-07-06 11:17:19 -07:00
Eric Anholt
b043409adf glsl: Suppress warning from matching_signature change.
gcc isn't smart enough to see that we only look at matched_score after
we've initialized it (because match != NULL happens at the same time)
2011-07-06 11:17:19 -07:00
Eric Anholt
abbbd14dd4 glsl: Fix make clean for dricore. 2011-07-06 11:17:19 -07:00
Kenneth Graunke
eafc74d7d4 i965/fs: Fix message register allocation in FB writes.
Commit 6750226e6d bumped the base MRF to
m2 instead of m0, but failed to adjust inst->mlen, which was being set
to the highest MRF.  Subtracting the base MRF solves the issue.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2011-07-06 11:12:17 -07:00
Völgyes Dávid
f747d03b1d Fixes for leaks reported by cppcheck. 2011-07-06 10:11:04 -04:00
Stéphane Marchesin
e53b41f263 i915g: Improve flushing using heuristics. 2011-07-06 02:49:58 -07:00
Stéphane Marchesin
2bc5e0e97b i915g: introduce the tiny shader optimizer. 2011-07-06 02:49:48 -07:00
Stéphane Marchesin
cc78eb63cd i915g: Add comment about DDX/DDY. 2011-07-06 02:17:30 -07:00
Stéphane Marchesin
26e7436ad3 i915g: Move back to the old method for target format fixup. 2011-07-06 02:17:30 -07:00
Vadim Girlin
6bde225b8b r600g: fix buffer overflow check in r600_query_begin 2011-07-05 15:57:11 -04:00
Vadim Girlin
971e1b743e r600g: fix bo map usage flags in r600_query_begin 2011-07-05 15:57:08 -04:00
Vadim Girlin
fbe9d4261f r600g: reduce flushes for queries 2011-07-05 15:57:06 -04:00
Vadim Girlin
9bf4c30d73 r600g: fix buffer offset in r600_query_begin 2011-07-05 15:57:01 -04:00
Henri Verbeet
3fccc14b2f r600g: Get rid of the state_inlines headers.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:47 +02:00
Henri Verbeet
88cf65a600 r600g: Get rid of an unused include in r600_texture.c.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Henri Verbeet
4015b5877c r600g: Get rid of some unused functions.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Henri Verbeet
18cdb9c8ab r600g: Use the actual Evergreen functions to query format support on Evergreen.
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Henri Verbeet
865f927218 r600g: Get rid of the unused "family" parameter to r600_is_vertex_format_supported().
Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
2011-07-05 01:58:46 +02:00
Christian König
c3b2230b71 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/tests/trivial/Makefile
	src/gallium/winsys/g3dvl/dri/XF86dri.c
	src/gallium/winsys/g3dvl/dri/driclient.c
	src/gallium/winsys/g3dvl/dri/driclient.h
	src/gallium/winsys/g3dvl/dri/xf86dri.h
	src/gallium/winsys/g3dvl/dri/xf86dristr.h
	src/gallium/winsys/r600/drm/r600_bo.c
2011-07-04 15:04:41 +02:00
José Fonseca
f67de2ed46 draw: Fix fetch_max calculation.
It should be

 max_index = start + count - 1

instead of

 max_index = count - 1
2011-07-04 12:31:30 +01:00
Thomas Hellstrom
424b1210d9 Merge branch 'xa_branch'
Conflicts:
	configure.ac

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 10:21:35 +02:00
Thomas Hellstrom
a221807dc5 st/glx: Fix endless loop in drawable validation
This fixes a regression introduced with commit

"st-api: Rework how drawables are invalidated v3"

where the glx state tracker manager would invalidate a drawable each time it
checks the drawable dimensions, even during a validate call, which
resulted in an endless loop, since the state tracker would immediately
detect the new invalidation and rerun the validate...

This change marks the drawable invalid only if the drawable dimensions actually
changed during the validate, which will result in at most a single
unnecessary validate by the context running a validate during which the
dimensions changed.

To avoid unnecessary validates altogether, we need to implement yet another
st-api change: Returning the current time stamp from the validate function,
as suggested by Chia-I Wu. The glx state tracker manager could then return
the stamp resulting from the last drawable dimension check.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 09:56:45 +02:00
Thomas Hellstrom
f81ac1840a st/xa: Fix crosscompile builds with nonstandard ld locations
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 09:55:51 +02:00
Thomas Hellstrom
a2a5ba5145 xa-vmwgfx: Remove unnecessary include
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-04 09:55:40 +02:00
Henri Verbeet
39fecd3229 r600g: Support the PIPE_FORMAT_R16_FLOAT colorformat.
NOTE: This is a candidate for the 7.11 branch.
2011-07-03 23:03:07 +02:00
Benjamin Franzke
7ed1826e2e configure: Require libudev for drm & wayland egl platforms
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 14:01:07 +02:00
Benjamin Franzke
9b8cd49930 configure: Fix typo in gbm check for egl drm platform
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 14:00:55 +02:00
Benjamin Franzke
b18b2994ef configure: Enable st/gbm if st/egl has drm platform
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 13:56:27 +02:00
Benjamin Franzke
b2d6375e6a egl_dri2: Fix compilation if udev devel files are not installed
NOTE: This is a candidate for the 7.11 branch.
2011-07-02 13:56:27 +02:00
Chia-I Wu
f2001df508 egl: add copyright notices
The list of copyright holders could be incomplete.  Please update
directly or notify me if your name is missing.
2011-07-02 18:21:31 +09:00
Chia-I Wu
8123934d5a autoconf: swrast does not require libdrm
This fixes

  $ ./configure --disable-driglx-direct \
                --with-dri-drivers=swrast \
                --with-gallium-drivers=
2011-07-02 10:15:23 +09:00
José Fonseca
b115662607 scons: Disable saving options automatically.
It makes things too random, as settings for temporary trials get stored
permannently, and it make difficult to build several platforms from the
same tree.

So disable it, again.
2011-07-01 19:04:57 +01:00
José Fonseca
1c59ea9592 svga: Use the correct element size.
Instead of always using the first element's size.

This fixes flashing floor on CINEBENCH R10.
2011-07-01 18:32:42 +01:00
José Fonseca
dda8d7ac3f u_upload_mgr: Use pipe_buffer_map_range istead of pipe_buffer_map.
pipe_buffer_map_range makes stricter assertions, and would have saved us
grief detecting a bug in svga user buffer uploads.
2011-07-01 18:32:40 +01:00
Micael Dias
7d39ff44a2 Gallium: fix buffer overflow
Signed-off-by: José Fonseca <jfonseca@vmware.com>
2011-07-01 18:12:37 +01:00
Kristian Høgsberg
ad90f4cab4 driclient: Remove
Not used or maintained.  We talked about removing it a few releases ago,
there were no objections but it just never happened.  Now it's gone.
2011-07-01 09:36:46 -04:00
José Fonseca
4482eba9b2 scons: Actually add src/glx/SConscript. 2011-07-01 13:51:39 +01:00
Thomas Hellstrom
542194251c svga: Fix multiple uploads of the same user-buffer.
If a user-buffer was referenced twice by a draw command, the affected ranges
were uploaded separately, with only the last one being referenced by the
hardware. Make sure we upload only a single range.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:41 +02:00
Thomas Hellstrom
a8cf4b6acf svga: Ignore redefine_user_buffer calls
We currently always treat contents of user-buffers as volatile so
we don't need to take any particular action when the state tracker
announces that the contents has changed.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:40 +02:00
Brian Paul
762518d26a svga: fix incorrect user buffer size computation for instance divisor case
See preceeding commit for more info.
2011-07-01 13:30:40 +02:00
Brian Paul
fa4bd30212 svga: fix incorrect user buffer size computation
Viewperf uses some unusual vertex arrays where the stride is less
than the element size.  In this case, the stride was 4 while the
element size was 12.  The difference of 8 bytes causes us to miss
uploading the tail bit of the array data.

Typically the stride is >= the element size so there was no problem
with other apps.
2011-07-01 13:30:39 +02:00
José Fonseca
bd00fb2c06 svga: Handle null buffers in svga_buffer_is_user_buffer(). 2011-07-01 13:30:38 +02:00
Thomas Hellstrom
2b301df4aa gallium/svga: Upload only parts of user-buffers that we actually use
Stream user buffer contents rather than trying to maintain persistent
host / hardware copies.
Resulting negative array offsets are not allowed by the hardware,
(well, at least not according to header files), so adjust index bias
to make all array offsets positive.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:38 +02:00
Thomas Hellstrom
0277df86df gallium/svga: Make use of u_upload_flush().
This enables us to pack more data into single upload buffers.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:37 +02:00
Thomas Hellstrom
cf4cd8592a gallium/util: Upload manager optimizations
Make sure that the upload manager doesn't upload data that's not
dirty. This speeds up the viewperf test proe-04/1 a factor 5 or so on svga.

Also introduce an u_upload_unmap() function that can be used
instead of u_upload_flush() so that we can pack
even more data in upload buffers. With this we can basically reuse the
upload buffer across flushes.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-07-01 13:30:36 +02:00
José Fonseca
6d58029bf0 svga: Flush when switching between HW to SW TNL, after updating need_swtnl.
Also, only flush when going from HW TNL to SW TNL, given it is impossible
for the buffers resulting from SWTNL to be ever referred by HW TNL path.
2011-07-01 13:30:36 +02:00
Chia-I Wu
c250363022 egl: fix a compiler warning 2011-07-01 18:28:56 +09:00
Chia-I Wu
bf04d9eebf st/egl: fix a typo
Wrong goto labels.
2011-07-01 18:28:46 +09:00
Chia-I Wu
c0b0e71148 st/egl: remove unused header 2011-07-01 18:19:31 +09:00
Chia-I Wu
94ec5fd1b3 autoconf: fix --disable-glx
libdrm is used in multiple places.  Always check for it and set
have_libdrm.  Each user can then check the variable.

This is useful when only EGL and DRI drivers are needed.
2011-07-01 17:46:27 +09:00
Chia-I Wu
5029ea4d9c autoconf: fix --disable-dri
Define GLX_INDIRECT_RENDERING and GLX_DIRECT_RENDERING when $enable_glx,
not $enable_dri.
2011-07-01 17:46:27 +09:00
Chia-I Wu
9e7a4147c7 autoconf: add --enable-{dri,glx,osmesa}
The idea is that DRI driver, libGL and libOSMesa are libraries that can
be independently enabled, yet --with-driver does not allow us to easily
do that, if not impossible.  This also matches what
--enable-{egl,xorg,d3d1x} do for the respective libraries.

There are two libGL providers: Xlib-based and DRI-based.  They cannot
coexist.  To be able to choose between them, --enable-xlib-glx is also
added.

With this commit, --with-driver=dri can be replaced by

  $ ./configure --enable-dri --enable-glx --disable-osmesa

--with-driver=xlib can be replaced by

  $ ./configure --disable-dri --enable-glx --enable-osmesa \
                --enable-xlib-glx

and --with-driver=osmesa can be replaced by

  $ ./configure --disable-dri --disable-glx --enable-osmesa

Some combinations that cannot be supported with --with-driver will
produce errors at the moment.  But in the future, we would like to
support, for example,

  $ ./configure --enable-dri --disable-glx --enable-egl
  (build libEGL and DRI drivers, but not libGL)

Note that this commit still keeps --with-driver for transitional
purpose.
2011-07-01 17:46:27 +09:00
Vinson Lee
f8fcaf0215 gallivm: Pass in CPU name to createTargetMachine when on llvm-3.0.
llvm-3.0svn revision 134127 changed createTargetMachine to take in
an additional argument of the CPU name.
2011-06-30 15:48:41 -07:00
Vinson Lee
b61e56756c gallivm: Rename TargetInstrDesc to MCInstrDesc when using llvm-3.0.
llvm-3.0svn revision 134021 renamed TargetInstrDesc to MCInstrDesc.
2011-06-30 15:07:57 -07:00
Marek Olšák
47362c2a61 docs: add GL3 GLX todo 2011-06-30 22:54:42 +02:00
Vadim Girlin
61c976c3cc r600g: fix check for empty cs 2011-06-30 16:39:08 -04:00
Marek Olšák
9e9d73ef10 docs: update GL3 status - vertex textures
They work fine on r600g.
2011-06-30 21:40:29 +02:00
José Fonseca
235225ec93 scons: Expose pkg-config in a simpler manner. 2011-06-30 17:36:37 +01:00
José Fonseca
2699fce0d6 scons: Buid libGL.so (WIP). 2011-06-30 11:34:51 +01:00
José Fonseca
0edb40cb69 scons: Make declaration-after-statement and pointer-arith just warnings.
Necessary, in order to build the whole tree.
2011-06-30 10:43:57 +01:00
Stéphane Marchesin
a9cb01f355 i915g: Implement surface format fixup without adding an extra instruction.
We also avoid writing output color twice, which might not work when we run out of phases.
2011-06-30 02:13:28 -07:00
Stéphane Marchesin
2adf02b456 i915g: update TODO. 2011-06-29 21:59:01 -07:00
Chia-I Wu
3e3df5fcd1 target/egl-static: fix a compiler warning 2011-06-30 10:23:50 +09:00
Stéphane Marchesin
5d7609715a i915g: Try to do better in the shader compiler.
- Copy i915c's support for phases, that should allow us to run a coupe more shaders.
- Fix the error messages.
- Still try to proceed when we get a shader that's too long.
2011-06-29 16:54:29 -07:00
Stéphane Marchesin
5349b95920 Gallium:draw:aaline and aapoint: Restore the old hooks when we destroy our stage. 2011-06-29 16:54:28 -07:00
Kenneth Graunke
578f6a9534 glsl: Don't use MOD_TO_FRACT lowering on GLSL 1.30's % operator.
MOD_TO_FRACT was designed to lower the GLSL 1.20 mod() function, which
operates on floating point values.  However, we also use ir_binop_mod
for GLSL 1.30's % operator, which operates on integers.

For now, make MOD_TO_FRACT only apply to floating-point mod operations.
In the future, we may want to add a lowering pass for integer-based mod.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
ed92b91212 glsl: Fix DIV_TO_MUL_RCP lowering for uint result types.
f2i results in an int/ivec; we need i2u to get a uint/uvec.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
8eb9753944 glsl: Distinguish "type mismatch" error messages for modulus operator.
Previously, it would simply say "type error" in three different cases:
- The LHS is not an integer
- The RHS is not an integer
- The LHS and RHS have different base types (int vs. uint)

Now the error messages state the specific problem.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
60eb63a855 glsl: Find the "closest" signature when there are multiple matches.
Previously, ir_function::matching_signature had a fatal bug: if a
function had more than one non-exact match, it would simply return NULL.

This occured, for example, when looking for max(uvec3, uvec3):
- max(vec3, vec3)   -> score 1 (found first)
- max(ivec3, ivec3) -> score 1 (found second...used to return NULL here)
- max(uvec3, uvec3) -> score 0 (exact match...the right answer)

This did not occur for max(ivec3, ivec3) since the second match found
was an exact match.

The new behavior is to return a match with the lowest score.  If there
is an exact match, that will be returned.  Otherwise, a match with the
least number of implicit conversions is chosen.

Fixes piglit tests max-uvec3.vert and glsl-inexact-overloads.shader_test.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
6b1ba7ccef glsl: Use i2u and u2i to implement constructor conversions.
Inspired by a patch from Bryan Cain <bryancain3@gmail.com>.

Fixes piglit tests:
- ctor-int-uint.vert
- ctor-ivec4-uvec4.vert
- ctor-uint-int.vert
- ctor-uvec4-ivec4.vert

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:13 -07:00
Kenneth Graunke
b633ddeb9f i965/fs: Implement new ir_unop_u2i and ir_unop_i2u opcodes.
No MOV is necessary since signed/unsigned integers share the same
bit-representation; it's simply a question of interpretation.  In
particular, the fs_reg::imm union shouldn't need updating.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Kenneth Graunke
006d5a1aa4 ir_to_mesa: "Support" u2f, i2u, and u2i operations by doing nothing.
Mesa IR actually stores all numbers as floating point, so this is
totally a farce, but we may as well keep it going.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Kenneth Graunke
3283e362e3 glsl: Revert "fix conversions from uint to bool and from..."
Reverts commit f41e1db327
"fix conversions from uint to bool and from float/bool to uint"

f2i, b2i, and b2i should not accept uint types.  Use i2u and u2i.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Bryan Cain
20ef96c7ff glsl: Add ir_unop_i2u and ir_unop_u2i operations.
These are necessary to handle int/uint constructor conversions.  For
example, the following code currently results in a type mismatch:

int x = 7;
uint y = uint(x);

In particular, uint(x) still has type int.

This commit simply adds the new operations; it does not generate them,
nor does it add backend support for them.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-29 16:07:12 -07:00
Eric Anholt
4f799e6142 glsl: Use the default values of ir_assignment() in lower_mat_op_to_vec.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:10:43 -07:00
Eric Anholt
e617a53a74 glsl: Allow ir_assignment() constructor to not specify condition.
We almost never want to specify a condition, and when we do we're
already thinking about it (because we're writing a lowering pass
generating the condition), so a default argument should make the code
more pleasant to read.

NOTE: This is a candidate for the 7.11 branch (we want to be able to
cherry-pick future code).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:10:03 -07:00
Eric Anholt
487dd96c27 glsl: Avoid making a temporary for lower_mat_op_to_vec if not needed.
Our copy propagation tends to be bad at handling the later array
accesses of the matrix argument we moved to a temporary.  Generally we
don't need to move it to a temporary, though, so this avoids needing
more copy propagation complexity.

Reduces instruction count of some Unigine Tropics and Sanctuary
fragment shaders that do operations on uniform matrix arrays by 5.9%
on gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:54 -07:00
Eric Anholt
8fad8637ef glsl: Make lower_mat_op_to_vec track derefs, not variables.
We were constrained to using temporaries because we were assuming
variables all over.  This simplifies things a bit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:47 -07:00
Eric Anholt
408377aed1 glsl: Rename lower_mat_op_to_vec operands/results to be less hungarian.
This awkward typing was to avoid shadowing the function argument (the
matrix) with the temporary deref (the column) before the
get_column()/get_element()s were moved into the expression/assignment
constructors.  They're about to become not-variables, so the current
names had to go.  This change is almost mechanical (other than
column_expr), so it should make the next diff clearer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:32 -07:00
Eric Anholt
a47fd5c27d glsl: Move get_{column,element} to expression args.
I think this makes the code more obvious by moving the declarations to
their single usage (now that we aren't using them to get at the ->type
field for expression constructors).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:27 -07:00
Eric Anholt
e75b5954db glsl: Drop explicit types of lower_mat_op_to_vec expressions.
The constructor can figure it out for us these days.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 15:09:08 -07:00
Adam Jackson
d44f821213 drisw: Remove cargo culting that breaks GLX 1.3 ctors
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:19 -04:00
Adam Jackson
4833104718 glx: Verify that drawable creation on the client side actually worked
... and clean up if it didn't.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:19 -04:00
Adam Jackson
9e2bc5d4b0 glx: Alias glXFreeContextEXT to glXDestroyContext
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-06-29 14:07:18 -04:00
Kenneth Graunke
5ddc518401 i965/gen7: Add missing ! to brw->gs.prog_active assertion.
A typo in commit c173541d97 accidentally removed the !.
It's supposed to assert that there is _not_ an active GS program.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38762

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-29 10:57:55 -07:00
Brian Paul
e17f2bad3a mesa: bump version to 7.12 (devel) 2011-06-29 07:38:10 -06:00
Brian Paul
600e01e758 configs: add libdrm cflags to linux-llvm config 2011-06-29 07:38:10 -06:00
Jon TURNEY
8f0a331040 i915g: Move definition of M_PI in i915_fpc_translate.c
Move defintion of M_PI (for the benefit of <math.h> which do not define it), to
before the first use of it

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-29 14:29:26 +01:00
Brian Paul
475685ce50 st/mesa: s/tex_usage/bindings/ in st_format.h
Just be consistent with the .c file.
2011-06-29 07:23:47 -06:00
Emil Velikov
9b5c538726 st/mesa: Use correct internal target
Commit 1a339b6c(st/mesa: prefer native texture formats when possible)
introduced two new arguments to the st_choose_format() functions.
This patch fixes the order and passes the correct internal_target
rather than GL_NONE

NOTE: This is a candidate for the 7.11 branch
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-29 07:18:32 -06:00
Thomas Hellstrom
5d2fad5444 st/glx: Fix compilation error
Fix compilation error due to commit
"Rework how drawables are invalidated v3"

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 15:03:52 +02:00
Andre Maasikas
19789e403c st/mesa: fix overwriting gl_format with pipe_format since 9d380f48
fixes assert later on in texcompress2/r600g

Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-29 06:52:45 -06:00
Thomas Hellstrom
ade9f0d727 st/dri: Get rid of the evil struct dri_drawable::context member
It's incorrect to assume a single context bound to a drawable.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 12:48:59 +02:00
Thomas Hellstrom
ac8fdbc1c7 st-api: Rework how drawables are invalidated v3.
The api and the state tracker manager code as well as the state tracker code
assumed that only a single context could be bound to a drawable. That is not
a valid assumption, since multiple contexts can bind to the same drawable.

Fix this by making it the state tracker's responsibility to update all
contexts binding to a drawable

Note that the state trackers themselves don't use atomic stamps on
frame-buffers. Multiple context rendering to the same drawable should
be protected by the application.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-29 12:48:59 +02:00
Stéphane Marchesin
1a7e17e44a i915g: Fix unimplemented Abs comment. 2011-06-29 01:23:44 -07:00
Stéphane Marchesin
4e6120576f i915g: If we have a program, that means the other fields are ours and we can free them.
Otherwise they probably belong to draw.
2011-06-28 20:42:39 -07:00
Stéphane Marchesin
c66877c290 i915g: Don't overflow the program buffer.
Otherwise it corrupts other fields of the struct and hilarity ensues.
2011-06-28 20:42:38 -07:00
Stéphane Marchesin
dd691032c8 i915g: Update the TODO with another idea. 2011-06-28 20:42:38 -07:00
Paul Berry
3097715d41 glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 14:00:20 -07:00
Paul Berry
9c4445de6e glsl: Changed extension enable bits to bools.
These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 13:57:03 -07:00
Paul Berry
b078aad8ab glsl: permit explicit locations on fragment shader outputs, not inputs
From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
2011-06-28 13:49:11 -07:00
Stéphane Marchesin
fe36bc0c41 i915g: Fix comment about sin/cos constants. 2011-06-28 12:07:11 -07:00
Stéphane Marchesin
bd1ee76442 i915g: Fix staging texture uploads a bit.
They still look corrupted, but at least now they don't look tiled any more.
2011-06-28 12:05:28 -07:00
Eric Anholt
a09c5c2e30 i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
2011-06-28 10:17:39 -07:00
Eric Anholt
cd7bfd5d44 i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
2011-06-28 10:17:39 -07:00
Alan Hourihane
6479922499 glx: Check HAVE_XF86VIDMODE before adding it as an implicit link
library.
2011-06-28 17:41:39 +01:00
Jon TURNEY
db78643182 Don't use -fvisibilty=hidden on cygwin
All it's going to do is generate lots and lots and lots of
'warning: visibility attribute not supported in this configuration; ignored'
warnings

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-06-28 17:07:02 +01:00
Jon TURNEY
560f76227c Fix config check that claims to test if CXX supports -fvisibility=hidden option to actually test the C++ compiler.
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-06-28 17:06:59 +01:00
Stéphane Marchesin
de33b0dd23 i915g: Add a debug_printf when we get the Abs flag. 2011-06-28 02:14:43 -07:00
Stéphane Marchesin
2e481e5fc4 i915g: Support PIPE_FORMAT_B10G10R10A2_UNORM. 2011-06-28 01:41:57 -07:00
Stéphane Marchesin
062a1e291f i915g: Improve SIN/COS a bit. 2011-06-28 00:59:41 -07:00
Stéphane Marchesin
77896b256a i915g: When emulating LUMINANCE8 and INTENSITY8 texutres, route alpha properly.
That fixes some formats in fbo-alphatest-formats.
2011-06-28 00:59:40 -07:00
Stéphane Marchesin
6f62a25448 i915g: fix shadow compare.
"Works" as well as i915c now.
2011-06-28 00:59:40 -07:00
Chia-I Wu
24137afb31 targets/egl-static: fix library search order
Use

  $(MKLIB) -ldflags '-L$(TOP)/$(LIB_DIR)'

instead of

  $(MKLIB) -L$(TOP)/$(LIB_DIR)

to make sure the local library path appears before system's.
2011-06-28 15:25:00 +09:00
Chia-I Wu
aa281dd392 st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
2011-06-28 15:07:30 +09:00
Stéphane Marchesin
a2537bbc95 i915g: Enable GL_ARB_instanced_arrays. 2011-06-27 19:27:58 -07:00
Stéphane Marchesin
8dd1e3670f i915g: Fix a bug in facing.
However doesn't work because of limitations in the draw module.
2011-06-27 18:29:50 -07:00
Ben Widawsky
6750226e6d i965: step message register allocation
The system routine requires m0 be reserved for saving off architectural
state. Moved the allocation to start at 2 instead of 0.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-27 14:21:22 -07:00
Ian Romanick
d2c6cef18a glsl: Fix depth unbalancing problem in if-statement flattening
Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-27 14:00:14 -07:00
Stéphane Marchesin
c191c87c81 i915g: Remove unused cbuf_dirty. 2011-06-27 02:08:44 -07:00
Stéphane Marchesin
e2422f77a2 i915g: Add a comment about a bug. 2011-06-27 02:06:00 -07:00
Stéphane Marchesin
ef3dac2aff i915g: initial support for SEMANTIC_FACE.
Doesn't work yet, see TODO.
2011-06-27 02:06:00 -07:00
Stéphane Marchesin
4887e1c31a i915g: update TODO. 2011-06-27 02:06:00 -07:00
Stéphane Marchesin
9d29d48bb0 i915g: Return the max result for the fake occlusion queries. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
b13865e694 i915g: Fix depth texture formats.
Depth compare still looks broken though.
2011-06-27 02:05:59 -07:00
Stéphane Marchesin
a8ebc5400e i915g: Fix u_blitter comment. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
811963a7ae i915g: Implement fake DDX/DDY. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
d2f05283d2 i915g: Fix gl_FragCoord. 2011-06-27 02:05:58 -07:00
Benjamin Franzke
992680c8b4 egl: Fix Terminate with shared gbm screens
NOTE: This is a candidate for the 7.11 branch.
2011-06-27 10:25:12 +02:00
Thomas Hellstrom
69140b719b st/xa: Update README.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:23:37 +02:00
Thomas Hellstrom
9a0c5b4634 st/xa: Add a function to check for supported formats
Typically this was done by having a surface creation function fail if
the format was not supported.
However, in some situations when changing hardware surface formats,
it's desirable to do this check before attempting costly readback operations.

Also updated the surface_redefine interface.

Bump minor.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:14:39 +02:00
Thomas Hellstrom
ab3587f70d st/xa: Various fixes for composite.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:14:34 +02:00
Chia-I Wu
3a07d9594a st/d3d1x: fix for st/egl native.h interface change
The interface was changed in 73df31eedd.
2011-06-27 12:20:52 +09:00
Marek Olšák
618dbc8130 configure.ac: sort Gallium directories alphabetically 2011-06-27 03:12:57 +02:00
Chia-I Wu
a1cadf2b5c targets/egl-static: fix building without libudev
Thanks to José for pointing out.
2011-06-26 18:04:42 +09:00
Chia-I Wu
450f486276 targets/egl-static: refactor drm_fd_get_screen_name
Add drm_fd_get_pci_id to get the PCI ID.  Fix a leak with udev on error.
2011-06-26 08:17:52 +09:00
Chia-I Wu
ed47d65c7c st/egl: fix a compile error
It is triggered when --with-driver=xlib is specified.
2011-06-26 08:16:59 +09:00
Chia-I Wu
56ec8e17d3 targets/gbm: attemp to fix unresolved symbols
Move system libraries (usually .so) out of --start-group / --end-group
pair.  Add possiblly missing archives, defines, and shared libraries.
2011-06-26 07:42:04 +09:00
Marek Olšák
bc517d64da r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-06-25 18:34:09 +02:00
Brian Paul
42e7a13e7b Revert "Fix 24bpp software rendering"
This reverts commit c0c0bb6cb1.
2011-06-25 06:17:01 -06:00
Chia-I Wu
8ea5330200 egl: fix EGL_MATCH_NATIVE_PIXMAP
EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.
2011-06-25 18:51:11 +09:00
Chia-I Wu
a0ad339915 st/egl: add get_pixmap_format callback to native_display
And use it for EGL_MATCH_NATIVE_PIXMAP.  Remove is_pixmap_supported
meanwhile.
2011-06-25 18:50:53 +09:00
Chia-I Wu
31520548b7 egl: make implementing eglChooseConfig easier
Add a new helper function, _eglFilterConfigArray, for drivers and hide
_eglSortConfigs.
2011-06-25 18:17:38 +09:00
Chia-I Wu
1e9f0b1736 targets/egl-static: do not use DRI_LIB_DEPS
It brings in libraries that are not necessarily needed.
2011-06-25 18:17:38 +09:00
Chia-I Wu
53d354b224 st/egl: add a fast path for ximage eglCopyBuffers 2011-06-25 16:23:21 +09:00
Chia-I Wu
7c4e9dcdce st/egl: clean up eglCopyBuffers
Add copy_to_pixmap method to native_display and use it for
eglCopyBuffers.
2011-06-25 16:23:21 +09:00
Chia-I Wu
73df31eedd st/egl: reorganize backend initialization
Remove set_event_handler() and pass the event handler with
native_get_XXX_platform().  Add init_screen() so that the pipe screen is
created later.  This way we don't need to pass user_data to
create_display().
2011-06-25 16:23:20 +09:00
Thomas Hellstrom
adf166b6c4 st/xa: Solid fill (tested) and composite (yet untested)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-21 21:37:02 +02:00
Thomas Hellstrom
5f20fae40d st/xa: Really support xa_surface_format. Bump minor.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-21 00:11:20 +02:00
Thomas Hellstrom
642951fbca st/xa: Support format-changing copy.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-20 23:47:13 +02:00
Thomas
a18ffcd40d st/xa: Make sure we blit all yuv regions.
The code forgot to increment a pointer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-16 16:25:18 +02:00
Thomas
7ba80e0c50 st/xa: Fix a typo pointed out by Keith Whitwell.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-16 16:25:18 +02:00
Thomas
82301ea011 target/dri-vmwgfx: Throttle dri clients by default.
Throttle pretty hard in order to prioritize user-space interactivity over
3D application speed. May revisit this later.

Signed-off-by: Thomas <thellstrom@vmware.com>
2011-06-16 16:25:17 +02:00
Thomas Hellstrom
9f2f5b3d7f st/xa: Initial import of the xa state-tracker and the xa-vmwgfx target.
See the file src/gallium/state_trackers/xa/README for more info.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-15 11:06:16 +02:00
Christian König
003401f95c Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/tests/unit/u_format_test.c
	src/gallium/winsys/r600/drm/r600_hw_context.c
2011-06-09 09:35:09 +02:00
Christian König
00b4e48560 [g3dvl] rework video buffer format handling 2011-06-07 22:01:30 +02:00
Christian König
8b02f9e67b xvmc: fix some warning about uninitialized vars 2011-06-07 21:15:58 +02:00
Christian König
f1bf7d3dbf [g3dvl] move dummy quantification into xvmc state tracker 2011-06-07 21:13:59 +02:00
Christian König
b4fa7db656 [g3dvl] split quant matrix out of picture info 2011-06-05 18:59:57 +02:00
Christian König
c4a168819d [g3dvl] rename map/unmap to begin/end frame
mapping and unmapping of buffers is just an implementation detail.
begining and ending an frame is much more descriptive
2011-06-05 17:53:48 +02:00
Christian König
7e1fbb3603 [g3dvl] remove unused and dublicate fields from picture structure 2011-06-05 17:07:17 +02:00
Christian König
c6c2ef0709 [g3dvl] use a vertex element instead of the instance id
Enable this change permanently
2011-06-05 16:39:10 +02:00
Christian König
bdfe77444d st/mesa: some more merge fixes 2011-06-05 01:28:44 +02:00
Christian König
129a3c1cf0 r600g: some merge fixes 2011-06-05 00:59:58 +02:00
Christian König
1eb957bb41 Merge remote-tracking branch 'origin/master' into pipe-video 2011-06-05 00:11:41 +02:00
Christian König
a6c76c8a90 [g3dvl] use a vertex element instead of the instance id 2011-06-04 23:54:46 +02:00
Christian König
f82cfe1eb4 Revert "Merge remote-tracking branch 'mareko/r300g-draw-instanced' into pipe-video"
This reverts commit 10370b752c, reversing
changes made to ded2a9a628.
2011-06-04 12:55:43 +02:00
Christian König
10370b752c Merge remote-tracking branch 'mareko/r300g-draw-instanced' into pipe-video 2011-06-03 10:47:56 +02:00
Christian König
ded2a9a628 [g3dvl] respect maximum instruction for idct render targets 2011-06-01 20:37:57 +02:00
Christian König
a019b60dd3 [g3dvl] dynamical adjust blocks per line 2011-06-01 19:41:43 +02:00
Christian König
912dc8ff09 [g3dvl] move quantification into shaders 2011-05-29 20:07:57 +02:00
Christian König
ae56a1dd67 [g3dvl] implement mismatch control inside idct shaders 2011-05-29 20:07:57 +02:00
Christian König
b4837a53d3 [g3dvl] fix resource type for idct
Only the intermediate resource are 3D textures
2011-05-29 20:07:57 +02:00
Christian König
0e88621919 Initial r300g support
Based uppon a patch from Pali Rohár <pali.rohar@gmail.com>.
This seems to get at least YUV->RGB conversion working.
So a simple "mplayer -vo vdpau" now seems to work fine.
2011-05-29 13:53:17 +02:00
Christian König
311eb749a1 [g3dvl] rework resource format handling 2011-05-22 18:36:47 +02:00
Christian König
5705fb1dca r600g: revert commit 36b322dffd for now
Disable scaled textures, since they didn't work 100% right now.
2011-05-22 18:28:09 +02:00
Christian König
aa63ebc48a Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-21 16:43:12 +02:00
Christian König
120b55a96e r600g: fix "Fixed-Point Data Conversions"
According to OpenGL 3.1 chapter 2.1.5 the representation without zero
should only be used for vertex attribute values, but not for textures
or frame-buffers.
2011-05-21 15:37:29 +02:00
Christian König
0ef773ff79 vdpau: rename vdpau driver to r600/softpie 2011-05-18 21:30:09 +02:00
Christian König
9f64199d39 [g3dvl] fix missing swizzle on instanceid 2011-05-18 00:10:59 +02:00
Christian König
9937e85bcc [g3dvl] add missing ureg_END 2011-05-16 23:05:38 +02:00
Christian König
07114b3fdc [g3dvl] softpipe now needs the llvm libs 2011-05-16 23:04:47 +02:00
Christian König
3e976ef31a [g3dvl] store the idct matrix as hex values
Give the dct matrix a higher precision.
2011-05-16 00:26:44 +02:00
Christian König
828540e491 Merge remote-tracking branch 'origin/master' into pipe-video 2011-05-15 19:26:53 +02:00
Christian König
3db6514357 [g3dvl] enable gl_rasterization_rules for idct 2011-05-15 19:21:21 +02:00
Christian König
20aabb9c2e [g3dvl] enable gl_rasterization_rules for zscan 2011-05-15 19:05:30 +02:00
Christian König
235de23e57 [g3dvl] store mvpos seperately from x,y cord 2011-05-15 15:27:38 +02:00
Christian König
5d7c8130b8 [g3dvl] pre apply zscan to quant matrix 2011-05-15 14:53:13 +02:00
Christian König
0121aae967 [g3dvl] no need for seperate intermediate buffers any more
This should reduce the video memory footprint drastically.
2011-05-15 14:07:39 +02:00
Christian König
56457ffe11 [g3dvl] move alignment of buffers to mb size into context 2011-05-15 13:08:38 +02:00
Christian König
6c731191c0 [g3dvl] fix fi_frame mb increment 2011-05-14 17:11:33 +02:00
Christian König
ce31aaec02 [g3dvl] move dct_type detection out of get_macroblock_modes 2011-05-08 22:28:33 +02:00
Christian König
3b773d06d2 [g3dvl] fix field selection of mb without mc 2011-05-08 13:39:56 +02:00
Christian König
626352648a [g3dvl] memcpy the DCT buffer instead of writing it directly
It looks like texture buffers are not cached so this seems to be alot faster
2011-05-07 18:09:31 +02:00
Christian König
e06a09ac37 vdpau: use multiple buffers to speed up rendering 2011-05-07 15:28:04 +02:00
Christian König
cd13ec253a vdpau: implement PresentationQueueSetBackgroundColor 2011-05-07 15:00:52 +02:00
Christian König
e0cc970a54 vdpau: as long as we don't have a background picture we don't want an alpha channel 2011-05-07 14:51:17 +02:00
Christian König
6a5d2d7967 [g3dvl] rgba surfaces are clearing if the alpha channel is one 2011-05-07 14:49:58 +02:00
Christian König
a67a0bb60c [g3dvl] using reciprocals for size calc is sometimes not precise enough 2011-05-07 14:39:35 +02:00
Christian König
213b9004a6 Merge remote-tracking branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_state.c
2011-05-07 14:11:40 +02:00
Christian König
6ad846ee78 [g3dvl] move zscan into shaders 2011-05-05 20:09:34 +02:00
Christian König
352bfb525a [g3dvl] remove quantizer_scale from picture structure 2011-05-04 22:30:16 +02:00
Christian König
a9b1c4fe2e [g3dvl] remove dc_dct_pred from picture structure 2011-05-04 22:16:03 +02:00
Christian König
e3789105fe [g3dvl] divide mpg12 width height by 16 2011-05-04 22:05:03 +02:00
Christian König
0f24c19eea [g3dvl] remove the dubble zscan from the mpg12 decoder 2011-05-04 20:39:54 +02:00
Christian König
08f3a7cf7e vdpau: make state tracker far less noisy 2011-05-04 19:58:33 +02:00
Christian König
7709e6ebc3 vdpau: remove empty color.c file 2011-05-04 19:44:20 +02:00
Christian König
ff20be919a [g3dvl] remove the unused bitstream parser components 2011-05-04 19:38:40 +02:00
Christian König
ee92f0fdad vdpau: remove the unused and incomplete mpeg2 parser 2011-05-04 19:37:46 +02:00
Christian König
c888fe027c [g3dvl] Implement MPEG2 VLD
Based uppon xine's slice_xvmc.c.
This gets VDPAU up and running.
2011-05-04 18:58:55 +02:00
Johannes Obermayr
f20608b951 [g3dvl] Name of pkg-config file is libva.
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-04-28 19:06:39 +02:00
Johannes Obermayr
f6f773189b [g3dvl] Fix compile error.
Signed-off-by: Christian König <deathsimple@vodafone.de>
2011-04-28 19:04:27 +02:00
Christian König
2471acfc4c vdpau: start to implement MPEG2 decoder part 2011-04-27 20:38:31 +02:00
Christian König
563f6c225c [g3dvl] make clear color configureable 2011-04-27 16:50:34 +02:00
Christian König
221e1b7aba [g3dvl] make reset_dirty_area a public interface 2011-04-27 15:28:13 +02:00
Christian König
0d53cb2e83 [g3dvl] implement clearing of dirty destination surface areas 2011-04-27 15:19:35 +02:00
Christian König
6092fbed46 [g3dvl] move compositor src and dst normalisation into layer setting 2011-04-27 13:01:01 +02:00
Christian König
559f6d6cf4 [g3dvl] fix setting width, height and chroma format in video buffer 2011-04-27 12:59:30 +02:00
Christian König
f3f212acf0 xvmc: recreate drawable surface only when dst area changes 2011-04-27 12:05:46 +02:00
Christian König
76d881b8b0 [g3dvl] fix a couple of bugs around paletted subpictures 2011-04-27 10:41:19 +02:00
Christian König
e602ecf9ef r600g: revert commit 68cc6bc5d8
Revert commit "remove the unneeded bo from COLOR[0-9]_INFO
Also implement a working alternative.
2011-04-26 19:09:45 +02:00
Christian König
2516a46544 vdpau: implement OutputSurfaceDestroy 2011-04-26 11:49:31 +02:00
Christian König
67d93ea940 vdpau: implement PresentationQueueDestroy 2011-04-26 11:48:33 +02:00
Christian König
13a50bd47d vdpau: implement VideoMixerDestroy 2011-04-26 11:16:54 +02:00
Christian König
38bd813177 vdpau: add stups for the missing functions 2011-04-26 11:12:59 +02:00
Marek Olšák
596f09aa7b r300g: implement draw_instanced for HWTCL 2011-04-25 14:04:51 +02:00
Christian König
5aa2641243 vdpau: implement and cleanup PresentationQueueTarget destruction 2011-04-25 11:39:41 +02:00
Christian König
7cde6722b0 xvmc: futher optimize ycbcr upload 2011-04-25 10:33:48 +02:00
Christian König
7f04fe5338 [g3dvl] merge idct stage 2 and mc ycbcr stage into a single draw 2011-04-25 01:20:15 +02:00
Christian König
104ac00663 [g3dvl] rework fence handling and add r600g workaround 2011-04-24 20:08:11 +02:00
Christian König
3ea7e2713c [g3dvl] start supporting different render target formats
Let's start with NV12, but anything else shouldn't be much of a problem any more.
2011-04-24 19:29:34 +02:00
Christian König
b54909910c [g3dvl] remove resource_format workaround 2011-04-24 16:04:23 +02:00
Christian König
4e6528428d r600g: implement clamp_fragment_color handling
The first small step to get arb_color_buffer_float working.
2011-04-24 13:03:16 +02:00
Christian König
68cc6bc5d8 r600g: remove the unneeded bo from COLOR[0-9]_INFO
The COLOR[0-7]_INFO registers doesn't neeed a bo.
2011-04-24 12:47:42 +02:00
Christian König
fa31b1095e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configs/linux-dri
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_state.c
	src/gallium/include/pipe/p_format.h
	src/gallium/tests/graw/fragment-shader/frag-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-add.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-1d.sh
	src/gallium/tests/graw/fragment-shader/frag-cb-2d.sh
	src/gallium/tests/graw/fragment-shader/frag-dp3.sh
	src/gallium/tests/graw/fragment-shader/frag-dp4.sh
	src/gallium/tests/graw/fragment-shader/frag-dst.sh
	src/gallium/tests/graw/fragment-shader/frag-ex2.sh
	src/gallium/tests/graw/fragment-shader/frag-face.sh
	src/gallium/tests/graw/fragment-shader/frag-flr.sh
	src/gallium/tests/graw/fragment-shader/frag-frc.sh
	src/gallium/tests/graw/fragment-shader/frag-kil.sh
	src/gallium/tests/graw/fragment-shader/frag-lg2.sh
	src/gallium/tests/graw/fragment-shader/frag-lit.sh
	src/gallium/tests/graw/fragment-shader/frag-lrp.sh
	src/gallium/tests/graw/fragment-shader/frag-mad-immx.sh
	src/gallium/tests/graw/fragment-shader/frag-mad.sh
	src/gallium/tests/graw/fragment-shader/frag-max.sh
	src/gallium/tests/graw/fragment-shader/frag-min.sh
	src/gallium/tests/graw/fragment-shader/frag-mov.sh
	src/gallium/tests/graw/fragment-shader/frag-mul.sh
	src/gallium/tests/graw/fragment-shader/frag-rcp.sh
	src/gallium/tests/graw/fragment-shader/frag-rsq.sh
	src/gallium/tests/graw/fragment-shader/frag-sge.sh
	src/gallium/tests/graw/fragment-shader/frag-slt.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-abs.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-absneg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-neg.sh
	src/gallium/tests/graw/fragment-shader/frag-srcmod-swz.sh
	src/gallium/tests/graw/fragment-shader/frag-sub.sh
	src/gallium/tests/graw/fragment-shader/frag-tempx.sh
	src/gallium/tests/graw/fragment-shader/frag-xpd.sh
	src/gallium/tests/graw/vertex-shader/vert-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-add.sh
	src/gallium/tests/graw/vertex-shader/vert-arl.sh
	src/gallium/tests/graw/vertex-shader/vert-arr.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-1d.sh
	src/gallium/tests/graw/vertex-shader/vert-cb-2d.sh
	src/gallium/tests/graw/vertex-shader/vert-dp3.sh
	src/gallium/tests/graw/vertex-shader/vert-dp4.sh
	src/gallium/tests/graw/vertex-shader/vert-dst.sh
	src/gallium/tests/graw/vertex-shader/vert-ex2.sh
	src/gallium/tests/graw/vertex-shader/vert-flr.sh
	src/gallium/tests/graw/vertex-shader/vert-frc.sh
	src/gallium/tests/graw/vertex-shader/vert-lg2.sh
	src/gallium/tests/graw/vertex-shader/vert-lit.sh
	src/gallium/tests/graw/vertex-shader/vert-lrp.sh
	src/gallium/tests/graw/vertex-shader/vert-mad.sh
	src/gallium/tests/graw/vertex-shader/vert-max.sh
	src/gallium/tests/graw/vertex-shader/vert-min.sh
	src/gallium/tests/graw/vertex-shader/vert-mov.sh
	src/gallium/tests/graw/vertex-shader/vert-mul.sh
	src/gallium/tests/graw/vertex-shader/vert-rcp.sh
	src/gallium/tests/graw/vertex-shader/vert-rsq.sh
	src/gallium/tests/graw/vertex-shader/vert-sge.sh
	src/gallium/tests/graw/vertex-shader/vert-slt.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-abs.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-absneg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-neg.sh
	src/gallium/tests/graw/vertex-shader/vert-srcmod-swz.sh
	src/gallium/tests/graw/vertex-shader/vert-sub.sh
	src/gallium/tests/graw/vertex-shader/vert-xpd.sh
	src/gallium/tools/trace/dump.py
	src/gallium/tools/trace/format.py
	src/gallium/tools/trace/model.py
	src/gallium/tools/trace/parse.py
2011-04-23 14:27:40 +02:00
Christian König
24d76d2966 [g3dvl] cleanup error handling 2011-04-23 13:58:08 +02:00
Christian König
2e6274fc3b [g3dvl] make ycbcr stream and block data a public interface 2011-04-23 13:24:35 +02:00
Christian König
f0819a22f3 [g3dvl] start implementing zscan and quantification
Not 100% complete, but at least a good start.
2011-04-23 03:37:05 +02:00
Christian König
b7acf83d52 [g3dvl] make motion vector buffers a public interface 2011-04-20 13:44:26 +02:00
Christian König
3511780a43 [g3dvl] revert commit 310eea52ca
Using a seperate vertex buffer for mc and ycbcr handling is still better.
2011-04-19 21:06:59 +02:00
Christian König
849bc838e8 [g3dvl] give each color component their own vertex buffer 2011-04-17 23:21:32 +02:00
Christian König
38a315b704 [g3dvl] no need for seperate mv vertex states any more 2011-04-17 21:31:31 +02:00
Christian König
b8a6e0e6fc [g3dvl] give mv their own vertex buffer back 2011-04-17 18:53:22 +02:00
Christian König
0a2310b375 [g3dvl] move blender state into idct code 2011-04-17 13:01:56 +02:00
Christian König
ca79aeb91e [g3dvl] rename vl_mpeg12_mc_renderer into vl_mc
It's still not 100% free from mpeg12 specific stuff,
but should now be a good start for other codecs.
2011-04-17 12:15:14 +02:00
Christian König
9c8bb28ca1 [g3dvl] move top/bottom field selection into mc code
Removes the workaround and get interlaced videos to work 100% correctly.
2011-04-17 12:04:18 +02:00
Christian König
f1485e155a [g3dvl] make macroblock_size configurable in mc 2011-04-16 16:22:53 +02:00
Christian König
cfe921a9b6 [g3dvl] remove dummy sampler from mc 2011-04-16 16:02:40 +02:00
Christian König
5294ac6223 [g3dvl] move mc fb and viewport handling into buffer object 2011-04-16 13:40:19 +02:00
Christian König
ff210aea7c [g3dvl] back to seperate mc for y and c planes 2011-04-16 13:04:04 +02:00
Christian König
ffcf287aa2 vdpau: implement VDPAU_DUMP option 2011-04-16 12:57:45 +02:00
Christian König
c87b83d4b2 [g3dvl] give mc and ycbcr stage its own vertex element state 2011-04-15 22:15:17 +02:00
Christian König
b1c44b0ea6 [g3dvl] give mv and ycbcr stage its own vertex shader 2011-04-15 21:26:06 +02:00
Christian König
4fc4f7b9ea [g3dvl] set ref samplers to linear again 2011-04-15 00:01:27 +02:00
Christian König
10c49b2875 [g3dvl] use blending for mc of ref frames 2011-04-14 23:39:27 +02:00
Christian König
e61a63a651 [g3dvl] cleanup blender and sampler views 2011-04-14 00:40:24 +02:00
Christian König
b88fa92400 [g3dvl] split mc into seperate stages 2011-04-13 23:21:11 +02:00
Christian König
751eb75310 [g3dvl] move intra handling into fetch_ycbcr 2011-04-13 20:07:21 +02:00
Christian König
efaf024f8c xvmc: use a pipe_video_rect for subpicture src & dst 2011-04-13 19:32:49 +02:00
Christian König
c7b65dcaff xvmc: Define some Xv attribs to allow users to specify color standard and procamp 2011-04-13 18:50:18 +02:00
Christian König
537370be4b xvmc: move subpicture swizzle into own function 2011-04-12 22:07:03 +02:00
Christian König
87e81a3e9d xvmc: fix compiler warning 2011-04-12 21:51:41 +02:00
Christian König
4d057864d0 xvmc: flush surface of macroblock (0,0) is detected 2011-04-12 21:42:08 +02:00
Christian König
3745025b28 [g3dvl] make resource_format param const 2011-04-12 20:45:31 +02:00
Christian König
b486766725 xvmc: cleanup headers 2011-04-12 20:38:21 +02:00
Christian König
f63aba41fb vdpau: switch cb cr planes in vlVdpVideoSurfacePutBitsYCbCr 2011-04-12 20:19:59 +02:00
Christian König
62373e8f9e vdpau: set at least a basic csc matrix 2011-04-12 19:42:47 +02:00
Christian König
4f3fb1586a [g3dvl] make resource format selection a public interface 2011-04-12 19:21:07 +02:00
Christian König
ccc80d2c09 [g3dvl] fully support different formats for source and intermediate textures 2011-04-11 23:55:36 +02:00
Christian König
36b322dffd r600g: support textures with scaled number formats 2011-04-11 00:49:28 +02:00
Christian König
bad3085c78 [g3dvl] autoselect texture formats 2011-04-10 22:45:22 +02:00
Christian König
871d6d49c9 [g3dvl] autoconfigure nr of idct render targets 2011-04-10 20:49:18 +02:00
Christian König
b6af6ba6c0 [g3dvl] remove unused rasterizer state from mpeg decoder 2011-04-10 20:34:21 +02:00
Christian König
ad4ed0e7f6 [g3dvl] give idct it's own init buffer function 2011-04-10 20:30:27 +02:00
Christian König
5ed848129c [g3dvl] cleanup headers and comments 2011-04-10 19:16:38 +02:00
Christian König
fcf765620d [g3dvl] make number of idct render targets configurable 2011-04-10 19:08:11 +02:00
Christian König
31109e1be2 [g3dvl] also use video buffer for idct intermediate 2011-04-10 18:46:31 +02:00
Christian König
8b0a9cc62c [g3dvl] get softpipe to work again 2011-04-10 00:33:36 +02:00
Christian König
816d820b7d xvmc: add a workaround for xines xxmc vo plugin 2011-04-09 20:46:24 +02:00
Christian König
7a5390b06f [g3dvl] make mv weights a public interface 2011-04-09 20:38:20 +02:00
Christian König
44477ac489 [g3dvl] give each mv an individual weight 2011-04-09 12:01:29 +02:00
Christian König
cae77aa80b vdpau: Implement basic output functionality
Even with totally wrong color space conversion
we finally se a picture with VDPAU. Yeah!
2011-04-09 01:34:02 +02:00
Christian König
f3ead63e70 vdpau: get at least the very basic mixer functions working 2011-04-08 22:13:46 +02:00
Christian König
255033e481 [g3dvl] use scissor to handle compositor dst_area 2011-04-08 22:07:30 +02:00
Christian König
574ffb440d vdpau: add compositor to mixer 2011-04-08 20:12:30 +02:00
Christian König
6710e690f6 vdpau: add compositor to presentation queue 2011-04-08 20:03:35 +02:00
Christian König
b98b58c76a vdpau: implement output surface creation 2011-04-08 19:21:13 +02:00
Christian König
19402275fb [g3dvl] stop waiting for replay of DRI2CopyRegion 2011-04-07 23:04:10 +02:00
Christian König
30c4a07310 [g3dvl] create composite buffer with USAGE_STREAM
Also add PIPE_TRANSFER_DONTBLOCK to mapping options
2011-04-07 23:00:26 +02:00
Christian König
fcdf50f74b [g3dvl] add support for different decoding entry points 2011-04-07 20:10:55 +02:00
Christian König
9d2e630cd0 [g3dvl] move mapping/unmapping and uploading of blocks out of idct code 2011-04-07 19:24:22 +02:00
Christian König
2c21d28e83 vdpau: implement vlVdpVideoSurfacePutBitsYCbCr 2011-04-06 20:38:16 +02:00
Christian König
05a2247a94 [g3dvl] set buffer_format correctly 2011-04-06 20:36:31 +02:00
Christian König
d9ad3aa3b9 [g3dvl] and finally split the decoder part out of the context
This should give a good basis to implement vdpau ontop of it.
2011-04-06 00:06:20 +02:00
Christian König
3a2b906805 [g3dvl] rename ycbcr buffer to video buffer and add some more functionality 2011-04-04 23:28:18 +02:00
Christian König
ebd564587a g3dvl/vdpau: some more indention fixes 2011-04-03 22:01:15 +02:00
Christian König
087e17f52e [g3dvl] fix vertex buffer size calculation 2011-04-03 20:49:15 +02:00
Christian König
e6176ce371 [g3dvl] some more debugging output in xvmc st 2011-04-03 19:57:49 +02:00
Christian König
e5f78a74f8 [g3dvl] split compositor out of video context
Also redesign the compositor a bit and make the result a public available interface
2011-04-03 16:09:23 +02:00
Christian König
e6d41e4d03 [g3dvl] start to cleanup the mess and provide at least basic functionality 2011-04-03 00:14:38 +02:00
Christian König
d5b05a869a [g3dvl] start over with vdpau decoding 2011-04-03 00:09:01 +02:00
Christian König
7dc87676f2 vdpau: get state tracker to compile again 2011-04-02 23:16:21 +02:00
Christian König
59774e5c7a [g3dvl] remove unused color_swizzle from idct code 2011-04-02 22:36:26 +02:00
Christian König
e6049aa0a9 [g3dvl] rework mpeg12 context error handling 2011-04-02 22:26:06 +02:00
Christian König
3e92b4fd14 g3dvl/xvmc: fix a stupid of by one bug 2011-04-02 20:29:27 +02:00
Christian König
71ee815b5c [g3dvl] remove PIPE_CAP_DECODE_TARGET_PREFERRED_FORMAT
It wasn't fully implemented anyway.
2011-04-02 19:50:37 +02:00
Christian König
794cde3f5e [g3dvl] splitt vertex element state into y, cb, cr 2011-04-02 12:05:22 +02:00
Christian König
4de5d81638 [g3dvl] some minor cleanup 2011-04-01 23:47:20 +02:00
Christian König
1f3a85ec79 [g3dvl] let mc code work on the different color planes seperately 2011-03-29 20:01:49 +02:00
Christian König
f3c9161b15 [g3dvl] remove texture dependencies from mc code 2011-03-27 20:41:43 +02:00
Christian König
020328ca32 [g3dvl] introduction of ycbcr buffers
Moves most of the buffer creation out of the idct code.
2011-03-27 19:43:02 +02:00
Christian König
5a351e5129 [g3dvl] no need for individual samplers for idct stage 1 & 2 2011-03-27 01:53:04 +01:00
Christian König
8330bc29dd [g3dvl] cleanup and improve idct error handling 2011-03-27 01:41:10 +01:00
Christian König
c6182cc6d4 [g3dvl] improve and cleanup mc error handling 2011-03-27 01:04:00 +01:00
Christian König
e8a701f40b [g3dvl] remove unused backbuffer from xvmc 2011-03-27 00:19:25 +01:00
Christian König
7f426615ab [g3dvl] fully implement paletted subpictures 2011-03-26 12:36:01 +01:00
Christian König
9a59f22d11 [g3dvl] correct subpicture stride in upload 2011-03-26 11:53:27 +01:00
Christian König
849a0b0a82 [g3dvl] start implementing palettes for subpictures 2011-03-26 11:46:07 +01:00
Christian König
5f23328a8a [g3dvl] get sampler swizzle right for subpictures
This should make ai44 work correctly.
2011-03-26 10:58:38 +01:00
Christian König
c001c39371 [g3dvl] add blend state to compositor
This seems to get at least mplayer working
2011-03-26 02:03:16 +01:00
Christian König
adbc9cee0d [g3dvl] correct layer size calculation 2011-03-26 01:26:52 +01:00
Christian König
05a2c182f1 [g3dvl] use quads instead of triangles for the compositor 2011-03-26 01:01:18 +01:00
Christian König
133add9c50 [g3dvl] the sampler textview map is no longer needed 2011-03-26 00:30:22 +01:00
Christian König
3d40d4f391 [g3dvl] throw out all unused parts of the interface 2011-03-26 00:20:16 +01:00
Christian König
4a0b80f00d [g3dvl] rework supicture handling
This gets ia44 and ai44 at least partial working
2011-03-25 23:38:50 +01:00
Christian König
a17788ac49 [g3dvl] start implementing AI44 and IA44 subpicture 2011-03-25 21:10:56 +01:00
Christian König
ce6f8331fa [g3dvl] make ref_surface handling more sane 2011-03-25 19:32:22 +01:00
Christian König
da3c6dd099 [g3dvl] move sampler views for reference frames into context 2011-03-24 21:24:58 +01:00
Christian König
884cb79edf [g3dvl] make mapping and flushing of buffers a public interface 2011-03-24 20:33:32 +01:00
Christian König
f65cdb9ea5 [g3dvl] fix configure.ac for r600 video targets 2011-03-22 21:58:28 +01:00
Christian König
f08d3bb59b [g3dvl] buffers must be aligned to macroblock size 2011-03-22 21:52:06 +01:00
Christian König
ba0bff8530 [g3dvl] make video buffer a public available interface 2011-03-22 19:58:21 +01:00
Christian König
52766c2c37 [g3dvl] handle different mc types more similary 2011-03-20 22:50:09 +01:00
Christian König
f2c6affa36 [g3dvl] simplify motion vector calculation 2011-03-20 22:14:49 +01:00
Christian König
bac8760f7f [g3dvl] rename motion vector fields 2011-03-20 21:34:38 +01:00
Christian König
dd6cd206a6 [g3dvl] correctly implement non power of two buffers 2011-03-20 19:45:06 +01:00
Christian König
713a52d856 [g3dvl] cleanup idct init 2011-03-20 19:29:47 +01:00
Christian König
1a238efe42 [g3dvl] fix power_of_two buffer with/height handling 2011-03-20 19:00:50 +01:00
Christian König
e9b305c100 [g3dvl] merge fixes 2011-03-19 12:26:17 +01:00
Christian König
74e1d64c6d r600g: revert some asm optimisations
They didn't have the desired effect and are still quite buggy
2011-03-19 11:40:22 +01:00
Christian König
2bf95c519e Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/tests/unit/SConscript
2011-03-19 01:02:40 +01:00
Christian König
f36846c77e vdpau: add vdpau-r600 target 2011-03-19 00:06:47 +01:00
Christian König
cbb3ad3d5a vdpau: fix formating and idention of surface.c 2011-03-19 00:06:46 +01:00
Christian König
d1655b60b0 get softpipe winsys to compile again 2011-03-19 00:06:46 +01:00
Christian König
49f4aff75c vdpau: make indention and formating more sane 2011-03-19 00:06:46 +01:00
Christian König
b90f569a0f vdpau: merge fixes for vdpau state tracker 2011-03-19 00:06:46 +01:00
Christian König
0719fdee2e fix chroma swizzle 2011-03-19 00:06:46 +01:00
Christian König
1d72cf6986 move empty block mask into mpeg12 context 2011-03-19 00:06:46 +01:00
Christian König
a1fecd09c2 [g3dvl] move mpeg12 context out of softpipe 2011-03-17 00:08:20 +01:00
Christian König
e87bd8c957 [g3dvl] cleanup and documentation 2011-03-16 23:09:52 +01:00
Christian König
0f07da0a1c [g3dvl] move idct out of mc code
iDCT and MC now look good, but sp_video_context is a total mess
2011-03-09 23:40:08 +01:00
Christian König
37a548c9d1 [g3dvl] start to cleanup the mess
Move the vertex buffer out of the mc code
2011-03-08 21:30:33 +01:00
Christian König
310eea52ca [g3dvl] use a single vertex buffer for both idct and mc 2011-03-08 18:34:05 +01:00
Christian König
43af13b2cb r600g: set start instance correctly 2011-03-08 16:48:39 +01:00
Christian König
4ea3817602 [g3dvl] use instanced drawing to reduce the vertex buffer payload 2011-03-05 16:36:38 +01:00
Christian König
199034a3cc Merge remote branch 'origin/master' into pipe-video 2011-03-05 15:46:56 +01:00
Christian König
54f11a27a1 Merge remote branch 'origin/master' into pipe-video 2011-03-04 17:15:43 +01:00
Christian König
0eccb1038a Merge remote branch 'origin/master' into pipe-video 2011-03-03 00:59:12 +01:00
Christian König
ed12c29bc4 r600g: merge fix 2011-03-02 20:48:03 +01:00
Christian König
b97e41c7b1 Merge remote branch 'origin/master' into pipe-video 2011-02-28 23:59:53 +01:00
Christian König
77217af40d r600g: Merge fix 2011-02-24 22:28:38 +01:00
Christian König
b922a0ce12 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/drivers/r600/r600_shader.c
	src/gallium/drivers/r600/r600_state_inlines.h
	src/gallium/drivers/r600/r600_texture.c
2011-02-24 22:02:42 +01:00
Christian König
f013b4f8f1 r600g: bugfixing register remapping 2011-01-29 12:10:37 +01:00
Christian König
86e5b79a27 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_texture.c
2011-01-21 21:51:24 +01:00
Christian König
78faf8d0e9 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
2011-01-20 22:43:18 +01:00
Christian König
d2ff6b8715 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_shader.c
2011-01-20 22:10:37 +01:00
Christian König
e755c7bec3 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_shader.c
2011-01-12 00:51:45 +01:00
Christian König
a96fe679e2 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_shader.c
2011-01-12 00:48:10 +01:00
Christian König
7965e2fc16 [g3dvl] merge fix 2011-01-11 21:54:30 +01:00
Christian König
9032d2a13e Merge remote branch 'vdpau/pipe-video' into pipe-video
Conflicts:
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/include/pipe/p_format.h
	src/gallium/state_trackers/xorg/xvmc/context.c
	src/gallium/tests/unit/SConscript
2011-01-10 23:41:08 +01:00
Christian König
b725bbebae [g3dvl] static usage for intermediate buffer 2011-01-10 22:19:14 +01:00
Christian König
1b1c15a54a r600g: place buffers into different domains, based on usage flags 2011-01-10 22:09:41 +01:00
Christian König
c8236aaf70 [g3dvl] move to integer verticies 2011-01-10 19:15:42 +01:00
Christian König
4025958e1b [g3dvl] use a table of empty block mask instead of calculating it 2011-01-09 14:19:14 +01:00
Christian König
3789a480ed r600g: check if hardware blits are possible bevore enabling tilling 2011-01-09 13:18:48 +01:00
Christian König
9bf8adc45e r600g: some merge fixes 2011-01-09 13:18:30 +01:00
Christian König
72e3099155 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/r600/eg_asm.c
	src/gallium/drivers/r600/r600_asm.c
	src/gallium/drivers/r600/r600_asm.h
	src/gallium/include/pipe/p_format.h
	src/gallium/targets/dri-nouveau/Makefile
2011-01-08 13:24:36 +01:00
Christian König
ef4def1d9a r600g: join export instructions 2011-01-08 11:11:48 +01:00
Christian König
10dbabc481 r600g: fully implement barrier handling 2011-01-07 18:26:51 +01:00
Christian König
3a49b567cf r600g: rearange exports 2010-12-28 23:45:46 +01:00
Christian König
c099fcd28a r600g: optimize unneeded alu moves 2010-12-28 13:09:54 +01:00
Christian König
f23dce0532 r600g: fix gpr usage intersection and add conditiona code handling 2010-12-27 20:50:05 +01:00
Christian König
22de93b435 r600g: implement register remapping 2010-12-27 17:58:00 +01:00
Christian König
2191d8064e [g3dvl] fix merge conflicts 2010-12-22 21:38:48 +01:00
Christian König
e179a8bf34 Merge remote branch 'origin/master' into pipe-video 2010-12-22 21:12:24 +01:00
Christian König
1b03996b12 r600g: remove some unneded barriers 2010-12-22 20:50:16 +01:00
Christian König
f853ea0078 [g3dvl] move code around for more optimal shader generation 2010-12-22 20:01:39 +01:00
Christian König
26127d6a2f r600g: rework literal handling 2010-12-22 17:45:51 +01:00
Christian König
adf89a3329 r600g: fix bug created by 120a558624 2010-12-21 21:27:57 +01:00
Christian König
ac5b174706 r600g: merge alu groups 2010-12-20 22:09:09 +01:00
Christian König
7b0cc9bd38 r600g: implement replacing gpr with pv and ps 2010-12-18 21:32:16 +01:00
Christian König
79f881156f r600g: rework bank swizzle code 2010-12-18 17:56:36 +01:00
Christian König
f6c47f686d r600g: fix alu slot assignment 2010-12-18 13:57:18 +01:00
Christian König
7ff871ee15 [g3dvl] add some missing writemasks 2010-12-18 00:47:00 +01:00
Christian König
120a558624 r600g: optimize away CF ALU instructions even if type doesn't match 2010-12-18 00:45:59 +01:00
Christian König
8cff56168d r600g: fix alu dumping 2010-12-17 22:57:36 +01:00
Christian König
01e3e7c7c3 r600g: fix tex and vtx joining 2010-12-16 22:23:48 +01:00
Christian König
f2fe373518 r600g: improve r600_bc_dump 2010-12-16 22:05:33 +01:00
Christian König
f780626c35 [g3dvl] move scaling completely into matrix and use less temp registers 2010-12-16 18:41:13 +01:00
Christian König
08c8cd26b8 r600g: implement output modifiers and use them to further optimize LRP 2010-12-16 16:42:14 +01:00
Christian König
f75578b31e r600g: use special constants for 0, 1, -1, 1.0f, 0.5f etc 2010-12-14 23:38:30 +01:00
Christian König
270f6d194c r600g: optimize temp register handling for LRP 2010-12-14 20:49:31 +01:00
Christian König
d98d2e7c6c [g3dvl] no need to swizzle a scalar 2010-12-14 20:20:36 +01:00
Christian König
9d967fc91e r600g: DP4 also supports writemasking 2010-12-14 19:32:08 +01:00
Christian König
d92e97d884 r600g: optimize away CF_INST_POP
If last instruction is an CF_INST_ALU we don't need to emit an
additional CF_INST_POP for stack clean up after an IF ELSE ENDIF.
2010-12-14 00:43:53 +01:00
Christian König
e13fecbbd6 [g3dvl] add reg_fixup_label to IF ELSE ENDIF 2010-12-13 00:04:58 +01:00
Christian König
be4de05c10 [g3dvl] move idct texture addr generation into vertex shader 2010-12-12 22:55:23 +01:00
Christian König
ebab090ed9 [g3dvl] seperate texture addr generation from fetching 2010-12-12 21:40:41 +01:00
Christian König
7bc9ab1181 r600g: texture instructions also work fine with TGSI_FILE_INPUT 2010-12-12 15:37:54 +01:00
Christian König
d5295552f5 r600g: Why all this fiddling with tgsi_helper_copy?
tgsi_helper_copy is used on several occasions to copy a temporary result
into the real destination register to emulate writemasks for OP3 and
reduction operations. According to R600 ISA that's unnecessary.

This patch fixes this use for MAD, CMP and DP4.
2010-12-12 15:37:14 +01:00
Christian König
ad643bfc12 [g3dvl] remove "Nouveau can't writemask tex dst regs" workaround
This now works with r600g, but will probably break Nouveau.
It's just way faster on r600 hardware, so let's fix Nouveau.
2010-12-11 14:34:01 +01:00
Christian König
dbe6454aa3 [g3dvl] move mv into vertex stream 2010-12-11 14:00:59 +01:00
Christian König
772b25e1f3 Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/drivers/r600/r600_pipe.c
	src/gallium/drivers/r600/r600_texture.c
2010-12-11 13:43:44 +01:00
Christian König
ab130400cf [g3dvl] move z-coord generation for multiple render targets into vertex shader 2010-12-10 12:05:30 +01:00
Christian König
4a8420513d [g3dvl] move idct stage 1 scaling into matrix 2010-12-10 11:31:17 +01:00
Christian König
680f118138 [g3dvl] double buffering seems to be enough 2010-12-10 11:05:11 +01:00
Christian König
9c296be7d6 [g3dvl] make render targets full configureable 2010-12-10 02:56:15 +01:00
Christian König
593a2cf8c5 [g3dvl] move interlaced dct handling into vertex shader 2010-12-10 01:27:21 +01:00
Christian König
1fb4bf84d5 [g3dvl] move frame predition handling vom fragment into vertex shader 2010-12-10 00:29:59 +01:00
Christian König
cf234984f4 [g3dvl] avoid some ELSE blocks 2010-12-10 00:13:32 +01:00
Christian König
00e60387fc [g3dvl] try a different buffer aproach 2010-12-09 22:34:43 +01:00
Christian König
25cdc79f32 [g3dvl] fix buffer handling in mc code 2010-12-09 22:28:31 +01:00
Christian König
7c4887f5ae [g3dvl] fix idct matrix upload 2010-12-09 22:27:03 +01:00
Christian König
1e3f5e9520 [g3dvl] split mc code into state and buffer 2010-12-08 23:37:57 +01:00
Christian König
3b2ef2d007 [g3dvl] move buffer mapping/unmapping out of flush 2010-12-08 22:35:30 +01:00
Christian König
877edb6785 [g3dvl] replace IF THEN ELSE with CMP statement 2010-12-08 21:28:38 +01:00
Christian König
1482b9a7f3 [g3dvl] remove shadow buffering of vertex buffers 2010-12-08 20:48:34 +01:00
Christian König
8df88ca10f [g3dvl] remove mb type handler structure 2010-12-08 19:41:01 +01:00
Christian König
050e7035f2 [g3dvl] move macro block type handling into shaders part 3 2010-12-08 19:18:55 +01:00
Christian König
5790ca5289 [g3dvl] moving macroblock type handling into shaders part 2 2010-12-08 18:42:48 +01:00
Christian König
081b01fd60 [g3dvl] start moving macroblock type handling into shaders 2010-12-08 18:26:58 +01:00
Christian König
b680476b52 [g3dvl] allways use all motion vectors
reprogramming the vertex buffers takes more time than pumping
all motion vectors through the vertex shader
2010-12-08 16:11:29 +01:00
Christian König
d8d8939dd5 [g3dvl] split empty block handling
Empty block handling is split between vertex shader (x-axis)
and fragment shader (y-axis).
2010-12-08 14:50:28 +01:00
Christian König
0b749d6dcb [g3dvl] split idct code into state and buffers 2010-12-08 02:12:24 +01:00
Christian König
22b4acb206 [g3dvl] use buffer width instead of texture size or vs constants 2010-12-07 21:23:14 +01:00
Christian König
bfb4fb057d [g3dvl] move vertex buffer handling into vl_vertex_buffer.c 2010-12-07 20:13:37 +01:00
Christian König
eb7452e267 [g3dvl] rework pot buffer handling and flushing 2010-12-07 00:29:02 +01:00
Christian König
6484898752 [g3dvl] move mapping/unmapping of buffers one layer up 2010-12-05 22:30:38 +01:00
Christian König
5701873402 [g3dvl] move vertex handling into vl_vb object 2010-12-05 17:57:52 +01:00
Christian König
8e0c05960d [g3dvl] cleanup empty block handling
doing empty block handling in the mc code is indeed faster
2010-12-05 16:46:10 +01:00
Christian König
9af3c243d9 move empty block handling back into mc for testing 2010-12-03 19:04:01 +01:00
Christian König
29840040af add rasterizer state 2010-12-03 19:04:01 +01:00
Christian König
27016941bc use CMP also for referenz frame fetch 2010-12-03 19:04:01 +01:00
Christian König
c8b7cf469f cleanup and use CMP instead of IF ELSE ENDIF 2010-12-03 19:04:01 +01:00
Christian König
74c71f09f3 move to four component calculation for idct code 2010-12-03 19:04:01 +01:00
Christian König
69f53c3dc8 copy only mv really needed to vb 2010-12-03 19:04:01 +01:00
Christian König
d2888c5f2f use vertex buffer also for mc code 2010-12-03 19:04:01 +01:00
Christian König
c7068d79a0 give each vertex element its own buffer 2010-12-03 19:04:00 +01:00
Christian König
838d109207 use vl_vb_upload_quads also for mc 2010-12-03 19:04:00 +01:00
Christian König
3e6a5077ca move vertex elemt states into mb type handlers 2010-12-03 19:04:00 +01:00
Christian König
3bbbb3c54f move macroblock type handling into its own structure 2010-12-03 19:04:00 +01:00
Christian König
4abe738288 use a shadow buffer for vertex data to optimize memory access 2010-12-03 19:04:00 +01:00
Christian König
a984c67b31 make nr of render targets configureable for testing 2010-12-03 19:04:00 +01:00
Christian König
336c7735ae [g3dvl] join empty blocks to get larger slices 2010-11-28 01:21:41 +01:00
Christian König
e742a1043d [g3dvl] use 8 zslices for idct 2010-11-27 18:20:38 +01:00
Christian König
3fd53e6c2a [g3dvl] some more bugfixing 2010-11-27 14:08:15 +01:00
Christian König
12836fbcfa [g3dvl] idividual vs for each stage and a bunch of bugsfixes 2010-11-27 14:01:01 +01:00
Christian König
027704db75 [g3dvl] give idct stage 1 & 2 its own sb_state and viewport 2010-11-27 11:24:24 +01:00
Christian König
13e28cff76 [g3dvl] use four component fetch also for idct source 2010-11-26 21:50:14 +01:00
Christian König
a981d62c97 r600g: disable hardware blit for stream texture 2010-11-26 21:44:22 +01:00
Christian König
cfe489b897 [g3dvl] split matrix mul into seperate functions 2010-11-26 20:25:00 +01:00
Christian König
7408a6ab89 [g3dvl] use inline constants instead of vs_const for idct 2010-11-26 19:14:55 +01:00
Christian König
3dd7bf7d39 [g3dvl] no need to keep the idct matrix multiple times 2010-11-25 22:10:21 +01:00
Christian König
9cff905343 [g3dvl] add dump option to xvmc 2010-11-25 21:23:48 +01:00
Christian König
ed8b767a8e [g3dvl] also use four elemets on right side multiplikation 2010-11-25 19:37:12 +01:00
Christian König
c9e10c666a [g3dvl] use four elements in matrix texture fetch 2010-11-24 23:54:21 +01:00
Christian König
de623b96ab r600g: disable not working formats 2010-11-24 23:44:30 +01:00
Christian König
431e72984b r600g: reenable texture uploads, but keep R16_SNORM disabled 2010-11-24 21:40:50 +01:00
Christian König
a51b0daa59 r600g: disable R32 float also in r600_translate_colorformat 2010-11-24 21:36:54 +01:00
Christian König
2c9db2484b [g3dvl] no need for all samplers at all stages 2010-11-24 20:00:52 +01:00
Christian König
5391ef8606 [g3dvl] remove flushing between stages 2010-11-24 19:46:51 +01:00
Christian König
ed49905944 [g3dvl] spread scaling between idct stages 2010-11-24 19:40:47 +01:00
Christian König
5a8078486a [g3dvl] remove invalid use of assert 2010-11-23 22:43:29 +01:00
Christian König
58d04f816c [g3dvl] switch to r32 float for idct matrix 2010-11-23 21:26:26 +01:00
Christian König
21efda8687 [g3dvl] add some error handling 2010-11-23 00:19:02 +01:00
Christian König
e6b71530da Merge remote branch 'origin/master' into pipe-video
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
2010-11-21 19:40:52 +01:00
Christian König
42c7291d2c [g3dvl] inverse check for iDCT 2010-11-21 14:34:38 +01:00
Christian König
ac1fd50163 [g3dvl] first working version of idct code 2010-11-21 14:19:40 +01:00
Christian König
331eb58d15 r600g: disable staging upload for now 2010-11-21 13:58:23 +01:00
Christian König
cc998ddf92 r600g: remove accidentally added r32 float format 2010-11-21 13:57:02 +01:00
Christian König
95febb69cc [g3dvl] move empty block handling into idct code 2010-11-20 22:24:42 +01:00
Christian König
03c5a0ea5c [g3dvl] enable stage 1&2 buffers in idct code 2010-11-20 21:08:12 +01:00
Christian König
749504a935 r600g: add support for signed normalized frame buffers 2010-11-20 21:06:42 +01:00
Christian König
e639e1b83e [g3dvl] next round of idct implementation 2010-11-16 22:30:50 +01:00
Christian König
508a4a056c [g3dvl] add skeleton and incomplete idct 2010-11-14 23:16:49 +01:00
Christian König
3cbe27a988 [g3dvl] ups missed this check 2010-11-14 20:35:02 +01:00
Christian König
3886295a0c [g3dvl] remove need for XVMC_INTRA_UNSIGNED
Move from unsigned to signed intra dct blocks.
You also need to update xf86-video-ati for this to work.
2010-11-14 20:14:25 +01:00
Christian König
48e19e8f35 [g3dvl] fix of my one bug in SCALE_FACTOR_16_TO_9 2010-11-14 02:17:39 +01:00
Christian König
0bc51ba484 [g3dvl] switch to using macroblock vertices 2010-11-13 17:16:27 +01:00
Christian König
35a8efe577 [g3dvl] move empty block handling completely into shaders 2010-11-13 16:56:59 +01:00
Christian König
d128c091c7 [g3dvl] use quads instead of triangles 2010-11-13 14:06:47 +01:00
Christian König
33311ffed5 [g3dvl] cleanup
Add missing comments simplyfy shaders etc...
2010-11-12 23:49:33 +01:00
Christian König
1eaf4806cd [g3dvl] and finally move field codec dct handling into shaders 2010-11-12 12:00:33 +01:00
Christian König
fa4d274516 [g3dvl] make room for second z-coord and interlaced flag 2010-11-12 01:04:22 +01:00
Christian König
7af05c4fe6 [g3dvl] move applying z-coord to fragment shader 2010-11-12 00:29:37 +01:00
Christian König
d8192f1821 [g3dvl] use constants for vertex shader outputs and move field calculation into own function 2010-11-12 00:17:56 +01:00
Christian König
97e92ab63b [g3dvl] move xfer_buffers_map/unmap into flush 2010-11-11 22:08:00 +01:00
Christian König
195bbe8ce2 Merge remote branch 'origin/master' into pipe-video 2010-11-11 21:07:42 +01:00
Christian König
99b57bc20e [g3dvl] move stuff from flush into own functions 2010-11-11 15:01:27 +01:00
Christian König
e406936b9e [g3dvl] remove empty block handling for now
Maybe this isn't going into the right direction,
but it makes handling the code easier for now.
2010-11-11 12:49:47 +01:00
Christian König
745906257a [g3dvl] use only one vertex element for ycbcr z-coord 2010-11-11 12:32:44 +01:00
Christian König
4c90c039f0 [g3dvl] move the rest of the calculations into the vertex shader 2010-11-11 11:53:12 +01:00
Christian König
1be1aa7ba1 [g3dvl] cleanup vert_stream_0 2010-11-11 00:39:30 +01:00
Christian König
3a247a08e8 [g3dvl] use clamp to border for empty block handling 2010-11-10 23:22:56 +01:00
Christian König
d073fec718 [g3dvl] move to 3D textures for y cb cr 2010-11-10 21:35:55 +01:00
Christian König
c2ec28be3a [g3dvl] again rework vertex shader a bit 2010-11-10 15:24:28 +01:00
Christian König
1eade3271a [g3dvl] workaround for motion vertical field selection 2010-11-09 23:18:33 +01:00
Christian König
5182416f03 [g3dvl] start handling motion_vertical_field_select 2010-11-09 20:01:58 +01:00
Christian König
725a5e15cf [g3dvl] cleanup naming convention and comments 2010-11-06 17:08:55 +01:00
Christian König
34e5ae5aed [g3dvl] motion type depends on picture structure not dct type 2010-11-06 16:18:24 +01:00
Christian König
d7fc97b6ab [g3dvl] simplyfy shaders and fix bugs 2010-11-05 22:48:27 +01:00
Christian König
dd51858850 [g3dvl] it finally starts to look like a badly deinterlaced video 2010-11-05 02:16:43 +01:00
Christian König
de2eec6a3d [g3dvl] move scaling to macroblocksize into vertex shader 2010-11-05 00:20:33 +01:00
Christian König
325233fdef [g3dvl] move vertex normalisation into vertex shader 2010-11-04 23:23:42 +01:00
Christian König
b4c5c6f51a [g3dvl] rework shader a bit 2010-11-04 21:41:39 +01:00
Christian König
2e4a7b7306 Fix zero block handling for field based mc 2010-11-03 00:38:07 +01:00
Christian König
0b75203c59 First try of field based mc 2010-10-30 01:42:16 +02:00
Thomas Balling Sørensen
2b296ec77c vl: initial implementation of vlVaQueryImageFormats(), vlVaCreateImage(), vlVaQuerySubpictureFormats(), vlVaCreateSurfaces(), vlVaQueryConfigEntrypoints(), vlVaQueryConfigProfiles() 2010-10-28 22:46:28 +02:00
Christian König
41ed47d6b8 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	src/gallium/include/pipe/p_format.h
2010-10-28 20:24:56 +02:00
Thomas Balling Sørensen
8ba4c96f82 vl: rest of va stubs 2010-10-28 14:32:54 +02:00
Thomas Balling Sørensen
a565f58eda vl: enable target va-r600 2010-10-28 13:40:59 +02:00
Thomas Balling Sørensen
3fac09ad87 vl: Initial implementation of vlVaQuerySubpictureFormats. 2010-10-28 12:51:35 +02:00
Thomas Balling Sørensen
fd2cbe94df vl: small typos and stuff 2010-10-28 09:40:25 +02:00
Thomas Balling Sørensen
6b6310e67c vl: morefixes to Luc's patch 2010-10-27 20:27:11 +02:00
Thomas Balling Sørensen
664f10625a vl: rest of Luc's patch 2010-10-27 13:01:18 +02:00
Thomas Balling Sørensen
990cb62963 vl: commited Orasanu Lucian's patch containing va stubs. 2010-10-27 11:00:11 +02:00
Thomas Balling Sørensen
17ea7d16bd vl: creating cleaner way of naming libraries 2010-10-26 14:06:01 +02:00
Thomas Balling Sørensen
050dfe9caf vl: fix some build issues after the merge 2010-10-26 13:58:19 +02:00
Thomas Balling Sørensen
6ac1bbe21a vl: pipe-video branch merged with Königs pipe-video branch 2010-10-26 13:44:19 +02:00
Thomas Balling Sørensen
4926c57480 Merge branch 'pipe-video' of git://anongit.freedesktop.org/~deathsimple/xvmc-r600 into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
2010-10-26 13:01:40 +02:00
Thomas Balling Sørensen
dbf3a15313 Merge branch 'master' into pipe-video
Conflicts:
	src/gallium/include/pipe/p_format.h
2010-10-26 12:49:41 +02:00
Thomas Balling Sørensen
1dccc4cfaa vl: add'ed stub for VaCreateImage 2010-10-25 21:38:08 +02:00
Thomas Balling Sørensen
aea4d004d2 vl: more stub work for a va implementation 2010-10-25 20:52:02 +02:00
Christian König
97a7cf230a Workaround for skipping vertex elements for r600g 2010-10-25 19:59:31 +02:00
Thomas Balling Sørensen
501ac572c6 vl: va state-tracker configuration scripts 2010-10-24 19:27:29 +02:00
Christian König
b0dfc3f261 Remove code copied over from r300 2010-10-24 00:53:49 +02:00
Christian König
4381580936 First xvmc-r600 implementation 2010-10-23 17:47:30 +02:00
Thomas Balling Sørensen
b122e50c3e vl: initial va-api implementation 2010-10-23 15:59:45 +02:00
Christian König
de4c2b91f4 Fix uninitialized memory problems 2010-10-23 14:01:13 +02:00
Christian König
ba9caba9c8 Some more merge fixes 2010-10-23 13:54:47 +02:00
Christian König
b13a0af510 Fix problems created by Merge 2010-10-16 16:41:09 +02:00
Thomas Balling Sørensen
2990292f0f vl: more work on the bitstream_parser 2010-10-13 11:27:07 +02:00
Christian König
695cc370a2 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	configure.ac
	src/gallium/drivers/nvfx/Makefile
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/winsys/nouveau/drm/nouveau_drm_api.c
2010-10-12 23:07:29 +02:00
Thomas Balling Sørensen
7d2bdc2d4d vl: bitstream decoder finds startcodes 2010-10-08 13:59:31 +02:00
Thomas Balling Sørensen
bff1ac875c vl: some more fixes and addition to the decoder handling 2010-10-07 00:26:46 +02:00
Thomas Balling Sørensen
65fe0866ae vl: implemented a few functions and made stubs to get mplayer running 2010-10-06 23:30:08 +02:00
Thomas Balling Sørensen
d0e203f1f0 vl: initial commit of the bitstream parser 2010-10-06 00:19:53 +02:00
Thomas Balling Sørensen
7d9e070b0d Merge branch 'pipe-video' of ssh://cgit.freedesktop.org/~tball/mesa-gallium-vdpau into pipe-video 2010-10-05 22:45:05 +02:00
Thomas Balling Sørensen
062149e2d2 Merge branch 'master' of ssh://cgit.freedesktop.org/~tball/mesa-gallium-vdpau into pipe-video 2010-10-05 22:42:56 +02:00
Thomas Balling Sørensen
2194e078c7 Merge remote branch 'origin/master' into pipe-video 2010-10-05 22:38:38 +02:00
Thomas Balling Sørensen
cd114a92b9 vl: change the xvmc state_tracker to the new gallium API 2010-10-05 15:18:29 +02:00
Thomas Balling Sørensen
d64d6f7712 vl: changed video pipe to use the new gallium API within master 2010-10-05 14:25:29 +02:00
Thomas Balling Sørensen
1218430e12 Merge branch 'master' into pipe-video
Conflicts:
	configs/linux-dri
	configure.ac
	src/gallium/drivers/nvfx/Makefile
	src/gallium/include/pipe/p_defines.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/tests/python/samples/tri.py
	src/gallium/tests/trivial/Makefile
	src/gallium/tests/unit/Makefile
	src/gallium/tests/unit/SConscript
	src/gallium/tests/unit/u_format_test.c
	src/gallium/winsys/nouveau/drm/nouveau_drm_api.c
2010-10-05 12:04:08 +02:00
Thomas Balling Sørensen
63b1525cf0 vl: ... 2010-10-05 11:06:02 +02:00
Thomas Balling Sørensen
cac5e60fd3 vl: moved some functions to more appropriate places 2010-09-30 15:58:57 +02:00
Thomas Balling Sørensen
8291db1cdb vl: Renamed function to appropriate name. 2010-09-27 22:45:05 +02:00
Thomas Balling Sørensen
a90bdd09b6 vl: Made vdpauinfo run again 2010-09-21 19:44:30 +02:00
Thomas Balling Sørensen
c5b6f7d166 vl: Made the project compile again. 2010-09-21 19:20:00 +02:00
Thomas Balling Sørensen
5386a8a2e0 vl: Various cleanups. Need to start from scratch with bitstream parser 2010-09-21 15:23:52 +02:00
Thomas Balling Sørensen
09a10be4db Fixed an endianproblem 2010-08-04 11:07:26 +02:00
Thomas Balling Sørensen
966b836e2d Stubs for the bitstream mpeg2 decoder 2010-08-01 11:10:19 +02:00
Thomas Balling Sørensen
6ada38d29a Added stubs for the rest of the vdpau interface 2010-07-22 01:46:40 +02:00
Thomas Balling Sørensen
725e4ada30 Made some decoding function for mpeg2-decoding 2010-07-20 14:27:06 +02:00
Thomas Balling Sørensen
c97ccc3353 Added decode.c 2010-07-18 23:42:49 +02:00
Thomas Balling Sørensen
06a49b1872 fixed compilation 2010-07-14 00:51:18 +02:00
Thomas Balling Sørensen
3299997bcc vdpau changes 2010-07-14 00:36:17 +02:00
Thomas Balling Sørensen
15bc635499 added surface.c and made some changes in device.c 2010-07-14 00:30:46 +02:00
Younes Manton
f3e34ba6fb st/vdpau: Initial commit.
Enough plumbing here to get vdpauinfo working.
2010-06-27 00:01:18 -04:00
Younes Manton
b9fe966519 vl: Fix RGB subpictures. 2010-06-13 17:37:33 -04:00
Younes Manton
4b2fcb2bcb vl: Add transfer funcs to pipe_video_context and softpipe. 2010-06-13 17:36:34 -04:00
Younes Manton
511cb3fbf9 vl: Decode to XRGB, not ARGB. 2010-06-06 13:31:53 -04:00
Younes Manton
6414952efe vl: Drop DRI1, clean up DRI2 bits. 2010-06-06 12:19:22 -04:00
Younes Manton
156fbb9fc5 vl: Check mo_type not mb_type when setting motion vectors. 2010-05-31 00:35:20 -04:00
Younes Manton
ea3a01ae4d vl: Get nouveau building again.
Still some DRI2 bits to sort out.
2010-05-29 19:22:14 -04:00
Younes Manton
62074f44bb st/xvmc: Restore tests removed by merge. 2010-05-29 19:20:41 -04:00
Younes Manton
2798958d89 vl: Dec sampler view refs instead of destroying them.
Gets rid of a bunch of double frees and the crash at shutdown.
2010-05-24 13:44:06 -04:00
Younes Manton
0a51e86332 vl: Use pipe_screen::video_context_create hook instead of SP ctor. 2010-05-24 00:14:45 -04:00
Younes Manton
0e59cd33e6 vl: Get softpipe working again.
Still segfaults on softpipe->destroy() in the draw module when
freeing a vertex buffer.
2010-05-23 19:56:12 -04:00
Younes Manton
2c29a93e87 vl: Get softpipe building again. 2010-05-08 20:11:29 -04:00
Younes Manton
fa3f0c832c gallium: Get rid of auxilary/util files that were removed in master. 2010-05-08 20:10:04 -04:00
Younes Manton
a8ea1dacc6 Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa into pipe-video
Conflicts:
	src/gallium/auxiliary/Makefile
	src/gallium/auxiliary/SConscript
	src/gallium/auxiliary/util/u_format.csv
	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_compositor.h
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
	src/gallium/drivers/identity/id_objects.c
	src/gallium/drivers/identity/id_objects.h
	src/gallium/drivers/identity/id_screen.c
	src/gallium/drivers/nv40/Makefile
	src/gallium/drivers/nv40/nv40_screen.c
	src/gallium/drivers/softpipe/sp_texture.c
	src/gallium/drivers/softpipe/sp_texture.h
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/drivers/softpipe/sp_video_context.h
	src/gallium/include/pipe/p_format.h
	src/gallium/include/pipe/p_screen.h
	src/gallium/include/pipe/p_video_context.h
	src/gallium/include/pipe/p_video_state.h
	src/gallium/include/state_tracker/dri1_api.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/state_trackers/dri/common/dri_context.c
	src/gallium/state_trackers/xorg/xvmc/attributes.c
	src/gallium/state_trackers/xorg/xvmc/block.c
	src/gallium/state_trackers/xorg/xvmc/context.c
	src/gallium/state_trackers/xorg/xvmc/subpicture.c
	src/gallium/state_trackers/xorg/xvmc/surface.c
	src/gallium/state_trackers/xorg/xvmc/tests/.gitignore
	src/gallium/state_trackers/xorg/xvmc/tests/Makefile
	src/gallium/state_trackers/xorg/xvmc/xvmc_private.h
	src/gallium/winsys/drm/radeon/core/radeon_drm.c
	src/gallium/winsys/g3dvl/vl_winsys.h
	src/gallium/winsys/g3dvl/xlib/xsp_winsys.c
	src/gallium/winsys/sw/Makefile
2010-04-30 20:42:30 -04:00
Younes Manton
404fb63b46 vl: WIP DRI2 support in the winsys. 2010-04-28 19:51:10 -04:00
Younes Manton
3107b54b01 st/xvmc: Mark exported funcs with PUBLIC. 2010-04-24 21:16:59 -04:00
Younes Manton
f64d0cf524 vl: Adapt to dri changes. 2010-04-24 15:37:25 -04:00
Younes Manton
356473121c vl: Get rid of pipe_video_surface on the nouveau side as well. 2010-04-24 13:52:47 -04:00
Younes Manton
edca5360ca vl: Fix up configure.ac/Makefile 2010-04-24 13:52:23 -04:00
Younes Manton
5eb822cb6a vl: Do some subpicture validation. 2010-04-18 12:16:40 -04:00
Younes Manton
99218cd2b3 vl: Add some query methods to pipe_video_context and use them. 2010-03-12 19:03:37 -05:00
Younes Manton
035332cbbb vl: Remove pipe_video_surface hooks from pipe_screen as well. 2010-03-12 14:38:37 -05:00
Younes Manton
f1bbd41e32 vl: Don't wrap blocks in pipe_user_buffers.
Mallocing/free eat up a noticeable amount of CPU time for no
practical benefit.
2010-03-12 13:36:52 -05:00
Younes Manton
69c3ad3fc1 vl: Use pipe_surface instead of pipe_texture in interfaces. 2010-03-12 12:38:33 -05:00
Younes Manton
299407aaa3 vl: Get rid of pipe_video_surface. 2010-03-12 12:09:44 -05:00
Younes Manton
81badd5029 gallium: Add common video format enums. 2010-03-12 11:20:06 -05:00
Younes Manton
a8238bb08a Merge remote branch 'origin/master' into pipe-video
Conflicts:
	configure.ac
	src/gallium/auxiliary/vl/Makefile
	src/gallium/auxiliary/vl/SConscript
	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_compositor.h
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.h
	src/gallium/drivers/nouveau/nouveau_winsys.h
	src/gallium/drivers/softpipe/sp_video_context.c
	src/gallium/include/pipe/p_video_state.h
	src/gallium/include/state_tracker/drm_api.h
	src/gallium/state_trackers/xorg/xvmc/surface.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
	src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h
	src/gallium/winsys/drm/radeon/core/radeon_drm.c
	src/gallium/winsys/g3dvl/nouveau/Makefile
2010-03-12 01:37:49 -05:00
Younes Manton
8046846489 vl: Subpicture/compositing fixes. 2010-03-05 23:26:03 -05:00
Younes Manton
8580b7a0ee vl: Add some basic debug output for XvMC.
Set the XVMC_DEBUG env var to:
	0 for no extra output
	1 for error output
	2 for warning output
	3 for tracing output
2010-03-05 23:14:49 -05:00
Younes Manton
40cd082afa vl: Add switches to autoconf.
Pass 'xorg/xvmc' to --with-state-trackers to get the XvMC state tracker.
Pass --enable-gallium-g3dvl to enable the winsys.
2010-03-05 23:11:05 -05:00
Cooper Yuan
4d65133e86 r300g/g3dvl: Fix build error and correct Makefile for xvmc lib 2010-02-01 17:53:46 +08:00
Cooper Yuan
6783672a97 r300g/g3dvl: port xvmc video stuff to mesa/pipe-video branch 2010-01-29 21:42:09 +08:00
Younes Manton
447dddb93d Merge branch 'master' into pipe-video
Conflicts:

	src/gallium/auxiliary/vl/vl_compositor.c
	src/gallium/auxiliary/vl/vl_compositor.h
	src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
	src/gallium/auxiliary/vl/vl_shader_build.c
2009-12-06 16:44:11 -05:00
Younes Manton
9e8ab2e7c1 g3dvl: It's ok to not have cliprects (minimized windows, etc). 2009-12-05 12:53:42 -05:00
Younes Manton
5f730690f8 g3dvl: Basic subpicture support.
RGB subpictures only at the moment.
2009-11-22 16:40:15 -05:00
Younes Manton
334676ed9a nouveau: Link with softpipe. 2009-11-14 14:00:52 -05:00
Younes Manton
8cdfa77b18 g3dvl: Use a func instead of large ugly macro to gen per-block verts. 2009-11-09 16:55:37 -05:00
Younes Manton
c756cb8463 g3dvl: Use immediates in shaders where possible. 2009-11-07 20:20:09 -05:00
Younes Manton
e57f7b7b10 g3dvl: Use ureg to build shaders. 2009-11-07 19:46:33 -05:00
Younes Manton
09878fb91a g3dvl: Unbreak debug build. 2009-11-07 19:45:47 -05:00
Younes Manton
181d034ad5 g3dvl: Remove src/driclient
It's in src/gallium/winsys/g3dvl/dri now.
2009-11-06 01:09:24 -05:00
Younes Manton
8ebc795ec4 g3dvl: Shared drm winsys bits. 2009-11-05 23:58:29 -05:00
Younes Manton
dcccbfd14e g3dvl: Wrap macroblock block buffer in a pipe user buffer. 2009-11-02 22:03:09 -05:00
Younes Manton
d18bd04dde g3dvl: Put misc helpers in u_video.h. 2009-11-02 21:22:14 -05:00
Younes Manton
e60a8e4fcf g3dvl: DRM winsys changes. 2009-11-02 20:32:58 -05:00
4401 changed files with 418443 additions and 744668 deletions

11
.dir-locals.el Normal file
View File

@@ -0,0 +1,11 @@
((nil
(indent-tabs-mode . nil)
(tab-width . 8)
(c-basic-offset . 3)
(c-file-style . "stroustrup")
(fill-column . 78)
(eval . (progn
(c-set-offset 'innamespace '0)
(c-set-offset 'inline-open '0)))
)
)

View File

@@ -1,10 +0,0 @@
;; -*- emacs-lisp -*-
;;
;; This file is processed by the dirvars emacs package. Each variable
;; setting below is performed when this dirvars file is loaded.
;;
indent-tabs-mode: nil
tab-width: 8
c-basic-offset: 3
kde-emacs-after-parent-string: ""
evaluate: (c-set-offset 'inline-open '0)

18
.gitignore vendored
View File

@@ -2,6 +2,9 @@
*.dll
*.exe
*.ilk
*.la
*.lo
*.log
*.o
*.obj
*.os
@@ -10,13 +13,21 @@
*.pyc
*.pyo
*.so
*.so.*
*.sw[a-z]
*.tar
*.tar.bz2
*.tar.gz
*.trs
*.zip
*~
depend
depend.bak
bin/ltmain.sh
lib
lib64
configure
configure.lineno
autom4te.cache
aclocal.m4
config.log
@@ -25,4 +36,11 @@ cscope*
.scon*
config.py
build
libtool
manifest.txt
.dir-locals.el
.deps/
.dirstamp
.libs/
Makefile
Makefile.in

63
Android.common.mk Normal file
View File

@@ -0,0 +1,63 @@
# Mesa 3-D graphics library
#
# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
# Copyright (C) 2010-2011 LunarG Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# use c99 compiler by default
ifeq ($(LOCAL_CC),)
ifeq ($(LOCAL_IS_HOST_MODULE),true)
LOCAL_CC := $(HOST_CC) -std=c99
else
LOCAL_CC := $(TARGET_CC) -std=c99
endif
endif
LOCAL_C_INCLUDES += \
$(MESA_TOP)/include
# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
LOCAL_CFLAGS += \
-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
LOCAL_CFLAGS += \
-DHAVE_PTHREAD=1 \
-fvisibility=hidden \
-Wno-sign-compare
ifeq ($(strip $(MESA_ENABLE_ASM)),true)
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += \
-DUSE_X86_ASM \
-DHAVE_DLOPEN \
endif
endif
LOCAL_CPPFLAGS += \
-Wno-error=non-virtual-dtor \
-Wno-non-virtual-dtor
# uncomment to keep the debug symbols
#LOCAL_STRIP_MODULE := false
ifeq ($(strip $(LOCAL_MODULE_TAGS)),)
LOCAL_MODULE_TAGS := optional
endif

99
Android.mk Normal file
View File

@@ -0,0 +1,99 @@
# Mesa 3-D graphics library
#
# Copyright (C) 2010-2011 Chia-I Wu <olvaffe@gmail.com>
# Copyright (C) 2010-2011 LunarG Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# BOARD_GPU_DRIVERS should be defined. The valid values are
#
# classic drivers: i915 i965
# gallium drivers: swrast i915g nouveau r300g r600g radeonsi vmwgfx
#
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
# module will also be built. DRI modules will be loaded by libGLES_mesa.
MESA_TOP := $(call my-dir)
MESA_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
MESA_ANDROID_MINOR_VERSION := $(word 2, $(subst ., , $(PLATFORM_VERSION)))
MESA_ANDROID_VERSION := $(MESA_ANDROID_MAJOR_VERSION).$(MESA_ANDROID_MINOR_VERSION)
MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
MESA_PYTHON2 := python
DRM_TOP := external/drm
DRM_GRALLOC_TOP := hardware/drm_gralloc
classic_drivers := i915 i965
gallium_drivers := swrast i915g nouveau r300g r600g radeonsi vmwgfx
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
# warn about invalid drivers
invalid_drivers := $(filter-out \
$(classic_drivers) $(gallium_drivers), $(MESA_GPU_DRIVERS))
ifneq ($(invalid_drivers),)
$(warning invalid GPU drivers: $(invalid_drivers))
# tidy up
MESA_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(MESA_GPU_DRIVERS))
endif
# host and target must be the same arch to generate matypes.h
ifeq ($(TARGET_ARCH),$(HOST_ARCH))
MESA_ENABLE_ASM := true
else
MESA_ENABLE_ASM := false
endif
ifneq ($(filter $(classic_drivers), $(MESA_GPU_DRIVERS)),)
MESA_BUILD_CLASSIC := true
else
MESA_BUILD_CLASSIC := false
endif
ifneq ($(filter $(gallium_drivers), $(MESA_GPU_DRIVERS)),)
MESA_BUILD_GALLIUM := true
else
MESA_BUILD_GALLIUM := false
endif
# add subdirectories
ifneq ($(strip $(MESA_GPU_DRIVERS)),)
SUBDIRS := \
src/mapi \
src/glsl \
src/mesa \
src/egl/main
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
SUBDIRS += \
src/egl/drivers/dri2 \
src/mesa/drivers/dri
endif
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
SUBDIRS += src/gallium
endif
mkfiles := $(patsubst %,$(MESA_TOP)/%/Android.mk,$(SUBDIRS))
include $(mkfiles)
endif

537
Makefile
View File

@@ -1,537 +0,0 @@
# Top-level Mesa makefile
TOP = .
SUBDIRS = src
# The git command below generates an empty string when we're not
# building in a GIT tree (i.e., building from a release tarball).
default: $(TOP)/configs/current
@$(TOP)/bin/extract_git_sha1
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \
fi \
done
all: default
doxygen:
cd doxygen && $(MAKE)
clean:
-@touch $(TOP)/configs/current
-@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) clean) ; \
fi \
done
-@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
realclean: clean
-rm -rf lib*
-rm -f $(TOP)/configs/current
-rm -f $(TOP)/configs/autoconf
-rm -rf autom4te.cache
-find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
-name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
distclean: realclean
install:
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
.PHONY: default doxygen clean realclean distclean install
# If there's no current configuration file
$(TOP)/configs/current:
@echo
@echo
@echo "Please choose a configuration from the following list:"
@ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
@echo
@echo "Then type 'make <config>' (ex: 'make linux-x86')"
@echo
@echo "Or, run './configure' then 'make'"
@echo "See './configure --help' for details"
@echo
@echo "(ignore the following error message)"
@exit 1
# Rules to set/install a specific build configuration
aix \
aix-64 \
aix-64-static \
aix-gcc \
aix-static \
autoconf \
bluegene-osmesa \
bluegene-xlc-osmesa \
beos \
catamount-osmesa-pgi \
darwin \
darwin-fat-32bit \
darwin-fat-all \
freebsd \
freebsd-dri \
freebsd-dri-amd64 \
freebsd-dri-x86 \
hpux10 \
hpux10-gcc \
hpux10-static \
hpux11-32 \
hpux11-32-static \
hpux11-32-static-nothreads \
hpux11-64 \
hpux11-64-static \
hpux11-ia64 \
hpux11-ia64-static \
hpux9 \
hpux9-gcc \
irix6-64 \
irix6-64-static \
irix6-n32 \
irix6-n32-static \
irix6-o32 \
irix6-o32-static \
linux \
linux-i965 \
linux-alpha \
linux-alpha-static \
linux-cell \
linux-cell-debug \
linux-debug \
linux-dri \
linux-dri-debug \
linux-dri-x86 \
linux-dri-x86-64 \
linux-dri-ppc \
linux-dri-xcb \
linux-egl \
linux-indirect \
linux-fbdev \
linux-ia64-icc \
linux-ia64-icc-static \
linux-icc \
linux-icc-static \
linux-llvm \
linux-llvm-debug \
linux-opengl-es \
linux-osmesa \
linux-osmesa-static \
linux-osmesa16 \
linux-osmesa16-static \
linux-osmesa32 \
linux-ppc \
linux-ppc-static \
linux-profile \
linux-sparc \
linux-sparc5 \
linux-static \
linux-ultrasparc \
linux-tcc \
linux-x86 \
linux-x86-debug \
linux-x86-32 \
linux-x86-64 \
linux-x86-64-debug \
linux-x86-64-profile \
linux-x86-64-static \
linux-x86-profile \
linux-x86-static \
netbsd \
openbsd \
osf1 \
osf1-static \
solaris-x86 \
solaris-x86-gcc \
solaris-x86-gcc-static \
sunos4 \
sunos4-gcc \
sunos4-static \
sunos5 \
sunos5-gcc \
sunos5-64-gcc \
sunos5-smp \
sunos5-v8 \
sunos5-v8-static \
sunos5-v9 \
sunos5-v9-static \
sunos5-v9-cc-g++ \
ultrix-gcc:
@ if test -f configs/current -o -L configs/current; then \
if ! cmp configs/$@ configs/current > /dev/null; then \
echo "Please run 'make realclean' before changing configs" ; \
exit 1 ; \
fi ; \
else \
cd configs && rm -f current && ln -s $@ current ; \
fi
$(MAKE) default
# Rules for making release tarballs
VERSION=7.11-devel
DIRECTORY = Mesa-$(VERSION)
LIB_NAME = MesaLib-$(VERSION)
GLUT_NAME = MesaGLUT-$(VERSION)
# This is part of MAIN_FILES
MAIN_ES_FILES = \
$(DIRECTORY)/src/mesa/main/*.xml \
$(DIRECTORY)/src/mesa/main/*.py \
$(DIRECTORY)/src/mesa/main/*.dtd
MAIN_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/configure \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/SConstruct \
$(DIRECTORY)/common.py \
$(DIRECTORY)/scons/*py \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/extract_git_sha1 \
$(DIRECTORY)/bin/install-sh \
$(DIRECTORY)/bin/mklib \
$(DIRECTORY)/bin/minstall \
$(DIRECTORY)/bin/version.mk \
$(DIRECTORY)/configs/[a-z]* \
$(DIRECTORY)/docs/*.html \
$(DIRECTORY)/docs/COPYING \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/glext.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
$(DIRECTORY)/include/GL/glu.h \
$(DIRECTORY)/include/GL/glu_mangle.h \
$(DIRECTORY)/include/GL/glx.h \
$(DIRECTORY)/include/GL/glxext.h \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/glfbdev.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/vms_x_fix.h \
$(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/pci_ids/*.h \
$(DIRECTORY)/include/c99/*.h \
$(DIRECTORY)/src/getopt/SConscript \
$(DIRECTORY)/src/getopt/getopt*.[ch] \
$(DIRECTORY)/src/glsl/Makefile \
$(DIRECTORY)/src/glsl/Makefile.template \
$(DIRECTORY)/src/glsl/SConscript \
$(DIRECTORY)/src/glsl/*.[ch] \
$(DIRECTORY)/src/glsl/*.ll \
$(DIRECTORY)/src/glsl/*.yy \
$(DIRECTORY)/src/glsl/*.[cly]pp \
$(DIRECTORY)/src/glsl/README \
$(DIRECTORY)/src/glsl/glcpp/*.[chly] \
$(DIRECTORY)/src/glsl/glcpp/README \
$(DIRECTORY)/src/glsl/builtins \
$(DIRECTORY)/src/Makefile \
$(DIRECTORY)/src/SConscript \
$(DIRECTORY)/src/mesa/Makefile* \
$(DIRECTORY)/src/mesa/SConscript \
$(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
$(DIRECTORY)/src/mesa/depend \
$(MAIN_ES_FILES) \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/*.cpp \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/program/*.[chly] \
$(DIRECTORY)/src/mesa/program/*.cpp \
$(DIRECTORY)/src/mesa/program/descrip.mms \
$(DIRECTORY)/src/mesa/swrast/*.[ch] \
$(DIRECTORY)/src/mesa/swrast/descrip.mms \
$(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \
$(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \
$(DIRECTORY)/src/mesa/vbo/*.[chS] \
$(DIRECTORY)/src/mesa/vbo/descrip.mms \
$(DIRECTORY)/src/mesa/tnl/*.[chS] \
$(DIRECTORY)/src/mesa/tnl/descrip.mms \
$(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \
$(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \
$(DIRECTORY)/src/mesa/drivers/Makefile \
$(DIRECTORY)/src/mesa/drivers/beos/*.cpp \
$(DIRECTORY)/src/mesa/drivers/beos/Makefile \
$(DIRECTORY)/src/mesa/drivers/common/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/common/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/fbdev/Makefile \
$(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile \
$(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \
$(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \
$(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/r300/compiler/SConscript \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \
$(DIRECTORY)/src/mesa/drivers/windows/*/*.def \
$(DIRECTORY)/src/mesa/drivers/x11/Makefile \
$(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \
$(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \
$(DIRECTORY)/src/mesa/ppc/*.[ch] \
$(DIRECTORY)/src/mesa/sparc/*.[chS] \
$(DIRECTORY)/src/mesa/x86/Makefile \
$(DIRECTORY)/src/mesa/x86/*.[ch] \
$(DIRECTORY)/src/mesa/x86/*.S \
$(DIRECTORY)/src/mesa/x86/rtasm/*.[ch] \
$(DIRECTORY)/src/mesa/x86-64/*.[chS] \
$(DIRECTORY)/src/mesa/x86-64/Makefile
MAPI_FILES = \
$(DIRECTORY)/include/GLES/*.h \
$(DIRECTORY)/include/GLES2/*.h \
$(DIRECTORY)/include/VG/*.h \
$(DIRECTORY)/src/mapi/es?api/Makefile \
$(DIRECTORY)/src/mapi/es?api/*.pc.in \
$(DIRECTORY)/src/mapi/glapi/gen/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen/*.py \
$(DIRECTORY)/src/mapi/glapi/gen/*.dtd \
$(DIRECTORY)/src/mapi/glapi/gen-es/Makefile \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.xml \
$(DIRECTORY)/src/mapi/glapi/gen-es/*.py \
$(DIRECTORY)/src/mapi/glapi/Makefile \
$(DIRECTORY)/src/mapi/glapi/SConscript \
$(DIRECTORY)/src/mapi/glapi/sources.mak \
$(DIRECTORY)/src/mapi/glapi/*.[chS] \
$(DIRECTORY)/src/mapi/mapi/mapi_abi.py \
$(DIRECTORY)/src/mapi/mapi/sources.mak \
$(DIRECTORY)/src/mapi/mapi/*.[ch] \
$(DIRECTORY)/src/mapi/shared-glapi/SConscript \
$(DIRECTORY)/src/mapi/shared-glapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/Makefile \
$(DIRECTORY)/src/mapi/vgapi/SConscript \
$(DIRECTORY)/src/mapi/vgapi/vgapi.csv \
$(DIRECTORY)/src/mapi/vgapi/vg.pc.in
EGL_FILES = \
$(DIRECTORY)/include/KHR/*.h \
$(DIRECTORY)/include/EGL/*.h \
$(DIRECTORY)/src/egl/Makefile \
$(DIRECTORY)/src/egl/*/Makefile \
$(DIRECTORY)/src/egl/*/Makefile.template \
$(DIRECTORY)/src/egl/*/*.[ch] \
$(DIRECTORY)/src/egl/*/*/Makefile \
$(DIRECTORY)/src/egl/*/*/*.[ch] \
$(DIRECTORY)/src/egl/wayland/wayland-drm/protocol/*.xml \
$(DIRECTORY)/src/egl/wayland/wayland-egl/*.pc.in \
$(DIRECTORY)/src/egl/main/SConscript \
$(DIRECTORY)/src/egl/main/*.pc.in \
$(DIRECTORY)/src/egl/main/*.def
GBM_FILES = \
$(DIRECTORY)/src/gbm/Makefile \
$(DIRECTORY)/src/gbm/main/*.pc.in \
$(DIRECTORY)/src/gbm/main/*.[ch] \
$(DIRECTORY)/src/gbm/main/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile \
$(DIRECTORY)/src/gbm/backends/Makefile.template \
$(DIRECTORY)/src/gbm/backends/*/*.[ch] \
$(DIRECTORY)/src/gbm/backends/*/Makefile \
GALLIUM_FILES = \
$(DIRECTORY)/src/mesa/state_tracker/*[ch] \
$(DIRECTORY)/src/gallium/Makefile \
$(DIRECTORY)/src/gallium/Makefile.template \
$(DIRECTORY)/src/gallium/SConscript \
$(DIRECTORY)/src/gallium/targets/Makefile.dri \
$(DIRECTORY)/src/gallium/targets/Makefile.xorg \
$(DIRECTORY)/src/gallium/targets/SConscript.dri \
$(DIRECTORY)/src/gallium/*/Makefile \
$(DIRECTORY)/src/gallium/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/auxiliary/gallivm/*.cpp \
$(DIRECTORY)/src/gallium/*/*/*.py \
$(DIRECTORY)/src/gallium/*/*/*.csv \
$(DIRECTORY)/src/gallium/*/*/*/Makefile \
$(DIRECTORY)/src/gallium/*/*/*/SConscript \
$(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
$(DIRECTORY)/src/gallium/*/*/*/*.py
APPLE_DRI_FILES = \
$(DIRECTORY)/src/glx/apple/Makefile \
$(DIRECTORY)/src/glx/apple/*.[ch]
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
$(DIRECTORY)/include/GL/internal/sarea.h \
$(DIRECTORY)/src/glx/Makefile \
$(DIRECTORY)/src/glx/*.[ch] \
$(APPLE_DRI_FILES) \
$(DIRECTORY)/src/mesa/drivers/dri/Makefile* \
$(DIRECTORY)/src/mesa/drivers/dri/dri.pc.in \
$(DIRECTORY)/src/mesa/drivers/dri/common/xmlpool/*.po \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/*.cpp \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/*.[chS] \
$(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/*/Makefile \
$(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
$(DIRECTORY)/src/glu/glu.pc.in \
$(DIRECTORY)/src/glu/sgi/Makefile \
$(DIRECTORY)/src/glu/sgi/Makefile.mgw \
$(DIRECTORY)/src/glu/sgi/Makefile.win \
$(DIRECTORY)/src/glu/sgi/glu.def \
$(DIRECTORY)/src/glu/sgi/dummy.cc \
$(DIRECTORY)/src/glu/sgi/glu.exports \
$(DIRECTORY)/src/glu/sgi/glu.exports.darwin \
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
$(DIRECTORY)/src/glu/sgi/include/gluos.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \
$(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \
$(DIRECTORY)/src/glu/sgi/libtess/README \
$(DIRECTORY)/src/glu/sgi/libtess/alg-outline \
$(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \
$(DIRECTORY)/src/glu/sgi/libutil/*.[ch]
GLW_FILES = \
$(DIRECTORY)/src/glw/*.[ch] \
$(DIRECTORY)/src/glw/Makefile* \
$(DIRECTORY)/src/glw/README \
$(DIRECTORY)/src/glw/glw.pc.in \
$(DIRECTORY)/src/glw/depend
GLUT_FILES = \
$(DIRECTORY)/include/GL/glut.h \
$(DIRECTORY)/include/GL/glutf90.h \
$(DIRECTORY)/src/glut/glx/Makefile* \
$(DIRECTORY)/src/glut/glx/SConscript \
$(DIRECTORY)/src/glut/glx/depend \
$(DIRECTORY)/src/glut/glx/glut.pc.in \
$(DIRECTORY)/src/glut/glx/*def \
$(DIRECTORY)/src/glut/glx/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.[ch] \
$(DIRECTORY)/src/glut/beos/*.cpp \
$(DIRECTORY)/src/glut/beos/Makefile
DEPEND_FILES = \
$(TOP)/src/mesa/depend \
$(TOP)/src/glx/depend \
$(TOP)/src/glw/depend \
$(TOP)/src/glut/glx/depend \
$(TOP)/src/glu/sgi/depend
LIB_FILES = \
$(MAIN_FILES) \
$(MAPI_FILES) \
$(ES_FILES) \
$(EGL_FILES) \
$(GBM_FILES) \
$(GALLIUM_FILES) \
$(DRI_FILES) \
$(SGI_GLU_FILES) \
$(GLW_FILES)
parsers: configure
-@touch $(TOP)/configs/current
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
$(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(LIB_NAME).tar.gz \
$(LIB_NAME).tar.bz2 \
$(LIB_NAME).zip \
$(GLUT_NAME).tar.gz \
$(GLUT_NAME).tar.bz2 \
$(GLUT_NAME).zip
tarballs: md5
rm -f ../$(LIB_NAME).tar
# Helper for autoconf builds
ACLOCAL = aclocal
ACLOCAL_FLAGS =
AUTOCONF = autoconf
AC_FLAGS =
aclocal.m4: configure.ac acinclude.m4
$(ACLOCAL) $(ACLOCAL_FLAGS)
configure: rm_depend configure.ac aclocal.m4 acinclude.m4
$(AUTOCONF) $(AC_FLAGS)
rm_depend:
@for dep in $(DEPEND_FILES) ; do \
rm -f $$dep ; \
touch $$dep ; \
done
rm_config: parsers
rm -f configs/current
rm -f configs/autoconf
$(LIB_NAME).tar: rm_config
cd .. ; tar -cf $(DIRECTORY)/$(LIB_NAME).tar $(LIB_FILES)
$(LIB_NAME).tar.gz: $(LIB_NAME).tar
gzip --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.gz
$(GLUT_NAME).tar: rm_depend
cd .. ; tar -cf $(DIRECTORY)/$(GLUT_NAME).tar $(GLUT_FILES)
$(GLUT_NAME).tar.gz: $(GLUT_NAME).tar
gzip --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.gz
$(LIB_NAME).tar.bz2: $(LIB_NAME).tar
bzip2 --stdout --best $(LIB_NAME).tar > $(LIB_NAME).tar.bz2
$(GLUT_NAME).tar.bz2: $(GLUT_NAME).tar
bzip2 --stdout --best $(GLUT_NAME).tar > $(GLUT_NAME).tar.bz2
$(LIB_NAME).zip: rm_config
rm -f $(LIB_NAME).zip ; \
cd .. ; \
zip -qr $(LIB_NAME).zip $(LIB_FILES) ; \
mv $(LIB_NAME).zip $(DIRECTORY)
$(GLUT_NAME).zip:
rm -f $(GLUT_NAME).zip ; \
cd .. ; \
zip -qr $(GLUT_NAME).zip $(GLUT_FILES) ; \
mv $(GLUT_NAME).zip $(DIRECTORY)
md5: $(ARCHIVES)
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@-md5sum $(GLUT_NAME).tar.gz
@-md5sum $(GLUT_NAME).tar.bz2
@-md5sum $(GLUT_NAME).zip
.PHONY: tarballs rm_depend rm_config md5

118
Makefile.am Normal file
View File

@@ -0,0 +1,118 @@
# Copyright © 2012 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
SUBDIRS = src
ACLOCAL_AMFLAGS = -I m4
doxygen:
cd doxygen && $(MAKE)
check-local:
$(MAKE) -C src/mapi/glapi/tests check
$(MAKE) -C src/mapi/shared-glapi/tests check
$(MAKE) -C src/mesa/main/tests check
$(MAKE) -C src/glx/tests check
.PHONY: doxygen
# Rules for making release tarballs
PACKAGE_VERSION=9.1-devel
PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
EXTRA_FILES = \
aclocal.m4 \
configure \
bin/ar-lib \
bin/compile \
bin/config.sub \
bin/config.guess \
bin/depcomp \
bin/install-sh \
bin/ltmain.sh \
bin/missing \
bin/ylwrap \
src/glsl/glsl_parser.cpp \
src/glsl/glsl_parser.h \
src/glsl/glsl_lexer.cpp \
src/glsl/glcpp/glcpp-lex.c \
src/glsl/glcpp/glcpp-parse.c \
src/glsl/glcpp/glcpp-parse.h \
src/mesa/main/api_exec_es1.c \
src/mesa/main/api_exec_es1_dispatch.h \
src/mesa/main/api_exec_es1_remap_helper.h \
src/mesa/main/api_exec_es2.c \
src/mesa/main/api_exec_es2_dispatch.h \
src/mesa/main/api_exec_es2_remap_helper.h \
src/mesa/program/lex.yy.c \
src/mesa/program/program_parse.tab.c \
src/mesa/program/program_parse.tab.h \
`git ls-files | grep "Makefile.am" | sed -e "s/Makefile.am/Makefile.in/"`
IGNORE_FILES = \
-x autogen.sh
parsers: configure
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp glcpp/glcpp-lex.c glcpp/glcpp-parse.c glcpp/glcpp-parse.h
$(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip
tarballs: md5
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
manifest.txt: .git
( \
ls -1 $(EXTRA_FILES) ; \
git ls-files $(IGNORE_FILES) \
) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
../$(PACKAGE_DIR):
ln -s $(PWD) $@
$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
rm -f $(PACKAGE_NAME).zip ; \
cd .. ; \
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
.PHONY: tarballs md5

View File

@@ -40,7 +40,8 @@ env = Environment(
ENV = os.environ,
)
opts.Save('config.py', env)
# XXX: This creates a many problems as it saves...
#opts.Save('config.py', env)
# Backwards compatability with old target configuration variable
try:

View File

@@ -1,119 +0,0 @@
# A few convenience macros for Mesa, mostly to keep all the platform
# specifics out of configure.ac.
# MESA_PIC_FLAGS()
#
# Find out whether to build PIC code using the option --enable-pic and
# the configure enable_static/enable_shared settings. If PIC is needed,
# figure out the necessary flags for the platform and compiler.
#
# The platform checks have been shamelessly taken from libtool and
# stripped down to just what's needed for Mesa. See _LT_COMPILER_PIC in
# /usr/share/aclocal/libtool.m4 or
# http://git.savannah.gnu.org/gitweb/?p=libtool.git;a=blob;f=libltdl/m4/libtool.m4;hb=HEAD
#
AC_DEFUN([MESA_PIC_FLAGS],
[AC_REQUIRE([AC_PROG_CC])dnl
AC_ARG_VAR([PIC_FLAGS], [compiler flags for PIC code])
AC_ARG_ENABLE([pic],
[AS_HELP_STRING([--disable-pic],
[compile PIC objects @<:@default=enabled for shared builds
on supported platforms@:>@])],
[enable_pic="$enableval"
test "x$enable_pic" = x && enable_pic=auto],
[enable_pic=auto])
# disable PIC by default for static builds
if test "$enable_pic" = auto && test "$enable_static" = yes; then
enable_pic=no
fi
# if PIC hasn't been explicitly disabled, try to figure out the flags
if test "$enable_pic" != no; then
AC_MSG_CHECKING([for $CC option to produce PIC])
# allow the user's flags to override
if test "x$PIC_FLAGS" = x; then
# see if we're using GCC
if test "x$GCC" = xyes; then
case "$host_os" in
aix*|beos*|cygwin*|irix5*|irix6*|osf3*|osf4*|osf5*)
# PIC is the default for these OSes.
;;
mingw*|os2*|pw32*)
# This hack is so that the source file can tell whether
# it is being built for inclusion in a dll (and should
# export symbols for example).
PIC_FLAGS="-DDLL_EXPORT"
;;
darwin*|rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
PIC_FLAGS="-fno-common"
;;
hpux*)
# PIC is the default for IA64 HP-UX and 64-bit HP-UX,
# but not for PA HP-UX.
case $host_cpu in
hppa*64*|ia64*)
;;
*)
PIC_FLAGS="-fPIC"
;;
esac
;;
*)
# Everyone else on GCC uses -fPIC
PIC_FLAGS="-fPIC"
;;
esac
else # !GCC
case "$host_os" in
hpux9*|hpux10*|hpux11*)
# PIC is the default for IA64 HP-UX and 64-bit HP-UX,
# but not for PA HP-UX.
case "$host_cpu" in
hppa*64*|ia64*)
# +Z the default
;;
*)
PIC_FLAGS="+Z"
;;
esac
;;
linux*|k*bsd*-gnu)
case `basename "$CC"` in
icc*|ecc*|ifort*)
PIC_FLAGS="-KPIC"
;;
pgcc*|pgf77*|pgf90*|pgf95*)
# Portland Group compilers (*not* the Pentium gcc
# compiler, which looks to be a dead project)
PIC_FLAGS="-fpic"
;;
ccc*)
# All Alpha code is PIC.
;;
xl*)
# IBM XL C 8.0/Fortran 10.1 on PPC
PIC_FLAGS="-qpic"
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*|*Sun\ F*)
# Sun C 5.9 or Sun Fortran
PIC_FLAGS="-KPIC"
;;
esac
esac
;;
solaris*)
PIC_FLAGS="-KPIC"
;;
sunos4*)
PIC_FLAGS="-PIC"
;;
esac
fi # GCC
fi # PIC_FLAGS
AC_MSG_RESULT([$PIC_FLAGS])
fi
AC_SUBST([PIC_FLAGS])
])# MESA_PIC_FLAGS

View File

@@ -3,16 +3,12 @@
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
SRCDIR=`(cd "$srcdir" && pwd)`
ORIGDIR=`pwd`
if test "x$SRCDIR" != "x$ORIGDIR"; then
echo "Mesa cannot be built when srcdir != builddir" 1>&2
exit 1
fi
MAKEFLAGS=""
cd "$srcdir"
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
"$srcdir"/configure "$@"
if test -z "$NOCONFIGURE"; then
"$srcdir"/configure "$@"
fi

9
bin/.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
config.guess
config.sub
install-sh
/depcomp
/missing
ylwrap
compile
ar-lib
/test-driver

View File

@@ -1,48 +0,0 @@
#!/bin/bash -e
usage()
{
echo "Usage: $0 <target1> <target2>"
echo "Highlight differences between Mesa configs"
echo "Example:"
echo " $0 linux linux-x86"
}
die()
{
echo "$@" >&2
return 1
}
case "$1" in
-h|--help) usage; exit 0;;
esac
[ $# -lt 2 ] && die 2 targets needed. See $0 --help
target1=$1
target2=$2
topdir=$(cd "`dirname $0`"/..; pwd)
cd "$topdir"
[ -f "./configs/$target1" ] || die Missing configs/$target1
[ -f "./configs/$target2" ] || die Missing configs/$target2
trap 'rm -f "$t1" "$t2"' 0
t1=$(mktemp)
t2=$(mktemp)
make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t1
TOP = .
include \$(TOP)/configs/$target1
default:
EOF
make -f- -n -p <<EOF | sed '/^# Not a target/,/^$/d' > $t2
TOP = .
include \$(TOP)/configs/$target2
default:
EOF
diff -pu -I'^#' $t1 $t2

1555
bin/config.guess vendored

File diff suppressed because it is too large Load Diff

1685
bin/config.sub vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +0,0 @@
#!/bin/sh
if [ ! -f src/mesa/main/git_sha1.h ]; then
touch src/mesa/main/git_sha1.h
fi
if [ ! -d .git ]; then
exit
fi
if which git > /dev/null; then
# Extract the 7-digit "short" SHA1 for the current HEAD, convert
# it to a string, and wrap it in a #define. This is used in
# src/mesa/main/version.c to put the GIT SHA1 in the GL_VERSION string.
git log -n 1 --oneline |\
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> src/mesa/main/git_sha1.h.tmp
if ! cmp -s src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h; then
mv src/mesa/main/git_sha1.h.tmp src/mesa/main/git_sha1.h
fi
fi

29
bin/get-pick-list.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
# Script for generating a list of candidates for cherry-picking to a stable branch
# Grep for commits with "cherry picked from commit" in the commit message.
git log --reverse --grep="cherry picked from commit" origin/master..HEAD |\
grep "cherry picked from commit" |\
sed -e 's/^[[:space:]]*(cherry picked from commit[[:space:]]*//' -e 's/)//' > already_picked
# Grep for commits that were marked as a candidate for the stable tree.
git log --reverse --pretty=%H -i --grep='^[[:space:]]*NOTE: This is a candidate' HEAD..origin/master |\
while read sha
do
# Check to see whether the patch is on the ignore list.
if [ -f bin/.cherry-ignore ] ; then
if grep -q ^$sha bin/.cherry-ignore ; then
continue
fi
fi
# Check to see if it has already been picked over.
if grep -q ^$sha already_picked ; then
continue
fi
git log -n1 --pretty=oneline $sha | cat
done
rm -f already_picked

View File

@@ -1 +0,0 @@
minstall

View File

@@ -1,74 +0,0 @@
#!/bin/sh
#
# Simple shell script for installing Mesa's header and library files.
# If the copy commands below don't work on a particular system (i.e. the
# -f or -d flags), we may need to branch on `uname` to do the right thing.
#
TOP=.
INCLUDE_DIR="/usr/local/include"
LIB_DIR="/usr/local/lib"
if [ "x$#" = "x0" ] ; then
echo
echo "***** Mesa installation - You may need root privileges to do this *****"
echo
echo "Default directory for header files is:" ${INCLUDE_DIR}
echo "Enter new directory or press <Enter> to accept this default."
read INPUT
if [ "x${INPUT}" != "x" ] ; then
INCLUDE_DIR=${INPUT}
fi
echo
echo "Default directory for library files is:" ${LIB_DIR}
echo "Enter new directory or press <Enter> to accept this default."
read INPUT
if [ "x${INPUT}" != "x" ] ; then
LIB_DIR=${INPUT}
fi
echo
echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL
echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR}
echo "Press <Enter> to continue, or <ctrl>-C to abort."
read INPUT
else
INCLUDE_DIR=$1/include
LIB_DIR=$1/lib
fi
# flags:
# -f = force
# -d = preserve symlinks (does not work on BSD)
if [ `uname` = "FreeBSD" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "Darwin" ] ; then
CP_FLAGS="-f"
elif [ `uname` = "AIX" ] ; then
CP_FLAGS="-fh"
else
CP_FLAGS="-fd"
fi
set -v
mkdir -p ${INCLUDE_DIR}
mkdir -p ${INCLUDE_DIR}/GL
# NOT YET: mkdir -p ${INCLUDE_DIR}/GLES
mkdir -p ${LIB_DIR}
cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL
cp -f ${TOP}/src/glw/*.h ${INCLUDE_DIR}/GL
# NOT YET: cp -f ${TOP}/include/GLES/*.h ${INCLUDE_DIR}/GLES
cp ${CP_FLAGS} ${TOP}/lib*/lib* ${LIB_DIR}
echo "Done."

View File

@@ -1,112 +0,0 @@
#!/bin/sh
# A minimal replacement for 'install' that supports installing symbolic links.
# Only a limited number of options are supported:
# -d dir Create a directory
# -m mode Sets a file's mode when installing
# If these commands aren't portable, we'll need some "if (arch)" type stuff
SYMLINK="ln -s"
MKDIR="mkdir -p"
RM="rm -f"
MODE=""
if [ "$1" = "-d" ] ; then
# make a directory path
$MKDIR "$2"
exit 0
fi
if [ "$1" = "-m" ] ; then
# set file mode
MODE=$2
shift 2
fi
# install file(s) into destination
if [ $# -ge 2 ] ; then
# Last cmd line arg is the dest dir
for FILE in $@ ; do
DESTDIR="$FILE"
done
# Loop over args, moving them to DEST directory
I=1
for FILE in $@ ; do
if [ $I = $# ] ; then
# stop, don't want to install $DEST into $DEST
exit 0
fi
DEST=$DESTDIR
# On CYGWIN, because DLLs are loaded by the native Win32 loader,
# they are installed in the executable path. Stub libraries used
# only for linking are installed in the library path
case `uname` in
CYGWIN*)
case $FILE in
*.dll)
DEST="$DEST/../bin"
;;
*)
;;
esac
;;
*)
;;
esac
PWDSAVE=`pwd`
# determine file's type
if [ -h "$FILE" ] ; then
#echo $FILE is a symlink
# Unfortunately, cp -d isn't universal so we have to
# use a work-around.
# Use ls -l to find the target that the link points to
LL=`ls -l "$FILE"`
for L in $LL ; do
TARGET=$L
done
#echo $FILE is a symlink pointing to $TARGET
FILE=`basename "$FILE"`
# Go to $DEST and make the link
cd "$DEST" # pushd
$RM "$FILE"
$SYMLINK "$TARGET" "$FILE"
cd "$PWDSAVE" # popd
elif [ -f "$FILE" ] ; then
#echo "$FILE" is a regular file
# Only copy if the files differ
if ! cmp -s $FILE $DEST/`basename $FILE`; then
$RM "$DEST/`basename $FILE`"
cp "$FILE" "$DEST"
fi
if [ $MODE ] ; then
FILE=`basename "$FILE"`
chmod $MODE "$DEST/$FILE"
fi
else
echo "Unknown type of argument: " "$FILE"
exit 1
fi
I=`expr $I + 1`
done
exit 0
fi
# If we get here, we didn't find anything to do
echo "Usage:"
echo " install -d dir Create named directory"
echo " install [-m mode] file [...] dest Install files in destination"

1012
bin/mklib

File diff suppressed because it is too large Load Diff

23
bin/shortlog_mesa.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# This script is used to generate the list of changes that
# appears in the release notes files, with HTML formatting.
typeset -i in_log=0
git shortlog $* | while read l
do
if [ $in_log -eq 0 ]; then
echo '<p>'$l'</p>'
echo '<ul>'
in_log=1
elif echo "$l" | egrep -q '^$' ; then
echo '</ul>'
echo
in_log=0
else
mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g')
echo ' <li>'${mesg}'</li>'
fi
done

View File

@@ -1,17 +0,0 @@
#!/usr/bin/make -sf
# Print the various Mesa version fields. This is mostly used to add the
# version to configure.
# This reflects that this script is usually called from the toplevel
TOP = .
include $(TOP)/configs/default
version:
@echo $(MESA_VERSION)
major:
@echo $(MESA_MAJOR)
minor:
@echo $(MESA_MINOR)
tiny:
@echo $(MESA_TINY)

View File

@@ -31,9 +31,15 @@ _machine_map = {
'i486': 'x86',
'i586': 'x86',
'i686': 'x86',
'BePC': 'x86',
'Intel': 'x86',
'ppc' : 'ppc',
'BeBox': 'ppc',
'BeMac': 'ppc',
'AMD64': 'x86_64',
'x86_64': 'x86_64',
'sparc': 'sparc',
'sun4u': 'sparc',
}
@@ -83,13 +89,15 @@ def AddOptions(opts):
opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine,
allowed_values=('generic', 'ppc', 'x86', 'x86_64')))
opts.Add(EnumOption('platform', 'target platform', host_platform,
allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'cygwin', 'sunos', 'freebsd8')))
allowed_values=('cygwin', 'darwin', 'freebsd', 'haiku', 'linux', 'sunos', 'windows')))
opts.Add(BoolOption('embedded', 'embedded build', 'no'))
opts.Add('toolchain', 'compiler toolchain', default_toolchain)
opts.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
opts.Add(BoolOption('llvm', 'use LLVM', default_llvm))
opts.Add(BoolOption('openmp', 'EXPERIMENTAL: compile with openmp (swrast)', 'no'))
opts.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
opts.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
opts.Add(BoolOption('quiet', 'DEPRECATED: quiet command lines', 'yes'))
opts.Add(BoolOption('quiet', 'DEPRECATED: profile build', 'yes'))
opts.Add(BoolOption('texture_float', 'enable floating-point textures and renderbuffers', 'no'))
if host_platform == 'windows':
opts.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values=('7.1', '8.0', '9.0')))

2
configs/.gitignore vendored
View File

@@ -1,2 +0,0 @@
current
autoconf

View File

@@ -1,30 +0,0 @@
# Configuration for AIX, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -O -DAIXV3 -DPTHREADS
CXXFLAGS = -O -DAIXV3 -DPTHREADS
# Misc tools and flags
MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lpthread -lm
GLU_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/lib -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB) -lXm -lXt -lX11
OSMESA_LIB_DEPS = -L$(TOP)/lib -l$(GL_LIB)
APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC

View File

@@ -1,27 +0,0 @@
# Configuration for AIX 64-bit, dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64
# Compiler and flags
CC = xlc
CXX = xlC
CFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS
CXXFLAGS = -q64 -qmaxmem=16384 -O -DAIXV3 -DPTHREADS
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -lX11 -lXext -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lC
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu -lX11 -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXm -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/lib64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lpthread -lC

View File

@@ -1,25 +0,0 @@
# Configuration for AIX, static libs
include $(TOP)/configs/default
CONFIG_NAME = aix-64-static
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -q64 -O -DAIXV3 -DPTHREADS
CXXFLAGS = -q64 -O -DAIXV3 -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
APP_LIB_DEPS = -q64 -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
-lX11 -lXext -lXmu -lXi -lm -lpthread -lC

View File

@@ -1,23 +0,0 @@
# Configuration for AIX with gcc
include $(TOP)/configs/default
CONFIG_NAME = aix-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O2 -DAIXV3
CXXFLAGS = -O2 -DAIXV3
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MKLIB_OPTIONS = -arch aix-gcc
GL_LIB_DEPS = -lX11 -lXext -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lXi -lXmu
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -Wl,-brtl -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -lX11 -lXext -lXmu -lXi

View File

@@ -1,25 +0,0 @@
# Configuration for AIX, static libs
include $(TOP)/configs/default
CONFIG_NAME = aix-static
# Compiler and flags
CC = cc
CXX = xlC
CFLAGS = -O -DAIXV3 -DPTHREADS
CXXFLAGS = -O -DAIXV3 -DPTHREADS
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
-lX11 -lXext -lXmu -lXi -lm -lpthread -lC

View File

@@ -1,233 +0,0 @@
# Autoconf configuration
# Pull in the defaults
include $(TOP)/configs/default
# This is generated by configure
CONFIG_NAME = autoconf
# Compiler and flags
CC = @CC@
CXX = @CXX@
OPT_FLAGS = @OPT_FLAGS@
ARCH_FLAGS = @ARCH_FLAGS@
ASM_FLAGS = @ASM_FLAGS@
PIC_FLAGS = @PIC_FLAGS@
DEFINES = @DEFINES@
API_DEFINES = @API_DEFINES@
SHARED_GLAPI = @SHARED_GLAPI@
CFLAGS_NOVISIBILITY = @CPPFLAGS@ @CFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS_NOVISIBILITY = @CPPFLAGS@ @CXXFLAGS@ \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
CFLAGS = $(CFLAGS_NOVISIBILITY) @VISIBILITY_CFLAGS@
CXXFLAGS = $(CXXFLAGS_NOVISIBILITY) @VISIBILITY_CXXFLAGS@
LDFLAGS = @LDFLAGS@
EXTRA_LIB_PATH = @EXTRA_LIB_PATH@
RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LDFLAGS = @RADEON_LDFLAGS@
NOUVEAU_CFLAGS = @NOUVEAU_CFLAGS@
NOUVEAU_LIBS = @NOUVEAU_LIBS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
LLVM_CFLAGS = @LLVM_CFLAGS@
LLVM_LDFLAGS = @LLVM_LDFLAGS@
LLVM_LIBS = @LLVM_LIBS@
GLW_CFLAGS = @GLW_CFLAGS@
GLUT_CFLAGS = @GLUT_CFLAGS@
GLX_TLS = @GLX_TLS@
DRI_CFLAGS = @DRI_CFLAGS@
DRI_CXXFLAGS = @DRI_CXXFLAGS@
# dlopen
DLOPEN_LIBS = @DLOPEN_LIBS@
# Source selection
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
GLAPI_ASM_SOURCES = @GLAPI_ASM_SOURCES@
# Misc tools and flags
MAKE = @MAKE@
SHELL = @SHELL@
MKLIB_OPTIONS = @MKLIB_OPTIONS@
MKDEP = @MKDEP@
MKDEP_OPTIONS = @MKDEP_OPTIONS@
INSTALL = @INSTALL@
# Python and flags (generally only needed by the developers)
PYTHON2 = @PYTHON2@
PYTHON_FLAGS = -t -O -O
# Flex and Bison for GLSL compiler
FLEX = @FLEX@
BISON = @BISON@
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = @OSMESA_LIB@
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = @GL_LIB_NAME@
GLU_LIB_NAME = @GLU_LIB_NAME@
GLUT_LIB_NAME = @GLUT_LIB_NAME@
GLW_LIB_NAME = @GLW_LIB_NAME@
OSMESA_LIB_NAME = @OSMESA_LIB_NAME@
EGL_LIB_NAME = @EGL_LIB_NAME@
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
VG_LIB_NAME = @VG_LIB_NAME@
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
WAYLAND_EGL_LIB_NAME = @WAYLAND_EGL_LIB_NAME@
GBM_LIB_NAME = @GBM_LIB_NAME@
# Globs used to install the lib and all symlinks
GL_LIB_GLOB = @GL_LIB_GLOB@
GLU_LIB_GLOB = @GLU_LIB_GLOB@
GLUT_LIB_GLOB = @GLUT_LIB_GLOB@
GLW_LIB_GLOB = @GLW_LIB_GLOB@
OSMESA_LIB_GLOB = @OSMESA_LIB_GLOB@
EGL_LIB_GLOB = @EGL_LIB_GLOB@
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
VG_LIB_GLOB = @VG_LIB_GLOB@
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
WAYLAND_EGL_LIB_GLOB = @WAYLAND_EGL_LIB_GLOB@
GBM_LIB_GLOB = @GBM_LIB_GLOB@
# Directories to build
LIB_DIR = @LIB_DIR@
SRC_DIRS = @SRC_DIRS@
GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
EGL_DRIVERS_DIRS = @EGL_DRIVERS_DIRS@
GBM_BACKEND_DIRS = @GBM_BACKEND_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_TARGET_DIRS = @GALLIUM_TARGET_DIRS@
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
EGL_PLATFORMS = @EGL_PLATFORMS@
EGL_CLIENT_APIS = @EGL_CLIENT_APIS@
# Dependencies
X11_INCLUDES = @X11_INCLUDES@
# GLw motif setup
GLW_SOURCES = @GLW_SOURCES@
MOTIF_CFLAGS = @MOTIF_CFLAGS@
# Library/program dependencies
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLUT_LIB_DEPS@
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLW_LIB_DEPS@
APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @WAYLAND_EGL_LIB_DEPS@
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) @GBM_LIB_DEPS@
# DRI dependencies
MESA_MODULES = @MESA_MODULES@
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
LIBDRM_CFLAGS = @LIBDRM_CFLAGS@
LIBDRM_LIB = @LIBDRM_LIBS@
DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@
GLPROTO_CFLAGS = @GLPROTO_CFLAGS@
EXPAT_INCLUDES = @EXPAT_INCLUDES@
# Autoconf directories
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
# Installation directories (for make install)
INSTALL_DIR = $(prefix)
INSTALL_LIB_DIR = $(libdir)
INSTALL_INC_DIR = $(includedir)
# DRI installation directories
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = @EGL_DRIVER_INSTALL_DIR@
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
# pkg-config substitutions
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
GL_PC_CFLAGS = @GL_PC_CFLAGS@
DRI_PC_REQ_PRIV = @DRI_PC_REQ_PRIV@
GLU_PC_REQ = @GLU_PC_REQ@
GLU_PC_REQ_PRIV = @GLU_PC_REQ_PRIV@
GLU_PC_LIB_PRIV = @GLU_PC_LIB_PRIV@
GLU_PC_CFLAGS = @GLU_PC_CFLAGS@
GLUT_PC_REQ_PRIV = @GLUT_PC_REQ_PRIV@
GLUT_PC_LIB_PRIV = @GLUT_PC_LIB_PRIV@
GLUT_PC_CFLAGS = @GLUT_PC_CFLAGS@
GLW_PC_REQ_PRIV = @GLW_PC_REQ_PRIV@
GLW_PC_LIB_PRIV = @GLW_PC_LIB_PRIV@
GLW_PC_CFLAGS = @GLW_PC_CFLAGS@
OSMESA_PC_REQ = @OSMESA_PC_REQ@
OSMESA_PC_LIB_PRIV = @OSMESA_PC_LIB_PRIV@
GLESv1_CM_PC_LIB_PRIV = @GLESv1_CM_PC_LIB_PRIV@
GLESv2_PC_LIB_PRIV = @GLESv2_PC_LIB_PRIV@
EGL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
EGL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
EGL_PC_CFLAGS = @GL_PC_CFLAGS@
WAYLAND_EGL_PC_REQ_PRIV = @WAYLAND_EGL_PC_REQ_PRIV@
WAYLAND_EGL_PC_LIB_PRIV = @WAYLAND_EGL_PC_LIB_PRIV@
WAYLAND_EGL_PC_CFLAGS = @WAYLAND_EGL_PC_CFLAGS@
GBM_PC_REQ_PRIV = @GBM_PC_REQ_PRIV@
GBM_PC_LIB_PRIV = @GBM_PC_LIB_PRIV@
GBM_PC_CFLAGS = @GBM_PC_CFLAGS@
XCB_DRI2_CFLAGS = @XCB_DRI2_CFLAGS@
XCB_DRI2_LIBS = @XCB_DRI2_LIBS@
LIBUDEV_CFLAGS = @LIBUDEV_CFLAGS@
LIBUDEV_LIBS = @LIBUDEV_LIBS@
WAYLAND_CFLAGS = @WAYLAND_CFLAGS@
WAYLAND_LIBS = @WAYLAND_LIBS@
MESA_LLVM = @MESA_LLVM@
LLVM_VERSION = @LLVM_VERSION@
ifneq ($(LLVM_VERSION),)
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
endif
HAVE_XF86VIDMODE = @HAVE_XF86VIDMODE@

View File

@@ -1,103 +0,0 @@
# Configuration for BeOS
# Written by Philippe Houdoin
include $(TOP)/configs/default
CONFIG_NAME = beos
DEFINES = \
-DBEOS_THREADS
MACHINE=$(shell uname -m)
ifeq ($(MACHINE), BePC)
CPU = x86
else
CPU = ppc
endif
ifeq ($(CPU), x86)
# BeOS x86 settings
DEFINES += \
-DGNU_ASSEMBLER \
-DUSE_X86_ASM \
-DUSE_MMX_ASM \
-DUSE_3DNOW_ASM \
-DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)
CC = gcc
CXX = g++
LD = gcc
CFLAGS = \
-Wall -Wno-multichar -Wno-ctor-dtor-privacy \
$(DEFINES)
CXXFLAGS = $(CFLAGS)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
LDFLAGS += -Xlinker
ifdef DEBUG
CFLAGS += -g -O0
LDFLAGS += -g
DEFINES += -DDEBUG
else
CFLAGS += -O3
endif
GLUT_CFLAGS = -fexceptions
else
# BeOS PPC settings
CC = mwcc
CXX = $(CC)
LD = mwldppc
CFLAGS = \
-w on -requireprotos \
$(DEFINES)
CXXFLAGS = $(CFLAGS)
LDFLAGS += \
-export pragma \
-init _init_routine_ \
-term _term_routine_ \
-lroot \
/boot/develop/lib/ppc/glue-noinit.a \
/boot/develop/lib/ppc/init_term_dyn.o \
/boot/develop/lib/ppc/start_dyn.o
ifdef DEBUG
CFLAGS += -g -O0
CXXFLAGS += -g -O0
LDFLAGS += -g
else
CFLAGS += -O7
CXXFLAGS += -O7
endif
GLUT_CFLAGS = -fexceptions
endif
# Directories
SRC_DIRS = gallium mesa glu glut/beos
GLU_DIRS = sgi
DRIVER_DIRS = beos
# Library/program dependencies
GL_LIB_DEPS =
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS =
GLUT_LIB_DEPS = -lgame -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
APP_LIB_DEPS = -lbe -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -l$(GLUT_LIB)

View File

@@ -1,32 +0,0 @@
# Configuration for building only libOSMesa on BlueGene, no Xlib driver
# This doesn't really have a lot of dependencies, so it should be usable
# on other (gcc-based) systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = bluegene-osmesa
# Compiler and flags
CC = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-gcc
CXX = /bgl/BlueLight/ppcfloor/blrts-gnu/bin/powerpc-bgl-blrts-gnu-g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURC
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lOSMesa -lGLU -lm

View File

@@ -1,28 +0,0 @@
# Configuration for building only libOSMesa on BlueGene using the IBM xlc compiler
# This doesn't really have a lot of dependencies, so it should be usable
# on similar systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = bluegene-osmesa
# Compiler and flags
CC = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlc
CXX = /opt/ibmcmp/vacpp/bg/8.0/bin/blrts_xlC
CFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -O3 -pedantic -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lOSMesa -lGLU -lm

View File

@@ -1,31 +0,0 @@
# Configuration for building only libOSMesa on Cray Xt3
# for the compute nodes running Catamount using the
# Portland Group compiler. The Portland Group toolchain has to be
# enabled before using "module switch PrgEnv-gnu PrgEnv-pgi" .
# This doesn't really have a lot of dependencies, so it should be usable
# on other similar systems too.
# It uses static linking and disables multithreading.
include $(TOP)/configs/default
CONFIG_NAME = catamount-osmesa-pgi
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
CXXFLAGS = -target=catamount -fastsse -O3 -Mnontemporal -Mprefetch=distance:8,nta -fPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lOSMesa -lGLU -lm

View File

@@ -1,42 +0,0 @@
# MinGW config include file updated for Mesa 7.0
#
# Updated : by Heromyth, on 2007-7-21
# Email : zxpmyth@yahoo.com.cn
# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
# The others havn't been tested yet.
# 2) The generated DLLs are *not* compatible with the ones built
# with the other compilers like VC8, especially for GLUT.
# 3) Although more tests are needed, it can be used individually!
# The generated DLLs by MingW with STDCALL are not totally compatible
# with the ones linked by Microsoft's compilers.
#
# xxx_USING_STDCALL = 1 Compiling MESA with __stdcall. This is default!
#
# xxx_USING_STDCALL = 0 Compiling MESA without __stdcall. I like this:)
#
# In fact, GL_USING_STDCALL and GLUT_USING_STDCALL can be
# different. For example:
#
# GL_USING_STDCALL = 0
# GLUT_USING_STDCALL = 1
#
# Suggested setting:
#
# ALL_USING_STDCALL = 1
#
# That's default!
#
ALL_USING_STDCALL = 1
ifeq ($(ALL_USING_STDCALL),1)
GL_USING_STDCALL = 1
GLUT_USING_STDCALL = 1
else
GL_USING_STDCALL = 0
GLUT_USING_STDCALL = 0
endif

View File

@@ -1,63 +0,0 @@
# Configuration for Darwin / MacOS X, making dynamic libs
include $(TOP)/configs/default
CONFIG_NAME = darwin
INSTALL_DIR = /usr/X11
X11_DIR = $(INSTALL_DIR)
# Compiler and flags
CC = gcc
CXX = g++
PIC_FLAGS = -fPIC
DEFINES = -D_DARWIN_C_SOURCE -DPTHREADS -D_GNU_SOURCE \
-DGLX_ALIAS_UNSUPPORTED \
-DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL
# -DGLX_INDIRECT_RENDERING \
# -D_GNU_SOURCE - for src/mesa/main ...
# -DGLX_DIRECT_RENDERING - pulls in libdrm stuff in glx
# -DGLX_USE_APPLEGL - supposed to be used with GLX_DIRECT_RENDERING to use AGL rather than DRM, but doesn't compile
# -DIN_DRI_DRIVER
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing -fvisibility=hidden \
-I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).dylib
GLU_LIB_NAME = lib$(GLU_LIB).dylib
GLUT_LIB_NAME = lib$(GLUT_LIB).dylib
GLW_LIB_NAME = lib$(GLW_LIB).dylib
OSMESA_LIB_NAME = lib$(OSMESA_LIB).dylib
VG_LIB_NAME = lib$(VG_LIB).dylib
# globs used to install the lib and all symlinks
GL_LIB_GLOB = lib$(GL_LIB).*dylib
GLU_LIB_GLOB = lib$(GLU_LIB).*dylib
GLUT_LIB_GLOB = lib$(GLUT_LIB).*dylib
GLW_LIB_GLOB = lib$(GLW_LIB).*dylib
OSMESA_LIB_GLOB = lib$(OSMESA_LIB).*dylib
VG_LIB_GLOB = lib$(VG_LIB).*dylib
GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS =
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glsl mapi/glapi mapi/vgapi glx/apple mesa gallium glu glut/glx
GLU_DIRS = sgi
DRIVER_DIRS = osmesa
#DRIVER_DIRS = dri
DRI_DIRS = swrast
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad failover
#GALLIUM_DRIVERS_DIRS += llvmpipe

View File

@@ -1,7 +0,0 @@
# Configuration for Darwin / MacOS X, making 32bit fat dynamic libs
RC_CFLAGS=-arch ppc -arch i386
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-fat-32bit

View File

@@ -1,7 +0,0 @@
# Configuration for Darwin / MacOS X, making 32bit and 64bit fat dynamic libs
RC_CFLAGS=-arch ppc -arch i386 -arch ppc64 -arch x86_64
include $(TOP)/configs/darwin
CONFIG_NAME = darwin-fat-all

View File

@@ -1,205 +0,0 @@
# Default/template configuration
# This is included by other config files which may override some
# of these variables.
# Think of this as a base class from which configs are derived.
CONFIG_NAME = default
# Version info
MESA_MAJOR=7
MESA_MINOR=11
MESA_TINY=0
MESA_VERSION = $(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY)
# external projects. This should be useless now that we use libdrm.
DRM_SOURCE_PATH=$(TOP)/../drm
# Compiler and flags
CC = cc
CXX = CC
HOST_CC = $(CC)
CFLAGS = -O
CXXFLAGS = -O
LDFLAGS =
HOST_CFLAGS = $(CFLAGS)
GLU_CFLAGS =
GLX_TLS = no
# Compiler for building demos/tests/etc
APP_CC = $(CC)
APP_CXX = $(CXX)
# Misc tools and flags
SHELL = /bin/sh
MKLIB = $(SHELL) $(TOP)/bin/mklib
MKLIB_OPTIONS =
MKDEP = makedepend
MKDEP_OPTIONS = -fdepend
MAKE = make
FLEX = flex
BISON = bison
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
INSTALL = $(MINSTALL)
# Tools for regenerating glapi (generally only needed by the developers)
PYTHON2 = python
PYTHON_FLAGS = -t -O -O
INDENT = indent
INDENT_FLAGS = -i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool
# Library names (base name)
GL_LIB = GL
GLU_LIB = GLU
GLUT_LIB = glut
GLW_LIB = GLw
OSMESA_LIB = OSMesa
EGL_LIB = EGL
GLESv1_CM_LIB = GLESv1_CM
GLESv2_LIB = GLESv2
VG_LIB = OpenVG
GLAPI_LIB = glapi
WAYLAND_EGL_LIB = wayland-egl
GBM_LIB = gbm
# Library names (actual file names)
GL_LIB_NAME = lib$(GL_LIB).so
GLU_LIB_NAME = lib$(GLU_LIB).so
GLUT_LIB_NAME = lib$(GLUT_LIB).so
GLW_LIB_NAME = lib$(GLW_LIB).so
OSMESA_LIB_NAME = lib$(OSMESA_LIB).so
EGL_LIB_NAME = lib$(EGL_LIB).so
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
VG_LIB_NAME = lib$(VG_LIB).so
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
WAYLAND_EGL_LIB_NAME = lib$(WAYLAND_EGL_LIB).so
GBM_LIB_NAME = lib$(GBM_LIB).so
# globs used to install the lib and all symlinks
GL_LIB_GLOB = $(GL_LIB_NAME)*
GLU_LIB_GLOB = $(GLU_LIB_NAME)*
GLUT_LIB_GLOB = $(GLUT_LIB_NAME)*
GLW_LIB_GLOB = $(GLW_LIB_NAME)*
OSMESA_LIB_GLOB = $(OSMESA_LIB_NAME)*
EGL_LIB_GLOB = $(EGL_LIB_NAME)*
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
VG_LIB_GLOB = $(VG_LIB_NAME)*
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
WAYLAND_EGL_LIB_GLOB = $(WAYLAND_EGL_LIB_NAME)*
GBM_LIB_GLOB = $(GBM_LIB_NAME)*
DRI_CFLAGS = $(CFLAGS)
DRI_CXXFLAGS = $(CXXFLAGS)
# Optional assembly language optimization files for libGL
MESA_ASM_SOURCES =
# GLw widget sources (Append "GLwMDrawA.c" here and add -lXm to GLW_LIB_DEPS in
# order to build the Motif widget too)
GLW_SOURCES = GLwDrawA.c
MOTIF_CFLAGS = -I/usr/include/Motif1.2
# Directories to build
LIB_DIR = lib
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium egl gallium/winsys gallium/targets glu glut/glx glw
GLU_DIRS = sgi
DRIVER_DIRS = x11 osmesa
# EGL drivers to build
EGL_DRIVERS_DIRS = glx
# gbm backends to build
GBM_BACKEND_DIRS = dri
# Gallium directories and
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARIES = $(TOP)/src/gallium/auxiliary/libgallium.a
GALLIUM_DRIVERS_DIRS = softpipe trace rbug noop identity galahad i915 i965 svga r300 nvfx nv50 failover
GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = sw sw/xlib
GALLIUM_TARGET_DIRS = libgl-xlib
GALLIUM_STATE_TRACKERS_DIRS = glx vega
# native platforms EGL should support
EGL_PLATFORMS = x11
EGL_CLIENT_APIS = $(GL_LIB)
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -ldl -lpthread
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
GLW_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lXt -lX11
APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
WAYLAND_EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lwayland-client -ldrm
GBM_LIB_DEPS = $(EXTRA_LIB_PATH) -ludev -ldl
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
X11_LIBS = -lX11
DLOPEN_LIBS = -ldl
# Installation directories (for make install)
INSTALL_DIR = /usr/local
INSTALL_LIB_DIR = $(INSTALL_DIR)/$(LIB_DIR)
INSTALL_INC_DIR = $(INSTALL_DIR)/include
DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
# EGL driver install directory
EGL_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/egl
# gbm backend install directory
GBM_BACKEND_INSTALL_DIR = $(INSTALL_LIB_DIR)/gbm
# Xorg driver install directory (for xorg state-tracker)
XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
# pkg-config substitutions
GL_PC_REQ_PRIV =
GL_PC_LIB_PRIV =
GL_PC_CFLAGS =
DRI_PC_REQ_PRIV =
GLU_PC_REQ = gl
GLU_PC_REQ_PRIV =
GLU_PC_LIB_PRIV =
GLU_PC_CFLAGS =
GLUT_PC_REQ_PRIV =
GLUT_PC_LIB_PRIV =
GLUT_PC_CFLAGS =
GLW_PC_REQ_PRIV =
GLW_PC_LIB_PRIV =
GLW_PC_CFLAGS =
OSMESA_PC_REQ =
OSMESA_PC_LIB_PRIV =
GLESv1_CM_PC_REQ_PRIV =
GLESv1_CM_PC_LIB_PRIV =
GLESv1_CM_PC_CFLAGS =
GLESv2_PC_REQ_PRIV =
GLESv2_PC_LIB_PRIV =
GLESv2_PC_CFLAGS =
VG_PC_REQ_PRIV =
VG_PC_LIB_PRIV =
VG_PC_CFLAGS =
WAYLAND_EGL_PC_REQ_PRIV =
WAYLAND_EGL_PC_LIB_PRIV =
WAYLAND_EGL_PC_CFLAGS =
GBM_PC_REQ_PRIV =
GBM_PC_LIB_PRIV =
GBM_PC_CFLAGS =

View File

@@ -1,31 +0,0 @@
# Configuration for FreeBSD
include $(TOP)/configs/default
CONFIG_NAME = FreeBSD
# Compiler and flags
CC = cc
CXX = c++
MAKE = gmake
OPT_FLAGS = -O2
PIC_FLAGS = -fPIC
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -DUSE_XSHM \
-DHZ=100
X11_INCLUDES = -I/usr/local/include
CFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES) -ffast-math -pedantic
CXXFLAGS += $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) $(X11_INCLUDES)
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
EXTRA_LIB_PATH = -L/usr/local/lib
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) $(EXTRA_LIB_PATH) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,53 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd
CONFIG_NAME = freebsd-dri
# Compiler and flags
CC = gcc
CXX = g++
WARN_FLAGS = -Wall
OPT_FLAGS = -O -g
EXPAT_INCLUDES = -I/usr/local/include
X11_INCLUDES = -I/usr/local/include
DEFINES = -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) -Wmissing-prototypes -std=c99 -Wundef -ffast-math \
$(ASM_FLAGS) $(X11_INCLUDES) $(DEFINES)
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(DEFINES) -Wall -ansi -pedantic $(ASM_FLAGS) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
ASM_SOURCES =
MESA_ASM_SOURCES =
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
LIBDRM_LIB = `pkg-config --libs libdrm`
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/local/lib -lGL -lXt -lX11
# Directories
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
DRM_SOURCE_PATH=$(TOP)/../drm
DRI_DIRS = i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
unichrome savage sis

View File

@@ -1,10 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri-amd64: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86-64
ASM_FLAGS = -DUSE_X86_64_ASM
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)

View File

@@ -1,13 +0,0 @@
# -*-makefile-*-
# Configuration for freebsd-dri: FreeBSD DRI hardware drivers
include $(TOP)/configs/freebsd-dri
CONFIG_NAME = freebsd-dri-x86
# Unnecessary on x86, generally.
PIC_FLAGS =
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,14 +0,0 @@
# Configuration for HPUX v10, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux10
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE
APP_LIB_DEPS = -$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,20 +0,0 @@
# Configuration for HPUX v10, with gcc
include $(TOP)/configs/default
CONFIG_NAME = hpux10-gcc
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -ansi -O3 -D_HPUX_SOURCE
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,30 +0,0 @@
# Configuration for HPUX v10, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux10-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lpthread -lm -lstdc++
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm -lstdc++

View File

@@ -1,30 +0,0 @@
# Configuration for HPUX v11
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread -lCsup -lcl

View File

@@ -1,26 +0,0 @@
# Configuration for HPUX v11, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-32-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DA2.0 -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,31 +0,0 @@
# Configuration for HPUX v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae +DD64 -O +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)
GL_LIB_DEPS = -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11, 64-bit, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-64-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DA2.0W -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6/pa20_64 -L/usr/contrib/X11R6/lib/pa20_64 -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread -lCsup -lcl

View File

@@ -1,30 +0,0 @@
# Configuration for HPUX IA64 v11, 64-bit
include $(TOP)/configs/default
CONFIG_NAME = hpux11-ia64
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = +z -Ae +DD64 -O +DSmckinley -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS =
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.so
GLU_LIB_NAME = libGLU.so
GLUT_LIB_NAME = libglut.so
GLW_LIB_NAME = libGLw.so
OSMESA_LIB_NAME = libOSMesa.so
# Library/program dependencies
GL_LIB_DEPS = -L/usr/lib/X11R6/ -L/usr/contrib/X11R6/lib/ -lXext -lXmu -lXt -lXi -lX11 -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm -lCsup -lcl
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(GL_LIB_DEPS)
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)

View File

@@ -1,27 +0,0 @@
# Configuration for HPUX v11, 64-bit, static libs
include $(TOP)/configs/default
CONFIG_NAME = hpux11-ia64-static
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM -DPTHREADS
CXXFLAGS = -O +DD64 -Ae -D_HPUX_SOURCE +DSmckinley -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DPTHREADS
MKLIB_OPTIONS = -static
LIB_DIR = lib64
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lXt -lX11 -lpthread -lm -lCsup -lcl

View File

@@ -1,16 +0,0 @@
# Configuration for HPUX v9, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux9
# Compiler and flags
CC = cc
# XXX fix this
CXX = c++
CFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM
CXXFLAGS = +z -O +Olibcalls +ESlit -Ae +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,14 +0,0 @@
# Configuration for HPUX v10, shared libs
include $(TOP)/configs/default
CONFIG_NAME = hpux9-gcc
# Compiler and flags
CC = cc
CXX = aCC
CFLAGS = -O +DAportable +z -Ae -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM
CXXFLAGS = -O +DAportable +Z -Ae -D_HPUX_SOURCE
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm

View File

@@ -1,17 +0,0 @@
# Configuration for IRIX 6.x, make n64 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-64
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib64
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -64 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lpthread -lm

View File

@@ -1,26 +0,0 @@
# Configuration for IRIX 6.x, make n64 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-64-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -64 -O3 -ansi -woff 1174 -DPTHREADS
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib64
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -64 -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,17 +0,0 @@
# Configuration for IRIX 6.x, make n32 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-n32
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1521,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1552 -DPTHREADS
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lfpe -lpthread -lm

View File

@@ -1,25 +0,0 @@
# Configuration for IRIX 6.x, make n32 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-n32-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -n32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM -DPTHREADS
CXXFLAGS = -n32 -mips2 -O2 -ansi -woff 3262,3666 -DPTHREADS
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -n32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lpthread -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,18 +0,0 @@
# Configuration for IRIX 6.x, make o32 DSOs
include $(TOP)/configs/default
CONFIG_NAME = irix6-o32
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -rpath $(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm

View File

@@ -1,25 +0,0 @@
# Configuration for IRIX 6.x, make o32 static libs
include $(TOP)/configs/default
CONFIG_NAME = irix6-o32-static
# Compiler and flags
CC = cc
CXX = CC
CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM
CXXFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666
MKLIB_OPTIONS = -static
GLW_SOURCES = GLwDrawA.c GLwMDrawA.c
LIB_DIR = lib32
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -32 -glut -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXext -lXmu -lXi -lm -lC
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,38 +0,0 @@
# Configuration for generic Linux
include $(TOP)/configs/default
CONFIG_NAME = linux
# Compiler and flags
CC = gcc
CXX = g++
OPT_FLAGS = -O3 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support. Add -m32
# to build properly on 64-bit platforms.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -Wdeclaration-after-statement \
-Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
CXXFLAGS = -Wall -Wpointer-arith $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(X11_INCLUDES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GLUT_CFLAGS = -fexceptions
EXTRA_LIB_PATH = -L/usr/X11R6/lib

View File

@@ -1,22 +0,0 @@
# Configuration for Linux on Alpha
include $(TOP)/configs/default
CONFIG_NAME = linux-alpha
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm

View File

@@ -1,31 +0,0 @@
# Configuration for Linux on Alpha, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-alpha-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE -DUSE_XSHM
CXXFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -D_XOPEN_SOURCE
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L/usr/X11R6/lib -lXt -lX11
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm -L/usr/X11R6/lib -lX11 -lm

View File

@@ -1,72 +0,0 @@
# linux-cell (non-debug build)
include $(TOP)/configs/linux
CONFIG_NAME = linux-cell
# Omiting other gallium drivers:
GALLIUM_DRIVERS_DIRS = cell softpipe trace rbug identity
# Compiler and flags
CC = ppu32-gcc
CXX = ppu32-g++
HOST_CC = gcc
APP_CC = gcc
APP_CXX = g++
OPT_FLAGS = -O3
# Cell SDK location
## For SDK 2.1: (plus, remove -DSPU_MAIN_PARAM_LONG_LONG below)
#SDK = /opt/ibm/cell-sdk/prototype/sysroot/usr
## For SDK 3.0:
SDK = /opt/cell/sdk/usr
COMMON_C_CPP_FLAGS = $(OPT_FLAGS) -Wall -Winline \
-fPIC -m32 -mabi=altivec -maltivec \
-I. -I$(SDK)/include \
-DGALLIUM_CELL $(DEFINES)
CFLAGS = $(COMMON_C_CPP_FLAGS) -Wmissing-prototypes -std=c99
CXXFLAGS = $(COMMON_C_CPP_FLAGS)
# Omitting glw here:
SRC_DIRS = glsl mapi/glapi mapi/vgapi mesa \
gallium gallium/winsys gallium/targets glu glut/glx
# Build no traditional Mesa drivers:
DRIVER_DIRS =
MKDEP_OPTIONS = -fdepend -Y
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread \
-L$(SDK)/lib -m32 -Wl,-m,elf32ppc -R$(SDK)/lib -lspe2
CELL_SPU_LIB = $(TOP)/src/gallium/drivers/cell/spu/g3d_spu.a
### SPU stuff
SPU_CC = spu-gcc
SPU_CFLAGS = $(OPT_FLAGS) -W -Wall -Winline -Wmissing-prototypes -Wno-main \
-I. -I$(SDK)/spu/include -I$(TOP)/src/mesa/ $(INCLUDE_DIRS) \
-DSPU_MAIN_PARAM_LONG_LONG \
-include spu_intrinsics.h
SPU_LFLAGS = -L$(SDK)/spu/lib -Wl,-N -lmisc -lm
SPU_AR = ppu-ar
SPU_AR_FLAGS = -qcs
SPU_EMBED = ppu32-embedspu
SPU_EMBED_FLAGS = -m32

View File

@@ -1,10 +0,0 @@
# linux-cell-debug
include $(TOP)/configs/linux-cell
# just override name and OPT_FLAGS here:
CONFIG_NAME = linux-cell-debug
OPT_FLAGS = -g -DDEBUG

View File

@@ -1,9 +0,0 @@
# Configuration for debugging on Linux
include $(TOP)/configs/linux
CONFIG_NAME = linux-debug
OPT_FLAGS = -g
#CFLAGS += -pedantic
DEFINES += -DDEBUG -DDEBUG_MATH

View File

@@ -1,78 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -O2 -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
GLUT_CFLAGS = -fexceptions
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
# Directories
SRC_DIRS := glx egl $(SRC_DIRS)
# EGL directories
EGL_DRIVERS_DIRS = glx
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = sw sw/xlib drm/vmware drm/intel drm/i965
GALLIUM_TARGET_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = egl
DRI_DIRS = i810 i915 i965 mach64 mga nouveau r128 r200 r300 r600 radeon \
savage sis tdfx unichrome swrast
INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau)
NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau)
LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon)
LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)

View File

@@ -1,16 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri-debug: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-debug
OPT_FLAGS = -O0 -g
ARCH_FLAGS = -DDEBUG
# Helpful to reduce the amount of stuff that gets built sometimes:
#DRI_DIRS = i915tex i915
#DRI_DIRS = i965
#DRI_DIRS = radeon r200 r300
#DRI_DIRS = unichrome sis
#DRI_DIRS = i810 mga r128 tdfx

View File

@@ -1,17 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-ppc
OPT_FLAGS = -Os -mcpu=603
PIC_FLAGS = -fPIC
ASM_FLAGS = -DUSE_PPC_ASM -DUSE_VMX_ASM
MESA_ASM_SOURCES = $(PPC_SOURCES)
# Build only the drivers for cards that exist on PowerPC. At some point MGA
# will be added, but not yet.
DRI_DIRS = mach64 r128 r200 r300 radeon tdfx

View File

@@ -1,13 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-x86
ARCH_FLAGS = -m32 -mmmx -msse -msse2
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,24 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/linux-dri
CONFIG_NAME = linux-dri-x86-64
ARCH_FLAGS = -m64
ASM_FLAGS = -DUSE_X86_64_ASM
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)
LIB_DIR = lib64
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib64
# sis is missing because it has not been converted to use
# the new interface. i810 are missing because there is no x86-64
# system where they could *ever* be used.
#
DRI_DIRS = i915 i965 mach64 mga r128 r200 r300 radeon savage tdfx unichrome

View File

@@ -1,56 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri-xcb
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = $(shell pkg-config --cflags-only-I x11) $(shell pkg-config --cflags-only-I xcb) $(shell pkg-config --cflags-only-I x11-xcb) $(shell pkg-config --cflags-only-I xcb-glx)
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
$(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
SRC_DIRS = glx gallium mesa glu glut/glx glw
DRIVER_DIRS = dri
DRI_DIRS = i810 i915 mach64 mga r128 r200 r300 radeon \
savage sis tdfx unichrome

View File

@@ -1,58 +0,0 @@
# -*-makefile-*-
# Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
OPT_FLAGS = -O -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER \
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = -Wall -Wmissing-prototypes -std=c99 -ffast-math \
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) $(ASM_FLAGS)
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
LIBDRM_LIB = $(shell pkg-config --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl \
$(LIBDRM_LIB)
# Directories
SRC_DIRS = gallium mesa gallium/winsys gallium/targets glu egl
DRIVER_DIRS = dri
GALLIUM_WINSYS_DIRS = egl_drm
GALLIUM_TARGET_DIRS =
DRI_DIRS = intel

View File

@@ -1,18 +0,0 @@
# Configuration for Linux fbdev interface
include $(TOP)/configs/linux
CONFIG_NAME = linux-fbdev
CFLAGS += -DUSE_GLFBDEV_DRIVER
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
SRC_DIRS += glut/fbdev
DRIVER_DIRS = fbdev osmesa
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lm -lpthread
OSMESA_LIB_DEPS = -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lgpm -lm

View File

@@ -1,9 +0,0 @@
# Configuration for standalone mode i965 debug
include $(TOP)/configs/linux-debug
CONFIG_NAME = linux-i965
GALLIUM_DRIVER_DIRS = i965
GALLIUM_WINSYS_DIRS = drm/i965/xlib
GALLIUM_TARGET_DIRS =

View File

@@ -1,21 +0,0 @@
# Configuration for Linux with Intel C compiler
include $(TOP)/configs/default
CONFIG_NAME = linux-icc
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -KPIC -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -arch icc-istatic
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi
GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(GL_LIB_DEPS)
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB)

View File

@@ -1,27 +0,0 @@
# Configuration for Linux with Intel C compiler, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-icc-static
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -ansi -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static -arch icc-istatic
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -i-static -cxxlib-icc -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lpthread -lm -lcxa -lunwind

View File

@@ -1,22 +0,0 @@
# Configuration for Linux with Intel C compiler
include $(TOP)/configs/default
CONFIG_NAME = linux-icc
# Compiler and flags
CC = icc
CXX = g++
CFLAGS = -O3 -tpp6 -axK -KPIC -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -arch icc
GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -lm
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,27 +0,0 @@
# Configuration for Linux with Intel C compiler, static libs
include $(TOP)/configs/default
CONFIG_NAME = linux-icc-static
# Compiler and flags
CC = icc
CXX = icpc
CFLAGS = -O3 -tpp6 -axK -D_GCC_LIMITS_H_ -D__GNUC__ -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM -DPTHREADS -I/usr/X11R6/include
CXXFLAGS = -O3 -tpp6 -axK -DPTHREADS
GLUT_CFLAGS = -fexceptions
MKLIB_OPTIONS = -static -arch icc
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
GL_LIB_DEPS =
GLUT_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm -lpthread -lcxa -lunwind
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,52 +0,0 @@
# -*-makefile-*-
# Configuration for linux-indirect: Builds a libGL capable of indirect
# rendering, but *NOT* capable of direct rendering.
include $(TOP)/configs/default
CONFIG_NAME = linux-dri
# Compiler and flags
CC = gcc
CXX = g++
#MKDEP = /usr/X11R6/bin/makedepend
#MKDEP = gcc -M
#MKDEP_OPTIONS = -MF depend
WARN_FLAGS = -Wall
OPT_FLAGS = -O -g
PIC_FLAGS = -fPIC
# Add '-DGLX_USE_TLS' to ARCH_FLAGS to enable TLS support.
ARCH_FLAGS ?=
DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
-D_BSD_SOURCE -D_GNU_SOURCE \
-DGLX_INDIRECT_RENDERING \
-DPTHREADS -DHAVE_ALIAS -DHAVE_POSIX_MEMALIGN
X11_INCLUDES = -I/usr/X11R6/include
CFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
$(ASM_FLAGS) -std=c99 -ffast-math
CXXFLAGS = $(WARN_FLAGS) $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES)
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
MESA_ASM_SOURCES =
# Library/program dependencies
EXTRA_LIB_PATH=-L/usr/X11R6/lib
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl
# Directories
SRC_DIRS = glx glu glut/glx glw
DRIVER_DIRS =

View File

@@ -1,44 +0,0 @@
# -*-makefile-*-
# Configuration for Linux and LLVM with optimizations
# Builds the llvmpipe gallium driver
include $(TOP)/configs/linux
CONFIG_NAME = linux-llvm
# Add llvmpipe driver
GALLIUM_DRIVERS_DIRS += llvmpipe
OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE
# override -std=c99
CFLAGS += -std=gnu99
LLVM_VERSION := $(shell llvm-config --version)
ifeq ($(LLVM_VERSION),)
$(warning Could not find LLVM! Make Sure 'llvm-config' is in the path)
MESA_LLVM=0
else
MESA_LLVM=1
HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
# $(info Using LLVM version: $(LLVM_VERSION))
endif
ifeq ($(MESA_LLVM),1)
LLVM_CFLAGS=`llvm-config --cppflags`
LLVM_CXXFLAGS=`llvm-config --cxxflags` -Wno-long-long
LLVM_LDFLAGS = $(shell llvm-config --ldflags)
LLVM_LIBS = $(shell llvm-config --libs)
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
LLVM_CXXFLAGS=
endif
LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++

View File

@@ -1,12 +0,0 @@
# -*-makefile-*-
# Configuration for Linux and LLVM with debugging info
# Builds the llvmpipe gallium driver
include $(TOP)/configs/linux-llvm
CONFIG_NAME = linux-llvm-debug
OPT_FLAGS = -g -ansi -pedantic
DEFINES += -DDEBUG -UNDEBUG

View File

@@ -1,28 +0,0 @@
# Configuration for OpenGL ES on Linux
include $(TOP)/configs/linux
CONFIG_NAME = linux-opengl-es
# Directories to build
LIB_DIR = lib
SRC_DIRS = egl glsl mapi/es1api mapi/es2api mesa/es \
gallium gallium/winsys gallium/targets
# egl st needs this
DEFINES += -DGLX_DIRECT_RENDERING
# no mesa or egl drivers
DRIVER_DIRS =
EGL_DRIVERS_DIRS =
GALLIUM_DRIVERS_DIRS = softpipe
# build libGLES*.so
GALLIUM_STATE_TRACKERS_DIRS = es
# build egl_x11_{swrast,i915}.so
GALLIUM_DRIVERS_DIRS += trace rbug i915
GALLIUM_STATE_TRACKERS_DIRS += egl
GALLIUM_WINSYS_DIRS += drm/intel
GALLIUM_TARGET_DIRS += egl-swrast egl-i915

View File

@@ -1,27 +0,0 @@
# Configuration for building only libOSMesa on Linux, no Xlib driver
# This doesn't really have any Linux dependencies, so it should be usable
# on other (gcc-based) systems.
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -g -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread -ldl
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,36 +0,0 @@
# Configuration for building static libOSMesa.a on Linux, no Xlib driver
# This doesn't really have any Linux dependencies, so it should be usable
# on other (gcc-based) systems.
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa
# Compiler and flags
CC = gcc -m32
CXX = g++ -m32
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DPTHREADS
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Directories
SRC_DIRS = mesa glu
DRIVER_DIRS = osmesa
# Dependencies
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
$(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm

View File

@@ -1,30 +0,0 @@
# Configuration for 16 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa16
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa16
OSMESA_LIB_NAME = libOSMesa16.so
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,31 +0,0 @@
# Configuration for 16 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa16-static
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa16
OSMESA_LIB_NAME = libOSMesa16.a
# Directories
SRC_DIRS = gallium mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,30 +0,0 @@
# Configuration for 32 bits/channel OSMesa library on Linux
include $(TOP)/configs/default
CONFIG_NAME = linux-osmesa32
# Compiler and flags
CC = gcc
CXX = g++
CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31
CXXFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE
# Work around aliasing bugs - developers should comment this out
CFLAGS += -fno-strict-aliasing
CXXFLAGS += -fno-strict-aliasing
# Library names
OSMESA_LIB = OSMesa32
OSMESA_LIB_NAME = libOSMesa32.so
# Directories
SRC_DIRS = mapi/glapi glsl mesa glu
DRIVER_DIRS = osmesa
# Dependencies
OSMESA_LIB_DEPS = -lm -lpthread
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(OSMESA_LIB)
APP_LIB_DEPS = -lm -lpthread

View File

@@ -1,9 +0,0 @@
# Configuration for Linux on PPC
include $(TOP)/configs/linux
CONFIG_NAME = linux-ppc
OPT_FLAGS = -O3 -mcpu=603 -fsigned-char -funroll-loops
# FIXME: Use of PowerPC assembly should be enabled here.

View File

@@ -1,15 +0,0 @@
# Configuration for Linux on PPC, static libs
include $(TOP)/configs/linux-ppc
CONFIG_NAME = linux-ppc-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a

View File

@@ -1,8 +0,0 @@
# Configuration for profiling on Linux with gprof
include $(TOP)/configs/linux-static
CONFIG_NAME = linux-profile
OPT_FLAGS = -pg -g -O2
DEFINES += -DNDEBUG

View File

@@ -1,9 +0,0 @@
# Configuration for Linux on Sparc
include $(TOP)/configs/linux
CONFIG_NAME = linux-sparc
#ASM_FLAGS = -DUSE_SPARC_ASM
#MESA_ASM_SOURCES = $(SPARC_SOURCES)
#GLAPI_ASM_SOURCES = $(SPARC_API)

View File

@@ -1,7 +0,0 @@
# Configuration for Linux on Sparc5
include $(TOP)/configs/linux-sparc
CONFIG_NAME = linux-sparc5
ARCH_FLAGS += -mcpu=ultrasparc

View File

@@ -1,26 +0,0 @@
# Configuration for generic Linux, making static libs
include $(TOP)/configs/linux
CONFIG_NAME = linux-static
MKLIB_OPTIONS = -static
PIC_FLAGS =
# Library names (actual file names)
GL_LIB_NAME = libGL.a
GLU_LIB_NAME = libGLU.a
GLUT_LIB_NAME = libglut.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
# Library/program dependencies (static libs don't have dependencies)
GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLUT_LIB_DEPS =
GLW_LIB_DEPS =
# Need to specify all libraries we may need
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) \
-l$(GL_LIB) -lm -L/usr/X11R6/lib/ -lX11 -lXext -lXmu -lXi -lpthread

View File

@@ -1,7 +0,0 @@
# Configuration for Linux on UltraSparc
include $(TOP)/configs/linux-sparc
CONFIG_NAME = linux-ultrasparc
ARCH_FLAGS += -mv8 -mtune=ultrasparc

View File

@@ -1,11 +0,0 @@
# Configuration for Linux with x86 optimizations
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86
ARCH_FLAGS = -m32 -mmmx -msse -msse2
ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM
MESA_ASM_SOURCES = $(X86_SOURCES)
GLAPI_ASM_SOURCES = $(X86_API)

View File

@@ -1,7 +0,0 @@
# To build Linux x86 32-bit in an x86-64 environment
include $(TOP)/configs/linux-x86
CONFIG_NAME = linux-x86-32
ARCH_FLAGS += -m32

View File

@@ -1,14 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/linux
CONFIG_NAME = linux-x86-64
ARCH_FLAGS = -m64
MESA_ASM_SOURCES = $(X86-64_SOURCES)
GLAPI_ASM_SOURCES = $(X86-64_API)
ASM_FLAGS = -DUSE_X86_64_ASM
LIB_DIR = lib64
EXTRA_LIB_PATH = -L/usr/X11R6/lib64

View File

@@ -1,8 +0,0 @@
# Configuration for Linux for 64-bit X86 (Opteron)
include $(TOP)/configs/linux-x86-64
CONFIG_NAME = linux-x86-64-debug
OPT_FLAGS = -g
DEFINES += -DDEBUG -DDEBUG_MATH

Some files were not shown because too many files have changed in this diff Show More