Re: [Mesa-dev] [PATCH 2/9] i965/vec4: Initialize LOD to 0.0f.

2015-10-19 Thread Matt Turner
On Mon, Oct 19, 2015 at 9:09 PM, Matt Turner wrote: > We implement textureQueryLevels (which takes no arguments, save the > sampler) using the resinfo message (which takes an argument of LOD). > Without initializing it, we'd generate a MOV from the null register to > load the LOD argument. > --- >

[Mesa-dev] [PATCH 8/9] i965: Add const to brw_compact_inst_bits.

2015-10-19 Thread Matt Turner
--- src/mesa/drivers/dri/i965/brw_inst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h index 819ce59..524a4fb 100644 --- a/src/mesa/drivers/dri/i965/brw_inst.h +++ b/src/mesa/drivers/dri/i965/brw

[Mesa-dev] [PATCH 5/9] i965: Prepare for next commit by adding more whitespace.

2015-10-19 Thread Matt Turner
We're going to add a field with a longer name that wouldn't align with the rest. --- src/mesa/drivers/dri/i965/brw_inst.h | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h

[Mesa-dev] [PATCH 4/9] i965: Compact acc_wr_control only on Gen6+.

2015-10-19 Thread Matt Turner
It only exists on Gen6+, and the next patches will add compaction support for the (unused) field in the same location on earlier platforms. --- src/mesa/drivers/dri/i965/brw_eu_compact.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_eu

[Mesa-dev] [PATCH 9/9] i965: Mark compacted 3-src instructions as Gen8+.

2015-10-19 Thread Matt Turner
--- src/mesa/drivers/dri/i965/brw_inst.h | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h index 524a4fb..db05a8a 100644 --- a/src/mesa/drivers/dri/i965/brw_inst.h +++

[Mesa-dev] [PATCH 1/9] i965/vec4: Don't emit MOVs for unused URB slots.

2015-10-19 Thread Matt Turner
Otherwise we'd emit a MOV from the null register (which isn't allowed). Helps 24 programs in shader-db (the geometry shaders in GSCloth): instructions in affected programs: 302 -> 262 (-13.25%) --- src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp| 18 +- src/mesa/drivers/dr

[Mesa-dev] [PATCH 2/9] i965/vec4: Initialize LOD to 0.0f.

2015-10-19 Thread Matt Turner
We implement textureQueryLevels (which takes no arguments, save the sampler) using the resinfo message (which takes an argument of LOD). Without initializing it, we'd generate a MOV from the null register to load the LOD argument. --- src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 2 +- 1 file chang

[Mesa-dev] [PATCH 6/9] i965: Add devinfo->gen assertions for acc_wr_control.

2015-10-19 Thread Matt Turner
... and for flag_subreg_nr since it's right near by. --- src/mesa/drivers/dri/i965/brw_inst.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_inst.h b/src/mesa/drivers/dri/i965/brw_inst.h index 088143c..cb3d7e6 100644 --- a/src/mesa/drivers/

[Mesa-dev] [PATCH 7/9] i965: Add mask_control_ex field and handle it in compaction.

2015-10-19 Thread Matt Turner
Documentation is sparse, but it appears to have existed on G45 and ILK as a second bit extension of the mask_control field. Setting the pair of bits to 0b11 enables "NoCMask". --- src/mesa/drivers/dri/i965/brw_eu_compact.c | 4 src/mesa/drivers/dri/i965/brw_inst.h | 2 ++ 2 files change

[Mesa-dev] [PATCH 3/9] i965: Add devinfo parameter to brw_compact_inst_* funcs.

2015-10-19 Thread Matt Turner
The next commit will add assertions dependent on devinfo->gen. Use compact()/uncompact() macros where possible, like the 3-src code does. --- src/mesa/drivers/dri/i965/brw_eu_compact.c | 118 ++--- src/mesa/drivers/dri/i965/brw_inst.h | 30 +--- 2 files changed,

Re: [Mesa-dev] [RFCv0 0/8] gallium: add support for NIR as alternate IR

2015-10-19 Thread Rob Clark
On Mon, Oct 19, 2015 at 8:53 PM, Marek Olšák wrote: > Yes, drivers need to "dup" tokens if they want to keep them. Their > lifetime is the create function and that's it. st/mesa only keeps the > tokens for vertex shaders, because it needs for emulating some > features with the Draw module. It is

Re: [Mesa-dev] [PATCH 1/3] gallium: add PIPE_CAP_SHAREABLE_SHADERS

2015-10-19 Thread Marek Olšák
On Tue, Oct 20, 2015 at 1:41 AM, Rob Clark wrote: > On Mon, Oct 19, 2015 at 7:07 PM, Marek Olšák wrote: >> On Mon, Oct 19, 2015 at 11:52 PM, Rob Clark wrote: >>> On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: From: Marek Olšák I'll let drivers figure out how to do it.

Re: [Mesa-dev] [RFCv0 0/8] gallium: add support for NIR as alternate IR

2015-10-19 Thread Marek Olšák
Yes, drivers need to "dup" tokens if they want to keep them. Their lifetime is the create function and that's it. st/mesa only keeps the tokens for vertex shaders, because it needs for emulating some features with the Draw module. I think there are 2 groups of people: - one would be okay with nuki

Re: [Mesa-dev] [PATCH 2/4] gallium: add new properties for clip and cull distance usage

2015-10-19 Thread Roland Scheidegger
Am 20.10.2015 um 01:26 schrieb Marek Olšák: > On Tue, Oct 20, 2015 at 12:03 AM, Roland Scheidegger > wrote: >> Am 19.10.2015 um 23:44 schrieb Marek Olšák: >>> On Mon, Oct 19, 2015 at 11:31 PM, Roland Scheidegger >>> wrote: Yes, but I still don't see much change from getting this informatio

Re: [Mesa-dev] [PATCH 1/3] gallium: add PIPE_CAP_SHAREABLE_SHADERS

2015-10-19 Thread Rob Clark
On Mon, Oct 19, 2015 at 7:07 PM, Marek Olšák wrote: > On Mon, Oct 19, 2015 at 11:52 PM, Rob Clark wrote: >> On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: >>> From: Marek Olšák >>> >>> I'll let drivers figure out how to do it. >>> --- >>> src/gallium/docs/source/screen.rst |

Re: [Mesa-dev] [PATCH 2/4] gallium: add new properties for clip and cull distance usage

2015-10-19 Thread Marek Olšák
On Tue, Oct 20, 2015 at 12:03 AM, Roland Scheidegger wrote: > Am 19.10.2015 um 23:44 schrieb Marek Olšák: >> On Mon, Oct 19, 2015 at 11:31 PM, Roland Scheidegger >> wrote: >>> Yes, but I still don't see much change from getting this information >>> from the property rather than how tgsi_scan doe

Re: [Mesa-dev] [PATCH 2/3] st/mesa: decouple shaders from contexts if they are shareable

2015-10-19 Thread Marek Olšák
On Mon, Oct 19, 2015 at 11:47 PM, Rob Clark wrote: > On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: >> From: Marek Olšák >> >> --- >> src/mesa/state_tracker/st_atom_shader.c | 10 +- >> src/mesa/state_tracker/st_cb_bitmap.c | 2 +- >> src/mesa/state_tracker/st_cb_drawpixels.

Re: [Mesa-dev] [PATCH] mesa: Improve handling of GL_BGRA format in es3 format_and_type checks

2015-10-19 Thread Jason Ekstrand
On Mon, Oct 19, 2015 at 2:52 PM, Eduardo Lima Mitev wrote: > On 10/19/2015 11:49 PM, Eduardo Lima Mitev wrote: >> On 10/16/2015 06:33 AM, Jason Ekstrand wrote: >>> On Wed, Oct 14, 2015 at 6:56 PM, Eduardo Lima Mitev >>> wrote: We recently added support for GL_BGRA internal format when valid

Re: [Mesa-dev] [PATCH 1/3] gallium: add PIPE_CAP_SHAREABLE_SHADERS

2015-10-19 Thread Marek Olšák
On Mon, Oct 19, 2015 at 11:52 PM, Rob Clark wrote: > On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: >> From: Marek Olšák >> >> I'll let drivers figure out how to do it. >> --- >> src/gallium/docs/source/screen.rst | 2 ++ >> src/gallium/drivers/freedreno/freedreno_screen.c |

Re: [Mesa-dev] [RFC 01/21] mesa/texcompress: Restrict FXT1 format to desktop GL subset

2015-10-19 Thread Nanley Chery
On Mon, Oct 19, 2015 at 4:02 PM, Ilia Mirkin wrote: > On Mon, Oct 19, 2015 at 6:58 PM, Nanley Chery > wrote: > > > > > > On Mon, Oct 19, 2015 at 3:47 PM, Ilia Mirkin > wrote: > >> > >> On Mon, Oct 19, 2015 at 6:36 PM, Nanley Chery > >> wrote: > >> > From: Nanley Chery > >> > > >> > In agreeme

Re: [Mesa-dev] [RFC 01/21] mesa/texcompress: Restrict FXT1 format to desktop GL subset

2015-10-19 Thread Ilia Mirkin
On Mon, Oct 19, 2015 at 6:58 PM, Nanley Chery wrote: > > > On Mon, Oct 19, 2015 at 3:47 PM, Ilia Mirkin wrote: >> >> On Mon, Oct 19, 2015 at 6:36 PM, Nanley Chery >> wrote: >> > From: Nanley Chery >> > >> > In agreement with the extension spec and commit >> > dd0eb004874645135b9aaac3ebbd0aaf274

Re: [Mesa-dev] [RFC 01/21] mesa/texcompress: Restrict FXT1 format to desktop GL subset

2015-10-19 Thread Nanley Chery
On Mon, Oct 19, 2015 at 3:47 PM, Ilia Mirkin wrote: > On Mon, Oct 19, 2015 at 6:36 PM, Nanley Chery > wrote: > > From: Nanley Chery > > > > In agreement with the extension spec and commit > > dd0eb004874645135b9aaac3ebbd0aaf274079ea, filter FXT1 formats to the > > desktop GL profiles. Now we no

Re: [Mesa-dev] [PATCH 4/7] st/va: implement VaCreateSurfaces2 and VaQuerySurfaceAttributes

2015-10-19 Thread Julien Isorce
On 19 October 2015 at 16:55, Emil Velikov wrote: > On 17 October 2015 at 00:14, Julien Isorce > wrote: > > Inspired from > http://cgit.freedesktop.org/vaapi/intel-driver/tree/src/i965_drv_video.c > > > Please mention the actual usecase here and/or how you've tested this. > Thx for the review.

Re: [Mesa-dev] [PATCH 3/3] st/mesa: create shaders which have only one variant immediatelly

2015-10-19 Thread Ilia Mirkin
On Mon, Oct 19, 2015 at 6:46 PM, Marek Olšák wrote: > On Mon, Oct 19, 2015 at 9:53 PM, Ilia Mirkin wrote: >> Actually this just occurred to me -- you should only check >> st->can_force_persamp_interp if PIPE_CAP_SAMPLE_SHADING is enabled. >> Otherwise it should be unreachable. And it's a bit weir

Re: [Mesa-dev] [RFC 01/21] mesa/texcompress: Restrict FXT1 format to desktop GL subset

2015-10-19 Thread Ilia Mirkin
On Mon, Oct 19, 2015 at 6:36 PM, Nanley Chery wrote: > From: Nanley Chery > > In agreement with the extension spec and commit > dd0eb004874645135b9aaac3ebbd0aaf274079ea, filter FXT1 formats to the > desktop GL profiles. Now we no longer advertise such formats as supported > in an ES context and t

Re: [Mesa-dev] [PATCH 3/3] st/mesa: create shaders which have only one variant immediatelly

2015-10-19 Thread Marek Olšák
On Mon, Oct 19, 2015 at 9:53 PM, Ilia Mirkin wrote: > Actually this just occurred to me -- you should only check > st->can_force_persamp_interp if PIPE_CAP_SAMPLE_SHADING is enabled. > Otherwise it should be unreachable. And it's a bit weird for a driver > to say "sample shading = no, force persam

[Mesa-dev] [RFC 20/21] mesa: Remove gl_extensions::dummy

2015-10-19 Thread Nanley Chery
From: Nanley Chery This variable existed to provide an unsigned error value for name_to_offset(). Since o(extension_sentinel) is also a valid unsigned error value, save space and replace this mysterious variable with a less mysterious one (extension_sentinel). Signed-off-by: Nanley Chery --- s

[Mesa-dev] [RFC 16/21] mesa: Fix ARB_texture_compression_bptc functionality leaks

2015-10-19 Thread Nanley Chery
From: Nanley Chery Stop leaks into the following contexts: * GLES in _mesa_target_can_be_compressed(). * Pre-3.1 GL legacy versions in all uses. The extension spec lists OpenGL 3.1 as required, so update the extension table accordingly. Signed-off-by: Nanley Chery --- src/mesa/main/exte

[Mesa-dev] [RFC 21/21] mesa/extensions: Declare _mesa_init_extensions() static inline

2015-10-19 Thread Nanley Chery
From: Nanley Chery Avoid the function call overhead for this one-liner. Signed-off-by: Nanley Chery --- src/mesa/main/extensions.c | 14 -- src/mesa/main/extensions.h | 16 ++-- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/mesa/main/extensions.c

[Mesa-dev] [RFC 15/21] mesa: Fix EXT_texture_sRGB functionality leaks

2015-10-19 Thread Nanley Chery
From: Nanley Chery Stop leaks into the following contexts: * GLES in _mesa_base_tex_format() and lookup_view_class(). * Pre-1.1 GL legacy contexts in all uses. Stop allowing compressed sRGB formats as valid formats in GLES3 contexts. I realized this was happening when CTS failures occured

[Mesa-dev] [RFC 19/21] mesa: Replace gl_extensions::EXT_texture3D with ::dummy_true

2015-10-19 Thread Nanley Chery
From: Nanley Chery Mesa unconditionally sets this driver flag to true in _mesa_init_extensions(). There is therefore no need for the driver to communicate support for this extension. Replace the driver capability flag with ::dummy_true. Signed-off-by: Nanley Chery --- src/glsl/glsl_parser_extr

[Mesa-dev] [RFC 18/21] mesa/extensions: Remove extra memsets on gl_extensions

2015-10-19 Thread Nanley Chery
From: Nanley Chery Aside from those modified in this commit, all gl_extensions structs are zero-initialized by default. There is therefore no need to memset the structs to 0. Also, remove the open-coded memset in _mesa_init_extensions(). Signed-off-by: Nanley Chery --- src/mesa/main/extensions

[Mesa-dev] [RFC 09/21] mesa: Generate a helper function for each extension

2015-10-19 Thread Nanley Chery
From: Nanley Chery Generate functions which determine if an extension is supported in the current context. Initially, enums were going to be explicitly used with _mesa_extension_supported(). The idea to embed the function and enums into generated helper functions was suggested by Kristian Høgsber

[Mesa-dev] [RFC 11/21] mesa: In helpers, only check driver capability for meta

2015-10-19 Thread Nanley Chery
From: Nanley Chery Make constext API and version checks done by the helper functions pass unconditionally while meta is in progress. This transparently makes extension checks solely dependent on struct gl_extensions while in meta. Signed-off-by: Nanley Chery --- src/mesa/drivers/common/meta.c

[Mesa-dev] [RFC 14/21] mesa: Fix ASTC extension functionality leak into GLES 1

2015-10-19 Thread Nanley Chery
From: Nanley Chery Stop a leak of ASTC functionality into GLES 1 contexts. Signed-off-by: Nanley Chery --- src/mesa/main/glformats.c | 4 ++-- src/mesa/main/teximage.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformat

[Mesa-dev] [RFC 10/21] mesa: Remove equality check in helper functions

2015-10-19 Thread Nanley Chery
From: Nanley Chery Since the version numbers being compared are integral and we don't ever expect gl_context::Version to be equal to 0, subtract 1 from the rhs of the equation and perform the optimization of removing the equality check. Signed-off-by: Nanley Chery --- src/mesa/main/extensions.

[Mesa-dev] [RFC 08/21] mesa/extensions: Replace extension::api_set with ::version

2015-10-19 Thread Nanley Chery
From: Nanley Chery The api_set field has no users outside of _mesa_extension_supported(). Remove it and allow the version field to take its place. The brunt of the transformation was performed with the following vim commands: s/\(GL [^,]\+\),\s*\d*,\s*\d*\(,\s*\d*\)\(,\s*\d*\)/\1, GLL, GLC\2\3/g

[Mesa-dev] [RFC 17/21] mesa: Fix ARB_ES3_compatibility functionality leaks

2015-10-19 Thread Nanley Chery
From: Nanley Chery Stop leaks into GLES1/2 and pre-3.3 GL contexts in all uses. The extension spec lists OpenGL 3.3 as one of the requirements, so update the extension table accordingly. v2. Require 3.3 for GL legacy contexts as well (Chad). Signed-off-by: Nanley Chery --- src/mesa/main/enab

[Mesa-dev] [RFC 12/21] mesa: Fix 3DFX_texture_compression_FXT1 funtionality leaks

2015-10-19 Thread Nanley Chery
From: Nanley Chery Stop leaks into the following contexts: * GLES in _mesa_get_compressed_formats(). * GL legacy 1.0 in all uses. The extension spec lists OpenGL 1.1 as required, so update the extension table accordingly. Signed-off-by: Nanley Chery --- src/mesa/main/extensions_table.h

[Mesa-dev] [RFC 13/21] mesa: Fix EXT_texture_compression_s3tc functionality leaks

2015-10-19 Thread Nanley Chery
From: Nanley Chery Stop leaks into the following contexts: * GLES 1 in _mesa_get_compressed_formats() and lookup_view_class(). * GL legacy 1.0 in all uses. The extension spec lists 1.1 as required for OpenGL and Rev 1.6 of the extension adds GLES 2.0.25 and 3.0.2 dependencies, so update th

Re: [Mesa-dev] [PATCH 1/7] nvc0: fix crash when nv50_miptree_from_handle fails

2015-10-19 Thread Julien Isorce
Thx for the review. I experienced the crash when testing patch 5/7 of this patch series, around "resource = pscreen->resource_from_handle" in the new vaCreateSurface2 function. Julien On 19 October 2015 at 16:59, Emil Velikov wrote: > On 17 October 2015 at 00:14, Julien Isorce > wrote: > > Sign

[Mesa-dev] [RFC 06/21] mesa/extensions: Create _mesa_extension_supported()

2015-10-19 Thread Nanley Chery
From: Nanley Chery Create a function which determines if an extension is supported in the current context. Signed-off-by: Nanley Chery --- src/mesa/main/extensions.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c i

[Mesa-dev] [RFC 05/21] mesa/extensions: Add extension::version

2015-10-19 Thread Nanley Chery
From: Nanley Chery Enable limiting advertised extension support by context version with finer granularity. GLuint is chosen over smaller datatypes because, when this field is eventually used, usage of this datatype provides the smallest .text size of the compiled library. Signed-off-by: Nanley C

[Mesa-dev] [RFC 00/21] Extensions Rework

2015-10-19 Thread Nanley Chery
From: Nanley Chery Summary: This series fixes 26 dEQP tests with prefix: dEQP-GLES2.functional.negative_api.texture.compressedteximage2d* and prevents similar bugs from occuring in the future. The bug fix that originated from using the helper functions (mentioned below) is split out for easy

[Mesa-dev] [RFC 01/21] mesa/texcompress: Restrict FXT1 format to desktop GL subset

2015-10-19 Thread Nanley Chery
From: Nanley Chery In agreement with the extension spec and commit dd0eb004874645135b9aaac3ebbd0aaf274079ea, filter FXT1 formats to the desktop GL profiles. Now we no longer advertise such formats as supported in an ES context and then throw an INVALID_ENUM error when the client tries to use such

[Mesa-dev] [RFC 07/21] mesa/extensions: Use _mesa_extension_supported()

2015-10-19 Thread Nanley Chery
From: Nanley Chery Replace open-coded checks for extension support with _mesa_extension_supported(). Signed-off-by: Nanley Chery --- src/mesa/main/extensions.c | 54 src/mesa/main/extensions_table.h | 6 ++--- 2 files changed, 14 insertions(+), 4

[Mesa-dev] [RFC 03/21] mesa/extensions: Wrap array entries in macros

2015-10-19 Thread Nanley Chery
From: Nanley Chery Now that we're using macros, remove the redundant text from each entry. Remove comments between the entries to make editing easier and separate the sections with blank lines. Structure the EXT macros in a way that helps reviewers verify that no meaning has been altered. Signe

[Mesa-dev] [RFC 04/21] mesa/extensions: Move entries entries to seperate file

2015-10-19 Thread Nanley Chery
From: Nanley Chery With this infrastructure set in place, we can now reuse the entries to generate useful code. Signed-off-by: Nanley Chery --- src/mesa/main/extensions.c | 321 +-- src/mesa/main/extensions_table.h | 320 +++

[Mesa-dev] [RFC 02/21] mesa/extensions: Remove array sentinel

2015-10-19 Thread Nanley Chery
From: Nanley Chery Simplify future updates to the extension struct array by removing the sentinel. Signed-off-by: Nanley Chery --- src/mesa/main/extensions.c | 43 +-- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/mesa/main/extensio

Re: [Mesa-dev] [PATCH 2/4] gallium: add new properties for clip and cull distance usage

2015-10-19 Thread Roland Scheidegger
Am 19.10.2015 um 23:44 schrieb Marek Olšák: > On Mon, Oct 19, 2015 at 11:31 PM, Roland Scheidegger > wrote: >> Yes, but I still don't see much change from getting this information >> from the property rather than how tgsi_scan does it now, which is by >> just using the usage mask from the output

Re: [Mesa-dev] [PATCH 1/3] gallium: add PIPE_CAP_SHAREABLE_SHADERS

2015-10-19 Thread Rob Clark
On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: > From: Marek Olšák > > I'll let drivers figure out how to do it. > --- > src/gallium/docs/source/screen.rst | 2 ++ > src/gallium/drivers/freedreno/freedreno_screen.c | 1 + > src/gallium/drivers/i915/i915_screen.c | 1

Re: [Mesa-dev] [PATCH] mesa: Improve handling of GL_BGRA format in es3 format_and_type checks

2015-10-19 Thread Eduardo Lima Mitev
On 10/19/2015 11:49 PM, Eduardo Lima Mitev wrote: > On 10/16/2015 06:33 AM, Jason Ekstrand wrote: >> On Wed, Oct 14, 2015 at 6:56 PM, Eduardo Lima Mitev wrote: >>> We recently added support for GL_BGRA internal format when validating >>> combination of format+type+internal_format in Tex(Sub)ImageX

Re: [Mesa-dev] [PATCH] mesa: Improve handling of GL_BGRA format in es3 format_and_type checks

2015-10-19 Thread Eduardo Lima Mitev
On 10/16/2015 06:33 AM, Jason Ekstrand wrote: > On Wed, Oct 14, 2015 at 6:56 PM, Eduardo Lima Mitev wrote: >> We recently added support for GL_BGRA internal format when validating >> combination of format+type+internal_format in Tex(Sub)ImageXD calls >> (to fix https://bugs.freedesktop.org/show_bu

Re: [Mesa-dev] [PATCH 2/3] st/mesa: decouple shaders from contexts if they are shareable

2015-10-19 Thread Rob Clark
On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: > From: Marek Olšák > > --- > src/mesa/state_tracker/st_atom_shader.c | 10 +- > src/mesa/state_tracker/st_cb_bitmap.c | 2 +- > src/mesa/state_tracker/st_cb_drawpixels.c | 2 +- > src/mesa/state_tracker/st_context.c | 3

Re: [Mesa-dev] [PATCH 2/4] gallium: add new properties for clip and cull distance usage

2015-10-19 Thread Marek Olšák
On Mon, Oct 19, 2015 at 11:31 PM, Roland Scheidegger wrote: > Yes, but I still don't see much change from getting this information > from the property rather than how tgsi_scan does it now, which is by > just using the usage mask from the output declaration. So the writes > shouldn't have to be an

Re: [Mesa-dev] [PATCH 1/4] mesa: replace UsesClipDistance with ClipDistanceArraySize

2015-10-19 Thread Marek Olšák
On Sun, Oct 18, 2015 at 9:38 PM, Tobias Klausmann wrote: > > > On 18.10.2015 19:14, Marek Olšák wrote: >> >> From: Marek Olšák >> >> This is more practical and needed by gallium. >> --- >> src/glsl/linker.cpp| 33 >> +++-- >> src/glsl/nir/glsl_to_nir

Re: [Mesa-dev] [PATCH 2/4] gallium: add new properties for clip and cull distance usage

2015-10-19 Thread Roland Scheidegger
Yes, but I still don't see much change from getting this information from the property rather than how tgsi_scan does it now, which is by just using the usage mask from the output declaration. So the writes shouldn't have to be analyzed. (There's also a slight change in patch 4/4, namely these outp

Re: [Mesa-dev] [PATCH 2/7] i965/gen9: Don't call tr_mode_vertical_texture_alignment() for 1D textures

2015-10-19 Thread Anuj Phogat
On Thu, Aug 13, 2015 at 2:51 PM, Anuj Phogat wrote: > Vertical alignment is not applicable to 1D textures. > > Signed-off-by: Anuj Phogat > --- > src/mesa/drivers/dri/i965/brw_tex_layout.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/mesa/drivers/dri/i965/brw_t

Re: [Mesa-dev] [PATCH 2/4] gallium: add new properties for clip and cull distance usage

2015-10-19 Thread Ilia Mirkin
AMD/NVIDIA hardware has a limit on how many cull/clip distances can be used at a time. On NVIDIA hw, there's a bitmask which you flip to determine if a distance is meant to clip or cull. It's nice not to have to analyze the output writes of a shader to tell how many clip distances are used. On Mon

Re: [Mesa-dev] [PATCH 2/4] gallium: add new properties for clip and cull distance usage

2015-10-19 Thread Roland Scheidegger
I don't have anything against new properties but why exactly is it needed? As far as I can tell, clip/cull distances aren't declared as arrays but just (up to two each) ordinary outputs, thus using the usage masks should work just fine. Or is this handled differently by some shader stages? Roland

Re: [Mesa-dev] [PATCH 2/3] i965/fs: Make emit_uniformize a no-op for immediates

2015-10-19 Thread Kristian Høgsberg
On Mon, Oct 19, 2015 at 4:19 AM, Francisco Jerez wrote: > Neil Roberts writes: > >> Just a thought, would it be better to move this check into the >> eliminate_find_live_channel optimisation? That way it could catch >> sources that become immediates through later optimisations. One problem >> wit

Re: [Mesa-dev] [PATCH 10/10] vbo: convert display list GL_LINE_LOOP prims to GL_LINE_STRIP

2015-10-19 Thread Sinclair Yeh
Acked-by: Sinclair Yeh On Fri, Oct 16, 2015 at 03:25:17PM -0600, Brian Paul wrote: > When a long GL_LINE_LOOP prim was split across primitives we drew > stray lines. See previous commit for details. > > This patch converts GL_LINE_LOOP prims into GL_LINE_STRIP prims so > that drivers don't ha

Re: [Mesa-dev] [RFCv0 2/8] gallium: refactor pipe_shader_state to support multiple IR's

2015-10-19 Thread Rob Clark
On Mon, Oct 19, 2015 at 4:24 PM, Roland Scheidegger wrote: > Am 19.10.2015 um 21:54 schrieb Rob Clark: >> The goal is to allow the pipe driver to request something other than >> TGSI, but detect whether what is getting is TGSI vs what it requested. >> The pipe drivers will always have to support T

Re: [Mesa-dev] [RFCv0 0/8] gallium: add support for NIR as alternate IR

2015-10-19 Thread Roland Scheidegger
The overall idea looks quite sane to me. Albeit obviously as you mentioned you'd really have to support all shader stages and deal with the variants (though there aren't many left). Roland Am 19.10.2015 um 21:54 schrieb Rob Clark: > From: Rob Clark > > (grr, resend to the right list..) > > Sti

Re: [Mesa-dev] [RFCv0 2/8] gallium: refactor pipe_shader_state to support multiple IR's

2015-10-19 Thread Roland Scheidegger
Am 19.10.2015 um 21:54 schrieb Rob Clark: > The goal is to allow the pipe driver to request something other than > TGSI, but detect whether what is getting is TGSI vs what it requested. > The pipe drivers will always have to support TGSI (and convert that into > whatever it is that they prefer), bu

Re: [Mesa-dev] [RFCv0 2/8] gallium: refactor pipe_shader_state to support multiple IR's

2015-10-19 Thread Roland Scheidegger
Am 19.10.2015 um 21:54 schrieb Rob Clark: > The goal is to allow the pipe driver to request something other than > TGSI, but detect whether what is getting is TGSI vs what it requested. > The pipe drivers will always have to support TGSI (and convert that into > whatever it is that they prefer), bu

[Mesa-dev] [RFCv0 0/8] gallium: add support for NIR as alternate IR

2015-10-19 Thread Rob Clark
From: Rob Clark (grr, resend to the right list..) Still quite rough around the edges, but now it's at the point of sorta- kinda-working-sometimes. So I guess time to get wider feedback. The initial goal is to figure out things that glsl_to_nir does differently from tgsi_to_nir, so we can fix t

Re: [Mesa-dev] [RFCv0 0/8] gallium: add support for NIR as alternate IR

2015-10-19 Thread Rob Clark
On Mon, Oct 19, 2015 at 3:51 PM, Ilia Mirkin wrote: > On Mon, Oct 19, 2015 at 3:47 PM, Rob Clark wrote: >> Also, there is some trivial shader variant handling in mesa st which >> would have to be ported to NIR. Or, perhaps, just somehow expose the >> shader key to the driver. (Currently most dr

[Mesa-dev] [RFCv0 5/8] freedreno/ir3: drop tokens arg

2015-10-19 Thread Rob Clark
We can get the tokens from variant->shader so drop the extra arg. This will make things easier to support either getting TGSI or NIR as input. --- src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gallium/dr

[Mesa-dev] [RFCv0 4/8] mesa/st: add support for NIR as possible driver IR

2015-10-19 Thread Rob Clark
--- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 223 - src/mesa/state_tracker/st_program.c| 43 +- 2 files changed, 260 insertions(+), 6 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp ind

[Mesa-dev] [RFCv0 7/8] freedreno/ir3: fix const_index handling for uniforms

2015-10-19 Thread Rob Clark
When coming directly from glsl_to_nir (rather than via TGSI where information about, for example, mat4's is lost), both const_index fields will be used (vs. tgsi_to_nir where the 2nd is always zero). For example: decl_var uniform INTERP_QUALIFIER_NONE mat4 ModelViewProjectionMatrix (0, 0) dec

[Mesa-dev] [PATCH 1/8] nir: add nir_var_all enum

2015-10-19 Thread Rob Clark
Otherwise, passing -1 gets you: error: invalid conversion from 'int' to 'nir_variable_mode' [-fpermissive] Signed-off-by: Rob Clark --- src/glsl/nir/nir.c | 4 src/glsl/nir/nir.h | 1 + src/glsl/nir/nir_lower_io.c | 2 +- src/mesa/drivers/dri/i96

[Mesa-dev] [RFCv0 6/8] freedreno/ir3: add support for NIR as preferred IR

2015-10-19 Thread Rob Clark
For now under debug flag, since only suitable for debugging/testing. --- src/gallium/drivers/freedreno/freedreno_screen.c | 5 +++- src/gallium/drivers/freedreno/freedreno_util.h | 1 + .../drivers/freedreno/ir3/ir3_compiler_nir.c | 15 ++- src/gallium/drivers/freedreno/ir3/i

[Mesa-dev] [RFCv0 8/8] freedreno/ir3: hack for mismatch on varying slots for glsl->tgsi->nir vs glsl->nir

2015-10-19 Thread Rob Clark
Complete hack just for debugging. It isn't intended that mixing and matching glsl->tgsi->nir vs glsl->nir between shader stages should actually work. --- src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/freedreno/ir

[Mesa-dev] [RFCv0 2/8] gallium: refactor pipe_shader_state to support multiple IR's

2015-10-19 Thread Rob Clark
The goal is to allow the pipe driver to request something other than TGSI, but detect whether what is getting is TGSI vs what it requested. The pipe drivers will always have to support TGSI (and convert that into whatever it is that they prefer), but in some cases we should be able to skip the TGSI

[Mesa-dev] [RFCv0 3/8] gallium: add NIR as a possible IR

2015-10-19 Thread Rob Clark
--- src/gallium/include/pipe/p_defines.h | 1 + src/gallium/include/pipe/p_state.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 29b0bfb..0dbc54c 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src

Re: [Mesa-dev] [PATCH 3/3] st/mesa: create shaders which have only one variant immediatelly

2015-10-19 Thread Ilia Mirkin
On Mon, Oct 19, 2015 at 2:31 PM, Ilia Mirkin wrote: > This series is Reviewed-by: Ilia Mirkin > provided that you run a couple of piglit tests through valgrind and > get no additional memory leaks. > > -ilia > > On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: >> From: Marek Olšák >> >> --

Re: [Mesa-dev] [PATCH 1/3] i965: Don't use message headers for typed/untyped reads

2015-10-19 Thread Kristian Høgsberg
On Mon, Oct 19, 2015 at 3:19 AM, Francisco Jerez wrote: > Hey Kristian, > > Kristian Høgsberg Kristensen writes: > >> We always set the mask to 0x, which is what it defaults to when no >> header is present. Let's drop the header instead. >> >> Signed-off-by: Kristian Høgsberg Kristensen >> -

Re: [Mesa-dev] [PATCH 5/7] i965/fs: move the fs_reg::smear() from get_timestamp() to the callers

2015-10-19 Thread Matt Turner
On Mon, Oct 19, 2015 at 11:55 AM, Connor Abbott wrote: > On Mon, Oct 19, 2015 at 2:29 PM, Matt Turner wrote: >> On Mon, Oct 19, 2015 at 7:45 AM, Emil Velikov >> wrote: >>> We're about to reuse get_timestamp() for the nir_intrinsic_shader_clock. >>> The in the latter the generalisation does not

Re: [Mesa-dev] [PATCH 5/7] i965/fs: move the fs_reg::smear() from get_timestamp() to the callers

2015-10-19 Thread Connor Abbott
On Mon, Oct 19, 2015 at 2:29 PM, Matt Turner wrote: > On Mon, Oct 19, 2015 at 7:45 AM, Emil Velikov > wrote: >> We're about to reuse get_timestamp() for the nir_intrinsic_shader_clock. >> The in the latter the generalisation does not apply, so move the smear() >> where needed. This also makes th

Re: [Mesa-dev] [PATCH 6/7] i965: Implement nir_intrinsic_shader_clock

2015-10-19 Thread Connor Abbott
On Mon, Oct 19, 2015 at 10:46 AM, Emil Velikov wrote: > Signed-off-by: Emil Velikov > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 9 + > src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 10 ++ > 2 files changed, 19 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/brw_

Re: [Mesa-dev] [PATCH 0/7] ARB_shader_clock support

2015-10-19 Thread Matt Turner
On Mon, Oct 19, 2015 at 7:45 AM, Emil Velikov wrote: > Hi all, > > This is a resent of the previous RFC series with a few minor changes > - fs_reg:;smear() has been moved out of get_timestamp() > - clock2x32ARB() has proper return value > - the nir intrinsic no longer claims to have a variable

Re: [Mesa-dev] [PATCH 6/7] i965: Implement nir_intrinsic_shader_clock

2015-10-19 Thread Matt Turner
On Mon, Oct 19, 2015 at 7:46 AM, Emil Velikov wrote: > Signed-off-by: Emil Velikov > --- > src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 9 + > src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 10 ++ > 2 files changed, 19 insertions(+) > > diff --git a/src/mesa/drivers/dri/i965/brw_f

Re: [Mesa-dev] [PATCH 3/3] st/mesa: create shaders which have only one variant immediatelly

2015-10-19 Thread Ilia Mirkin
This series is Reviewed-by: Ilia Mirkin provided that you run a couple of piglit tests through valgrind and get no additional memory leaks. -ilia On Sat, Oct 10, 2015 at 9:09 PM, Marek Olšák wrote: > From: Marek Olšák > > --- > src/mesa/state_tracker/st_cb_program.c | 5 +++-- > src/mesa/s

Re: [Mesa-dev] [PATCH 5/7] i965/fs: move the fs_reg::smear() from get_timestamp() to the callers

2015-10-19 Thread Matt Turner
On Mon, Oct 19, 2015 at 7:45 AM, Emil Velikov wrote: > We're about to reuse get_timestamp() for the nir_intrinsic_shader_clock. > The in the latter the generalisation does not apply, so move the smear() > where needed. This also makes the function analogous to the vec4 one. > > Signed-off-by: Emil

Re: [Mesa-dev] [PATCH 4/7] nir: add shader_clock intrinsic

2015-10-19 Thread Matt Turner
On Mon, Oct 19, 2015 at 7:45 AM, Emil Velikov wrote: > v2: Add flags and inline comment/description. > v3: None of the input/outputs are variables > > Signed-off-by: Emil Velikov > --- > src/glsl/nir/glsl_to_nir.cpp | 6 ++ > src/glsl/nir/nir_intrinsics.h | 8 > 2 files changed, 14

Re: [Mesa-dev] [RFC PATCH 00/40] Rework/consolidate the pipe-loader business

2015-10-19 Thread Emil Velikov
On 19 October 2015 at 17:07, Brian Paul wrote: > On 10/17/2015 04:57 PM, Emil Velikov wrote: >> >> Hi all, >> >> Here goes a series (which is slightly overdue), that reworks the >> target-helpers into a pipe-loader like interface. As such the >> state-tracker do not need to know that there is a di

[Mesa-dev] [PATCH v2] i965/vec4: track and use independently each flag channel

2015-10-19 Thread Alejandro Piñeiro
vec4_live_variables tracks now each flag channel independently, so vec4_dead_code_eliminate can update the writemask of null registers, based on which component are alive at the moment. This would allow vec4_cmod_propagation to optimize out several movs involving null registers. v2: added support

Re: [Mesa-dev] [PATCH 15/40] pipe-loader: rework the sw backend

2015-10-19 Thread Emil Velikov
On 19 October 2015 at 17:03, Brian Paul wrote: > On 10/17/2015 04:57 PM, Emil Velikov wrote: >> >> Move the winsys into the pipe-target, bla bla bla >> >> XXX: separate pipe-drivers are likely to be busted >> >> Signed-off-by: Emil Velikov >> --- >> src/gallium/auxiliary/pipe-loader/pipe_loader

[Mesa-dev] [PATCH v2 16/40] pipe-loader: teardown the winsys, if create_screen fails

2015-10-19 Thread Emil Velikov
i.e. plug some (hard to hit) memory leaks. v2: really teardown the winsys (it rebase fallout), per Brian. Signed-off-by: Emil Velikov --- src/gallium/auxiliary/pipe-loader/pipe_loader_sw.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/pipe-loader

Re: [Mesa-dev] [PATCH 6/7] st/va: add initial Video Post Processing support

2015-10-19 Thread Emil Velikov
On 19 October 2015 at 18:17, Ilia Mirkin wrote: > On Mon, Oct 19, 2015 at 1:10 PM, Emil Velikov > wrote: >> On 17 October 2015 at 00:14, Julien Isorce wrote: >>> if (!ctx) >>>return VA_STATUS_ERROR_INVALID_CONTEXT; >>> >>> - if (!(picture_width && picture_height)) >>> + is_vpp =

Re: [Mesa-dev] [PATCH 6/7] st/va: add initial Video Post Processing support

2015-10-19 Thread Ilia Mirkin
On Mon, Oct 19, 2015 at 1:10 PM, Emil Velikov wrote: > On 17 October 2015 at 00:14, Julien Isorce wrote: >> if (!ctx) >>return VA_STATUS_ERROR_INVALID_CONTEXT; >> >> - if (!(picture_width && picture_height)) >> + is_vpp = config_id == PIPE_VIDEO_PROFILE_UNKNOWN && >> + pictu

Re: [Mesa-dev] [PATCH 6/7] st/va: add initial Video Post Processing support

2015-10-19 Thread Emil Velikov
On 17 October 2015 at 00:14, Julien Isorce wrote: > Improve following functions to support VA_PROFILE_NONE profile (vpp): > vlVaQueryConfigProfiles > vlVaQueryConfigEntrypoints > vlVaCreateConfig > vlVaQueryConfigAttributes > > Add VADriverVTableVPP and improve following functions to support vpp:

Re: [Mesa-dev] MSVC, MinGW build break

2015-10-19 Thread Rob Clark
On Mon, Oct 19, 2015 at 10:02 AM, Jose Fonseca wrote: > On 17/10/15 17:44, Rob Clark wrote: >> >> On Sat, Oct 17, 2015 at 12:36 PM, Brian Paul wrote: >>> >>> On 10/17/2015 10:07 AM, Brian Paul wrote: On 10/17/2015 07:04 AM, Rob Clark wrote: > > > On Fri, Oct 16, 2015 at

Re: [Mesa-dev] [PATCH] i965: Query the actual GTT size for reporting total usuable GPU memory

2015-10-19 Thread Daniel Vetter
On Mon, Oct 19, 2015 at 12:08:41PM +0100, Chris Wilson wrote: > The amount of memory that the GPU can use in any single batch is the > amount of memory it can map into its page tables, that is the GTT size. > With per-process GTT (i.e. every context has its own set of page tables), > this value may

Re: [Mesa-dev] [PATCH 5/7] st/va: implement dmabuf import for VaCreateSurfaces2

2015-10-19 Thread Emil Velikov
On 17 October 2015 at 00:14, Julien Isorce wrote: > For now it is limited to RGBA, BGRA, RGBX, BGRX surfaces. > > Signed-off-by: Julien Isorce > --- > src/gallium/state_trackers/va/surface.c| 90 > +- > src/gallium/state_trackers/va/va_private.h | 1 + > 2 files

Re: [Mesa-dev] [PATCH 1/4] mesa: replace UsesClipDistance with ClipDistanceArraySize

2015-10-19 Thread Brian Paul
On 10/18/2015 11:14 AM, Marek Olšák wrote: From: Marek Olšák This is more practical and needed by gallium. --- src/glsl/linker.cpp| 33 +++-- src/glsl/nir/glsl_to_nir.cpp | 3 ++- src/mesa/drivers/dri/i965/brw_vs.c | 2 +- src/mesa/main/m

Re: [Mesa-dev] [PATCH 7/7] st/va: add headless support, i.e. VA_DISPLAY_DRM

2015-10-19 Thread Emil Velikov
On 17 October 2015 at 00:14, Julien Isorce wrote: > This patch allows to use gallium vaapi without requiring > a X server running for your second graphic card. > I've sent a lengthy series which should mitigate the need of some hunks. > Signed-off-by: Julien Isorce > --- > src/gallium/state_tra

Re: [Mesa-dev] [RFC PATCH 00/40] Rework/consolidate the pipe-loader business

2015-10-19 Thread Brian Paul
On 10/17/2015 04:57 PM, Emil Velikov wrote: Hi all, Here goes a series (which is slightly overdue), that reworks the target-helpers into a pipe-loader like interface. As such the state-tracker do not need to know that there is a difference between the two and it only uses the pipe-loader interfa

Re: [Mesa-dev] [PATCH 3/7] st/va: in VaPutImage only destroy previous buffer if pipe->create_video_buffer succeeds

2015-10-19 Thread Emil Velikov
On 17 October 2015 at 00:14, Julien Isorce wrote: > If formats are not the same it seems to re-create the video > buffer with the right format. > But if the creation of this new video buffer fails the surface > loose its video buffer. > Let's just destroy the previous buffer on success. > The form

  1   2   >