RetroArch/gfx/drivers_shader/shader_null.c

117 lines
2.5 KiB
C
Raw Normal View History

/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2017-01-22 12:40:32 +00:00
* Copyright (C) 2011-2017 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
2015-10-31 19:53:08 +00:00
#include <stdlib.h>
#include <string.h>
2015-10-31 19:53:08 +00:00
2014-10-21 05:58:58 +00:00
#include <compat/strl.h>
#include <compat/posix_string.h>
2015-10-31 19:53:08 +00:00
#include <boolean.h>
#include <gfx/math/matrix_4x4.h>
2016-01-20 05:16:55 +00:00
#include <string/stdstring.h>
2015-10-31 19:53:08 +00:00
#ifdef HAVE_CONFIG_H
#include "../../config.h"
#endif
#include "../video_shader_driver.h"
2015-12-05 06:33:21 +00:00
typedef struct null_shader_data
{
void *empty;
} null_shader_data_t;
static void shader_null_deinit(void *data)
{
null_shader_data_t *null_shader = (null_shader_data_t*)data;
if (!null_shader)
return;
free(null_shader);
}
static void *shader_null_init(void *data, const char *path)
{
null_shader_data_t *null_shader = (null_shader_data_t*)
calloc(1, sizeof(*null_shader));
if (!null_shader)
return NULL;
return null_shader;
}
static void shader_null_set_uniform_parameter(
void *data,
struct uniform_info *param,
void *uniform_data)
{
}
2015-12-05 06:33:21 +00:00
static unsigned shader_null_num(void *data)
{
return 0;
}
2015-12-05 06:33:21 +00:00
static unsigned shader_null_get_prev_textures(void *data)
{
return 0;
}
2015-12-05 06:33:21 +00:00
static bool shader_null_get_feedback_pass(void *data, unsigned *idx)
{
(void)idx;
return false;
}
2015-12-05 06:33:21 +00:00
static struct video_shader *shader_null_get_current_shader(void *data)
{
return NULL;
}
2016-04-16 02:56:15 +00:00
static bool shader_null_compile_program(
void *data,
unsigned idx,
void *program_data,
struct shader_program_info *program_info)
{
return true;
}
const shader_backend_t shader_null_backend = {
shader_null_init,
shader_null_deinit,
2017-05-18 12:06:50 +00:00
NULL,
shader_null_set_uniform_parameter,
2016-04-16 02:56:15 +00:00
shader_null_compile_program,
2017-05-18 12:06:50 +00:00
NULL,
shader_null_num,
NULL,
2017-05-18 12:06:50 +00:00
NULL,
2017-05-18 12:18:01 +00:00
NULL,
NULL,
2017-05-18 12:06:50 +00:00
NULL,
NULL,
shader_null_get_prev_textures,
shader_null_get_feedback_pass,
2017-05-18 12:18:01 +00:00
NULL,
shader_null_get_current_shader,
RARCH_SHADER_NONE,
"nullshader"
};