summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_extensions.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-11-27 17:01:01 +1100
committerTimothy Arceri <[email protected]>2018-01-17 23:43:28 +1100
commita20016d8277f9cd68620784417a57ae227783a04 (patch)
treea42cc195c097c31f33b8e997de5eb1e05bff625f /src/mesa/state_tracker/st_extensions.c
parenta34262aed77dc358c29b492139796a9847dd37d1 (diff)
st/glsl_to_tgsi: add ARB_get_program_binary support using TGSI
This resolves a game bug in Dead Island. The game doesn't properly handle ARB_get_program_binary with 0 supported formats, and ends up crashing. This will enable ARB_get_program_binary binary support for any driver that currently enables the on-disk shader cache. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85564
Diffstat (limited to 'src/mesa/state_tracker/st_extensions.c')
-rw-r--r--src/mesa/state_tracker/st_extensions.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index c8411a69951..370d1a7e06b 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -417,6 +417,10 @@ void st_init_limits(struct pipe_screen *screen,
c->GLSLFrontFacingIsSysVal =
screen->get_param(screen, PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL);
+ /* GL_ARB_get_program_binary */
+ if (screen->get_disk_shader_cache && screen->get_disk_shader_cache(screen))
+ c->NumProgramBinaryFormats = 1;
+
c->MaxAtomicBufferBindings =
c->Program[MESA_SHADER_FRAGMENT].MaxAtomicBuffers;