mirror of
https://github.com/libretro/RetroArch
synced 2025-03-06 04:13:52 +00:00
Create d3d_shaders
This commit is contained in:
parent
02e0be55a8
commit
e9d16655f0
@ -86,30 +86,7 @@ typedef struct cg_renderchain
|
||||
CGcontext cgCtx;
|
||||
} cg_renderchain_t;
|
||||
|
||||
|
||||
static const char *stock_cg_d3d9_program =
|
||||
"void main_vertex"
|
||||
"("
|
||||
" float4 position : POSITION,"
|
||||
" float2 texCoord : TEXCOORD0,"
|
||||
" float4 color : COLOR,"
|
||||
""
|
||||
" uniform float4x4 modelViewProj,"
|
||||
""
|
||||
" out float4 oPosition : POSITION,"
|
||||
" out float2 otexCoord : TEXCOORD0,"
|
||||
" out float4 oColor : COLOR"
|
||||
")"
|
||||
"{"
|
||||
" oPosition = mul(modelViewProj, position);"
|
||||
" otexCoord = texCoord;"
|
||||
" oColor = color;"
|
||||
"}"
|
||||
""
|
||||
"float4 main_fragment(in float4 color : COLOR, float2 tex : TEXCOORD0, uniform sampler2D s0 : TEXUNIT0) : COLOR"
|
||||
"{"
|
||||
" return color * tex2D(s0, tex);"
|
||||
"}";
|
||||
#include "../drivers/d3d_shaders/opaque.cg.d3d9.h"
|
||||
|
||||
static INLINE bool validate_param_name(const char *name)
|
||||
{
|
||||
|
23
gfx/drivers/d3d_shaders/opaque.cg.d3d9.h
Normal file
23
gfx/drivers/d3d_shaders/opaque.cg.d3d9.h
Normal file
@ -0,0 +1,23 @@
|
||||
static const char *stock_cg_d3d9_program =
|
||||
"void main_vertex"
|
||||
"("
|
||||
" float4 position : POSITION,"
|
||||
" float2 texCoord : TEXCOORD0,"
|
||||
" float4 color : COLOR,"
|
||||
""
|
||||
" uniform float4x4 modelViewProj,"
|
||||
""
|
||||
" out float4 oPosition : POSITION,"
|
||||
" out float2 otexCoord : TEXCOORD0,"
|
||||
" out float4 oColor : COLOR"
|
||||
")"
|
||||
"{"
|
||||
" oPosition = mul(modelViewProj, position);"
|
||||
" otexCoord = texCoord;"
|
||||
" oColor = color;"
|
||||
"}"
|
||||
""
|
||||
"float4 main_fragment(in float4 color : COLOR, float2 tex : TEXCOORD0, uniform sampler2D s0 : TEXUNIT0) : COLOR"
|
||||
"{"
|
||||
" return color * tex2D(s0, tex);"
|
||||
"}";
|
41
gfx/drivers/d3d_shaders/opaque.hlsl.d3d9.h
Normal file
41
gfx/drivers/d3d_shaders/opaque.hlsl.d3d9.h
Normal file
@ -0,0 +1,41 @@
|
||||
static const char *stock_hlsl_program =
|
||||
"void main_vertex\n"
|
||||
"(\n"
|
||||
" float4 position : POSITION,\n"
|
||||
" float4 color : COLOR,\n"
|
||||
"\n"
|
||||
" uniform float4x4 modelViewProj,\n"
|
||||
"\n"
|
||||
" float4 texCoord : TEXCOORD0,\n"
|
||||
" out float4 oPosition : POSITION,\n"
|
||||
" out float4 oColor : COLOR,\n"
|
||||
" out float2 otexCoord : TEXCOORD\n"
|
||||
")\n"
|
||||
"{\n"
|
||||
" oPosition = mul(modelViewProj, position);\n"
|
||||
" oColor = color;\n"
|
||||
" otexCoord = texCoord;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"struct output\n"
|
||||
"{\n"
|
||||
" float4 color: COLOR;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"struct input\n"
|
||||
"{\n"
|
||||
" float2 video_size;\n"
|
||||
" float2 texture_size;\n"
|
||||
" float2 output_size;\n"
|
||||
" float frame_count;\n"
|
||||
" float frame_direction;\n"
|
||||
" float frame_rotation;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"output main_fragment(float2 texCoord : TEXCOORD0,\n"
|
||||
"uniform sampler2D decal : TEXUNIT0, uniform input IN)\n"
|
||||
"{\n"
|
||||
" output OUT;\n"
|
||||
" OUT.color = tex2D(decal, texCoord);\n"
|
||||
" return OUT;\n"
|
||||
"}\n";
|
@ -22,47 +22,7 @@
|
||||
#include "../d3d/d3d.h"
|
||||
#include "../../rewind.h"
|
||||
|
||||
static const char *stock_hlsl_program =
|
||||
"void main_vertex\n"
|
||||
"(\n"
|
||||
" float4 position : POSITION,\n"
|
||||
" float4 color : COLOR,\n"
|
||||
"\n"
|
||||
" uniform float4x4 modelViewProj,\n"
|
||||
"\n"
|
||||
" float4 texCoord : TEXCOORD0,\n"
|
||||
" out float4 oPosition : POSITION,\n"
|
||||
" out float4 oColor : COLOR,\n"
|
||||
" out float2 otexCoord : TEXCOORD\n"
|
||||
")\n"
|
||||
"{\n"
|
||||
" oPosition = mul(modelViewProj, position);\n"
|
||||
" oColor = color;\n"
|
||||
" otexCoord = texCoord;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"struct output\n"
|
||||
"{\n"
|
||||
" float4 color: COLOR;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"struct input\n"
|
||||
"{\n"
|
||||
" float2 video_size;\n"
|
||||
" float2 texture_size;\n"
|
||||
" float2 output_size;\n"
|
||||
" float frame_count;\n"
|
||||
" float frame_direction;\n"
|
||||
" float frame_rotation;\n"
|
||||
"};\n"
|
||||
"\n"
|
||||
"output main_fragment(float2 texCoord : TEXCOORD0,\n"
|
||||
"uniform sampler2D decal : TEXUNIT0, uniform input IN)\n"
|
||||
"{\n"
|
||||
" output OUT;\n"
|
||||
" OUT.color = tex2D(decal, texCoord);\n"
|
||||
" return OUT;\n"
|
||||
"}\n";
|
||||
#include "../drivers/d3d_shaders/opaque.hlsl.d3d9.h"
|
||||
|
||||
struct shader_program_hlsl_data
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user