[Mesa-dev] [PATCH 4/8] gallium: add PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY

Nicolai Hähnle nhaehnle at gmail.com
Thu May 24 08:42:07 UTC 2018


Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

On 23.05.2018 22:58, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> ---
>   src/gallium/docs/source/screen.rst               | 6 ++++++
>   src/gallium/drivers/etnaviv/etnaviv_screen.c     | 1 +
>   src/gallium/drivers/freedreno/freedreno_screen.c | 1 +
>   src/gallium/drivers/i915/i915_screen.c           | 1 +
>   src/gallium/drivers/llvmpipe/lp_screen.c         | 2 ++
>   src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 1 +
>   src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 2 ++
>   src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 2 ++
>   src/gallium/drivers/r300/r300_screen.c           | 1 +
>   src/gallium/drivers/r600/r600_pipe.c             | 3 +++
>   src/gallium/drivers/radeonsi/si_get.c            | 3 +++
>   src/gallium/drivers/softpipe/sp_screen.c         | 2 ++
>   src/gallium/drivers/svga/svga_screen.c           | 3 +++
>   src/gallium/drivers/swr/swr_screen.cpp           | 2 ++
>   src/gallium/drivers/v3d/v3d_screen.c             | 3 +++
>   src/gallium/drivers/vc4/vc4_screen.c             | 1 +
>   src/gallium/drivers/virgl/virgl_screen.c         | 2 ++
>   src/gallium/include/pipe/p_defines.h             | 1 +
>   18 files changed, 37 insertions(+)
> 
> diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
> index 5bc6ee99f08..0f18b7a94b9 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -86,20 +86,26 @@ The integer capabilities:
>   * ``PIPE_CAP_VERTEX_COLOR_CLAMPED``: Whether the driver is capable of
>     clamping vertex colors when they come out of a vertex shader, as specified
>     by the pipe_rasterizer_state::clamp_vertex_color flag.  If unsupported,
>     the vertex colors are never clamped. This is the default for DX10 hardware.
>     If both clamped and unclamped CAPs are supported, the clamping can be
>     controlled through pipe_rasterizer_state.  If the driver cannot do vertex
>     color clamping, the state tracker may insert clamping code into the vertex
>     shader.
>   * ``PIPE_CAP_GLSL_FEATURE_LEVEL``: Whether the driver supports features
>     equivalent to a specific GLSL version. E.g. for GLSL 1.3, report 130.
> +* ``PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY``: Whether the driver supports
> +  features equivalent to a specific GLSL version including all legacy OpenGL
> +  features only present in the OpenGL compatibility profile.
> +  The only legacy features that Gallium drivers must implement are
> +  the legacy shader inputs and outputs (colors, texcoords, fog, clipvertex,
> +  edgeflag).
>   * ``PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION``: Whether quads adhere to
>     the flatshade_first setting in ``pipe_rasterizer_state``.
>   * ``PIPE_CAP_USER_VERTEX_BUFFERS``: Whether the driver supports user vertex
>     buffers.  If not, the state tracker must upload all data which is not in hw
>     resources.  If user-space buffers are supported, the driver must also still
>     accept HW resource buffers.
>   * ``PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY``: This CAP describes a hw
>     limitation.  If true, pipe_vertex_buffer::buffer_offset must always be aligned
>     to 4.  If false, there are no restrictions on the offset.
>   * ``PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY``: This CAP describes a hw
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> index cada83609a8..244726ea014 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> @@ -147,20 +147,21 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>         return 1;
>      case PIPE_CAP_NATIVE_FENCE_FD:
>         return screen->drm_version >= ETNA_DRM_VERSION_FENCE_FD;
>   
>      /* Memory */
>      case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>         return 256;
>      case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
>         return 4; /* XXX could easily be supported */
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
>         return 120;
>   
>      case PIPE_CAP_NPOT_TEXTURES:
>         return true; /* VIV_FEATURE(priv->dev, chipMinorFeatures1,
>                         NON_POWER_OF_TWO); */
>   
>      case PIPE_CAP_TEXTURE_SWIZZLE:
>      case PIPE_CAP_PRIMITIVE_RESTART:
>         return VIV_FEATURE(screen, chipMinorFeatures1, HALTI0);
>   
> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
> index c59995c75d1..f97c46b0fa2 100644
> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
> @@ -254,20 +254,21 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>   		 * current firmware) do draw_indirect with base_instance.
>   		 * Since draw_indirect is needed sooner (gles31 and gl40 vs
>   		 * gl42), hide base_instance on a5xx.  :-/
>   		 */
>   		return is_a4xx(screen);
>   
>   	case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>   		return 64;
>   
>   	case PIPE_CAP_GLSL_FEATURE_LEVEL:
> +	case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
>   		if (glsl120)
>   			return 120;
>   		return is_ir3(screen) ? 140 : 120;
>   
>   	case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
>   		if (is_a5xx(screen))
>   			return 4;
>   		return 0;
>   
>   	case PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS:
> diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
> index 1b8c0ad9a29..b08d2283e7e 100644
> --- a/src/gallium/drivers/i915/i915_screen.c
> +++ b/src/gallium/drivers/i915/i915_screen.c
> @@ -335,20 +335,21 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
>      case PIPE_CAP_PACKED_UNIFORMS:
>         return 0;
>   
>      case PIPE_CAP_MAX_VIEWPORTS:
>         return 1;
>   
>      case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
>         return 64;
>   
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
>         return 120;
>   
>      case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>         return 16;
>   
>      /* Features we can lie about (boolean caps). */
>      case PIPE_CAP_OCCLUSION_QUERY:
>         return is->debug.lie ? 1 : 0;
>   
>      /* Texturing. */
> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
> index af1aff4e1e0..f12ad09298d 100644
> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
> @@ -198,20 +198,22 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
>      case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>      case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
>         return 1;
>      case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
>         return 0;
>      case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
>      case PIPE_CAP_VERTEX_COLOR_CLAMPED:
>         return 1;
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
>         return 330;
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +      return 140;
>      case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
>         return 0;
>      case PIPE_CAP_COMPUTE:
>         return 0;
>      case PIPE_CAP_USER_VERTEX_BUFFERS:
>         return 1;
>      case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
>      case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
>      case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
>      case PIPE_CAP_TGSI_TEXCOORD:
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> index a24176a8e94..99249d26b3c 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> @@ -57,20 +57,21 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>      /* non-boolean capabilities */
>      case PIPE_CAP_MAX_RENDER_TARGETS:
>         return (eng3d->oclass >= NV40_3D_CLASS) ? 4 : 1;
>      case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
>         return 13;
>      case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
>         return 10;
>      case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
>         return 13;
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
>         return 120;
>      case PIPE_CAP_ENDIANNESS:
>         return PIPE_ENDIAN_LITTLE;
>      case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>         return 16;
>      case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
>         return NOUVEAU_MIN_BUFFER_MAP_ALIGN;
>      case PIPE_CAP_MAX_VIEWPORTS:
>         return 1;
>      case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index b278a2f11b4..2495a545fde 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> @@ -102,20 +102,22 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>      case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
>      case PIPE_CAP_MIN_TEXEL_OFFSET:
>         return -8;
>      case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
>      case PIPE_CAP_MAX_TEXEL_OFFSET:
>         return 7;
>      case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
>         return 128 * 1024 * 1024;
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
>         return 330;
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +      return 140;
>      case PIPE_CAP_MAX_RENDER_TARGETS:
>         return 8;
>      case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
>         return 1;
>      case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
>         return 4;
>      case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>      case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
>         return 64;
>      case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> index e1c7b3a2364..f679cbdba3e 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> @@ -127,20 +127,22 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>      case PIPE_CAP_MAX_TEXEL_OFFSET:
>         return 7;
>      case PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET:
>         return -32;
>      case PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET:
>         return 31;
>      case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
>         return 128 * 1024 * 1024;
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
>         return 430;
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +      return 140;
>      case PIPE_CAP_MAX_RENDER_TARGETS:
>         return 8;
>      case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
>         return 1;
>      case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
>         return 4;
>      case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
>      case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>         return 128;
>      case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
> diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
> index 8a6e0c2f21f..459349e821c 100644
> --- a/src/gallium/drivers/r300/r300_screen.c
> +++ b/src/gallium/drivers/r300/r300_screen.c
> @@ -113,20 +113,21 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>           case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>               return 1;
>   
>           case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
>               return R300_BUFFER_ALIGNMENT;
>   
>           case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>               return 16;
>   
>           case PIPE_CAP_GLSL_FEATURE_LEVEL:
> +        case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
>               return 120;
>   
>           /* r300 cannot do swizzling of compressed textures. Supported otherwise. */
>           case PIPE_CAP_TEXTURE_SWIZZLE:
>               return r300screen->caps.dxtc_swizzle;
>   
>           /* We don't support color clamping on r500, so that we can use color
>            * intepolators for generic varyings. */
>           case PIPE_CAP_VERTEX_COLOR_CLAMPED:
>               return !is_r500;
> diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
> index 1a293ea6987..ff7306998bb 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -336,20 +336,23 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>   		return 1;
>   
>   	case PIPE_CAP_GLSL_FEATURE_LEVEL:
>   		if (family >= CHIP_CEDAR)
>   		   return 430;
>   		/* pre-evergreen geom shaders need newer kernel */
>   		if (rscreen->b.info.drm_minor >= 37)
>   		   return 330;
>   		return 140;
>   
> +	case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +		return 140;
> +
>   	/* Supported except the original R600. */
>   	case PIPE_CAP_INDEP_BLEND_ENABLE:
>   	case PIPE_CAP_INDEP_BLEND_FUNC:
>   		/* R600 doesn't support per-MRT blends */
>   		return family == CHIP_R600 ? 0 : 1;
>   
>   	/* Supported on Evergreen. */
>   	case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
>   	case PIPE_CAP_CUBE_MAP_ARRAY:
>   	case PIPE_CAP_TEXTURE_GATHER_SM5:
> diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
> index 5379ba9ade5..01050cf02b4 100644
> --- a/src/gallium/drivers/radeonsi/si_get.c
> +++ b/src/gallium/drivers/radeonsi/si_get.c
> @@ -207,20 +207,23 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>   	case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
>   	case PIPE_CAP_MAX_VERTEX_STREAMS:
>   	case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
>   		return 4;
>   
>   	case PIPE_CAP_GLSL_FEATURE_LEVEL:
>   		if (sscreen->info.has_indirect_compute_dispatch)
>   			return 450;
>   		return 420;
>   
> +	case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +		return 140;
> +
>   	case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
>   		return MIN2(sscreen->info.max_alloc_size, INT_MAX);
>   
>   	case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
>   	case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
>   	case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
>   		return !sscreen->info.has_unaligned_shader_loads;
>   
>   	case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>   		return sscreen->info.has_sparse_vm_mappings ?
> diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
> index f9c786ae75d..f9c916d9382 100644
> --- a/src/gallium/drivers/softpipe/sp_screen.c
> +++ b/src/gallium/drivers/softpipe/sp_screen.c
> @@ -144,20 +144,22 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
>      case PIPE_CAP_TEXTURE_BARRIER:
>         return 0;
>      case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
>      case PIPE_CAP_VERTEX_COLOR_UNCLAMPED: /* draw module */
>      case PIPE_CAP_VERTEX_COLOR_CLAMPED: /* draw module */
>         return 1;
>      case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
>         return 0;
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
>         return 330;
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +      return 140;
>      case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
>      case PIPE_CAP_TGSI_TEX_TXF_LZ:
>         return 0;
>      case PIPE_CAP_COMPUTE:
>         return 1;
>      case PIPE_CAP_USER_VERTEX_BUFFERS:
>      case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>      case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
>      case PIPE_CAP_TGSI_VS_LAYER_VIEWPORT:
>      case PIPE_CAP_DOUBLES:
> diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
> index 82d7c98b685..2744f3100eb 100644
> --- a/src/gallium/drivers/svga/svga_screen.c
> +++ b/src/gallium/drivers/svga/svga_screen.c
> @@ -271,20 +271,23 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
>         return 0; /* The driver can't clamp vertex colors */
>      case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
>         return 0; /* The driver can't clamp fragment colors */
>   
>      case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
>         return 1; /* expected for GL_ARB_framebuffer_object */
>   
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
>         return sws->have_vgpu10 ? 330 : 120;
>   
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +      return sws->have_vgpu10 ? 140 : 120;
> +
>      case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
>         return 0;
>   
>      case PIPE_CAP_SM3:
>         return 1;
>   
>      case PIPE_CAP_DEPTH_CLIP_DISABLE:
>      case PIPE_CAP_INDEP_BLEND_ENABLE:
>      case PIPE_CAP_CONDITIONAL_RENDER:
>      case PIPE_CAP_QUERY_TIMESTAMP:
> diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
> index 738792bf08b..091d322d38c 100644
> --- a/src/gallium/drivers/swr/swr_screen.cpp
> +++ b/src/gallium/drivers/swr/swr_screen.cpp
> @@ -176,20 +176,22 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
>      case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
>         return 2048;
>      case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
>         return SWR_MAX_TEXTURE_ARRAY_LAYERS;
>      case PIPE_CAP_MIN_TEXEL_OFFSET:
>         return -8;
>      case PIPE_CAP_MAX_TEXEL_OFFSET:
>         return 7;
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
>         return 330;
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +      return 140;
>      case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>         return 16;
>      case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
>         return 64;
>      case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
>         return 65536;
>      case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
>         return 0;
>      case PIPE_CAP_MAX_VIEWPORTS:
>         return 1;
> diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c
> index 3777802a6d7..d578265eef0 100644
> --- a/src/gallium/drivers/v3d/v3d_screen.c
> +++ b/src/gallium/drivers/v3d/v3d_screen.c
> @@ -116,20 +116,23 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>   
>           case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>                   return 256;
>   
>           case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
>                   return 4;
>   
>           case PIPE_CAP_GLSL_FEATURE_LEVEL:
>                   return 400;
>   
> +	case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +		return 140;
> +
>           case PIPE_CAP_MAX_VIEWPORTS:
>                   return 1;
>   
>           case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
>                   return 1;
>           case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
>                   return 0;
>           case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
>                   if (screen->devinfo.ver >= 40)
>                           return 0;
> diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
> index d497cd2e869..6415d95746b 100644
> --- a/src/gallium/drivers/vc4/vc4_screen.c
> +++ b/src/gallium/drivers/vc4/vc4_screen.c
> @@ -157,20 +157,21 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>   
>                   /* lying for GL 2.0 */
>           case PIPE_CAP_OCCLUSION_QUERY:
>           case PIPE_CAP_POINT_SPRITE:
>                   return 1;
>   
>           case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>                   return 256;
>   
>           case PIPE_CAP_GLSL_FEATURE_LEVEL:
> +	case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
>                   return 120;
>   
>           case PIPE_CAP_MAX_VIEWPORTS:
>                   return 1;
>   
>           case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
>           case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
>                   return 1;
>   
>           case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
> diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
> index 1ca9e85de73..5e764ff16b2 100644
> --- a/src/gallium/drivers/virgl/virgl_screen.c
> +++ b/src/gallium/drivers/virgl/virgl_screen.c
> @@ -126,20 +126,22 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
>         return 0;
>      case PIPE_CAP_VERTEX_COLOR_UNCLAMPED:
>         return 1;
>      case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
>      case PIPE_CAP_VERTEX_COLOR_CLAMPED:
>         return vscreen->caps.caps.v1.bset.color_clamping;
>      case PIPE_CAP_MIXED_COLORBUFFER_FORMATS:
>         return 1;
>      case PIPE_CAP_GLSL_FEATURE_LEVEL:
>         return vscreen->caps.caps.v1.glsl_level;
> +   case PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY:
> +      return MIN2(vscreen->caps.caps.v1.glsl_level, 140);
>      case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
>         return 0;
>      case PIPE_CAP_COMPUTE:
>         return 0;
>      case PIPE_CAP_USER_VERTEX_BUFFERS:
>         return 0;
>      case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
>         return vscreen->caps.caps.v2.uniform_buffer_offset_alignment;
>      case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>      case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> index 6b2f33b9e37..6cc73a31bfc 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -679,20 +679,21 @@ enum pipe_cap
>      PIPE_CAP_MAX_TEXEL_OFFSET,
>      PIPE_CAP_CONDITIONAL_RENDER,
>      PIPE_CAP_TEXTURE_BARRIER,
>      PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS,
>      PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS,
>      PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME,
>      PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS,
>      PIPE_CAP_VERTEX_COLOR_UNCLAMPED,
>      PIPE_CAP_VERTEX_COLOR_CLAMPED,
>      PIPE_CAP_GLSL_FEATURE_LEVEL,
> +   PIPE_CAP_GLSL_FEATURE_LEVEL_COMPATIBILITY,
>      PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION,
>      PIPE_CAP_USER_VERTEX_BUFFERS,
>      PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY,
>      PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY,
>      PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY,
>      PIPE_CAP_COMPUTE,
>      PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT,
>      PIPE_CAP_START_INSTANCE,
>      PIPE_CAP_QUERY_TIMESTAMP,
>      PIPE_CAP_TEXTURE_MULTISAMPLE,
> 


-- 
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.


More information about the mesa-dev mailing list