wined3d: Add CTXUSAGE_CLEAR context usage.
This commit is contained in:
parent
97cd8bab1b
commit
fdadf26c20
|
@ -842,6 +842,19 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU
|
|||
/* This does not require any special states to be set up */
|
||||
break;
|
||||
|
||||
case CTXUSAGE_CLEAR:
|
||||
if(context->last_was_blit && GL_SUPPORT(NV_TEXTURE_SHADER2)) {
|
||||
glEnable(GL_TEXTURE_SHADER_NV);
|
||||
checkGLcall("glEnable(GL_TEXTURE_SHADER_NV)");
|
||||
}
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
checkGLcall("glEnable GL_SCISSOR_TEST");
|
||||
context->last_was_blit = FALSE;
|
||||
Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
|
||||
Context_MarkStateDirty(context, STATE_SCISSORRECT);
|
||||
break;
|
||||
|
||||
case CTXUSAGE_DRAWPRIM:
|
||||
/* This needs all dirty states applied */
|
||||
if(context->last_was_blit && GL_SUPPORT(NV_TEXTURE_SHADER2)) {
|
||||
|
|
|
@ -4463,12 +4463,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Coun
|
|||
apply_fbo_state(iface);
|
||||
}
|
||||
|
||||
ActivateContext(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD);
|
||||
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
checkGLcall("glEnable GL_SCISSOR_TEST");
|
||||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SCISSORRECT);
|
||||
IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE));
|
||||
ActivateContext(This, This->render_targets[0], CTXUSAGE_CLEAR);
|
||||
|
||||
if (Count > 0 && pRects) {
|
||||
curRect = pRects;
|
||||
|
|
|
@ -527,6 +527,7 @@ typedef enum ContextUsage {
|
|||
CTXUSAGE_RESOURCELOAD = 1, /* Only loads textures: No State is applied */
|
||||
CTXUSAGE_DRAWPRIM = 2, /* OpenGL states are set up for blitting DirectDraw surfacs */
|
||||
CTXUSAGE_BLIT = 3, /* OpenGL states are set up 3D drawing */
|
||||
CTXUSAGE_CLEAR = 4, /* Drawable and states are set up for clearing */
|
||||
} ContextUsage;
|
||||
|
||||
void ActivateContext(IWineD3DDeviceImpl *device, IWineD3DSurface *target, ContextUsage usage);
|
||||
|
|
Loading…
Reference in New Issue