From 6ef5607d991420791bcce5a9eb82966f52ecd810 Mon Sep 17 00:00:00 2001 From: Jason Brown Date: Sun, 9 Oct 2016 14:17:54 +0200 Subject: [PATCH] gsdx shader: add a shader to render text for OSD Gregory: code extracted from the OSD PR to reduce conflict --- plugins/GSdx/GSDevice.h | 4 +++- plugins/GSdx/GSDeviceOGL.h | 2 +- plugins/GSdx/res/glsl/convert.glsl | 7 +++++++ plugins/GSdx/res/glsl_source.h | 7 +++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/plugins/GSdx/GSDevice.h b/plugins/GSdx/GSDevice.h index 7d32b28830..7780b3b0ee 100644 --- a/plugins/GSdx/GSDevice.h +++ b/plugins/GSdx/GSDevice.h @@ -44,7 +44,9 @@ enum ShaderConvert { ShaderConvert_RGBA8_TO_FLOAT24, ShaderConvert_RGBA8_TO_FLOAT16, ShaderConvert_RGB5A1_TO_FLOAT16, - ShaderConvert_RGBA_TO_8I = 17 + ShaderConvert_RGBA_TO_8I = 17, + ShaderConvert_OSD, + ShaderConvert_Count }; #pragma pack(push, 1) diff --git a/plugins/GSdx/GSDeviceOGL.h b/plugins/GSdx/GSDeviceOGL.h index a1aa2f5a23..884c0e1700 100644 --- a/plugins/GSdx/GSDeviceOGL.h +++ b/plugins/GSdx/GSDeviceOGL.h @@ -429,7 +429,7 @@ public: struct { GLuint vs; // program object - GLuint ps[18]; // program object + GLuint ps[ShaderConvert_Count]; // program object GLuint ln; // sampler object GLuint pt; // sampler object GSDepthStencilOGL* dss; diff --git a/plugins/GSdx/res/glsl/convert.glsl b/plugins/GSdx/res/glsl/convert.glsl index 633b0476d0..600d563ca8 100644 --- a/plugins/GSdx/res/glsl/convert.glsl +++ b/plugins/GSdx/res/glsl/convert.glsl @@ -278,6 +278,13 @@ void ps_main17() } #endif +#ifdef ps_main18 +void ps_main18() +{ + SV_Target0 = PSin.c * vec4(1.0, 1.0, 1.0, sample_c().r); +} +#endif + #ifdef ps_main7 void ps_main7() { diff --git a/plugins/GSdx/res/glsl_source.h b/plugins/GSdx/res/glsl_source.h index f960738530..09d2c2f00d 100644 --- a/plugins/GSdx/res/glsl_source.h +++ b/plugins/GSdx/res/glsl_source.h @@ -413,6 +413,13 @@ static const char* const convert_glsl = "}\n" "#endif\n" "\n" + "#ifdef ps_main18\n" + "void ps_main18()\n" + "{\n" + " SV_Target0 = PSin.c * vec4(1.0, 1.0, 1.0, sample_c().r);\n" + "}\n" + "#endif\n" + "\n" "#ifdef ps_main7\n" "void ps_main7()\n" "{\n"