[Mesa-dev] [PATCH 1/7] gallium: add pipe_blend_state::srgb_enable and the CAP

Roland Scheidegger sroland at vmware.com
Mon Jun 12 23:11:35 UTC 2017


I can't say I like this neither.

This just seems to add complexity to the gallium interface for
questionable reasons. Reducing the srgb weirdness all different apis
have (and there's PLENTY of that all around) to just using different
formats everywhere is imho a very nice property I'd like to keep.

I'll understand sacrifices might have to be made sometimes to interface
purity for performance reasons.
But I'd like to see some proof this is justified for performance
reasons, and a microbenchmark which exposes this specifically even if it
might never happen in practice imho isn't good enough. The vertex/index
buffer changes for instance were a lot more convincing to me (they also
didn't make things that much uglier).

Roland

Am 12.06.2017 um 18:56 schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> This is much faster than updating the whole framebuffer state.
> ---
>  src/gallium/docs/source/cso/blend.rst            | 6 +++++-
>  src/gallium/docs/source/screen.rst               | 2 ++
>  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         | 1 +
>  src/gallium/drivers/nouveau/nv30/nv30_screen.c   | 1 +
>  src/gallium/drivers/nouveau/nv50/nv50_screen.c   | 1 +
>  src/gallium/drivers/nouveau/nvc0/nvc0_screen.c   | 1 +
>  src/gallium/drivers/r300/r300_screen.c           | 1 +
>  src/gallium/drivers/r600/r600_pipe.c             | 1 +
>  src/gallium/drivers/radeonsi/si_pipe.c           | 1 +
>  src/gallium/drivers/softpipe/sp_screen.c         | 1 +
>  src/gallium/drivers/svga/svga_screen.c           | 1 +
>  src/gallium/drivers/swr/swr_screen.cpp           | 1 +
>  src/gallium/drivers/vc4/vc4_screen.c             | 1 +
>  src/gallium/drivers/virgl/virgl_screen.c         | 1 +
>  src/gallium/include/pipe/p_defines.h             | 1 +
>  src/gallium/include/pipe/p_state.h               | 1 +
>  19 files changed, 24 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/docs/source/cso/blend.rst b/src/gallium/docs/source/cso/blend.rst
> index 7316e5c..2c69253 100644
> --- a/src/gallium/docs/source/cso/blend.rst
> +++ b/src/gallium/docs/source/cso/blend.rst
> @@ -92,21 +92,25 @@ alpha_to_coverage
>     If enabled, the fragment's alpha value is used to override the fragment's
>     coverage mask.  The coverage mask will be all zeros if the alpha value is
>     zero.  The coverage mask will be all ones if the alpha value is one.
>     Otherwise, the number of bits set in the coverage mask will be proportional
>     to the alpha value.  Note that this step happens regardless of whether
>     multisample is enabled or the destination buffer is multisampled.
>  alpha_to_one
>     If enabled, the fragment's alpha value will be set to one.  As with
>     alpha_to_coverage, this step happens regardless of whether multisample
>     is enabled or the destination buffer is multisampled.
> -
> +srgb_enable
> +   If PIPE_CAP_BLEND_STATE_SRGB_ENABLE is exposed, the i-th bit is set,
> +   and the i-th color buffer is UNORM and has 8 bits per channel, the color
> +   buffer is forced to sRGB. This has no effect with other formats.
> +   In addition to draw calls, pipe_context::clear is affected too.
>  
>  Per-rendertarget Members
>  ------------------------
>  
>  blend_enable
>     If blending is enabled, perform a blend calculation according to blend
>     functions and source/destination factors. Otherwise, the incoming fragment
>     color gets passed unmodified (but colormask still applies).
>  rgb_func
>     The blend function to use for rgb channels. One of PIPE_BLEND.
> diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
> index 288fb5c..acbd1ac 100644
> --- a/src/gallium/docs/source/screen.rst
> +++ b/src/gallium/docs/source/screen.rst
> @@ -387,20 +387,22 @@ The integer capabilities:
>  * ``PIPE_CAP_TGSI_BALLOT``: Whether the BALLOT and READ_* opcodes as well as
>    the SUBGROUP_* semantics are supported.
>  * ``PIPE_CAP_TGSI_TES_LAYER_VIEWPORT``: Whether ``TGSI_SEMANTIC_LAYER`` and
>    ``TGSI_SEMANTIC_VIEWPORT_INDEX`` are supported as tessellation evaluation
>    shader outputs.
>  * ``PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX``: Whether a buffer with just
>    PIPE_BIND_CONSTANT_BUFFER can be legally passed to set_vertex_buffers.
>  * ``PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION``: As the name says.
>  * ``PIPE_CAP_POST_DEPTH_COVERAGE``: whether
>    ``TGSI_PROPERTY_FS_POST_DEPTH_COVERAGE`` is supported.
> +* ``PIPE_CAP_BLEND_STATE_SRGB_ENABLE``: Whether pipe_blend_state::srgb_enable
> +  is implemented.
>  
>  
>  .. _pipe_capf:
>  
>  PIPE_CAPF_*
>  ^^^^^^^^^^^^^^^^
>  
>  The floating-point capabilities are:
>  
>  * ``PIPE_CAPF_MAX_LINE_WIDTH``: The maximum width of a regular line.
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_screen.c b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> index 8fd1184..dadaa04 100644
> --- a/src/gallium/drivers/etnaviv/etnaviv_screen.c
> +++ b/src/gallium/drivers/etnaviv/etnaviv_screen.c
> @@ -250,20 +250,21 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>     case PIPE_CAP_INT64_DIVMOD:
>     case PIPE_CAP_TGSI_TEX_TXF_LZ:
>     case PIPE_CAP_TGSI_CLOCK:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>     case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>  
>     /* Stream output. */
>     case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
>     case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>     case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
>     case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>        return 0;
>  
>     /* Geometry shader output, unsupported. */
> diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
> index 0bf9e8e..1dffba7 100644
> --- a/src/gallium/drivers/freedreno/freedreno_screen.c
> +++ b/src/gallium/drivers/freedreno/freedreno_screen.c
> @@ -309,20 +309,21 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>  	case PIPE_CAP_INT64_DIVMOD:
>  	case PIPE_CAP_TGSI_TEX_TXF_LZ:
>  	case PIPE_CAP_TGSI_CLOCK:
>  	case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>  	case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>  	case PIPE_CAP_TGSI_BALLOT:
>  	case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>  	case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>  	case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>  	case PIPE_CAP_POST_DEPTH_COVERAGE:
> +	case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>  		return 0;
>  
>  	case PIPE_CAP_MAX_VIEWPORTS:
>  		return 1;
>  
>  	case PIPE_CAP_SHAREABLE_SHADERS:
>  	case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
>  	/* manage the variants for these ourself, to avoid breaking precompile: */
>  	case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
>  	case PIPE_CAP_VERTEX_COLOR_CLAMPED:
> diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
> index a0dbc12..c41c93c 100644
> --- a/src/gallium/drivers/i915/i915_screen.c
> +++ b/src/gallium/drivers/i915/i915_screen.c
> @@ -271,20 +271,21 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
>     case PIPE_CAP_FRAMEBUFFER_NO_ATTACHMENT:
>     case PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR:
>     case PIPE_CAP_CULL_DISTANCE:
>     case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
>     case PIPE_CAP_TGSI_VOTE:
>     case PIPE_CAP_MAX_WINDOW_RECTANGLES:
>     case PIPE_CAP_POLYGON_OFFSET_UNITS_UNSCALED:
>     case PIPE_CAP_TGSI_ARRAY_COMPONENTS:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>  
>     case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
>     case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>     case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
>     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_VS_LAYER_VIEWPORT:
>     case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
> diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
> index 4e8c110..a260aee 100644
> --- a/src/gallium/drivers/llvmpipe/lp_screen.c
> +++ b/src/gallium/drivers/llvmpipe/lp_screen.c
> @@ -348,20 +348,21 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_TGSI_FS_FBFETCH:
>     case PIPE_CAP_TGSI_MUL_ZERO_WINS:
>     case PIPE_CAP_TGSI_CLOCK:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>     case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>     }
>     /* should only get here on unhandled cases */
>     debug_printf("Unexpected PIPE_CAP %d query\n", param);
>     return 0;
>  }
>  
>  static int
>  llvmpipe_get_shader_param(struct pipe_screen *screen,
>                            enum pipe_shader_type shader,
> diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> index 553ee49..5694a23 100644
> --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
> @@ -212,20 +212,21 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>     case PIPE_CAP_INT64:
>     case PIPE_CAP_INT64_DIVMOD:
>     case PIPE_CAP_TGSI_TEX_TXF_LZ:
>     case PIPE_CAP_TGSI_CLOCK:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>  
>     case PIPE_CAP_VENDOR_ID:
>        return 0x10de;
>     case PIPE_CAP_DEVICE_ID: {
>        uint64_t device_id;
>        if (nouveau_getparam(dev, NOUVEAU_GETPARAM_PCI_DEVICE, &device_id)) {
>           NOUVEAU_ERR("NOUVEAU_GETPARAM_PCI_DEVICE failed.\n");
>           return -1;
>        }
> diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> index 631b2c9..3115d84 100644
> --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
> @@ -264,20 +264,21 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>     case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
>     case PIPE_CAP_TGSI_FS_FBFETCH:
>     case PIPE_CAP_DOUBLES:
>     case PIPE_CAP_INT64:
>     case PIPE_CAP_INT64_DIVMOD:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>  
>     case PIPE_CAP_VENDOR_ID:
>        return 0x10de;
>     case PIPE_CAP_DEVICE_ID: {
>        uint64_t device_id;
>        if (nouveau_getparam(dev, NOUVEAU_GETPARAM_PCI_DEVICE, &device_id)) {
>           NOUVEAU_ERR("NOUVEAU_GETPARAM_PCI_DEVICE failed.\n");
>           return -1;
>        }
> diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> index cf31b6c..715ec25 100644
> --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
> @@ -293,20 +293,21 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>     case PIPE_CAP_PCI_GROUP:
>     case PIPE_CAP_PCI_BUS:
>     case PIPE_CAP_PCI_DEVICE:
>     case PIPE_CAP_PCI_FUNCTION:
>     case PIPE_CAP_VIEWPORT_SUBPIXEL_BITS:
>     case PIPE_CAP_TGSI_CAN_READ_OUTPUTS:
>     case PIPE_CAP_NATIVE_FENCE_FD:
>     case PIPE_CAP_GLSL_OPTIMIZE_CONSERVATIVELY:
>     case PIPE_CAP_INT64_DIVMOD:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>  
>     case PIPE_CAP_VENDOR_ID:
>        return 0x10de;
>     case PIPE_CAP_DEVICE_ID: {
>        uint64_t device_id;
>        if (nouveau_getparam(dev, NOUVEAU_GETPARAM_PCI_DEVICE, &device_id)) {
>           NOUVEAU_ERR("NOUVEAU_GETPARAM_PCI_DEVICE failed.\n");
>           return -1;
>        }
> diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
> index 346ce05..3e49525 100644
> --- a/src/gallium/drivers/r300/r300_screen.c
> +++ b/src/gallium/drivers/r300/r300_screen.c
> @@ -234,20 +234,21 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>          case PIPE_CAP_INT64:
>          case PIPE_CAP_INT64_DIVMOD:
>          case PIPE_CAP_TGSI_TEX_TXF_LZ:
>          case PIPE_CAP_TGSI_CLOCK:
>          case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>          case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>          case PIPE_CAP_TGSI_BALLOT:
>          case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>          case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>          case PIPE_CAP_POST_DEPTH_COVERAGE:
> +        case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>              return 0;
>  
>          /* SWTCL-only features. */
>          case PIPE_CAP_PRIMITIVE_RESTART:
>          case PIPE_CAP_USER_VERTEX_BUFFERS:
>          case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
>              return !r300screen->caps.has_tcl;
>  
>          /* HWTCL-only features / limitations. */
>          case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
> diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
> index d4fdccb..1f4bd5c 100644
> --- a/src/gallium/drivers/r600/r600_pipe.c
> +++ b/src/gallium/drivers/r600/r600_pipe.c
> @@ -390,20 +390,21 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>  	case PIPE_CAP_TGSI_FS_FBFETCH:
>  	case PIPE_CAP_INT64:
>  	case PIPE_CAP_INT64_DIVMOD:
>  	case PIPE_CAP_TGSI_TEX_TXF_LZ:
>  	case PIPE_CAP_TGSI_CLOCK:
>  	case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>  	case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>  	case PIPE_CAP_TGSI_BALLOT:
>  	case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>  	case PIPE_CAP_POST_DEPTH_COVERAGE:
> +	case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>  		return 0;
>  
>  	case PIPE_CAP_DOUBLES:
>  		if (rscreen->b.family == CHIP_ARUBA ||
>  		    rscreen->b.family == CHIP_CAYMAN ||
>  		    rscreen->b.family == CHIP_CYPRESS ||
>  		    rscreen->b.family == CHIP_HEMLOCK)
>  			return 1;
>  		return 0;
>  
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
> index cb37226..538c8e8 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.c
> +++ b/src/gallium/drivers/radeonsi/si_pipe.c
> @@ -530,20 +530,21 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
>  	case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
>  	case PIPE_CAP_VERTEXID_NOBASE:
>  	case PIPE_CAP_PRIMITIVE_RESTART_FOR_PATCHES:
>  	case PIPE_CAP_MAX_WINDOW_RECTANGLES:
>  	case PIPE_CAP_NATIVE_FENCE_FD:
>  	case PIPE_CAP_TGSI_FS_FBFETCH:
>  	case PIPE_CAP_TGSI_MUL_ZERO_WINS:
>  	case PIPE_CAP_UMA:
>  	case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>  	case PIPE_CAP_POST_DEPTH_COVERAGE:
> +	case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>  		return 0;
>  
>  	case PIPE_CAP_QUERY_BUFFER_OBJECT:
>  		return si_have_tgsi_compute(sscreen);
>  
>  	case PIPE_CAP_DRAW_PARAMETERS:
>  	case PIPE_CAP_MULTI_DRAW_INDIRECT:
>  	case PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS:
>  		return sscreen->has_draw_indirect_multi;
>  
> diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
> index de26494..a7454be 100644
> --- a/src/gallium/drivers/softpipe/sp_screen.c
> +++ b/src/gallium/drivers/softpipe/sp_screen.c
> @@ -298,20 +298,21 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_TGSI_FS_FBFETCH:
>     case PIPE_CAP_TGSI_MUL_ZERO_WINS:
>     case PIPE_CAP_TGSI_CLOCK:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>     case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>     case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
>        return 4;
>     }
>     /* should only get here on unhandled cases */
>     debug_printf("Unexpected PIPE_CAP %d query\n", param);
>     return 0;
>  }
>  
>  static int
> diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
> index 5ffb6c8..65c3cdb 100644
> --- a/src/gallium/drivers/svga/svga_screen.c
> +++ b/src/gallium/drivers/svga/svga_screen.c
> @@ -437,20 +437,21 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_INT64_DIVMOD:
>     case PIPE_CAP_TGSI_TEX_TXF_LZ:
>     case PIPE_CAP_TGSI_CLOCK:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>     case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>     }
>  
>     debug_printf("Unexpected PIPE_CAP_ query %u\n", param);
>     return 0;
>  }
>  
>  
>  static int
>  vgpu9_get_shader_param(struct pipe_screen *screen,
> diff --git a/src/gallium/drivers/swr/swr_screen.cpp b/src/gallium/drivers/swr/swr_screen.cpp
> index 7931d19..d0d635e 100644
> --- a/src/gallium/drivers/swr/swr_screen.cpp
> +++ b/src/gallium/drivers/swr/swr_screen.cpp
> @@ -333,20 +333,21 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_INT64_DIVMOD:
>     case PIPE_CAP_TGSI_TEX_TXF_LZ:
>     case PIPE_CAP_TGSI_CLOCK:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>     case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>  
>     case PIPE_CAP_VENDOR_ID:
>        return 0xFFFFFFFF;
>     case PIPE_CAP_DEVICE_ID:
>        return 0xFFFFFFFF;
>     case PIPE_CAP_ACCELERATED:
>        return 0;
>     case PIPE_CAP_VIDEO_MEMORY: {
>        /* XXX: Do we want to return the full amount of system memory ? */
> diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c
> index 1f66d4c..c40080a 100644
> --- a/src/gallium/drivers/vc4/vc4_screen.c
> +++ b/src/gallium/drivers/vc4/vc4_screen.c
> @@ -249,20 +249,21 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
>          case PIPE_CAP_INT64_DIVMOD:
>          case PIPE_CAP_TGSI_TEX_TXF_LZ:
>          case PIPE_CAP_TGSI_CLOCK:
>          case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>          case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>          case PIPE_CAP_TGSI_BALLOT:
>          case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>  	case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>  	case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>          case PIPE_CAP_POST_DEPTH_COVERAGE:
> +	case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>                  return 0;
>  
>                  /* Stream output. */
>          case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
>          case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
>          case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
>          case PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS:
>          case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
>                  return 0;
>  
> diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
> index 456381e..78d8974 100644
> --- a/src/gallium/drivers/virgl/virgl_screen.c
> +++ b/src/gallium/drivers/virgl/virgl_screen.c
> @@ -257,20 +257,21 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
>     case PIPE_CAP_TGSI_TEX_TXF_LZ:
>     case PIPE_CAP_TGSI_CLOCK:
>     case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
>     case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
>     case PIPE_CAP_TGSI_BALLOT:
>     case PIPE_CAP_DOUBLES:
>     case PIPE_CAP_TGSI_TES_LAYER_VIEWPORT:
>     case PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX:
>     case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
>     case PIPE_CAP_POST_DEPTH_COVERAGE:
> +   case PIPE_CAP_BLEND_STATE_SRGB_ENABLE:
>        return 0;
>     case PIPE_CAP_VENDOR_ID:
>        return 0x1af4;
>     case PIPE_CAP_DEVICE_ID:
>        return 0x1010;
>     case PIPE_CAP_ACCELERATED:
>        return 1;
>     case PIPE_CAP_UMA:
>     case PIPE_CAP_VIDEO_MEMORY:
>        return 0;
> diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
> index c02bbdb..576440d 100644
> --- a/src/gallium/include/pipe/p_defines.h
> +++ b/src/gallium/include/pipe/p_defines.h
> @@ -766,20 +766,21 @@ enum pipe_cap
>     PIPE_CAP_INT64_DIVMOD,
>     PIPE_CAP_TGSI_TEX_TXF_LZ,
>     PIPE_CAP_TGSI_CLOCK,
>     PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE,
>     PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE,
>     PIPE_CAP_TGSI_BALLOT,
>     PIPE_CAP_TGSI_TES_LAYER_VIEWPORT,
>     PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX,
>     PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION,
>     PIPE_CAP_POST_DEPTH_COVERAGE,
> +   PIPE_CAP_BLEND_STATE_SRGB_ENABLE,
>  };
>  
>  #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
>  #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600 (1 << 1)
>  
>  enum pipe_endian
>  {
>     PIPE_ENDIAN_LITTLE = 0,
>     PIPE_ENDIAN_BIG = 1,
>  #if defined(PIPE_ARCH_LITTLE_ENDIAN)
> diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
> index 15be8cb..a585c59 100644
> --- a/src/gallium/include/pipe/p_state.h
> +++ b/src/gallium/include/pipe/p_state.h
> @@ -324,20 +324,21 @@ struct pipe_rt_blend_state
>  
>  
>  struct pipe_blend_state
>  {
>     unsigned independent_blend_enable:1;
>     unsigned logicop_enable:1;
>     unsigned logicop_func:4;      /**< PIPE_LOGICOP_x */
>     unsigned dither:1;
>     unsigned alpha_to_coverage:1;
>     unsigned alpha_to_one:1;
> +   unsigned srgb_enable:PIPE_MAX_COLOR_BUFS;
>     struct pipe_rt_blend_state rt[PIPE_MAX_COLOR_BUFS];
>  };
>  
>  
>  struct pipe_blend_color
>  {
>     float color[4];
>  };
>  
>  
> 



More information about the mesa-dev mailing list