mesa.git
11 years agoi965: Enable floating-point textures always
Ian Romanick [Tue, 21 Aug 2012 22:53:27 +0000 (15:53 -0700)]
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>
11 years agor300g: add a workaround for the AA colorbuffer addressing bug on R500
Marek Olšák [Sun, 20 Jan 2013 17:09:58 +0000 (18:09 +0100)]
r300g: add a workaround for the AA colorbuffer addressing bug on R500

11 years agor300g: allow resolutions up to 1280x1024 with AA optimizations on 1-pipe cards
Marek Olšák [Sun, 20 Jan 2013 15:52:17 +0000 (16:52 +0100)]
r300g: allow resolutions up to 1280x1024 with AA optimizations on 1-pipe cards

because single-pipe cards have bigger CMASK RAM

11 years agor300g: enable AA optimizations for the RGBA16F format
Marek Olšák [Tue, 15 Jan 2013 20:41:34 +0000 (21:41 +0100)]
r300g: enable AA optimizations for the RGBA16F format

11 years agoradeonsi: More assorted depth/stencil changes ported from r600g.
Marek Olšák [Thu, 17 Jan 2013 18:36:41 +0000 (19:36 +0100)]
radeonsi: More assorted depth/stencil changes ported from r600g.

[ Squashed port of the following r600g commits: - Michel Dänzer ]

commit 428e37c2da420f7dc14a2ea265f2387270f9bee1
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 e2f623f1d6da9bc987582ff68d0471061ae44030
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 43e226b6efb77db2247741cc2057d9625a2cfa05
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 b242adbe5cfa165b252064a1ea36f802d8251ef1
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 611dd529425281d73f1f0ad2000362d4a5525a25
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 80755ff56317446a8c89e611edc1fdf320d6779b
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 fe1fd675565231b49d3ac53d0b4bec39d8bc6781
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 5a17d8318ec2c20bf86275044dc8f715105a88e7
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 dee58f94af833906863b0ff2955b20f3ab407e63
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>
11 years agoradeonsi: improve flushed depth texture handling
Vadim Girlin [Tue, 15 Jan 2013 18:36:32 +0000 (19:36 +0100)]
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 37708479608af877986b76302a9c92611d1e23d0 ]

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agoradeonsi: Assorted depth/stencil changes ported from r600g.
Marek Olšák [Tue, 15 Jan 2013 18:04:13 +0000 (19:04 +0100)]
radeonsi: Assorted depth/stencil changes ported from r600g.

[ Squashed port of the following r600g commits: - Michel Dänzer ]

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

    r600g: inline r600_hw_copy_region

commit 4891c5dc64ccd8cf2bf8a8550ae23e1a61806a7d
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 da98bb6fc105e1a2f688a1713ca9e50f0ac8fbed
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>
11 years agoradeonsi: Enable 1D tiling for non-depth resources as well.
Michel Dänzer [Thu, 17 Jan 2013 18:16:49 +0000 (19:16 +0100)]
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>
11 years agoradeonsi: Fix 1D tiling mode index for non-scanout resources.
Michel Dänzer [Thu, 17 Jan 2013 18:15:15 +0000 (19:15 +0100)]
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>
11 years agobuild: Remove dead SHARED_GLAPI variable
Matt Turner [Sat, 19 Jan 2013 07:18:14 +0000 (23:18 -0800)]
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>
11 years agoglsl/build: Build glsl_test only on make check
Matt Turner [Mon, 14 Jan 2013 22:21:41 +0000 (14:21 -0800)]
glsl/build: Build glsl_test only on make check

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
11 years agoglsl/build: Remove dead LIBRARY_* variables
Matt Turner [Mon, 14 Jan 2013 22:26:40 +0000 (14:26 -0800)]
glsl/build: Remove dead LIBRARY_* variables

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
11 years agoxmlpool/build: generate options.h via BUILT_SOURCES
Matt Turner [Mon, 14 Jan 2013 22:18:02 +0000 (14:18 -0800)]
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>
11 years agofbobject: add additional fbo completeness checks for GLES
Jordan Justen [Thu, 27 Dec 2012 21:34:44 +0000 (13:34 -0800)]
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>
11 years agoframebuffer: update allowed implementation format/type
Jordan Justen [Sat, 12 Jan 2013 09:11:21 +0000 (01:11 -0800)]
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>
11 years agoreadpix: allow implementation format/type
Jordan Justen [Sat, 12 Jan 2013 09:05:44 +0000 (01:05 -0800)]
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>
11 years agoextensions: enable EXT_color_buffer_float for ES3
Jordan Justen [Fri, 11 Jan 2013 01:29:27 +0000 (17:29 -0800)]
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>
11 years agoextensions: Add ES3-only extension support
Matt Turner [Fri, 18 Jan 2013 23:16:10 +0000 (15:16 -0800)]
extensions: Add ES3-only extension support

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoreadpix: check FBO completeness before trying to access the read-buffer
Jordan Justen [Fri, 28 Dec 2012 19:27:04 +0000 (11:27 -0800)]
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>
11 years agoreadpix: add error checking for GLES3
Jordan Justen [Fri, 28 Dec 2012 19:24:37 +0000 (11:24 -0800)]
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>
11 years agocopyteximage: update error checking for GLES3
Jordan Justen [Sun, 13 Jan 2013 04:11:00 +0000 (20:11 -0800)]
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>
11 years agocopyteximage: check that sRGB usage is valid for GLES3 / GL
Jordan Justen [Fri, 28 Dec 2012 19:00:50 +0000 (11:00 -0800)]
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>
11 years agointel: Enable GL_OES_depth_texture_cube_map
Ian Romanick [Fri, 18 Jan 2013 23:44:38 +0000 (15:44 -0800)]
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>
11 years agomesa/es3: Allow unsized depth and depth-stencil formats in ES3
Ian Romanick [Fri, 18 Jan 2013 23:43:38 +0000 (15:43 -0800)]
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>
11 years agomesa/es2: Allow depth component cube maps in ES2 if the extension is enabled
Ian Romanick [Fri, 18 Jan 2013 23:43:08 +0000 (15:43 -0800)]
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>
11 years agomesa: Add extension bit tracking for GL_OES_depth_texture_cube_map
Ian Romanick [Fri, 18 Jan 2013 23:41:50 +0000 (15:41 -0800)]
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>
11 years agogallium: Remove ppc asm backend
Adam Jackson [Wed, 2 Jan 2013 17:44:49 +0000 (12:44 -0500)]
gallium: Remove ppc asm backend

The vs part hasn't been wired up since tgsi_sse2 was disabled in:

    commit 4eb3225b38ce12cb34ab3d90804c9683bd7b4ed3
    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>
11 years agobuild: require python module libxml2
Andreas Boll [Fri, 18 Jan 2013 14:31:57 +0000 (15:31 +0100)]
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>
11 years agor600g/llvm: Fixes addressspace of basevectors for clipvertex
Vincent Lejeune [Sat, 19 Jan 2013 21:27:16 +0000 (22:27 +0100)]
r600g/llvm: Fixes addressspace of basevectors for clipvertex

11 years agonv50/ir: add definitions of Target and CodeEmitter dtors
Christoph Bumiller [Sat, 19 Jan 2013 21:08:01 +0000 (22:08 +0100)]
nv50/ir: add definitions of Target and CodeEmitter dtors

I really did build test, my compiler just doesn't seem to care.

11 years agonouveau: fix undefined behaviour when testing sample_count
Christoph Bumiller [Sat, 19 Jan 2013 19:53:22 +0000 (20:53 +0100)]
nouveau: fix undefined behaviour when testing sample_count

NOTE: This is a candidate for the 9.0 branch.

11 years agonv50/ir: fix a couple of warnings
Christoph Bumiller [Sat, 12 Jan 2013 16:37:34 +0000 (17:37 +0100)]
nv50/ir: fix a couple of warnings

11 years agomesa: Array uniform name length includes length of [0]
Ian Romanick [Sat, 15 Dec 2012 03:00:32 +0000 (19:00 -0800)]
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>
11 years agomesa: Array uniform names are supposed to have [0] appended
Ian Romanick [Fri, 14 Dec 2012 23:01:48 +0000 (15:01 -0800)]
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>
11 years agomesa: Refactor getting a uniform's name to a helper function
Ian Romanick [Fri, 14 Dec 2012 22:59:11 +0000 (14:59 -0800)]
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>
11 years agoglsl: Eliminate link_update_uniform_buffer_variables return value
Ian Romanick [Wed, 12 Dec 2012 00:51:02 +0000 (16:51 -0800)]
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>
11 years agoglsl: Remove unused loc parameter from generate_call
Ian Romanick [Tue, 11 Dec 2012 20:54:02 +0000 (12:54 -0800)]
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>
11 years agomesa: Remove unused field gl_uniform_buffer_variable::Buffer
Ian Romanick [Thu, 13 Dec 2012 10:22:24 +0000 (02:22 -0800)]
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>
11 years agolinker: Use helper variable sh
Ian Romanick [Thu, 13 Dec 2012 20:42:02 +0000 (12:42 -0800)]
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>
11 years agoglsl: Remove stale comment
Ian Romanick [Thu, 13 Dec 2012 20:14:47 +0000 (12:14 -0800)]
glsl: Remove stale comment

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Track UBO block names in the symbol table.
Kenneth Graunke [Wed, 28 Nov 2012 08:18:02 +0000 (00:18 -0800)]
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>
11 years agoglsl: Reject row_major and column_major on non-matrix types
Ian Romanick [Wed, 16 Jan 2013 20:01:50 +0000 (12:01 -0800)]
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>
11 years agomesa: Skip updating texgen when not doing fixed function.
Eric Anholt [Tue, 8 Jan 2013 19:09:49 +0000 (11:09 -0800)]
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>
11 years agomesa: Don't bother updating ff texture state if we have a fragment shader.
Eric Anholt [Tue, 8 Jan 2013 17:56:24 +0000 (09:56 -0800)]
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>
11 years agomesa: Drop a comment about ff vertex shading and texturing.
Eric Anholt [Tue, 8 Jan 2013 00:58:58 +0000 (16:58 -0800)]
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>
11 years agomesa: Fix out of bounds writes when uncompressing non-block-aligned ETC1.
Eric Anholt [Fri, 11 Jan 2013 01:48:16 +0000 (17:48 -0800)]
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>
11 years agoi965: Add support for GL_ARB_texture_buffer_object_rgb32.
Eric Anholt [Thu, 10 Jan 2013 22:53:12 +0000 (14:53 -0800)]
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>
11 years agoi965: Add support for MESA_FORMAT_RGB_FLOAT32 surfaces.
Eric Anholt [Fri, 11 Jan 2013 00:11:26 +0000 (16:11 -0800)]
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>
11 years agointel: Make intel_region's pitch be bytes instead of pixels.
Eric Anholt [Thu, 10 Jan 2013 23:11:28 +0000 (15:11 -0800)]
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>
11 years agointel: Make intel_blit.c take pitches in bytes.
Eric Anholt [Thu, 10 Jan 2013 23:22:12 +0000 (15:22 -0800)]
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>
11 years agor600g/llvm: tgsi to llvm emits store.swizzle intrinsic for vs/fs output
Vincent Lejeune [Fri, 11 Jan 2013 18:48:29 +0000 (19:48 +0100)]
r600g/llvm: tgsi to llvm emits store.swizzle intrinsic for vs/fs output

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g/llvm: tgsi to llvm emits stream output intrinsics.
Vincent Lejeune [Fri, 11 Jan 2013 18:48:28 +0000 (19:48 +0100)]
r600g/llvm: tgsi to llvm emits stream output intrinsics.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g/llvm:translate ARL opcode to a simple cast
Vincent Lejeune [Tue, 8 Jan 2013 21:46:37 +0000 (22:46 +0100)]
r600g/llvm:translate ARL opcode to a simple cast

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g/llvm: rework handling of the constants
Vadim Girlin [Tue, 8 Jan 2013 21:46:35 +0000 (22:46 +0100)]
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>
11 years agomesa: Only mark textures as mipmap incomplete on MAX_LEVEL issues.
Kenneth Graunke [Thu, 17 Jan 2013 17:38:02 +0000 (09:38 -0800)]
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>
11 years agoi965/vs: Store texturing results into a vec4 temporary.
Kenneth Graunke [Thu, 17 Jan 2013 04:24:13 +0000 (20:24 -0800)]
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>
11 years agoi965/vs: Set LOD to 0 for ordinary texture() calls.
Kenneth Graunke [Thu, 17 Jan 2013 03:09:52 +0000 (19:09 -0800)]
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>
11 years agoi965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.
Kenneth Graunke [Thu, 17 Jan 2013 03:08:12 +0000 (19:08 -0800)]
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>
11 years agoi965: Lower textureGrad() with samplerCubeShadow on pre-Haswell.
Kenneth Graunke [Wed, 16 Jan 2013 19:14:14 +0000 (11:14 -0800)]
i965: Lower textureGrad() with samplerCubeShadow on pre-Haswell.

Fixes regressions since commit 899017fc54c40c969b5239b33f3a17b311878b0d
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>
11 years agollvmpipe: turn on integer texture support
Roland Scheidegger [Sun, 13 Jan 2013 01:28:40 +0000 (17:28 -0800)]
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>
11 years agollvmpipe: more fixes for integer color buffers
Roland Scheidegger [Sun, 13 Jan 2013 01:20:13 +0000 (17:20 -0800)]
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>
11 years agollvmpipe: trivial code and comment cleanup.
Roland Scheidegger [Sun, 13 Jan 2013 01:09:04 +0000 (17:09 -0800)]
llvmpipe: trivial code and comment cleanup.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agollvmpipe: fix using wrong format with MRT in blend code
Roland Scheidegger [Sun, 13 Jan 2013 01:07:37 +0000 (17:07 -0800)]
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>
11 years agomesa/es3: Don't check dimensions in _mesa_es3_error_check_format_and_type
Ian Romanick [Wed, 16 Jan 2013 23:34:49 +0000 (15:34 -0800)]
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>
11 years agomesa: Don't allow DEPTH_STENCIL for 3D textures
Ian Romanick [Wed, 16 Jan 2013 23:34:26 +0000 (15:34 -0800)]
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>
11 years agoswrast: fix assorted bugs in software blit code
Brian Paul [Thu, 17 Jan 2013 15:59:13 +0000 (08:59 -0700)]
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>
11 years agoradeonsi: Actually keep track if we are using depth textures for samplers.
Michel Dänzer [Wed, 5 Dec 2012 17:35:22 +0000 (18:35 +0100)]
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>
11 years agoradeonsi: Fix Z24 texture formats.
Michel Dänzer [Tue, 15 Jan 2013 10:46:40 +0000 (11:46 +0100)]
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>
11 years agoradeonsi: Set SPI_SHADER_COL_FORMAT to what the pixel shader actually exports.
Michel Dänzer [Fri, 21 Dec 2012 14:39:26 +0000 (15:39 +0100)]
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>
11 years agoradeonsi: Use proper hardware format for stencil texturing.
Michel Dänzer [Fri, 11 Jan 2013 18:51:09 +0000 (19:51 +0100)]
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>
11 years agoradeonsi: Enable tiling for depth/stencil resources.
Michel Dänzer [Thu, 17 Jan 2013 15:31:58 +0000 (16:31 +0100)]
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>
11 years agoradeonsi: Consolidate calculation of tile mode index.
Michel Dänzer [Thu, 13 Dec 2012 13:32:56 +0000 (14:32 +0100)]
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>
11 years agonvc0: add support for accelerated video decoding through the dedicated engines
Maarten Lankhorst [Sun, 2 Dec 2012 11:07:35 +0000 (12:07 +0100)]
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.

11 years agoradeonsi: Pass texture type to sampling intrinsics.
Michel Dänzer [Fri, 30 Nov 2012 10:38:24 +0000 (11:38 +0100)]
radeonsi: Pass texture type to sampling intrinsics.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agonvc0: add space checks to clear functions
Maarten Lankhorst [Thu, 17 Jan 2013 11:35:38 +0000 (12:35 +0100)]
nvc0: add space checks to clear functions

Thanks to calim for helping me find and fix the issue.

11 years agonv50: add space checks to clear functions, and respect depth
Maarten Lankhorst [Thu, 17 Jan 2013 11:33:34 +0000 (12:33 +0100)]
nv50: add space checks to clear functions, and respect depth

Thanks to calim for helping me find and fix the issue.

11 years agost/mesa: a couple fixes for st_BlitFramebuffer()
Brian Paul [Wed, 16 Jan 2013 15:41:01 +0000 (08:41 -0700)]
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>
11 years agost/mesa: simplify some src/dst surface setup in BlitFramebuffer
Brian Paul [Wed, 16 Jan 2013 15:47:55 +0000 (08:47 -0700)]
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>
11 years agometa: add 'f' suffix to floats to silence some MSVC warnings
Brian Paul [Wed, 16 Jan 2013 15:25:43 +0000 (08:25 -0700)]
meta: add 'f' suffix to floats to silence some MSVC warnings

11 years agomesa: add missing ASSERT_OUTSIDE_BEGIN_END() in _mesa_GetInternalformativ()
Brian Paul [Wed, 16 Jan 2013 15:19:13 +0000 (08:19 -0700)]
mesa: add missing ASSERT_OUTSIDE_BEGIN_END() in _mesa_GetInternalformativ()

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agobuild: Make src/gtest before src/mesa
Matt Turner [Mon, 14 Jan 2013 22:38:01 +0000 (14:38 -0800)]
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.

11 years agoFix mapi code generator for out-of-tree build
Jon TURNEY [Mon, 14 Jan 2013 15:35:05 +0000 (15:35 +0000)]
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>
11 years agonvc0: Add support for video buffer
Maarten Lankhorst [Sun, 2 Dec 2012 11:07:35 +0000 (12:07 +0100)]
nvc0: Add support for video buffer

11 years agovl/video_buffer: fix up surface ordering for the interlaced case
Maarten Lankhorst [Tue, 18 Dec 2012 12:17:22 +0000 (13:17 +0100)]
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>
11 years agovl/compositor: fix weave shader bugs
Maarten Lankhorst [Tue, 18 Dec 2012 12:13:01 +0000 (13:13 +0100)]
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>
11 years agomesa: add new formatquery.c file to SConscript file to fix build
Brian Paul [Wed, 16 Jan 2013 15:18:33 +0000 (08:18 -0700)]
mesa: add new formatquery.c file to SConscript file to fix build

11 years agoradeonsi/vdpau: remove nonsense state tracker dep
Christian König [Wed, 16 Jan 2013 14:15:38 +0000 (15:15 +0100)]
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>
11 years agoglapi: Remove duplicate ARB_base_instance from gl_API.xml
Ian Romanick [Wed, 16 Jan 2013 07:20:02 +0000 (23:20 -0800)]
glapi: Remove duplicate ARB_base_instance from gl_API.xml

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agointel: Enable GL_ARB_internalformat_query
Ian Romanick [Sat, 1 Dec 2012 19:06:31 +0000 (11:06 -0800)]
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>
11 years agomesa: Add driver method to determine the possible sample counts
Ian Romanick [Sat, 1 Dec 2012 19:05:00 +0000 (11:05 -0800)]
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>
11 years agomesa: Add dispatch and extension XML for GL_ARB_internalformat_query
Ian Romanick [Fri, 30 Nov 2012 20:43:58 +0000 (12:43 -0800)]
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>
11 years agomesa: Add extension tracking bit for GL_ARB_internalformat_query
Ian Romanick [Fri, 30 Nov 2012 20:42:59 +0000 (12:42 -0800)]
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>
11 years agomesa: Add skeleton implementation of glGetInternalformativ
Ian Romanick [Fri, 30 Nov 2012 20:41:50 +0000 (12:41 -0800)]
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>
11 years agometa: Move loop variable declaration outside for loop.
Vinson Lee [Wed, 16 Jan 2013 02:03:25 +0000 (18:03 -0800)]
meta: Move loop variable declaration outside for loop.

Fixes build with MSVC.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
11 years agomesa: move declarations before code to fix MSVC build
Brian Paul [Wed, 16 Jan 2013 00:02:30 +0000 (17:02 -0700)]
mesa: move declarations before code to fix MSVC build

11 years agomesa: Round float param in glTexparameterf() to nearest integer
Anuj Phogat [Mon, 7 Jan 2013 05:00:11 +0000 (10:30 +0530)]
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>
11 years agomesa: Add support to allow blitting to multiple color draw buffers
Anuj Phogat [Wed, 12 Dec 2012 04:17:47 +0000 (20:17 -0800)]
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>
11 years agomesa: Add error checking in _mesa_BlitFramebuffer() for MRTs
Anuj Phogat [Wed, 12 Dec 2012 04:17:47 +0000 (20:17 -0800)]
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>
11 years agomesa: Fix GL error generation in _mesa_GetFramebufferAttachmentParameteriv()
Anuj Phogat [Wed, 12 Dec 2012 04:08:13 +0000 (20:08 -0800)]
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>
11 years agointel: Support blitting to multiple color draw buffers
Anuj Phogat [Wed, 12 Dec 2012 03:36:05 +0000 (19:36 -0800)]
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>