mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-28 20:48:13 +02:00
Together with the previous patch that corrects the number of
swapchain images on Xwayland this gives Zink/Venus a spead
boost in a number of work loads and close the gap or even
surpass VirGL when the benchmark is not GPU bound.
Some numbers:
zink (Virtio-GPU Venus (Host: RADV RENOIR)) / VirGL
Benchmark VirGL baseline Zink/Venus +1
and Xwayland +1
==================================================================
OpenArena (FPS) 63.8 60.1 148.5
Unigine Sancuary (FPS) 129.1 121.4 164.7
Unigine Tropics (FPS) 107.2 85.7 114.3
Unigine Heaven (FPS) 48.5 48.0 51.5
Unigine Valley (FPS) 48.0 45.6 47.4
Xonotic (FPS) 90.5 59.4 89.2
GpuTest/Volcano (Points) 2960 2966 3013
zink (Virtio-GPU Venus (Host: Intel Xe TGL GT2)) / VirGL
Benchmark VirGL baseline Zink/Venus +1
and Xwayland +1
===========================================================
OpenArena (FPS) 95.1 59.8 78.9
Unigine Sancuary (FPS) 85.5 76.6 81.8
Unigine Tropics (FPS) 66.0 59.8 62.7
Unigine Heaven (FPS) 28.8 28.7 28.0
Unigine Valley (FPS) 29.0 28.0 27.0
Xonotic (FPS) 64.2 49.4 51.1
GpuTest/Volcano (Points) 2855 2718 2747
v2: Fix limiting minImageCount (Mike)
Signed-off-by: Gert Wollny <gert.wollny@collabora.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21136>
|
||
|---|---|---|
| .. | ||
| auxiliary | ||
| drivers | ||
| frontends | ||
| include | ||
| targets | ||
| tests | ||
| tools | ||
| winsys | ||
| meson.build | ||
| README.portability | ||
CROSS-PLATFORM PORTABILITY GUIDELINES FOR GALLIUM3D
= General Considerations =
The frontend and winsys driver support a rather limited number of
platforms. However, the pipe drivers are meant to run in a wide number of
platforms. Hence the pipe drivers, the auxiliary modules, and all public
headers in general, should strictly follow these guidelines to ensure
= Compiler Support =
* Include the p_compiler.h.
* Cast explicitly when converting to integer types of smaller sizes.
* Cast explicitly when converting between float, double and integral types.
* Don't use named struct initializers.
* Don't use variable number of macro arguments. Use static inline functions
instead.
* Don't use C99 features.
= Standard Library =
* Avoid including standard library headers. Most standard library functions are
not available in Windows Kernel Mode. Use the appropriate p_*.h include.
== Memory Allocation ==
* Use MALLOC, CALLOC, FREE instead of the malloc, calloc, free functions.
* Use align_pointer() function defined in u_memory.h for aligning pointers
in a portable way.
== Debugging ==
* Use the functions/macros in p_debug.h.
* Don't include assert.h, call abort, printf, etc.
= Code Style =
== Inherantice in C ==
The main thing we do is mimic inheritance by structure containment.
Here's a silly made-up example:
/* base class */
struct buffer
{
int size;
void (*validate)(struct buffer *buf);
};
/* sub-class of bufffer */
struct texture_buffer
{
struct buffer base; /* the base class, MUST COME FIRST! */
int format;
int width, height;
};
Then, we'll typically have cast-wrapper functions to convert base-class
pointers to sub-class pointers where needed:
static inline struct vertex_buffer *vertex_buffer(struct buffer *buf)
{
return (struct vertex_buffer *) buf;
}
To create/init a sub-classed object:
struct buffer *create_texture_buffer(int w, int h, int format)
{
struct texture_buffer *t = malloc(sizeof(*t));
t->format = format;
t->width = w;
t->height = h;
t->base.size = w * h;
t->base.validate = tex_validate;
return &t->base;
}
Example sub-class method:
void tex_validate(struct buffer *buf)
{
struct texture_buffer *tb = texture_buffer(buf);
assert(tb->format);
assert(tb->width);
assert(tb->height);
}
Note that we typically do not use typedefs to make "class names"; we use
'struct whatever' everywhere.
Gallium's pipe_context and the subclassed psb_context, etc are prime examples
of this. There's also many examples in Mesa and the Mesa state tracker.