Lets have a look at trace from blob (GC3000):
0x000b000b, /* [10080] NTE.SAMPLER[0].SIZE := WIDTH=11,HEIGHT=11 */
0x2001b86e, /* [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=3.437500,HEIGHT=3.437500,ASTC=0,INT_FILTER=1,SRGB=0 */
If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x2001b86e) we can see that 0x6e is used for WIDTH and HEIGHT.
Lets have a look at an other texutre size 180x180:
0x00b400b4, /* [10080] NTE.SAMPLER[0].SIZE := WIDTH=180,HEIGHT=180 */
0x2003bcef, /* [10100] NTE.SAMPLER[0].LOG_SIZE := WIDTH=7.468750,HEIGHT=7.468750,ASTC=0,INT_FILTER=1,SRGB=0 */
Lets use the same test on a different GPU that uses texture descriptors (GC7000):
[44] SIZE: 0x000b000b WIDTH=11,HEIGHT=11
...
[74] LOG_SIZE_EXT: 0x03750375 WIDTH=3.457031,HEIGHT=3.457031
If we ignore the WIDTH and HEIGHT outputs and only look at the raw value (0x03750375) we can see that 0x375 is used for WIDTH and HEIGHT.
Lets have a look at an other texutre size 180x180:
[44] SIZE: 0x00b400b4 WIDTH=180,HEIGHT=180
..
[74] LOG_SIZE_EXT: 0x077d077d WIDTH=7.488281,HEIGHT=7.488281
etnaviv creates the following values for the two texture sizes:
11 -> 0x6f
180 -> 0xf0
Lets switch to U_FIXED(..) which results in equal values.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>
Drop our custom calculation of the logarithm base 2 and switch
to log2f(..).
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24364>
With certain build configuration that value can be a non empty string and
needs to be used.
This will also require distributions to rebuild mesa if and only if
CLANG_RESOURCE_DIR changes between clang rebuilds or updates.
Signed-off-by: Karol Herbst <git@karolherbst.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23981>
Even with direct descriptors, our current implementation works by
doing A64 messages to read/write dynamic buffers. This is so that we
can apply the sliding range view of the descriptor while having
robustness support.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 06dfd216d3 ("anv: add direct descriptor support to apply_layout")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24256>
This is to inform you of some planned downtime in the LAVA lab as follows:
* Start: 2023-08-14 08:00 BST (UTC+1)
* End: 2023-08-14 12:00 BST (UTC+1)
Signed-off-by: Sergi Blanch Torne <sergi.blanch.torne@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24424>
This both gets rid of its use of nir_ssa_dest_init() but also will make
it easier to mechanically remove nir_dest entirely later.
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
This both gets rid of its use of nir_ssa_dest_init() but also will make
it easier to mechanically remove nir_dest entirely later.
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
Catching the cases that Coccinelle missed. Mostly in C++ files using
gtest which causes Coccinelle to just give up and walk away.
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24658>
The buffer data is not directly accessible to application and it's
internally used to only store VACodedBufferSegment struct.
Ignore the size requested by application and instead allocate
sizeof(VACodedBufferSegment). Use calloc to zero out the struct.
This can save significant amount of memory, for example FFmpeg
will request up to tens of MB for single buffer.
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6462
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24410>
GL uses this for adding clip distances to shaders that are missing them,
but the vulkan spec guarantees "A shader must write a single clip distance
for each enabled clip half-space"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24657>
Both EGL and Vulkan implementations require obtaining buffer metadata,
e.g., format, modifier, offsets, strides, etc.
Currently, mesa3d doesn't have a generic solution, and every Vulkan
implementation uses its getters. Most of the getters rely on
kernel metadata storage that is available for x86-based GPU drivers.
ARM-based Vulkan drivers rely on userspace metadata sharing, making it
important to use advanced metadata API. Otherwise, the driver will work
with limited functionality (no YUV, lack of support for modifiers, etc.)
Current EGL buffer getter implementation is advanced enough and used as
a base for a common Android buffer-getter logic.
Use example:
void
android_buffer_test(android_handle_type *a_handle)
{
// First, get the gralloc object. It will be created if it doesn't
// exist. Use U_GRALLOC_TYPE_AUTO to let the implementation choose
// the best gralloc
struct u_gralloc *gralloc = u_gralloc_create(U_GRALLOC_TYPE_AUTO);
// Prepare the internal handle structure (hal_format and
// pixel_stride are required for the fallback implementation).
// Both Vulkan and EGL clients expose HAL format / pixel stride
// in their structures.
u_gralloc_buffer_handle hnd = {
.handle = a_handle->native_handle,
.hal_format = a_handle->hal_format,
.pixel_stride = a_handle->pixel_stride,
};
// Get the basic buffer info
u_gralloc_buffer_basic_info basic_info;
int ret = u_gralloc_get_buffer_basic_info(gralloc, &hnd, &basic_info);
if (ret) {
// Handle the error
}
// Get the color info
u_gralloc_buffer_color_info color_info;
ret = u_gralloc_get_buffer_color_info(gralloc, &hnd, &color_info);
if (ret) {
// Handle the error
}
// unref the gralloc object
u_gralloc_destroy(&gralloc);
}
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215>
Macro leverages __attribute__((__nonnull__)) to help users mark
the function parameter that isn't allowed to be NULL.
Suggested-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18215>
Arguments are parsed in order, so the `-c` here causes that first `--rm`
won't get applied and then it gets overriden by `-o` which writes the file.
Sadly zstd won't report this as a issue, but that's being reported in [1],
so maybe in future versions zstd will warn about it.
[1] https://github.com/facebook/zstd/issues/3719
Fixes: d110299d77 ("ci/deqp-runner: compress results.csv before uploading it to GitLab")
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24651>
The initialization can be simplified and the real programming moved
over to genX_pipeline.c
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24632>