[Mesa-dev] [RFC 14/63] mesa/formatquery: Added a func to check if the is supported

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 spec: "If the particular and combination do not make sense, or if a particular type of is not supported by the implementation the "unsupported" answer should be given. This is not an error." This function

[Mesa-dev] [RFC 10/63] mesa: Completely remove QuerySamplesForFormat from driver func table

2016-01-19 Thread Eduardo Lima Mitev
At this point, all uses have been replaced by the more general hook QueryInternalFormat, introduced by ARB_internalformat_query2. --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/main/dd.h| 18 -- src/mesa/main/formatquery.c | 14

[Mesa-dev] [RFC 07/63] mesa/multisample: Check sample count using the new driver hook

2016-01-19 Thread Eduardo Lima Mitev
Use QueryInternalFormat instead of QuerySamplesForFormat to obtain the highest supported sample. QuerySamplesForFormat is to be removed. --- src/mesa/main/multisample.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/multisample.c

[Mesa-dev] [RFC 11/63] mesa/main: Add extension tracking bit for ARB_internalformat_query2

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes --- src/mesa/main/extensions_table.h | 1 + src/mesa/main/mtypes.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index aeccb01..0d3e635 100644 ---

[Mesa-dev] [RFC 06/63] st/format: Replace QuerySamplesForFormat by new QueryInternalFormat hook

2016-01-19 Thread Eduardo Lima Mitev
The previous code for SAMPLES and NUM_SAMPLE_COUNTS is reused as a private function. --- src/mesa/state_tracker/st_cb_texture.c | 2 +- src/mesa/state_tracker/st_format.c | 38 -- src/mesa/state_tracker/st_format.h | 8 +++ 3 files changed, 40

[Mesa-dev] [RFC 21/63] mesa/formatquery: Added func to check if the 'resource' is supported

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes Checks that the 'resource', as defined by the ARB_internalformat_query2 specification, is supported by the implementation for those 'pnames' that require this check. --- src/mesa/main/formatquery.c | 91 - 1

[Mesa-dev] [RFC 30/63] mesa/formatquery: handle unmodified buffer for SAMPLES on the 64-bit query

2016-01-19 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro From arb_internalformat_query2 spec: " If is not color-renderable, depth-renderable, or stencil-renderable (as defined in section 4.4.4), or if does not support multiple samples (ie other than TEXTURE_2D_MULTISAMPLE,

[Mesa-dev] [RFC 33/63] mesa/teximage: add _mesa_is_cube_map_texture utility method

2016-01-19 Thread Eduardo Lima Mitev
--- src/mesa/main/teximage.c | 18 ++ src/mesa/main/teximage.h | 4 2 files changed, 22 insertions(+) diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 250d758..4cca396 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -256,6

[Mesa-dev] [RFC 31/63] mesa/formatquery: support for IMAGE_FORMAT_COMPATIBILITY_TYPE

2016-01-19 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro From arb_internalformat_query2 spec: "IMAGE_FORMAT_COMPATIBILITY_TYPE: The matching criteria use for the resource when used as an image textures is returned in . This is equivalent to calling GetTexParameter with set to

[Mesa-dev] [RFC 35/63] mesa/formatquery: Added {COLOR, DEPTH, STENCIL}_COMPONENTS queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes --- src/mesa/main/formatquery.c | 30 +++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index cf9290f..acf907e 100644 --- a/src/mesa/main/formatquery.c

[Mesa-dev] [RFC 38/63] mesa/genmipmap: Added a function to validate the internalformat

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes It will be used by the ARB_internalformat_query2 implementation to implement mipmap related queries. --- src/mesa/main/genmipmap.c | 16 src/mesa/main/genmipmap.h | 3 +++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git

[Mesa-dev] [RFC 32/63] main/formatquery: support for MAX_{WIDTH/HEIGHT/DEPTH/LAYERS}

2016-01-19 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro Implemented by calling GetIntegerv with the equivalent pname and handling individually the exceptions related to dimensions. All those pnames are used to get the maximum value for each dimension of the given target. The only difference between this

[Mesa-dev] [RFC 37/63] mesa/genmipmap: Added a function to check if the target is valid

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes It will be used by the ARB_internalformat_query2 implementation to implement mipmap related queries. --- src/mesa/main/genmipmap.c | 34 +- src/mesa/main/genmipmap.h | 3 +++ 2 files changed, 24 insertions(+), 13

[Mesa-dev] [RFC 34/63] mesa/formatquery: support for MAX_COMBINED_DIMENSIONS

2016-01-19 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro It is implemented combining the values returned by calls to the 32-bit query _mesa_GetInternalformati32v. The main reason is simplicity. The other option would be C how we implemented the support of GL_MAX_{WIDTH/HEIGHT/DEPTH} and GL_SAMPLES.

[Mesa-dev] [RFC 36/63] mesa/formatquery: Added {COLOR, DEPTH, STENCIL}_RENDERABLE queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes --- src/mesa/main/formatquery.c | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index acf907e..f0ea210 100644 --- a/src/mesa/main/formatquery.c +++

[Mesa-dev] [RFC 54/63] mesa/formatquery: Added framebuffer renderability related queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- FRAMEBUFFER_RENDERABLE: The support for rendering to the resource via framebuffer attachment is returned in . - FRAMEBUFFER_RENDERABLE_LAYERED: The support for layered rendering to

[Mesa-dev] [RFC 50/63] mesa/formatquery: Added CLEAR_BUFFER query

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- CLEAR_BUFFER: The support for using the resource with ClearBuffer*Data commands is returned in . Possible values returned are FULL_SUPPORT, CAVEAT_SUPPORT, or NONE. If the resource

[Mesa-dev] [RFC 55/63] mesa/texparam: make public target_allows_setting_sampler_parameters

2016-01-19 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro In order to allow to be used on ARB_internalformat_query2 implementation. --- src/mesa/main/texparam.c | 32 src/mesa/main/texparam.h | 3 +++ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git

[Mesa-dev] [RFC 56/63] mesa/formatquery: added FILTER pname support

2016-01-19 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro It discards out the targets and internalformats that explicitly mention (per-spec) that doesn't support filter types other than NEAREST or NEAREST_MIPMAP_NEAREST. Those are: * Texture buffers target * Multisample targets * Any integer

[Mesa-dev] [RFC 61/63] mesa/formatquery: Add (GET_)TEXTURE_IMAGE_TYPE pnames

2016-01-19 Thread Eduardo Lima Mitev
These basically reuse the default implementation of GL_READ_PIXELS_TYPE. --- src/mesa/main/formatquery.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 2551476..158b908 100644 ---

[Mesa-dev] [RFC 63/63] i965: Enable the ARB_internalformat_query2 extension

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes --- src/mesa/drivers/dri/i965/intel_extensions.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c index 889f7cb..4392112 100644 ---

[Mesa-dev] [RFC 57/63] mesa/formatquery: Add support for READ_PIXELS query

2016-01-19 Thread Eduardo Lima Mitev
This is supported since very early version of OpenGL, but we still call the driver to give it the opportunity to report caveat or no support. --- src/mesa/main/formatquery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/formatquery.c

[Mesa-dev] [RFC 58/63] mesa/formatquery: Add READ_PIXELS_FORMAT pname

2016-01-19 Thread Eduardo Lima Mitev
--- src/mesa/main/formatquery.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 1b98b82..fc8c10f 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -596,9

[Mesa-dev] [RFC 62/63] i965/formatquery: Add support for INTERNALFORMAT_PREFERRED query

2016-01-19 Thread Eduardo Lima Mitev
This pname is tricky. The spec states that an internal format should be returned, that is compatible with the passed internal format, and has at least the same precision. There is no clear API to resolve this. The closest we have (and what other drivers (i.e, NVidia proprietary) do, is to return

[Mesa-dev] [RFC 59/63] mesa/formatquery: Add READ_PIXELS_TYPE pname

2016-01-19 Thread Eduardo Lima Mitev
We call the driver to provide its preferred type, but also provide a default implementation that selects a generic type based on the passed internal format. --- src/mesa/main/formatquery.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git

[Mesa-dev] [RFC 40/63] mesa/formatquery: Added COLOR_ENCODING query.

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- COLOR_ENCODING: The color encoding for the resource is returned in . Possible values for color buffers are LINEAR or SRGB, for linear or sRGB-encoded color components, respectively. For

[Mesa-dev] [RFC 60/63] mesa/formatquery: Add (GET_)TEXTURE_IMAGE_FORMAT pnames

2016-01-19 Thread Eduardo Lima Mitev
--- src/mesa/main/formatquery.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 0f63259..2551476 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -652,6

[Mesa-dev] [RFC 27/63] mesa/main: Extend _mesa_get_format_bits to accept new pnames

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes The new pnames accepted by the function are: - INTERNALFORMAT_RED_SIZE - INTERNALFORMAT_GREEN_SIZE - INTERNALFORMAT_BLUE_SIZE - INTERNALFORMAT_ALPHA_SIZE - INTERNALFORMAT_DEPTH_SIZE -

[Mesa-dev] [RFC 28/63] mesa/formatquery: Added INTERNALFORMAT_{X}_{SIZE, TYPE} queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 spec: "- INTERNALFORMAT_RED_SIZE - INTERNALFORMAT_GREEN_SIZE - INTERNALFORMAT_BLUE_SIZE - INTERNALFORMAT_ALPHA_SIZE - INTERNALFORMAT_DEPTH_SIZE - INTERNALFORMAT_STENCIL_SIZE -

[Mesa-dev] [RFC 24/63] mesa/formatquery: Added INTERNALFORMAT_PREFERRED pname

2016-01-19 Thread Eduardo Lima Mitev
--- src/mesa/main/formatquery.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index da65624..1a3bdbd 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -580,6 +580,10 @@

[Mesa-dev] [RFC 26/63] mesa/main: Extend _mesa_base_format_has_channel to accept new pnames

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes The new pnames accepted by the function are: - INTERNALFORMAT_RED_SIZE - INTERNALFORMAT_GREEN_SIZE - INTERNALFORMAT_BLUE_SIZE - INTERNALFORMAT_ALPHA_SIZE - INTERNALFORMAT_DEPTH_SIZE -

[Mesa-dev] [RFC 25/63] mesa/main: Make legal_get_tex_level_parameter_target public

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes It will be used by the ARB_internalformat_query2 implementation to check if the target is valid for those that are said in the spec that should return the same values than the 'glGetTexLevelParameter{if}v' function: - INTERNALFORMAT_RED_SIZE -

[Mesa-dev] [RFC 29/63] mesa/formatquery: initial implementation for GetInternalformati64v

2016-01-19 Thread Eduardo Lima Mitev
From: Alejandro Piñeiro It just does a wrapping on the existing 32-bit GetInternalformativ. We will maintain the 32-bit query as default as it is likely that it would be the one most used. --- src/mesa/main/formatquery.c | 8 +++- 1 file changed, 7 insertions(+), 1

[Mesa-dev] [RFC 48/63] mesa/formatquery: Added simultaneous texture and depth/stencil queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST: The support for using the resource both as a source for texture sampling while it is bound as a buffer for depth test is written to . For example, a

[Mesa-dev] [RFC 47/63] mesa/formatquery: Added queries related to image textures

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- IMAGE_TEXEL_SIZE: The size of a texel when the resource when used as an image texture is returned in . This is the value from the /Size/ column in Table 3.22. If the resource is not

[Mesa-dev] [RFC 39/63] mesa/formatquery: Added mipmap related queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes Specifically MIPMAP, MANUAL_GENERATE_MIPMAP and AUTO_GENERATE_MIPMAP queries. From the ARB_internalformat_query2 specification: "- MIPMAP: If the resource supports mipmaps, TRUE is returned in . If the resource is not supported, or if mipmaps

[Mesa-dev] [RFC 49/63] mesa/formatquery: Added compressed texture related queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- TEXTURE_COMPRESSED: If is a compressed format that is supported for this type of resource, TRUE is returned in . If the internal format is not compressed, or the type of resource

[Mesa-dev] [RFC 53/63] mesa/formatquery: Added texture gather/shadow related queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- TEXTURE_SHADOW: The support for using the resource with shadow samplers is written to . - TEXTURE_GATHER: The support for using the resource with texture gather operations is

[Mesa-dev] [RFC 43/63] mesa/formatquery: Added queries related to texture sampling in shaders

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- VERTEX_TEXTURE: The support for using the resource as a source for texture sampling in a vertex shader is written to . - TESS_CONTROL_TEXTURE: The support for using the resource as a

[Mesa-dev] [RFC 51/63] mesa/textureview: Make _lookup_view_class public

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes It will be used by the ARB_internalformat_query2 implementation to implement the VIEW_COMPATIBILITY_CLASS query. --- src/mesa/main/textureview.c | 12 src/mesa/main/textureview.h | 8 2 files changed, 12 insertions(+), 8

[Mesa-dev] [RFC 42/63] mesa/formatquery: Added SRGB_DECODE_ARB query

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- SRGB_DECODE_ARB: The support for toggling whether sRGB decode happens at sampling time (see EXT/ARB_texture_sRGB_decode) for the resource is returned in . Possible values returned

[Mesa-dev] [RFC 46/63] mesa/shaderimage: Added func to get the GL_IMAGE_CLASS from the format

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes It will be used by the ARB_internalformat_query2 implementation to implement the IMAGE_COMPATIBILITY_CLASS query. --- src/mesa/main/shaderimage.c | 45 + src/mesa/main/shaderimage.h | 6 ++ 2 files

[Mesa-dev] [RFC 41/63] mesa/formatquery: Added SRGB_{READ, WRITE} queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- SRGB_READ: The support for converting from sRGB colorspace on read operations (see section 3.9.18) from the resource is returned in . Possible values returned are FULL_SUPPORT,

[Mesa-dev] [RFC 45/63] mesa/formatquery: Added SHADER_IMAGE_{LOAD, STORE, ATOMIC} queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- SHADER_IMAGE_LOAD: The support for using the resource with image load operations in shaders is written to . In this case the is the value of the parameter that would be passed

[Mesa-dev] [RFC 52/63] mesa/formatquery: Added texture view related queries

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes From the ARB_internalformat_query2 specification: "- TEXTURE_VIEW: The support for using the resource with the TextureView command is returned in . Possible values returned are FULL_SUPPORT, CAVEAT_SUPPORT, or NONE. If the resource

[Mesa-dev] [RFC 44/63] mesa/shaderimage: Make is_image_format_supported public

2016-01-19 Thread Eduardo Lima Mitev
From: Antia Puentes It will be used by the ARB_internalformat_query2 implementation to implement queries related to the ARB_shader_image_load_store extension. --- src/mesa/main/shaderimage.c | 13 + src/mesa/main/shaderimage.h | 8 2 files changed, 13

[Mesa-dev] [RFC 08/63] mesa/formatquery: Remove tracking of number of elements in the response

2016-01-19 Thread Eduardo Lima Mitev
Currently, the number of integers returned in the response to GetInternalFormativ is being tracked by a 'count' variable. This is so only the modified elements from the temporary buffer are copied into the original user buffer. However, with the introduction of ARB_internalformat_query2, keeping

Re: [Mesa-dev] [PATCH v2 01/10] tgsi: add MEMBAR opcode to handle memoryBarrier* GLSL intrinsics

2016-01-19 Thread Roland Scheidegger
I am actually wondering how well that would work for d3d11. d3d11 just has AllMemoryBarrier, DeviceMemoryBarrier plus GroupMemoryBarrier - and for each of them also a "WithGroupSync" version. Hmm. Roland Am 19.01.2016 um 03:30 schrieb Ilia Mirkin: > Signed-off-by: Ilia Mirkin

Re: [Mesa-dev] [PATCH v2 01/10] tgsi: add MEMBAR opcode to handle memoryBarrier* GLSL intrinsics

2016-01-19 Thread Ilia Mirkin
This is designed to map the GLSL intrinsics. Should one have a desire to also support d3d11, one could figure out what the overlap is and rejigger the arguments so that both sets of desires are expressible. I glanced at SM5 sync before doing this, and TBH I couldn't really make sense of it:

<    1   2