* policies, either expressed or implied, of the copyright holders.
*/
-#include <stdio.h>
-#include <string.h>
+#include "pipe/p_compiler.h"
+
#include "postprocess/postprocess.h"
#include "postprocess/pp_mlaa.h"
#include "postprocess/pp_filters.h"
#include "util/u_box.h"
#include "util/u_sampler.h"
#include "util/u_inlines.h"
+#include "util/u_memory.h"
+#include "util/u_string.h"
#include "pipe/p_screen.h"
#define IMM_SPACE 80
dimensions[1] = p->framebuffer.height;
}
- p->pipe->set_constant_buffer(p->pipe, PIPE_SHADER_VERTEX, 0, constbuf);
- p->pipe->set_constant_buffer(p->pipe, PIPE_SHADER_FRAGMENT, 0, constbuf);
+ pipe_set_constant_buffer(p->pipe, PIPE_SHADER_VERTEX, 0, constbuf);
+ pipe_set_constant_buffer(p->pipe, PIPE_SHADER_FRAGMENT, 0, constbuf);
mstencil.stencil[0].enabled = 1;
mstencil.stencil[0].valuemask = mstencil.stencil[0].writemask = ~0;
pp_filter_misc_state(p);
cso_set_depth_stencil_alpha(p->cso, &mstencil);
p->pipe->clear(p->pipe, PIPE_CLEAR_STENCIL | PIPE_CLEAR_COLOR,
- p->clear_color, 0, 0);
+ &p->clear_color, 0, 0);
cso_single_sampler(p->cso, 0, &p->sampler_point);
cso_single_sampler_done(p->cso);
struct pipe_box box;
struct pipe_resource res;
-
- char *tmp_text = calloc(sizeof(blend2fs_1) + sizeof(blend2fs_2) +
- IMM_SPACE, sizeof(char));
+ char *tmp_text;
constbuf = pipe_buffer_create(ppq->p->screen, PIPE_BIND_CONSTANT_BUFFER,
PIPE_USAGE_STATIC, sizeof(constants));
pp_debug("mlaa: using %u max search steps\n", val);
+ tmp_text = CALLOC(sizeof(blend2fs_1) + sizeof(blend2fs_2) +
+ IMM_SPACE, sizeof(char));
+
if (!tmp_text) {
pp_debug("Failed to allocate shader space\n");
return;
}
- sprintf(tmp_text, "%s"
- "IMM FLT32 { %.8f, 0.0000, 0.0000, 0.0000}\n"
- "%s\n", blend2fs_1, (float) val, blend2fs_2);
+ util_sprintf(tmp_text, "%s"
+ "IMM FLT32 { %.8f, 0.0000, 0.0000, 0.0000}\n"
+ "%s\n", blend2fs_1, (float) val, blend2fs_2);
memset(&res, 0, sizeof(res));
ppq->shaders[n][4] = pp_tgsi_to_state(ppq->p->pipe, neigh3fs, false,
"neigh3fs");
- free(tmp_text);
+ FREE(tmp_text);
}
/** Short wrapper to init the depth version. */