Permalink
Browse files

Reintroduce CGP refactor.

Fix several issues that caused crashes.
  • Loading branch information...
1 parent c3ac302 commit e649db253ccbdaabc232ce8c9894ccc9092c7feb @Themaister committed Apr 6, 2013
Showing with 733 additions and 505 deletions.
  1. +1 −0 Makefile
  2. +1 −0 Makefile.win
  3. +7 −0 conf/config_file.c
  4. +1 −0 conf/config_file.h
  5. +2 −2 gfx/gl.c
  6. +2 −20 gfx/gl_common.h
  7. +93 −462 gfx/shader_cg.c
  8. +1 −10 gfx/shader_cg.h
  9. +2 −1 gfx/shader_common.h
  10. +4 −4 gfx/shader_glsl.c
  11. +1 −1 gfx/shader_glsl.h
  12. +513 −0 gfx/shader_parse.c
  13. +98 −0 gfx/shader_parse.h
  14. +3 −5 gfx/state_tracker.h
  15. +4 −0 griffin/griffin.c
View
@@ -23,6 +23,7 @@ OBJ = frontend/frontend.o \
conf/config_file.o \
screenshot.o \
gfx/scaler/scaler.o \
+ gfx/shader_parse.o \
gfx/scaler/pixconv.o \
gfx/scaler/scaler_int.o \
gfx/scaler/filter.o \
View
@@ -29,6 +29,7 @@ OBJ = frontend/frontend.o \
gfx/scaler/scaler_int.o \
gfx/scaler/filter.o \
gfx/state_tracker.o \
+ gfx/shader_parse.o \
gfx/fonts/fonts.o \
gfx/fonts/bitmapfont.o \
gfx/image.o \
View
@@ -696,6 +696,13 @@ void config_set_int(config_file_t *conf, const char *key, int val)
config_set_string(conf, key, buf);
}
+void config_set_hex(config_file_t *conf, const char *key, unsigned val)
+{
+ char buf[128];
+ snprintf(buf, sizeof(buf), "%x", val);
+ config_set_string(conf, key, buf);
+}
+
void config_set_uint64(config_file_t *conf, const char *key, uint64_t val)
{
char buf[128];
View
@@ -92,6 +92,7 @@ bool config_get_bool(config_file_t *conf, const char *entry, bool *in);
void config_set_double(config_file_t *conf, const char *entry, double value);
void config_set_float(config_file_t *conf, const char *entry, float value);
void config_set_int(config_file_t *conf, const char *entry, int val);
+void config_set_hex(config_file_t *conf, const char *entry, unsigned val);
void config_set_uint64(config_file_t *conf, const char *entry, uint64_t val);
void config_set_char(config_file_t *conf, const char *entry, char val);
void config_set_string(config_file_t *conf, const char *entry, const char *val);
View
@@ -439,7 +439,7 @@ static bool gl_shader_filter_type(void *data, unsigned index, bool *smooth)
}
#ifdef HAVE_FBO
-static void gl_shader_scale(void *data, unsigned index, struct gl_fbo_scale *scale)
+static void gl_shader_scale(void *data, unsigned index, struct gfx_fbo_scale *scale)
{
gl_t *gl = (gl_t*)data;
@@ -674,7 +674,7 @@ void gl_init_fbo(void *data, unsigned width, unsigned height)
return;
#endif
- struct gl_fbo_scale scale, scale_last;
+ struct gfx_fbo_scale scale, scale_last;
gl_shader_scale(gl, 1, &scale);
gl_shader_scale(gl, gl_shader_num_func(gl), &scale_last);
View
@@ -22,6 +22,7 @@
#include "gfx_context.h"
#include "scaler/scaler.h"
#include "fonts/gl_font.h"
+#include "shader_parse.h"
#ifdef HAVE_CONFIG_H
#include "../config.h"
@@ -160,25 +161,6 @@ struct gl_fbo_rect
unsigned height;
};
-enum gl_scale_type
-{
- RARCH_SCALE_ABSOLUTE,
- RARCH_SCALE_INPUT,
- RARCH_SCALE_VIEWPORT
-};
-
-struct gl_fbo_scale
-{
- bool fp_fbo;
- enum gl_scale_type type_x;
- enum gl_scale_type type_y;
- float scale_x;
- float scale_y;
- unsigned abs_x;
- unsigned abs_y;
- bool valid;
-};
-
struct gl_ortho
{
GLfloat left;
@@ -239,7 +221,7 @@ typedef struct gl
GLuint fbo[MAX_SHADERS];
GLuint fbo_texture[MAX_SHADERS];
struct gl_fbo_rect fbo_rect[MAX_SHADERS];
- struct gl_fbo_scale fbo_scale[MAX_SHADERS];
+ struct gfx_fbo_scale fbo_scale[MAX_SHADERS];
int fbo_pass;
bool fbo_inited;
Oops, something went wrong.

0 comments on commit e649db2

Please sign in to comment.