DXGL r906 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r905
|
r906
|
r907
>
Date:
23:33, 2 April 2019
Author:
admin
Status:
new
Tags:
Comment:
Define a few code lines for texture rectangle shaders.
Modified paths:
/ddraw/ShaderGen2D.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/ShaderGen2D.cpp
—
—
@@ -83,7 +83,8 @@
84
84
"//REV" STR(SHADER2DVERSION) "\n";
85
85
static const char version_110[] = "#version 110\n";
86
86
static const char version_130[] = "#version 130\n";
87
-static const char ext_shader4[] = "#extension GL_EXT_gpu_shader4 : require";
87
+static const char ext_shader4[] = "#extension GL_EXT_gpu_shader4 : require\n";
88
+static const char ext_texrect[] = "#extension GL_ARB_texture_rectangle : require\n";
88
89
static const char vertexshader[] = "//2D Vertex Shader\n";
89
90
static const char fragshader[] = "//2D Fragment Shader\n";
90
91
static const char idheader[] = "//ID: 0x";
—
—
@@ -101,7 +102,9 @@
102
103
// Uniforms
103
104
static const char unif_view[] = "uniform vec4 view;\n";
104
105
static const char unif_srctex[] = "uniform sampler2D srctex;\n";
106
+static const char unif_srctexrect[] = "uniform sampler2DRect srctex;\n";
105
107
static const char unif_desttex[] = "uniform sampler2D desttex;\n";
108
+static const char unif_desttexrect[] = "uniform sampler2DRect desttex;\n";
106
109
static const char unif_patterntex[] = "uniform sampler2D patterntex;\n";
107
110
static const char unif_stenciltex[] = "uniform sampler2D stenciltex;\n";
108
111
static const char unif_srcpal[] = "uniform sampler2D srcpal;\n";
—
—
@@ -124,10 +127,15 @@
125
128
126
129
// Operations
127
130
static const char op_src[] = "src = ivec4(texture2D(srctex,gl_TexCoord[0].st)*vec4(colorsizesrc)+.5);\n";
131
+static const char op_srcrect[] = "src = ivec4(texture2DRect(srctex,gl_TexCoord[0].st)*vec4(colorsizesrc)+.5);\n";
128
132
static const char op_pixel[] = "pixel = ivec4(texture2D(srctex,gl_TexCoord[0].st)*vec4(colorsizedest)+.5);\n";
133
+static const char op_pixelrect[] = "pixel = ivec4(texture2DRect(srctex,gl_TexCoord[0].st)*vec4(colorsizedest)+.5);\n";
129
134
static const char op_palpixel[] = "vec4 myindex = texture2D(srctex, gl_TexCoord[0].xy);\n\
130
135
vec2 index = vec2(((myindex.x*(255.0/256.0))+(0.5/256.0)),0.5);\n\
131
136
pixel = ivec4(texture2D(srcpal, index)*vec4(colorsizedest)+.5);\n";
137
+static const char op_palpixelrect[] = "vec4 myindex = texture2DRect(srctex, gl_TexCoord[0].xy);\n\
138
+vec2 index = vec2(((myindex.x*(255.0/256.0))+(0.5/256.0)),0.5);\n\
139
+pixel = ivec4(texture2D(srcpal, index)*vec4(colorsizedest)+.5);\n";
132
140
static const char op_pixelmul256[] = "pixel = ivec4(vec4(256.0)*texture2D(srctex,gl_TexCoord[0].st)*vec4(colorsizedest)+.5);\n";
133
141
static const char op_color[] = "pixel = fillcolor;\n";
134
142
static const char op_dest[] = "dest = ivec4(texture2D(desttex,gl_TexCoord[1].st)*vec4(colorsizedest)+.5);\n";
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version