From 010c18c4433c4d3b929dc8c9ca6002697b356c98 Mon Sep 17 00:00:00 2001 From: Antonio Gomes Date: Fri, 6 Jan 2023 23:52:05 -0300 Subject: [PATCH] gallium: Add new caps PIPE_CAP_LINEAR_IMAGE_(PITCH_ALIGNMENT|BASE_ADDRESS_ALIGNMENT) Part-of: --- docs/gallium/screen.rst | 6 ++++++ src/gallium/auxiliary/util/u_screen.c | 6 ++++++ src/gallium/include/pipe/p_defines.h | 2 ++ 3 files changed, 14 insertions(+) diff --git a/docs/gallium/screen.rst b/docs/gallium/screen.rst index e6f3c8c..cb66016 100644 --- a/docs/gallium/screen.rst +++ b/docs/gallium/screen.rst @@ -162,6 +162,12 @@ The integer capabilities: * ``PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT``: Describes the required alignment for pipe_sampler_view::u.buf.offset, in bytes. If a driver does not support offset/size, it should return 0. +* ``PIPE_CAP_LINEAR_IMAGE_PITCH_ALIGNMENT``: Describes the row pitch alignment + size that pipe_sampler_view::u.tex2d_from_buf must be multiple of, in pixels. + If a driver does not support images created from buffers, it should return 0. +* ``PIPE_CAP_LINEAR_IMAGE_BASE_ADDRESS_ALIGNMENT``: Describes the minimum alignment + in pixels of the offset of a host pointer for images created from buffers. + If a driver does not support images created from buffers, it should return 0. * ``PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY``: Whether the driver only supports R, RG, RGB and RGBA formats for PIPE_BUFFER sampler views. When this is the case it should be assumed that the swizzle parameters diff --git a/src/gallium/auxiliary/util/u_screen.c b/src/gallium/auxiliary/util/u_screen.c index 8c8a66c..c0ed2f0 100644 --- a/src/gallium/auxiliary/util/u_screen.c +++ b/src/gallium/auxiliary/util/u_screen.c @@ -179,6 +179,12 @@ u_pipe_screen_get_param_defaults(struct pipe_screen *pscreen, /* GL_EXT_texture_buffer minimum value. */ return 65536; + case PIPE_CAP_LINEAR_IMAGE_PITCH_ALIGNMENT: + return 0; + + case PIPE_CAP_LINEAR_IMAGE_BASE_ADDRESS_ALIGNMENT: + return 0; + case PIPE_CAP_MAX_VIEWPORTS: return 1; diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index d7d0510..250fde8 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -808,6 +808,8 @@ enum pipe_cap PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY, PIPE_CAP_TGSI_TEXCOORD, PIPE_CAP_TEXTURE_BUFFER_SAMPLER, + PIPE_CAP_LINEAR_IMAGE_PITCH_ALIGNMENT, + PIPE_CAP_LINEAR_IMAGE_BASE_ADDRESS_ALIGNMENT, PIPE_CAP_TEXTURE_TRANSFER_MODES, PIPE_CAP_QUERY_PIPELINE_STATISTICS, PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK, -- 2.7.4