DXGL r406 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r405‎ | r406 | r407 >
Date:00:48, 14 November 2013
Author:admin
Status:new
Tags:
Comment:
Simplify blitter vertex shader a bit.
Modified paths:
  • /ddraw/shadergen2d.cpp (modified) (history)
  • /ddraw/shaders.cpp (modified) (history)

Diff [purge]

Index: ddraw/shadergen2d.cpp
@@ -43,7 +43,7 @@
4444 Bit 14: ROP index bit 2
4545 Bit 15: Use source color key (DDBLT_KEYSRC)
4646 Bit 16: ROP index bit 3
47 -Bit 17: Use ROP (DDBLT_ROP, forces integer processing)
 47+Bit 17: Use ROP (DDBLT_ROP, may force integer processing)
4848 Bit 18: ROP index bit 4
4949 Bit 19: Z-buffer blit (DDBLT_ZBUFFER)
5050 Bit 20: Use dest. Z constant (DDBLT_ZBUFFERDESTCONSTOVERRIDE)
@@ -699,4 +699,7 @@
700700 void CreateShader2D(int index, DWORD id)
701701 {
702702 string tmp;
 703+ genshaders2D[index].shader.vsrc = new string;
 704+ genshaders2D[index].shader.fsrc = new string;
 705+
703706 }
\ No newline at end of file
Index: ddraw/shaders.cpp
@@ -105,8 +105,6 @@
106106 void main()\n\
107107 {\n\
108108 vec4 xyzw = vec4(xy[0],xy[1],0,1);\n\
109 - vec4 rgba = vec4(rgb[0],rgb[1],rgb[2],1);\n\
110 - vec4 strq = vec4(st[0],st[1],0,1);\n\
111109 mat4 proj = mat4(\n\
112110 vec4(2.0 / (view[1] - view[0]), 0, 0, 0),\n\
113111 vec4(0, 2.0 / (view[2] - view[3]), 0, 0),\n\
@@ -114,8 +112,8 @@
115113 vec4(-(view[1] + view[0]) / (view[1] - view[0]),\n\
116114 -(view[2] + view[3]) / (view[2] - view[3]), -1 , 1));\n\
117115 gl_Position = proj * xyzw;\n\
118 - gl_FrontColor = rgba;\n\
119 - gl_TexCoord[0] = strq;\n\
 116+ gl_FrontColor = vec4(rgb,1.0);\n\
 117+ gl_TexCoord[0] = vec4(st,0.0,1.0);\n\
120118 } ";
121119
122120