#include "sp_tex_tile_cache.h"
#include "sp_texture.h"
#include "sp_query.h"
-
+#include "sp_screen.h"
/**
softpipe_create_context( struct pipe_screen *screen,
void *priv )
{
+ struct softpipe_screen *sp_screen = softpipe_screen(screen);
struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
uint i;
/*
* Create drawing context and plug our rendering stage into it.
*/
- if (debug_get_bool_option("SOFTPIPE_USE_LLVM", FALSE))
+ if (sp_screen->using_llvm)
softpipe->draw = draw_create(&softpipe->pipe);
else
softpipe->draw = draw_create_no_llvm(&softpipe->pipe);
#include "sp_fence.h"
#include "sp_public.h"
+DEBUG_GET_ONCE_BOOL_OPTION(use_llvm, "SOFTPIPE_USE_LLVM", FALSE);
static const char *
softpipe_get_vendor(struct pipe_screen *screen)
static int
softpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_shader_cap param)
{
+ struct softpipe_screen *sp_screen = softpipe_screen(screen);
switch(shader)
{
case PIPE_SHADER_FRAGMENT:
switch (param) {
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
#ifdef HAVE_LLVM
- /* Softpipe doesn't yet know how to tell draw/llvm about textures */
- return 0;
-#else
+ if (sp_screen->use_llvm)
+ /* Softpipe doesn't yet know how to tell draw/llvm about textures */
+ return 0;
+#endif
return PIPE_MAX_VERTEX_SAMPLERS;
+ case PIPE_SHADER_CAP_INTEGERS:
+#ifdef HAVE_LLVM /* gallivm doesn't support integers yet */
+ if (sp_screen->use_llvm)
+ return 0;
#endif
+ /* fallthrough */
default:
return draw_get_shader_param(shader, param);
}
screen->base.context_create = softpipe_create_context;
screen->base.flush_frontbuffer = softpipe_flush_frontbuffer;
+ screen->using_llvm = debug_get_option_use_llvm();
+
util_format_s3tc_init();
softpipe_init_screen_texture_funcs(&screen->base);