[Mesa-dev] [PATCH] i965: correct alignment units for 2D compressed textures on Skylake

2015-06-10 Thread Nanley Chery
From: Nanley Chery On Gen9+, vertical and horizontal alignment values for compressed textures are equal to the pre-Gen9 value squared. Each miplevel must be aligned to this value. Signed-off-by: Nanley Chery --- This fixes an FXT1 Piglit test regression and shows no failures on Jenkins

Re: [Mesa-dev] [PATCH] i965: Fix aligning to the block size in intel_miptree_copy_slice

2015-06-12 Thread Nanley Chery
Hey Neil, While this patch does fix FXT1, it also regresses 21 other Piglit tests on SKL. - Nanley On Thu, Jun 11, 2015 at 8:59 AM, Neil Roberts wrote: > This function was trying to align the width and height to a multiple > of the block size for compressed textures. It was using align_w/h as a

Re: [Mesa-dev] [PATCH] i965: Fix aligning to the block size in intel_miptree_copy_slice

2015-06-12 Thread Nanley Chery
results from the first file with any that appear in the > second file. Once I do that then there are no regressions and only the > two FXT1 tests appear in the fixes. > > It might be interesting to see if you can run some of the regressing > tests by hand after a reboot to s

Re: [Mesa-dev] [PATCH] i965: correct alignment units for 2D compressed textures on Skylake

2015-06-12 Thread Nanley Chery
On Thu, Jun 11, 2015 at 8:56 AM, Neil Roberts wrote: > Hi Nanley, > > Could you explain the reasoning behind this patch? I can't find any > mention of needing to align to the square of the block size in the docs. > Sure. I came to the conclusion that alignment must be squared due to 3 parts of the

Re: [Mesa-dev] [PATCH] i965: correct alignment units for 2D compressed textures on Skylake

2015-06-12 Thread Nanley Chery
On Thu, Jun 11, 2015 at 9:04 AM, Ben Widawsky wrote: > On Wed, Jun 10, 2015 at 05:01:44PM -0700, Nanley Chery wrote: >> From: Nanley Chery >> >> On Gen9+, vertical and horizontal alignment values for compressed textures >> are >> equal to the pre-Gen9 val

Re: [Mesa-dev] [PATCH] i965: Fix aligning to the block size in intel_miptree_copy_slice

2015-06-13 Thread Nanley Chery
My test results haven't been consistent and some of the failures don't seem to match what's going on in this patch. I'll have to look into improving my testing methods on SKL, but that's a separate issue. This patch makes sense.

Re: [Mesa-dev] [PATCH] i965: correct alignment units for 2D compressed textures on Skylake

2015-06-13 Thread Nanley Chery
>>> >>> src/mesa/drivers/dri/i965/brw_tex_layout.c | 20 >>> 1 file changed, 8 insertions(+), 12 deletions(-) >>> >>> diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c >>> b/src/mesa/drivers/dri/i965/brw_tex_layout.c >>> index 312a887..dffc699 100644 >>> --- a/src/mesa/

Re: [Mesa-dev] [PATCH] i965: correct alignment units for 2D compressed textures on Skylake

2015-06-15 Thread Nanley Chery
Although most of the patch is incorrect, the following change is still necessary isn't it? if (mt->compressed) { mip1_width = ALIGN(minify(mt->physical_width0, 1), mt->align_w) + - ALIGN(minify(mt->physical_width0, 2), bw); + ALIGN(minify(mt->physical_widt

Re: [Mesa-dev] [PATCH] i965: correct alignment units for 2D compressed textures on Skylake

2015-06-17 Thread Nanley Chery
#x27;t exempt LOD-0 from being aligned by the alignment term, right? Thanks, Nanley On Mon, Jun 15, 2015 at 10:45 AM, Neil Roberts wrote: > Nanley Chery writes: > >> Although most of the patch is incorrect, the following change is still >> necessary isn't it? >

Re: [Mesa-dev] [RFC v2 10/15] i965: enable ASTC support for Skylake

2015-06-17 Thread Nanley Chery
I agree. This will be fixed in the next revision. On Tue, Jun 9, 2015 at 12:03 PM, Ian Romanick wrote: > Should this patch be last? It looks like later patches fix bugs. > > On 06/01/2015 10:13 AM, Nanley Chery wrote: >> From: Nanley Chery >> >> v2: remove O

Re: [Mesa-dev] [RFC v2 14/15] i965: refactor miptree alignment calculation code

2015-06-18 Thread Nanley Chery
intel_horizontal_texture_alignment_unit are called from within the top-level (and only within it), it would be assumed that the references also apply to these functions. On Tue, Jun 9, 2015 at 12:13 PM, Ian Romanick wrote: > On 06/01/2015 10:13 AM, Nanley Chery wrote: >> From: Nan

[Mesa-dev] [PATCH v3 06/18] mesa/glformats: recognize ASTC formats as compressed

2015-06-22 Thread Nanley Chery
From: Nanley Chery Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- src/mesa/main/glformats.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index ac69fab..e7363b5 100644 --- a/src/mesa/main

[Mesa-dev] [PATCH v3 03/18] mesa: disable online compression for ASTC formats

2015-06-22 Thread Nanley Chery
From: Nanley Chery Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- src/mesa/main/texcompress.c | 22 ++ src/mesa/main/teximage.c| 28 2 files changed, 50 insertions(+) diff --git a/src/mesa/main/texcompress.c b/src/mesa/main

[Mesa-dev] [PATCH v3 02/18] glapi: add support for KHR_texture_compression_astc_ldr

2015-06-22 Thread Nanley Chery
From: Nanley Chery v2: correct the spelling of the sRGB variants. remove spaces around "=" when setting the enum value. Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- .../glapi/gen/KHR_texture_compression_astc.xml | 40 ++ src/mapi/glapi/gen/M

[Mesa-dev] [PATCH v3 04/18] mesa: return bool instead of GLboolean in compressedteximage_only_format()

2015-06-22 Thread Nanley Chery
From: Nanley Chery In agreement with the coding style, functions that aren't directly visible to the GL API should prefer the use of bool over GLboolean. Suggested-by: Ian Romanick Signed-off-by: Nanley Chery --- src/mesa/main/teximage.c | 6 +++--- 1 file changed, 3 insertions(

[Mesa-dev] [PATCH v3 07/18] mesa/texcompress: enable translation between MESA and GL ASTC formats

2015-06-22 Thread Nanley Chery
From: Nanley Chery Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- src/mesa/main/texcompress.c | 114 1 file changed, 114 insertions(+) diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 1654fc6..203a065 100644

[Mesa-dev] [PATCH v3 05/18] mesa: add ASTC extensions to the extensions table

2015-06-22 Thread Nanley Chery
From: Nanley Chery v2: alphabetize the extensions. remove OES ASTC extension. Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- src/mesa/main/extensions.c | 2 ++ src/mesa/main/mtypes.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/mesa/main/extensions.c b/src

[Mesa-dev] [PATCH v3 09/18] mesa/formats: store whether or not a format is sRGB in gl_format_info

2015-06-22 Thread Nanley Chery
From: Nanley Chery v2: remove extra newline. v3: use bool instead of GLboolean. Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- src/mesa/main/format_info.py | 2 ++ src/mesa/main/formats.c | 28 2 files changed, 6 insertions(+), 24 deletions

[Mesa-dev] [PATCH v3 00/18] Enable support for 2D ASTC (LDR and HDR modes) in SKL

2015-06-22 Thread Nanley Chery
From: Nanley Chery This patch series enables support for the KHR_texture_compression_astc_{ldr,hdr} extensions on Skylake machines. This revision includes developer suggestions and fixes rendering issues on previously untested systems. The sRGB issues were fixed and determined to be unrelated to

[Mesa-dev] [PATCH v3 01/18] mesa/formats: define the 2D ASTC formats

2015-06-22 Thread Nanley Chery
From: Nanley Chery Includes definition of the formats, updates to functions likely to be used, as well as changes necessary for compilation. Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- src/mesa/main/format_info.py | 3 + src/mesa/main/formats.c | 130

[Mesa-dev] [PATCH v3 14/18] i965: correct mt->align_h for 2D textures on Skylake

2015-06-22 Thread Nanley Chery
From: Nanley Chery In agreement with commit 4ab8d59a23, vertical alignment values are equal to four times the block height on Gen9+. v2: add newlines to separate declarations, statments, and comments. Reviewed-by: Anuj Phogat Reviewed-by: Neil Roberts Signed-off-by: Nanley Chery --- src

[Mesa-dev] [PATCH v3 17/18] i965: refactor miptree alignment calculation code

2015-06-22 Thread Nanley Chery
From: Nanley Chery Remove redundant checks and comments by grouping our calculations for align_w and align_h wherever possible. v2: reintroduce brw. don't include functional changes. don't adjust function parameters or create a new function. Signed-off-by: Nanley Chery ---

[Mesa-dev] [PATCH v3 11/18] mesa/macros: add power-of-two assertions for alignment macros

2015-06-22 Thread Nanley Chery
From: Nanley Chery ALIGN and ROUND_DOWN_TO both require that the alignment value passed into the macro be a power of two in the comments. Using software assertions verifies this to be the case. v2: use static inline functions instead of gcc-specific statement expressions. Signed-off-by: Nanley

[Mesa-dev] [PATCH v3 08/18] mesa/teximage: return the base internal format of the ASTC formats

2015-06-22 Thread Nanley Chery
From: Nanley Chery This is necesary to initialize the gl_texture_image struct. From the KHR_texture_compression_astc_ldr spec: "Added to Section 3.8.6, Compressed Texture Images Add the tokens specified above to Table 3.16, Compressed Internal Formats. In all cases, the base int

[Mesa-dev] [PATCH v3 16/18] i965: enable ASTC support for Skylake

2015-06-22 Thread Nanley Chery
From: Nanley Chery v2: remove OES ASTC extension reference. Signed-off-by: Nanley Chery --- src/mesa/drivers/dri/i965/intel_extensions.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index

[Mesa-dev] [PATCH v3 12/18] mesa/macros: move ALIGN_NPOT to macros.h

2015-06-22 Thread Nanley Chery
From: Nanley Chery Aligning with a non-power-of-two number is a general task that can be used in various places. This commit is required for the next one. Signed-off-by: Nanley Chery --- src/mesa/drivers/dri/i965/intel_upload.c | 6 -- src/mesa/main/macros.h | 6

[Mesa-dev] [PATCH v3 18/18] swrast: add a new macro, FETCH_COMPRESSED

2015-06-22 Thread Nanley Chery
From: Nanley Chery This patch creates a new macro, FETCH_COMPRESSED - similar in nature to the other FETCH_* macros. This reduces repetition in the code that deals with compressed textures. Reviewed-by: Anuj Phogat Signed-off-by: Nanley Chery --- src/mesa/swrast/s_texfetch.c | 239

[Mesa-dev] [PATCH v3 13/18] i965: use ALIGN_NPOT for setting ASTC mipmap layouts

2015-06-22 Thread Nanley Chery
From: Nanley Chery ALIGN is changed to ALIGN_NPOT because alignment values are sometimes not powers of two when working with ASTC. Signed-off-by: Nanley Chery --- src/mesa/drivers/dri/i965/brw_tex_layout.c| 12 ++-- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 ++-- 2 files

[Mesa-dev] [PATCH v3 10/18] i965/surface_formats: add support for 2D ASTC surface formats

2015-06-22 Thread Nanley Chery
From: Nanley Chery Intel surface formats default to LDR unless there is hardware support for HDR and the texture is able to be processed in HDR mode. v2: remove extra newlines. v3: follow existing coding style in translate_tex_format(). Signed-off-by: Nanley Chery --- src/mesa/drivers/dri

[Mesa-dev] [PATCH v3 15/18] i965: change the meaning of cpp for compressed textures

2015-06-22 Thread Nanley Chery
From: Nanley Chery An ASTC block takes up 16 bytes for all block width and height configurations. This size is not integrally divisible by all ASTC block widths. Therefore cpp is changed to mean bytes per block if the texture is compressed. Because the original definition was bytes per block

[Mesa-dev] [PATCH] i965/gen9: use an unreserved surface alignment value

2015-06-24 Thread Nanley Chery
From: Nanley Chery Although the horizontal and vertical alignment fields are ignored here, 0 is a reserved value for them and may cause undefined behavior. Change the default value to an abitrary valid one. Signed-off-by: Nanley Chery --- src/mesa/drivers/dri/i965/gen8_surface_state.c | 4

Re: [Mesa-dev] [PATCH] i965/gen9: use an unreserved surface alignment value

2015-06-25 Thread Nanley Chery
On Thu, Jun 25, 2015 at 12:37 AM, Pohjolainen, Topi wrote: > On Wed, Jun 24, 2015 at 05:57:13PM -0700, Anuj Phogat wrote: >> On Wed, Jun 24, 2015 at 3:51 PM, Nanley Chery wrote: >> > From: Nanley Chery >> > >> > Although the horizontal and vertical alignment

Re: [Mesa-dev] [PATCH v3 11/18] mesa/macros: add power-of-two assertions for alignment macros

2015-06-25 Thread Nanley Chery
How about if I create a patch which puts the greater than 0 check into is_power_of_two()? (value > 0) && (value & (value - 1)) == 0); Thanks, Nanley On Wed, Jun 24, 2015 at 3:22 PM, Anuj Phogat wrote: > On Mon, Jun 22, 2015 at 4:02 PM, Nanley Chery wrote: >> From: N

Re: [Mesa-dev] [PATCH v3 12/18] mesa/macros: move ALIGN_NPOT to macros.h

2015-06-25 Thread Nanley Chery
On Wed, Jun 24, 2015 at 3:43 PM, Anuj Phogat wrote: > On Mon, Jun 22, 2015 at 4:02 PM, Nanley Chery wrote: >> From: Nanley Chery >> >> Aligning with a non-power-of-two number is a general task that can be used in >> various places. This commit is required for the ne

Re: [Mesa-dev] [PATCH v3 11/18] mesa/macros: add power-of-two assertions for alignment macros

2015-06-26 Thread Nanley Chery
On Thu, Jun 25, 2015 at 4:16 PM, Anuj Phogat wrote: > On Thu, Jun 25, 2015 at 3:22 PM, Nanley Chery wrote: >> How about if I create a patch which puts the greater than 0 check into >> is_power_of_two()? >> >> (value > 0) && (value & (value - 1)) == 0); &

[Mesa-dev] [PATCH] mesa/macros: move ALIGN_NPOT to macros.h

2015-06-26 Thread Nanley Chery
From: Nanley Chery Aligning with a non-power-of-two number is a general task that can be used in various places. This commit is required for the next one. v2: add greater than 0 assertion (Anuj). convert the macro to a static inline function. Signed-off-by: Nanley Chery --- src/mesa

[Mesa-dev] [PATCH] i965/surface_formats: add support for 2D ASTC surface formats

2015-06-30 Thread Nanley Chery
From: Nanley Chery Define two-thirds of the 2D Intel ASTC surface formats (LDR-only). This allows a 1-to-1 mapping from the mesa format to the Intel format. ASTC textures will default to being processed in LDR mode. If there is hardware support for HDR/Full mode and the texture is not sRGB, add

Re: [Mesa-dev] [PATCH] i965/chv|skl: Apply sampler bypass w/a

2015-07-02 Thread Nanley Chery
Nice find. What do you think about putting this in a function to reduce the code duplication? - Nanley On Wed, Jul 1, 2015 at 6:14 PM, Ben Widawsky wrote: > On Wed, Jul 01, 2015 at 04:03:53PM -0700, Ben Widawsky wrote: >> Certain compressed formats require this setting. The docs don't go into mu

[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

[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 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 al

[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

[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

[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 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

[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

[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

[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

[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

[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

[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

[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 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

[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

[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

[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

[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

[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

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 &

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 > >&

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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 6:26 AM, Ian Romanick wrote: > On 10/19/2015 05:58 PM, Nanley Chery wrote: > > > > > > On Mon, Oct 19, 2015 at 3:47 PM, Ilia Mirkin > <mailto:imir...@alum.mit.edu>> wrote: > > > > On Mon, Oct 19, 2015 at 6:36 PM, Nanl

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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 8:14 AM, Marek Olšák wrote: > On Tue, Oct 20, 2015 at 4:31 PM, Erik Faye-Lund > wrote: > > On Tue, Oct 20, 2015 at 12:36 AM, Nanley Chery > wrote: > >> From: Nanley Chery > >> > >> - { "GL_SUN_mul

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

2015-10-20 Thread Nanley Chery
ck to its original position. Thanks, Nanley Marek > > On Tue, Oct 20, 2015 at 5:14 PM, Marek Olšák wrote: > > On Tue, Oct 20, 2015 at 4:31 PM, Erik Faye-Lund > wrote: > >> On Tue, Oct 20, 2015 at 12:36 AM, Nanley Chery > wrote: > >>> From: Nanley Ch

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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 8:26 AM, Marek Olšák wrote: > On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery > wrote: > > From: Nanley Chery > > > > Generate functions which determine if an extension is supported in the > > current context. Initially, enums were go

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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 8:32 AM, Marek Olšák wrote: > On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery > wrote: > > From: Nanley Chery > > > > Stop leaks into the following contexts: > >* GLES in _mesa_base_tex_format() and lookup_view_class(). > >* Pr

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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 8:57 AM, Marek Olšák wrote: > On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery > wrote: > > From: Nanley Chery > > > > Avoid the function call overhead for this one-liner. > > Can you measure the overhead? If not, there is no reason for t

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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 9:31 AM, Marek Olšák wrote: > On Tue, Oct 20, 2015 at 6:25 PM, Nanley Chery > wrote: > > > > > > On Tue, Oct 20, 2015 at 8:57 AM, Marek Olšák wrote: > >> > >> On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery > >> wrote:

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

2015-10-20 Thread Nanley Chery
On Tue, Oct 20, 2015 at 8:49 AM, Marek Olšák wrote: > On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery > wrote: > > From: Nanley Chery > > > > Aside from those modified in this commit, all gl_extensions structs are > > zero-initialized by default. There is t

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

2015-10-20 Thread Nanley Chery
ersion, when in fact a longer list of dependencies would suffice instead. I'll look into this issue. If it's the right way to go, I can allow all versions of GL compatibility by simply replacing the '31' with 'GLL' in a v2. > Marek > > On Tue, Oct 20, 20

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

2015-10-20 Thread Nanley Chery
ontained within any other extension and our context version is less than 3.3, we may not be able to actually implement the extension spec as described. I will try to see if this is the case. I agree that technical roadblocks should be the only things which prevent us from advertising certain extensions

Re: [Mesa-dev] [PATCH] mesa/glformats: Undo code changes from _mesa_base_tex_format() move

2015-10-21 Thread Nanley Chery
On Wed, Oct 21, 2015 at 7:23 AM, Emil Velikov wrote: > On 9 October 2015 at 23:35, Nanley Chery wrote: > > From: Nanley Chery > > > > The refactoring commit, c6bf1cd, accidentally reverted cd49b97 > > and 99b1f47. These changes caused more code to be added to the &

[Mesa-dev] [PATCH] mesa: Enable ASTC in GLES' [NUM_]COMPRESSED_TEXTURE_FORMATS queries

2015-10-21 Thread Nanley Chery
From: Nanley Chery In OpenGL ES, the COMPRESSED_TEXTURE_FORMATS query returns the set of supported specific compressed formats. Since ASTC formats fit within that category, include them in the set and update the NUM_COMPRESSED_TEXTURE_FORMATS query as well. This enables GLES2-based ASTC dEQP

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

2015-10-22 Thread Nanley Chery
On Thu, Oct 22, 2015 at 3:06 AM, Emil Velikov wrote: > On 20 October 2015 at 16:43, Nanley Chery wrote: > > On Tue, Oct 20, 2015 at 8:16 AM, Marek Olšák wrote: > >> > >> Also, the FIXME comment should be on its own line. > >> > > > > I moved it

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

2015-10-22 Thread Nanley Chery
On Thu, Oct 22, 2015 at 3:19 AM, Emil Velikov wrote: > On 19 October 2015 at 23:36, Nanley Chery wrote: > > From: Nanley Chery > > > > Create a function which determines if an extension is supported in the > > current context. > > > > Signed-off-by: N

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

2015-10-22 Thread Nanley Chery
On Thu, Oct 22, 2015 at 11:08 AM, Chad Versace wrote: > On Thu 22 Oct 2015, Emil Velikov wrote: > > On 19 October 2015 at 23:36, Nanley Chery wrote: > > > From: Nanley Chery > > > > > > Create a function which determines if an extension is su

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

2015-10-22 Thread Nanley Chery
On Thu, Oct 22, 2015 at 3:13 AM, Emil Velikov wrote: > On 19 October 2015 at 23:36, Nanley Chery wrote: > > From: Nanley Chery > > > > With this infrastructure set in place, we can now reuse the entries to > > generate useful code. > > > > Signed-off-

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

2015-10-22 Thread Nanley Chery
On Thu, Oct 22, 2015 at 3:40 AM, Emil Velikov wrote: > On 19 October 2015 at 23:44, Nanley Chery wrote: > > From: Nanley Chery > > > > This variable existed to provide an unsigned error value for > > name_to_offset(). Since o(extension_sentinel) is also a valid uns

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

2015-10-23 Thread Nanley Chery
On Wed, Oct 21, 2015 at 11:43 PM, Erik Faye-Lund wrote: > On Tue, Oct 20, 2015 at 12:44 AM, Nanley Chery > wrote: > > From: Nanley Chery > > > > Since the version numbers being compared are integral and we don't ever > > expect gl_context::Version to be equ

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

2015-10-23 Thread Nanley Chery
On Thu, Oct 22, 2015 at 3:17 AM, Emil Velikov wrote: > On 19 October 2015 at 23:36, Nanley Chery wrote: > > From: Nanley Chery > > > > Enable limiting advertised extension support by context version with > > finer granularity. GLuint is chosen over smaller datat

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

2015-10-23 Thread Nanley Chery
On Thu, Oct 22, 2015 at 11:02 AM, Chad Versace wrote: > On Mon 19 Oct 2015, Nanley Chery wrote: > > From: Nanley Chery > > > > Enable limiting advertised extension support by context version with > > finer granularity. GLuint is chosen over smaller datatypes beca

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

2015-10-23 Thread Nanley Chery
On Thu, Oct 22, 2015 at 3:32 AM, Emil Velikov wrote: > On 19 October 2015 at 23:44, Nanley Chery wrote: > > From: Nanley Chery > > > > Aside from those modified in this commit, all gl_extensions structs are > > zero-initialized by default. There is therefore no nee

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

2015-10-23 Thread Nanley Chery
On Tue, Oct 20, 2015 at 4:32 PM, Nanley Chery wrote: > > > On Tue, Oct 20, 2015 at 8:45 AM, Marek Olšák wrote: > >> NAK. I'd like this extension in compatibility contexts. The fact the >> spec requires OpenGL 3.3 was just authors' laziness. >> >> &g

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

2015-10-23 Thread Nanley Chery
On Thu, Oct 22, 2015 at 12:15 PM, Chad Versace wrote: > On Mon 19 Oct 2015, Nanley Chery wrote: > > From: Nanley Chery > > > > Stop leaks into the following contexts: > >* GLES in _mesa_base_tex_format() and lookup_view_class(). > >* Pre-1.1 GL legacy c

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

2015-10-23 Thread Nanley Chery
On Thu, Oct 22, 2015 at 11:30 AM, Chad Versace wrote: > On Mon 19 Oct 2015, Nanley Chery wrote: > > From: Nanley Chery > > > > Generate functions which determine if an extension is supported in the > > current context. Initially, enums were going

Re: [Mesa-dev] [PATCH v6 2/2] mesa/teximage: accept ASTC formats for 3D texture specification

2015-10-26 Thread Nanley Chery
On Mon, Oct 26, 2015 at 11:15 AM, Neil Roberts wrote: > Nanley Chery writes: > > > + /* Throw an INVALID_OPERATION error if the target is > > + * TEXTURE_CUBE_MAP_ARRAY and the format is not ASTC. > > + */ > > + if (target_can_be_c

Re: [Mesa-dev] [PATCH v6 2/2] mesa/teximage: accept ASTC formats for 3D texture specification

2015-10-26 Thread Nanley Chery
On Mon, Oct 26, 2015 at 11:53 AM, Roland Scheidegger wrote: > Am 26.10.2015 um 19:31 schrieb Ilia Mirkin: > > On Mon, Oct 26, 2015 at 2:15 PM, Neil Roberts > wrote: > >> Nanley Chery writes: > >> > >>> + /* Throw a

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

2015-10-26 Thread Nanley Chery
On Fri, Oct 23, 2015 at 3:01 PM, Nanley Chery wrote: > > > On Thu, Oct 22, 2015 at 12:15 PM, Chad Versace > wrote: > >> On Mon 19 Oct 2015, Nanley Chery wrote: >> > From: Nanley Chery >> > >> > Stop leaks into the following context

Re: [Mesa-dev] [Mesa-stable] [PATCH] mesa: Enable ASTC in GLES' [NUM_]COMPRESSED_TEXTURE_FORMATS queries

2015-10-26 Thread Nanley Chery
On Mon, Oct 26, 2015 at 4:30 PM, Ian Romanick wrote: > Reviewed-by: Ian Romanick > > On 10/21/2015 03:06 PM, Nanley Chery wrote: > > From: Nanley Chery > > > > In OpenGL ES, the COMPRESSED_TEXTURE_FORMATS query returns the set of > > supported specific compr

[Mesa-dev] [PATCH] mesa/teximage: Fix ASTC-caused S3TC regression

2015-10-28 Thread Nanley Chery
From: Nanley Chery The ASTC spec forbids other compressed formats from being used against the targets: TEXTURE_CUBE_MAP_ARRAY and TEXTURE_3D. Because other compressed formats were previously supported for these targets in desktop GL, it's considered to be a spec bug and Mesa will diverge

[Mesa-dev] [PATCH v2] mesa/teximage: Fix S3TC regression due to ASTC interaction

2015-10-28 Thread Nanley Chery
From: Nanley Chery A prior, literal reading of the ASTC spec led to the prohibition of some compressed formats being used against the targets: TEXTURE_CUBE_MAP_ARRAY and TEXTURE_3D. Since the spec does not specify interactions with other extensions for specific compressed textures, remove such

[Mesa-dev] [PATCH v2 01/18] mesa/extensions: Remove array sentinel

2015-10-30 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

[Mesa-dev] [PATCH v2 02/18] mesa/extensions: Wrap array entries in macros

2015-10-30 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 al

[Mesa-dev] [PATCH v2 03/18] mesa/extensions: Move entries entries to seperate file

2015-10-30 Thread Nanley Chery
From: Nanley Chery With this infrastructure set in place, we can now reuse the entries to generate useful code. v2. Add the new file into Makefile.sources (Emil) Signed-off-by: Nanley Chery --- src/mesa/Makefile.sources| 1 + src/mesa/main/extensions.c | 321

[Mesa-dev] [PATCH v2 05/18] mesa/extensions: Create _mesa_extension_supported()

2015-10-30 Thread Nanley Chery
From: Nanley Chery Create a function which determines if an extension is supported in the current context. v2. Use common variable names (Emil) Insert new line between variables and return statement (Chad) Rename api_set variable to api_bit (Chad) Signed-off-by: Nanley Chery --- src

[Mesa-dev] [PATCH v2 06/18] mesa/extensions: Use _mesa_extension_supported()

2015-10-30 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

[Mesa-dev] [PATCH v2 04/18] mesa/extensions: Add extension::version

2015-10-30 Thread Nanley Chery
From: Nanley Chery Enable limiting advertised extension support by context version with finer granularity. v2. Use uint*t type for version and note the expected values (Emil) Use an 8-bit wide datatype. Reformat macro for better readability (Chad) Signed-off-by: Nanley Chery --- src

[Mesa-dev] [PATCH v2 13/18] mesa: Fix ASTC extension functionality leak into GLES 1

2015-10-30 Thread Nanley Chery
From: Nanley Chery Stop a leak of ASTC functionality into GLES 1 contexts. v2. Handle ASTC driver capability check in texcompress.c Signed-off-by: Nanley Chery --- src/mesa/main/glformats.c | 4 ++-- src/mesa/main/texcompress.c | 2 +- src/mesa/main/teximage.c| 6 +++--- 3 files

[Mesa-dev] [PATCH v2 07/18] mesa/extensions: Replace extension::api_set with ::version

2015-10-30 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

  1   2   3   4   5   6   7   8   9   10   >