DXGL r280 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r279
|
r280
|
r281
>
Date:
01:00, 7 December 2012
Author:
admin
Status:
new
Tags:
Comment:
Fix enabling/disabling lighting in shader generator.
Add D3DRENDERTSTATE_LIGHTING and D3DRENDERSTATE_COLORVERTEX to shader ID.
Modified paths:
/ddraw/glDirect3DDevice.cpp
(modified) (
history
)
/ddraw/shadergen.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirect3DDevice.cpp
—
—
@@ -498,6 +498,8 @@
499
499
if(noalpha) texstages[0].alphaop = D3DTOP_SELECTARG2;
500
500
else texstages[0].alphaop = D3DTOP_MODULATE;
501
501
}
502
+ if(renderstate[D3DRENDERSTATE_LIGHTING]) shader |= (1i64 << 59);
503
+ if(renderstate[D3DRENDERSTATE_COLORVERTEX]) shader |= (1i64 << 60);
502
504
for(i = 0; i < 8; i++)
503
505
{
504
506
if(!texstages[i].dirty) continue;
Index: ddraw/shadergen.cpp
—
—
@@ -64,6 +64,8 @@
65
65
Bit 49 - Normalize normals VS
66
66
Bit 50 - Use transformed vertices VS
67
67
Bits 51-58 - Point or spot light VS/FS
68
+Bit 59 - Enable lights VS/FS
69
+Bit 60 - Use vertex colors VS
68
70
*/
69
71
70
72
/* Bits in Texture Stage ID:
—
—
@@ -440,7 +442,8 @@
441
443
// Uniforms
442
444
vsrc->append(unif_ambient);
443
445
if((id>>50)&1) vsrc->append(unif_size);
444
- numlights = (id>>18)&7;
446
+ if((id>>59)&1) numlights = (id>>18)&7;
447
+ else numlights = 0;
445
448
if(numlights) // Lighting
446
449
{
447
450
vsrc->append(lightstruct);
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