softpipe: add null ptr check in softpipe_map_constant_buffers()
[mesa.git] / src / gallium / drivers / softpipe / sp_state_fs.c
index e5b609cf6c98b83231207e31b353ec36beab12a1..4d01a9dbe15fa7ff66a4cb88c74ac9c8d06e1708 100644 (file)
@@ -32,7 +32,7 @@
 #include "pipe/p_defines.h"
 #include "util/u_memory.h"
 #include "pipe/p_inlines.h"
-#include "pipe/p_winsys.h"
+#include "pipe/internal/p_winsys_screen.h"
 #include "pipe/p_shader_tokens.h"
 #include "draw/draw_context.h"
 #include "tgsi/tgsi_dump.h"
@@ -146,16 +146,15 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
                              const struct pipe_constant_buffer *buf)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
-   struct pipe_winsys *ws = pipe->winsys;
+   struct pipe_screen *screen = pipe->screen;
 
    assert(shader < PIPE_SHADER_TYPES);
    assert(index == 0);
 
    /* note: reference counting */
-   winsys_buffer_reference(ws,
+   pipe_buffer_reference(screen,
                         &softpipe->constants[shader].buffer,
                         buf ? buf->buffer : NULL);
-   softpipe->constants[shader].size = buf ? buf->size : 0;
 
    softpipe->dirty |= SP_NEW_CONSTANTS;
 }