mesa.git
11 years agoegl: Add EGL_WAYLAND_PLANE_WL attribute
Kristian Høgsberg [Thu, 5 Jul 2012 20:43:04 +0000 (16:43 -0400)]
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>
11 years agowayland-drm: Add protocol to create planar buffers
Kristian Høgsberg [Thu, 5 Jul 2012 20:27:05 +0000 (16:27 -0400)]
wayland-drm: Add protocol to create planar buffers

11 years agowayland-drm: Pass struct wl_drm_buffer to the driver
Kristian Høgsberg [Thu, 5 Jul 2012 18:19:48 +0000 (14:19 -0400)]
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.

11 years agointel: Implement __DRIimage::createSubImage and bump supported version to 5
Kristian Høgsberg [Thu, 5 Jul 2012 17:02:02 +0000 (13:02 -0400)]
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>
11 years agointel: Add offset field to miptree
Kristian Høgsberg [Thu, 5 Jul 2012 03:09:14 +0000 (23:09 -0400)]
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>
11 years agointel: Add support for new __DRIimage formats
Kristian Høgsberg [Thu, 5 Jul 2012 16:13:06 +0000 (12:13 -0400)]
intel: Add support for new __DRIimage formats

11 years ago__DRIimage: version 5, add new formats and createSubImage
Kristian Høgsberg [Thu, 5 Jul 2012 02:56:09 +0000 (22:56 -0400)]
__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>
11 years agor600g/compute: Disable growing the memory pool
Tom Stellard [Wed, 11 Jul 2012 16:18:22 +0000 (16:18 +0000)]
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.

11 years agoradeon/llvm: Use multiclasses for floating point loads
Tom Stellard [Tue, 10 Jul 2012 15:15:49 +0000 (11:15 -0400)]
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).

11 years agoradeon/llvm: Don't set the IMM bit in SMRD instruction definitions.
Tom Stellard [Tue, 10 Jul 2012 12:51:31 +0000 (08:51 -0400)]
radeon/llvm: Don't set the IMM bit in SMRD instruction definitions.

The IMM bit is already being set in SICodeEmitter.

11 years agor600g/compute: Add more debugging output
Tom Stellard [Wed, 11 Jul 2012 17:46:59 +0000 (17:46 +0000)]
r600g/compute: Add more debugging output

11 years agoi965: Revert the VBOs-in-system-memory hack.
Eric Anholt [Thu, 5 Jul 2012 20:43:43 +0000 (13:43 -0700)]
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>
11 years agoAdd emacs setup for the docs/devinfo.html comment wrapping recommendation.
Eric Anholt [Wed, 4 Jul 2012 20:12:09 +0000 (13:12 -0700)]
Add emacs setup for the docs/devinfo.html comment wrapping recommendation.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoglx/dri2: Add support for GLX_ARB_create_context_robustness
Ian Romanick [Tue, 3 Jul 2012 18:32:59 +0000 (11:32 -0700)]
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>
11 years agodri2: Hard-code the DRI2 version
Ian Romanick [Tue, 3 Jul 2012 18:15:00 +0000 (11:15 -0700)]
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>
11 years agoglapi: Apply Xorg indent rules to all files generated for the xserver
Ian Romanick [Fri, 8 Jun 2012 20:17:10 +0000 (13:17 -0700)]
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>
11 years agodocs: Update GL3.txt.
Kenneth Graunke [Tue, 10 Jul 2012 23:51:49 +0000 (16:51 -0700)]
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>
11 years agomesa: Remove unneeded extern qualifiers
Chad Versace [Fri, 22 Jun 2012 02:18:03 +0000 (19:18 -0700)]
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>
11 years agor600g: improve flushed depth texture handling v2
Vadim Girlin [Tue, 10 Jul 2012 22:19:51 +0000 (02:19 +0400)]
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>
11 years agoi965: Add hardware context support.
Kenneth Graunke [Tue, 12 Jun 2012 19:07:09 +0000 (12:07 -0700)]
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>
11 years agomesa/test: Update name of GL_TIME_ELAPSED
Ian Romanick [Tue, 10 Jul 2012 20:37:06 +0000 (13:37 -0700)]
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

11 years agodocs/relnotes-8.0.4: fix html markup
Andreas Boll [Tue, 10 Jul 2012 17:09:28 +0000 (19:09 +0200)]
docs/relnotes-8.0.4: fix html markup

11 years agogallium/docs: document interface changes for timestamp query
Marek Olšák [Tue, 10 Jul 2012 16:55:46 +0000 (18:55 +0200)]
gallium/docs: document interface changes for timestamp query

the query type is already documented

11 years agoidentity: implement get_timestamp
Marek Olšák [Tue, 10 Jul 2012 16:48:02 +0000 (18:48 +0200)]
identity: implement get_timestamp

11 years agonoop: implement get_timestamp
Marek Olšák [Tue, 10 Jul 2012 16:46:08 +0000 (18:46 +0200)]
noop: implement get_timestamp

11 years agotrace: implement get_timestamp
Marek Olšák [Tue, 10 Jul 2012 16:43:51 +0000 (18:43 +0200)]
trace: implement get_timestamp

11 years agogalahad: implement get_timestamp
Marek Olšák [Tue, 10 Jul 2012 16:14:46 +0000 (18:14 +0200)]
galahad: implement get_timestamp

11 years agodocs: update relnotes-8.1 and GL3 status
Marek Olšák [Thu, 5 Jul 2012 18:27:28 +0000 (20:27 +0200)]
docs: update relnotes-8.1 and GL3 status

11 years agosoftpipe: implement get_timestamp and expose ARB_timer_query
Marek Olšák [Thu, 5 Jul 2012 21:20:21 +0000 (23:20 +0200)]
softpipe: implement get_timestamp and expose ARB_timer_query

PIPE_QUERY_TIMESTAMP is already implemented and working.

11 years agost/mesa: implement ARB_timer_query
Marek Olšák [Thu, 5 Jul 2012 18:27:01 +0000 (20:27 +0200)]
st/mesa: implement ARB_timer_query

11 years agogallium: add QUERY_TIMESTAMP cap and get_timestamp screen function
Marek Olšák [Thu, 5 Jul 2012 18:04:02 +0000 (20:04 +0200)]
gallium: add QUERY_TIMESTAMP cap and get_timestamp screen function

11 years agomesa: implement glGet(GL_TIMESTAMP) v2
Marek Olšák [Thu, 5 Jul 2012 18:21:29 +0000 (20:21 +0200)]
mesa: implement glGet(GL_TIMESTAMP) v2

This is adds a new driver function to retrieve the timestamp.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: add ARB_timer_query to the extension list
Marek Olšák [Tue, 26 Jun 2012 19:24:19 +0000 (21:24 +0200)]
mesa: add ARB_timer_query to the extension list

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: add QueryCounter display list support
Marek Olšák [Tue, 26 Jun 2012 19:47:44 +0000 (21:47 +0200)]
mesa: add QueryCounter display list support

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: implement TIMESTAMP query and glQueryCounter
Marek Olšák [Tue, 26 Jun 2012 03:55:12 +0000 (05:55 +0200)]
mesa: implement TIMESTAMP query and glQueryCounter

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoglapi: add ARB_timer_query
Marek Olšák [Mon, 25 Jun 2012 23:36:44 +0000 (01:36 +0200)]
glapi: add ARB_timer_query

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agodocs: Add 8.0.4 release notes
Ian Romanick [Tue, 10 Jul 2012 15:30:11 +0000 (08:30 -0700)]
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>
11 years agoglsl: Add parsing for GLSL uniform blocks.
Eric Anholt [Wed, 18 Apr 2012 20:35:56 +0000 (13:35 -0700)]
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>
11 years agoglsl: Don't hide the type of struct_declaration_list.
Eric Anholt [Thu, 26 Apr 2012 17:16:52 +0000 (10:16 -0700)]
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>
11 years agoglcpp: Add built-in #define for GL_ARB_uniform_buffer_object.
Kenneth Graunke [Tue, 3 Jul 2012 22:19:59 +0000 (15:19 -0700)]
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>
11 years agoglsl: Parser handles "#extension GL_ARB_uniform_buffer_object"
Vincent Lejeune [Sun, 25 Dec 2011 18:17:03 +0000 (19:17 +0100)]
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>
11 years agoglsl: Reduce a bit of extra code in the merging of layout qualifiers.
Eric Anholt [Tue, 24 Apr 2012 19:18:17 +0000 (12:18 -0700)]
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>
11 years agoglsl: Take advantage of the layout qualifier flags union to clean up parsing.
Eric Anholt [Tue, 24 Apr 2012 19:14:39 +0000 (12:14 -0700)]
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>
11 years agor600g: Don't create a texture for the memory_pool during screen init
Tom Stellard [Mon, 9 Jul 2012 15:42:25 +0000 (11:42 -0400)]
r600g: Don't create a texture for the memory_pool during screen init

This fixes a segfault in r600_screen_create() introduced by
eb065f5d9d1159af3a88a64a7606c9b6d67dc3

Reported by tilman on irc.

11 years agoradeon/llvm: Rename namespace from AMDIL to AMDGPU
Tom Stellard [Sun, 8 Jul 2012 16:41:05 +0000 (12:41 -0400)]
radeon/llvm: Rename namespace from AMDIL to AMDGPU

11 years agor600g: Update number of gprs when adding a vertex instruction
Tom Stellard [Thu, 28 Jun 2012 19:55:54 +0000 (19:55 +0000)]
r600g: Update number of gprs when adding a vertex instruction

11 years agor600g/compute: Use evergreen_cb() for binding RATs
Tom Stellard [Wed, 27 Jun 2012 13:37:05 +0000 (13:37 +0000)]
r600g/compute: Use evergreen_cb() for binding RATs

11 years agor600g: Add support for RATs in evergreen_cb()
Tom Stellard [Wed, 27 Jun 2012 13:27:30 +0000 (13:27 +0000)]
r600g: Add support for RATs in evergreen_cb()

11 years agor600g: Use a texture as the underlying resource for compute_memory_pool
Tom Stellard [Thu, 21 Jun 2012 23:32:43 +0000 (19:32 -0400)]
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.

11 years agor600g: Add is_rat flag to r600_resource_texture
Tom Stellard [Fri, 22 Jun 2012 17:02:33 +0000 (17:02 +0000)]
r600g: Add is_rat flag to r600_resource_texture

11 years agor600g: Add r600_context_pipe_state_emit()
Tom Stellard [Tue, 26 Jun 2012 20:54:32 +0000 (20:54 +0000)]
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.

11 years agor600g: Add pkt_flag parameter to r600_context_block_emit_dirty()
Tom Stellard [Mon, 25 Jun 2012 21:16:11 +0000 (21:16 +0000)]
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>
11 years agor600g/compute: Move LOOP_CONST initialization to start_compute_cs atom
Tom Stellard [Tue, 26 Jun 2012 14:37:27 +0000 (14:37 +0000)]
r600g/compute: Move LOOP_CONST initialization to start_compute_cs atom

11 years agor600g: Add start_compute_cs atom to struct r600_context
Tom Stellard [Mon, 25 Jun 2012 17:56:01 +0000 (17:56 +0000)]
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>
11 years agor600g: Add pkt_flag member to struct r600_command_buffer
Tom Stellard [Mon, 25 Jun 2012 20:00:47 +0000 (20:00 +0000)]
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>
11 years agor600g: Only emit start_cs_cmd atom once for compute command streams
Tom Stellard [Sun, 24 Jun 2012 23:24:39 +0000 (19:24 -0400)]
r600g: Only emit start_cs_cmd atom once for compute command streams

11 years agor600g: fix stencil texturing with Z32_FLOAT_S8X24_UINT
Marek Olšák [Sat, 7 Jul 2012 22:25:36 +0000 (00:25 +0200)]
r600g: fix stencil texturing with Z32_FLOAT_S8X24_UINT

11 years agor600g: add assertions after translate_colorswap/colorformat/dbformat/texformat
Marek Olšák [Sat, 7 Jul 2012 22:23:41 +0000 (00:23 +0200)]
r600g: add assertions after translate_colorswap/colorformat/dbformat/texformat

11 years agor600g: inline r600_hw_copy_region
Marek Olšák [Sat, 7 Jul 2012 17:10:00 +0000 (19:10 +0200)]
r600g: inline r600_hw_copy_region

11 years agor600g: enable dual src blending on r7xx
Marek Olšák [Sat, 7 Jul 2012 07:36:35 +0000 (09:36 +0200)]
r600g: enable dual src blending on r7xx

No lockups here.

11 years agor600g: use depth format from pipe_surface, not pipe_resource
Marek Olšák [Sat, 7 Jul 2012 16:41:01 +0000 (18:41 +0200)]
r600g: use depth format from pipe_surface, not pipe_resource

11 years agor600g: use u_box_origin_2d helper function
Marek Olšák [Sat, 7 Jul 2012 00:30:54 +0000 (02:30 +0200)]
r600g: use u_box_origin_2d helper function

11 years agogallium/u_blitter: consolidate some state changes
Marek Olšák [Sat, 7 Jul 2012 15:31:42 +0000 (17:31 +0200)]
gallium/u_blitter: consolidate some state changes

11 years agor600g: remove stray semicolon
Marek Olšák [Fri, 6 Jul 2012 23:26:31 +0000 (01:26 +0200)]
r600g: remove stray semicolon

11 years agodocs: document ARB_blend_func_extended and EXT_texture_rg in relnotes-8.1
Marek Olšák [Sat, 7 Jul 2012 13:09:05 +0000 (15:09 +0200)]
docs: document ARB_blend_func_extended and EXT_texture_rg in relnotes-8.1

also sort the extensions

11 years agoi965/fs: Invalidate live intervals after copy propagation.
Eric Anholt [Tue, 5 Jun 2012 20:14:38 +0000 (13:14 -0700)]
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>
11 years agoi965/fs: Invalidate live intervals in passes that remove an instruction.
Eric Anholt [Tue, 5 Jun 2012 20:13:33 +0000 (13:13 -0700)]
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.

11 years agoi965/vs: Move the other two src_reg/dst_reg constructors to brw_vec4.cpp.
Eric Anholt [Wed, 4 Jul 2012 20:31:46 +0000 (13:31 -0700)]
i965/vs: Move the other two src_reg/dst_reg constructors to brw_vec4.cpp.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/vs: Move class functions to brw_vec4.cpp.
Eric Anholt [Wed, 4 Jul 2012 20:25:27 +0000 (13:25 -0700)]
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>
11 years agoi965/fs: Move class functions from the header to .cpp files.
Eric Anholt [Wed, 4 Jul 2012 20:12:50 +0000 (13:12 -0700)]
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>
11 years agogalahad: Check that texture format is supported.
José Fonseca [Fri, 6 Jul 2012 19:38:41 +0000 (20:38 +0100)]
galahad: Check that texture format is supported.

11 years agogalahad: More detailed resource checks.
José Fonseca [Fri, 6 Jul 2012 09:37:52 +0000 (10:37 +0100)]
galahad: More detailed resource checks.

11 years agogalahad: Fix zealous warnings.
José Fonseca [Fri, 6 Jul 2012 19:12:56 +0000 (20:12 +0100)]
galahad: Fix zealous warnings.

11 years agogalahad: Enumerate all methods that are missing.
José Fonseca [Fri, 6 Jul 2012 18:13:44 +0000 (19:13 +0100)]
galahad: Enumerate all methods that are missing.

11 years agogalahad: Implement render_condition.
José Fonseca [Fri, 6 Jul 2012 17:45:14 +0000 (18:45 +0100)]
galahad: Implement render_condition.

11 years agogalahad: Don't implement context methods that are not implemented by the underlying...
José Fonseca [Fri, 6 Jul 2012 09:38:28 +0000 (10:38 +0100)]
galahad: Don't implement context methods that are not implemented by the underlying pipe driver.

11 years agogalahad: Use debug_printf.
José Fonseca [Fri, 6 Jul 2012 09:36:55 +0000 (10:36 +0100)]
galahad: Use debug_printf.

stderr is not visible on windows.

11 years agogalahad: Silence creation messages.
José Fonseca [Fri, 6 Jul 2012 17:37:48 +0000 (18:37 +0100)]
galahad: Silence creation messages.

Let galahad warnings be true warnings.

11 years agogalahad: Use reference counting when destroying the wraped objects.
José Fonseca [Fri, 6 Jul 2012 17:31:15 +0000 (18:31 +0100)]
galahad: Use reference counting when destroying the wraped objects.

As the wrapped pipe driver may hold internal references.

11 years agogalahad: Point to the galahad objects from the galahad sampler view.
José Fonseca [Fri, 6 Jul 2012 17:30:25 +0000 (18:30 +0100)]
galahad: Point to the galahad objects from the galahad sampler view.

And not the wraped driver's objects.

11 years agogalahad: Don't defer index buffer when it's NULL.
José Fonseca [Fri, 6 Jul 2012 15:55:09 +0000 (16:55 +0100)]
galahad: Don't defer index buffer when it's NULL.

11 years agotarget-helpers: Enable debug helpers only on debug builds.
José Fonseca [Fri, 6 Jul 2012 08:50:11 +0000 (09:50 +0100)]
target-helpers: Enable debug helpers only on debug builds.

Some of these helpers use debug_get_option, which works also on releases.

11 years agost/mesa: only expose ARB_shader_bit_encoding with GLSL 1.3
Marek Olšák [Wed, 4 Jul 2012 00:35:39 +0000 (02:35 +0200)]
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>
11 years agoegl_dri2: Reorganize the EGLImage constructors to share more code
Kristian Høgsberg [Thu, 5 Jul 2012 04:39:25 +0000 (00:39 -0400)]
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>
11 years agointel: Share common __DRIimage allocation code
Kristian Høgsberg [Thu, 5 Jul 2012 04:17:47 +0000 (00:17 -0400)]
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>
11 years agointel: Just look up image->internal_format using _mesa_get_format_base_format
Kristian Høgsberg [Thu, 5 Jul 2012 04:07:15 +0000 (00:07 -0400)]
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>
11 years agointel: Remove unused __DRIimage::data_type field
Kristian Høgsberg [Thu, 5 Jul 2012 03:34:31 +0000 (23:34 -0400)]
intel: Remove unused __DRIimage::data_type field

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agosvga: whitespace fixes
Brian Paul [Mon, 2 Jul 2012 19:47:53 +0000 (13:47 -0600)]
svga: whitespace fixes

11 years agoRevert "mesa: #define fprintf to be __mingw_fprintf() on Mingw32"
Brian Paul [Mon, 2 Jul 2012 23:23:18 +0000 (17:23 -0600)]
Revert "mesa: #define fprintf to be __mingw_fprintf() on Mingw32"

This reverts commit cbffaf20e9e6154310ba68bb2b44adc37ba83bcd.

Use the PRIx64 macro in the fprintf() call instead, as suggested
by Dylan Noblesmith.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agomesa: use the PRIx64 macro for printing 64-bit hexadecimal values
Brian Paul [Mon, 2 Jul 2012 23:23:03 +0000 (17:23 -0600)]
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>
11 years agosvga: implement TGSI_OPCODE_ROUND
Brian Paul [Mon, 2 Jul 2012 23:03:50 +0000 (17:03 -0600)]
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>
11 years agosvga: fix CMP translation for vertex shaders
Brian Paul [Fri, 29 Jun 2012 23:10:58 +0000 (17:10 -0600)]
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>
11 years agosvga: properly implement TRUNC instruction
Brian Paul [Fri, 29 Jun 2012 22:59:46 +0000 (16:59 -0600)]
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>
11 years agosvga: fix register collision issue in emit_conditional()
Brian Paul [Tue, 3 Jul 2012 21:51:22 +0000 (15:51 -0600)]
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>
11 years agosvga: emit some debug messages when shader compilation fails
Brian Paul [Fri, 29 Jun 2012 22:53:35 +0000 (16:53 -0600)]
svga: emit some debug messages when shader compilation fails

11 years agointel: Fix a comment typo.
Eric Anholt [Wed, 30 May 2012 19:18:36 +0000 (12:18 -0700)]
intel: Fix a comment typo.

11 years agomesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x.
Gwenole Beauchesne [Wed, 18 Apr 2012 14:38:47 +0000 (16:38 +0200)]
mesa: add GL_EXT_texture_rg extension for OpenGL ES 2.x.

11 years agoGLES2: upgrade gl2ext.h to version 18099
Kristian Høgsberg [Wed, 4 Jul 2012 00:47:04 +0000 (20:47 -0400)]
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
8f3be339850ead96f9c6200db4e0db1f74e39d13 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>
11 years agomesa/st: gl_ClipDistance must be interpolated in 3d space.
Olivier Galibert [Sun, 24 Jun 2012 09:18:18 +0000 (11:18 +0200)]
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>
11 years agogallium/util: Save and restore vertex buffer state in util_gen_mipmap.
Stuart Abercrombie [Fri, 29 Jun 2012 23:31:24 +0000 (16:31 -0700)]
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 784dd51198433e5c299da4a7742c68d21d68d1c1 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>