DXGL r594 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r593
|
r594
|
r595
>
Date:
21:35, 8 February 2015
Author:
admin
Status:
new
Tags:
Comment:
More attempts at fixing the queue.
Fix crash when setting a light with a NULL pointer.
Modified paths:
/ddraw/glRenderer.cpp
(modified) (
history
)
/ddraw/opqueue.c
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glRenderer.cpp
—
—
@@ -395,7 +395,6 @@
396
396
uploadop->texture = texture;
397
397
memcpy(opbuffer, outbuffer, outy*outpitch);
398
398
opqueue_putunlock(&This->queue, uploadopsize);
399
- glRenderer_Sync(This);
400
399
}
401
400
402
401
/**
—
—
@@ -932,7 +931,7 @@
933
932
lightop->opcode.size = sizeof(SETLIGHTOP);
934
933
lightop->index = index;
935
934
lightop->remove = remove;
936
- memcpy(&lightop->light, light, sizeof(D3DLIGHT7));
935
+ if(light) memcpy(&lightop->light, light, sizeof(D3DLIGHT7));
937
936
opqueue_putunlock(&This->queue, sizeof(SETLIGHTOP));
938
937
}
939
938
—
—
@@ -1156,6 +1155,10 @@
1157
1156
glRenderer__SetViewport(This, &setviewportop->viewport);
1158
1157
opqueue_getunlock(&This->queue, setviewportop->opcode.size);
1159
1158
break;
1159
+ default:
1160
+ FIXME("Invalid opcode detected");
1161
+ opqueue_getunlock(&This->queue, opcode->opcode.size);
1162
+ break;
1160
1163
}
1161
1164
}
1162
1165
return 0;
Index: ddraw/opqueue.c
—
—
@@ -98,7 +98,7 @@
99
99
queue->waitfull = TRUE;
100
100
_exitspinlock(&queue->readlock);
101
101
_enterspinlock(&queue->writelock);
102
- WaitForSingleObject(queue->waitevent, 10);
102
+ Sleep(0);
103
103
}
104
104
if (waitfull) ResetEvent(queue->waitevent);
105
105
queue->waitfull = FALSE;
—
—
@@ -121,18 +121,20 @@
122
122
123
123
BYTE *opqueue_getlock(OPQUEUE *queue)
124
124
{
125
+ BOOL exit = TRUE;
125
126
_enterspinlock(&queue->readlock);
126
127
_enterspinlock(&queue->writelock);
127
128
if (queue->readptr == queue->writeptr)
128
129
{
129
- _exitspinlock(&queue->readlock);
130
130
queue->waitempty = TRUE;
131
131
ResetEvent(queue->waitevent);
132
+ _exitspinlock(&queue->readlock);
132
133
_exitspinlock(&queue->writelock);
133
134
WaitForSingleObject(queue->waitevent, INFINITE);
134
135
_enterspinlock(&queue->readlock);
136
+ exit = FALSE;
135
137
}
136
- _exitspinlock(&queue->writelock);
138
+ if(exit) _exitspinlock(&queue->writelock);
137
139
return queue->data + queue->readptr;
138
140
}
139
141
void opqueue_getunlock(OPQUEUE *queue, DWORD size)
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