summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2019-05-27 16:31:17 +0200
committerGert Wollny <[email protected]>2019-06-20 08:50:38 +0200
commitb79366344929c6e477c64a63f246c6db0766a71c (patch)
treede30a029eddea8e99a5b8d2726ddb7a2ea8f2dc7 /src/gallium/drivers/virgl
parent13d4a34c4463c8c68553b8ce18cb1aa76d567ecb (diff)
virgl: Add driconf tweak for emulating BGRA surfaces on GLES
These tweaks are used to fix rendering issues with Valve games and at least also "The Raven Remastered" when run on a GLES host. v2: Fix type in define and remove virgl from driconf option (Emil) v3: Encode tweak binary instead of using strings (Gurchetan) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl')
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c2
-rw-r--r--src/gallium/drivers/virgl/virgl_protocol.h1
-rw-r--r--src/gallium/drivers/virgl/virgl_screen.c7
3 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index cd653b70ce9..3ce131a1e06 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -1404,6 +1404,8 @@ static void virgl_get_sample_position(struct pipe_context *ctx,
static void virgl_send_tweaks(struct virgl_context *vctx, struct virgl_screen *rs)
{
+ if (rs->tweak_gles_emulate_bgra)
+ virgl_encode_tweak(vctx, virgl_tweak_gles_brga_emulate, 1);
}
struct pipe_context *virgl_context_create(struct pipe_screen *pscreen,
diff --git a/src/gallium/drivers/virgl/virgl_protocol.h b/src/gallium/drivers/virgl/virgl_protocol.h
index c3ad598601d..71d1703cada 100644
--- a/src/gallium/drivers/virgl/virgl_protocol.h
+++ b/src/gallium/drivers/virgl/virgl_protocol.h
@@ -592,6 +592,7 @@ enum virgl_context_cmd {
#define VIRGL_SET_TWEAKS_VALUE 2
enum vrend_tweak_type {
+ virgl_tweak_gles_brga_emulate,
virgl_tweak_undefined
};
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c
index 31de32f9289..54bde6f1237 100644
--- a/src/gallium/drivers/virgl/virgl_screen.c
+++ b/src/gallium/drivers/virgl/virgl_screen.c
@@ -27,6 +27,7 @@
#include "util/u_video.h"
#include "util/u_math.h"
#include "util/os_time.h"
+#include "util/xmlconfig.h"
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
@@ -36,6 +37,7 @@
#include "virgl_resource.h"
#include "virgl_public.h"
#include "virgl_context.h"
+#include "virgl_protocol.h"
int virgl_debug = 0;
static const struct debug_named_value debug_options[] = {
@@ -852,11 +854,16 @@ virgl_create_screen(struct virgl_winsys *vws, const struct pipe_screen_config *c
{
struct virgl_screen *screen = CALLOC_STRUCT(virgl_screen);
+ const char *VIRGL_GLES_EMULATE_BGRA = "gles_emulate_bgra";
if (!screen)
return NULL;
virgl_debug = debug_get_option_virgl_debug();
+ if (config && config->options) {
+ screen->tweak_gles_emulate_bgra =
+ driQueryOptionb(config->options, VIRGL_GLES_EMULATE_BGRA);
+ }
screen->vws = vws;
screen->base.get_name = virgl_get_name;
screen->base.get_vendor = virgl_get_vendor;