mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 03:35:22 +00:00
Move GL stock shader to gfx/drivers/gl_shaders
This commit is contained in:
parent
f0f60901ff
commit
02e0be55a8
31
gfx/drivers/gl_shaders/opaque.cg.h
Normal file
31
gfx/drivers/gl_shaders/opaque.cg.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/* Used when we call deactivate() since just unbinding
|
||||||
|
* the program didn't seem to work... */
|
||||||
|
static const char *stock_cg_gl_program =
|
||||||
|
"struct input"
|
||||||
|
"{"
|
||||||
|
" float2 tex_coord;"
|
||||||
|
" float4 color;"
|
||||||
|
" float4 vertex_coord;"
|
||||||
|
" uniform float4x4 mvp_matrix;"
|
||||||
|
" uniform sampler2D texture;"
|
||||||
|
"};"
|
||||||
|
"struct vertex_data"
|
||||||
|
"{"
|
||||||
|
" float2 tex;"
|
||||||
|
" float4 color;"
|
||||||
|
"};"
|
||||||
|
"void main_vertex"
|
||||||
|
"("
|
||||||
|
" out float4 oPosition : POSITION,"
|
||||||
|
" input IN,"
|
||||||
|
" out vertex_data vert"
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
" oPosition = mul(IN.mvp_matrix, IN.vertex_coord);"
|
||||||
|
" vert = vertex_data(IN.tex_coord, IN.color);"
|
||||||
|
"}"
|
||||||
|
""
|
||||||
|
"float4 main_fragment(input IN, vertex_data vert, uniform sampler2D s0 : TEXUNIT0) : COLOR"
|
||||||
|
"{"
|
||||||
|
" return vert.color * tex2D(s0, vert.tex);"
|
||||||
|
"}";
|
@ -52,6 +52,10 @@
|
|||||||
|
|
||||||
#define PREV_TEXTURES (GFX_MAX_TEXTURES - 1)
|
#define PREV_TEXTURES (GFX_MAX_TEXTURES - 1)
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
#define RARCH_CG_DEBUG
|
||||||
|
#endif
|
||||||
|
|
||||||
struct cg_fbo_params
|
struct cg_fbo_params
|
||||||
{
|
{
|
||||||
CGparameter vid_size_f;
|
CGparameter vid_size_f;
|
||||||
@ -110,6 +114,8 @@ struct uniform_cg_data
|
|||||||
CGparameter loc;
|
CGparameter loc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include "../drivers/gl_shaders/opaque.cg.h"
|
||||||
|
|
||||||
static void gl_cg_set_uniform_parameter(
|
static void gl_cg_set_uniform_parameter(
|
||||||
void *data,
|
void *data,
|
||||||
struct uniform_info *param,
|
struct uniform_info *param,
|
||||||
@ -177,41 +183,6 @@ static void gl_cg_set_uniform_parameter(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define RARCH_CG_DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Used when we call deactivate() since just unbinding
|
|
||||||
* the program didn't seem to work... */
|
|
||||||
static const char *stock_cg_gl_program =
|
|
||||||
"struct input"
|
|
||||||
"{"
|
|
||||||
" float2 tex_coord;"
|
|
||||||
" float4 color;"
|
|
||||||
" float4 vertex_coord;"
|
|
||||||
" uniform float4x4 mvp_matrix;"
|
|
||||||
" uniform sampler2D texture;"
|
|
||||||
"};"
|
|
||||||
"struct vertex_data"
|
|
||||||
"{"
|
|
||||||
" float2 tex;"
|
|
||||||
" float4 color;"
|
|
||||||
"};"
|
|
||||||
"void main_vertex"
|
|
||||||
"("
|
|
||||||
" out float4 oPosition : POSITION,"
|
|
||||||
" input IN,"
|
|
||||||
" out vertex_data vert"
|
|
||||||
")"
|
|
||||||
"{"
|
|
||||||
" oPosition = mul(IN.mvp_matrix, IN.vertex_coord);"
|
|
||||||
" vert = vertex_data(IN.tex_coord, IN.color);"
|
|
||||||
"}"
|
|
||||||
""
|
|
||||||
"float4 main_fragment(input IN, vertex_data vert, uniform sampler2D s0 : TEXUNIT0) : COLOR"
|
|
||||||
"{"
|
|
||||||
" return vert.color * tex2D(s0, vert.tex);"
|
|
||||||
"}";
|
|
||||||
|
|
||||||
#ifdef RARCH_CG_DEBUG
|
#ifdef RARCH_CG_DEBUG
|
||||||
static void cg_error_handler(CGcontext ctx, CGerror error, void *data)
|
static void cg_error_handler(CGcontext ctx, CGerror error, void *data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user