Commit 3471f841 authored by Austin English's avatar Austin English Committed by Alexandre Julliard

wined3d: Spelling fixes.

parent 90f89fa7
...@@ -1366,8 +1366,8 @@ void pshader_hw_texdepth(SHADER_OPCODE_ARG* arg) { ...@@ -1366,8 +1366,8 @@ void pshader_hw_texdepth(SHADER_OPCODE_ARG* arg) {
char dst_name[50]; char dst_name[50];
/* texdepth has an implicit destination, the fragment depth value. It's only parameter, /* texdepth has an implicit destination, the fragment depth value. It's only parameter,
* which is essentially an input, is the destiantion register because it is the first * which is essentially an input, is the destination register because it is the first
* param. According to the msdn, this must be register r5, but let's keep it more flexible * parameter. According to the msdn, this must be register r5, but let's keep it more flexible
* here * here
*/ */
pshader_get_register_name(arg->dst, dst_name); pshader_get_register_name(arg->dst, dst_name);
...@@ -1562,7 +1562,7 @@ void shader_hw_nrm(SHADER_OPCODE_ARG* arg) { ...@@ -1562,7 +1562,7 @@ void shader_hw_nrm(SHADER_OPCODE_ARG* arg) {
void shader_hw_sincos(SHADER_OPCODE_ARG* arg) { void shader_hw_sincos(SHADER_OPCODE_ARG* arg) {
/* This instruction exists in ARB, but the d3d instruction takes two extra parameters which /* This instruction exists in ARB, but the d3d instruction takes two extra parameters which
* must contain fixed constants. So we need a separate functin to filter those constants and * must contain fixed constants. So we need a separate function to filter those constants and
* can't use map2gl * can't use map2gl
*/ */
SHADER_BUFFER* buffer = arg->buffer; SHADER_BUFFER* buffer = arg->buffer;
......
...@@ -125,7 +125,7 @@ static inline int shader_skip_opcode( ...@@ -125,7 +125,7 @@ static inline int shader_skip_opcode(
DWORD opcode_token) { DWORD opcode_token) {
/* Shaders >= 2.0 may contain address tokens, but fortunately they /* Shaders >= 2.0 may contain address tokens, but fortunately they
* have a useful legnth mask - use it here. Shaders 1.0 contain no such tokens */ * have a useful length mask - use it here. Shaders 1.0 contain no such tokens */
return (WINED3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) >= 2)? return (WINED3DSHADER_VERSION_MAJOR(This->baseShader.hex_version) >= 2)?
((opcode_token & WINED3DSI_INSTLENGTH_MASK) >> WINED3DSI_INSTLENGTH_SHIFT): ((opcode_token & WINED3DSI_INSTLENGTH_MASK) >> WINED3DSI_INSTLENGTH_SHIFT):
......
...@@ -127,7 +127,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_GetParent(IWineD3DBaseTexture *iface, IUn ...@@ -127,7 +127,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_GetParent(IWineD3DBaseTexture *iface, IUn
IWineD3DBaseTexture IWineD3DBaseTexture parts follow IWineD3DBaseTexture IWineD3DBaseTexture parts follow
****************************************************** */ ****************************************************** */
/* There is no OpenGL equivilent of setLOD, getLOD, all they do it priortise testure loading /* There is no OpenGL equivalent of setLOD, getLOD, all they do it prioritize texture loading
* so just pretend that they work unless something really needs a failure. */ * so just pretend that they work unless something really needs a failure. */
DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew) { DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew) {
IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface;
...@@ -299,7 +299,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) { ...@@ -299,7 +299,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_BindTexture(IWineD3DBaseTexture *iface) {
checkGLcall("glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels)"); checkGLcall("glTexParameteri(textureDimensions, GL_TEXTURE_MAX_LEVEL, This->baseTexture.levels)");
} }
if(textureDimensions==GL_TEXTURE_CUBE_MAP_ARB) { if(textureDimensions==GL_TEXTURE_CUBE_MAP_ARB) {
/* Cubemaps are always set to clamp, regardeless of the sampler state. */ /* Cubemaps are always set to clamp, regardless of the sampler state. */
glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); glTexParameteri(textureDimensions, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
...@@ -420,7 +420,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface ...@@ -420,7 +420,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface
glValue = stateLookup[WINELOOKUP_MAGFILTER][state - minLookup[WINELOOKUP_MAGFILTER]]; glValue = stateLookup[WINELOOKUP_MAGFILTER][state - minLookup[WINELOOKUP_MAGFILTER]];
TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue); TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue);
glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue); glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue);
/* We need to reset the Aniotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentataion to see how it should be switched off. */ /* We need to reset the Aniotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentation to see how it should be switched off. */
if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC) && WINED3DTEXF_ANISOTROPIC == state && if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC) && WINED3DTEXF_ANISOTROPIC == state &&
textureDimensions != GL_TEXTURE_RECTANGLE_ARB) { textureDimensions != GL_TEXTURE_RECTANGLE_ARB) {
glTexParameteri(textureDimensions, GL_TEXTURE_MAX_ANISOTROPY_EXT, samplerStates[WINED3DSAMP_MAXANISOTROPY]); glTexParameteri(textureDimensions, GL_TEXTURE_MAX_ANISOTROPY_EXT, samplerStates[WINED3DSAMP_MAXANISOTROPY]);
......
...@@ -249,7 +249,7 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar ...@@ -249,7 +249,7 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar
PUSH1(0); /* end the list */ PUSH1(0); /* end the list */
/* In case of failure hope that standard ChooosePixelFormat will find something suitable */ /* In case of failure hope that standard ChoosePixelFormat will find something suitable */
if(!GL_EXTCALL(wglChoosePixelFormatARB(hdc, (const int*)&attribs, NULL, 1, &iPixelFormat, &nFormats))) if(!GL_EXTCALL(wglChoosePixelFormatARB(hdc, (const int*)&attribs, NULL, 1, &iPixelFormat, &nFormats)))
{ {
/* PixelFormat selection */ /* PixelFormat selection */
...@@ -474,10 +474,10 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) { ...@@ -474,10 +474,10 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) {
* *
* Sets up a context for DirectDraw blitting. * Sets up a context for DirectDraw blitting.
* All texture units are disabled, texture unit 0 is set as current unit * All texture units are disabled, texture unit 0 is set as current unit
* fog, lighting, blending, alpha test, z test, scissor test, culling diabled * fog, lighting, blending, alpha test, z test, scissor test, culling disabled
* color writing enabled for all channels * color writing enabled for all channels
* register combiners disabled, shaders disabled * register combiners disabled, shaders disabled
* world matris is set to identity, texture matrix 0 too * world matrix is set to identity, texture matrix 0 too
* projection matrix is setup for drawing screen coordinates * projection matrix is setup for drawing screen coordinates
* *
* Params: * Params:
...@@ -740,7 +740,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf ...@@ -740,7 +740,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf
if(This->activeContext && tid == This->lastThread) { if(This->activeContext && tid == This->lastThread) {
context = This->activeContext; context = This->activeContext;
} else { } else {
/* This may happen if the app jumps streight into offscreen rendering /* This may happen if the app jumps straight into offscreen rendering
* Start using the context of the primary swapchain. tid == 0 is no problem * Start using the context of the primary swapchain. tid == 0 is no problem
* for findThreadContextForSwapChain. * for findThreadContextForSwapChain.
* *
......
...@@ -1056,7 +1056,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa ...@@ -1056,7 +1056,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
/* Set its container to this object */ /* Set its container to this object */
IWineD3DVolume_SetContainer(object->volumes[i], (IWineD3DBase *)object); IWineD3DVolume_SetContainer(object->volumes[i], (IWineD3DBase *)object);
/* calcualte the next mipmap level */ /* calculate the next mipmap level */
tmpW = max(1, tmpW >> 1); tmpW = max(1, tmpW >> 1);
tmpH = max(1, tmpH >> 1); tmpH = max(1, tmpH >> 1);
tmpD = max(1, tmpD >> 1); tmpD = max(1, tmpD >> 1);
...@@ -2166,7 +2166,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D ...@@ -2166,7 +2166,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
if(!This->d3d_initialized) return WINED3DERR_INVALIDCALL; if(!This->d3d_initialized) return WINED3DERR_INVALIDCALL;
/* I don't think that the interface guarants that the device is destroyed from the same thread /* I don't think that the interface guarantees that the device is destroyed from the same thread
* it was created. Thus make sure a context is active for the glDelete* calls * it was created. Thus make sure a context is active for the glDelete* calls
*/ */
ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD);
...@@ -2236,7 +2236,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D ...@@ -2236,7 +2236,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, D3DCB_D
TRACE("Releasing the render target at %p\n", This->render_targets[0]); TRACE("Releasing the render target at %p\n", This->render_targets[0]);
if(IWineD3DSurface_Release(This->render_targets[0]) >0){ if(IWineD3DSurface_Release(This->render_targets[0]) >0){
/* This check is a bit silly, itshould be in swapchain_release FIXME("(%p) Something's still holding the renderTarget\n",This); */ /* This check is a bit silly, it should be in swapchain_release FIXME("(%p) Something's still holding the renderTarget\n",This); */
} }
TRACE("Setting rendertarget to NULL\n"); TRACE("Setting rendertarget to NULL\n");
This->render_targets[0] = NULL; This->render_targets[0] = NULL;
...@@ -2458,8 +2458,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface, ...@@ -2458,8 +2458,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSource(IWineD3DDevice *iface,
return WINED3D_OK; return WINED3D_OK;
} }
/* Need to do a getParent and pass the reffs up */ /* Need to do a getParent and pass the references up */
/* MSDN says ..... When an application no longer holds a references to this interface, the interface will automatically be freed. /* MSDN says ..... When an application no longer holds a reference to this interface, the interface will automatically be freed.
which suggests that we shouldn't be ref counting? and do need a _release on the stream source to reset the stream source which suggests that we shouldn't be ref counting? and do need a _release on the stream source to reset the stream source
so for now, just count internally */ so for now, just count internally */
if (pStreamData != NULL) { if (pStreamData != NULL) {
...@@ -2572,7 +2572,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTransform(IWineD3DDevice *iface, W ...@@ -2572,7 +2572,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTransform(IWineD3DDevice *iface, W
*/ */
/* Capture the times we can just ignore the change for now */ /* Capture the times we can just ignore the change for now */
if (d3dts == WINED3DTS_VIEW) { /* handle the VIEW matrice */ if (d3dts == WINED3DTS_VIEW) { /* handle the VIEW matrix */
This->view_ident = !memcmp(lpmatrix, identity, 16 * sizeof(float)); This->view_ident = !memcmp(lpmatrix, identity, 16 * sizeof(float));
/* Handled by the state manager */ /* Handled by the state manager */
} }
...@@ -4268,7 +4268,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface, ...@@ -4268,7 +4268,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
if(vbo || SrcStartIndex) { if(vbo || SrcStartIndex) {
unsigned int i; unsigned int i;
/* ProcessVertices can't convert FROM a vbo, and vertex buffers used to source into ProcesVerticse are /* ProcessVertices can't convert FROM a vbo, and vertex buffers used to source into ProcessVertices are
* unlikely to ever be used for drawing. Release vbos in those buffers and fix up the strided structure * unlikely to ever be used for drawing. Release vbos in those buffers and fix up the strided structure
* *
* Also get the start index in, but only loop over all elements if there's something to add at all. * Also get the start index in, but only loop over all elements if there's something to add at all.
...@@ -5597,7 +5597,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, ...@@ -5597,7 +5597,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
/* not a whole row so we have to do it a line at a time */ /* not a whole row so we have to do it a line at a time */
int j; int j;
/* hopefully using pointer addtion will be quicker than using a point + j * rowoffset */ /* hopefully using pointer addition will be quicker than using a point + j * rowoffset */
const unsigned char* data =((const unsigned char *)IWineD3DSurface_GetData(pSourceSurface)) + offset; const unsigned char* data =((const unsigned char *)IWineD3DSurface_GetData(pSourceSurface)) + offset;
for(j = destTop ; j < (srcHeight + destTop) ; j++){ for(j = destTop ; j < (srcHeight + destTop) ; j++){
...@@ -6031,7 +6031,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD ...@@ -6031,7 +6031,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD
} }
} }
/* rendertarget and deptth stencil functions */ /* rendertarget and depth stencil functions */
static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice* iface,DWORD RenderTargetIndex, IWineD3DSurface **ppRenderTarget) { static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice* iface,DWORD RenderTargetIndex, IWineD3DSurface **ppRenderTarget) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
...@@ -6499,11 +6499,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice * ...@@ -6499,11 +6499,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
if (pNewZStencil == This->stencilBufferTarget) { if (pNewZStencil == This->stencilBufferTarget) {
TRACE("Trying to do a NOP SetRenderTarget operation\n"); TRACE("Trying to do a NOP SetRenderTarget operation\n");
} else { } else {
/** OpenGL doesn't support 'sharing' of the stencilBuffer so we may incure an extra memory overhead /** OpenGL doesn't support 'sharing' of the stencilBuffer so we may incur an extra memory overhead
* depending on the renter target implementation being used. * depending on the renter target implementation being used.
* A shared context implementation will share all buffers between all rendertargets (including swapchains), * A shared context implementation will share all buffers between all rendertargets (including swapchains),
* implementations that use separate pbuffers for different swapchains or rendertargets will have to duplicate the * implementations that use separate pbuffers for different swapchains or rendertargets will have to duplicate the
* stencil buffer and incure an extra memory overhead * stencil buffer and incur an extra memory overhead
******************************************************/ ******************************************************/
tmp = This->stencilBufferTarget; tmp = This->stencilBufferTarget;
...@@ -6980,7 +6980,7 @@ static void WINAPI IWineD3DDeviceImpl_GetGammaRamp(IWineD3DDevice *iface, UINT i ...@@ -6980,7 +6980,7 @@ static void WINAPI IWineD3DDeviceImpl_GetGammaRamp(IWineD3DDevice *iface, UINT i
** ********************************************************/ ** ********************************************************/
/** This function must be called in the release of a resource when ref == 0, /** This function must be called in the release of a resource when ref == 0,
* the contents of resource must still be correct, * the contents of resource must still be correct,
* any handels to other resource held by the caller must be closed * any handles to other resource held by the caller must be closed
* (e.g. a texture should release all held surfaces because telling the device that it's been released.) * (e.g. a texture should release all held surfaces because telling the device that it's been released.)
*****************************************************/ *****************************************************/
static void WINAPI IWineD3DDeviceImpl_AddResource(IWineD3DDevice *iface, IWineD3DResource *resource){ static void WINAPI IWineD3DDeviceImpl_AddResource(IWineD3DDevice *iface, IWineD3DResource *resource){
...@@ -7129,7 +7129,7 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW ...@@ -7129,7 +7129,7 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
} }
/* Remove the resoruce from the resourceStore */ /* Remove the resource from the resourceStore */
IWineD3DDeviceImpl_RemoveResource(iface, resource); IWineD3DDeviceImpl_RemoveResource(iface, resource);
TRACE("Resource released\n"); TRACE("Resource released\n");
......
...@@ -970,7 +970,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { ...@@ -970,7 +970,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) {
* video memory. If the value is slightly wrong it doesn't matter as we didn't include AGP-like memory which * video memory. If the value is slightly wrong it doesn't matter as we didn't include AGP-like memory which
* makes the amount of addressable memory higher and second OpenGL isn't that critical it moves to system * makes the amount of addressable memory higher and second OpenGL isn't that critical it moves to system
* memory behind our backs if really needed. * memory behind our backs if really needed.
* Note that the amout of video memory can be overruled using a registry setting. * Note that the amount of video memory can be overruled using a registry setting.
*/ */
switch (gl_info->gl_vendor) { switch (gl_info->gl_vendor) {
case VENDOR_NVIDIA: case VENDOR_NVIDIA:
...@@ -2667,7 +2667,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, ...@@ -2667,7 +2667,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
*pCaps->PS20Caps.Caps = 0; *pCaps->PS20Caps.Caps = 0;
*pCaps->PS20Caps.DynamicFlowControlDepth = 0; /* WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0 */ *pCaps->PS20Caps.DynamicFlowControlDepth = 0; /* WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0 */
*pCaps->PS20Caps.NumTemps = max(12, GLINFO_LOCATION.ps_arb_max_temps); *pCaps->PS20Caps.NumTemps = max(12, GLINFO_LOCATION.ps_arb_max_temps);
*pCaps->PS20Caps.StaticFlowControlDepth = WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH; /* Minumum: 1 */ *pCaps->PS20Caps.StaticFlowControlDepth = WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH; /* Minimum: 1 */
*pCaps->PS20Caps.NumInstructionSlots = WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS; /* Minimum number (64 ALU + 32 Texture), a GeforceFX uses 512 */ *pCaps->PS20Caps.NumInstructionSlots = WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS; /* Minimum number (64 ALU + 32 Texture), a GeforceFX uses 512 */
*pCaps->MaxPShaderInstructionsExecuted = 512; /* Minimum value, a GeforceFX uses 1024 */ *pCaps->MaxPShaderInstructionsExecuted = 512; /* Minimum value, a GeforceFX uses 1024 */
...@@ -2882,7 +2882,7 @@ static void fixup_extensions(WineD3D_GL_Info *gl_info) { ...@@ -2882,7 +2882,7 @@ static void fixup_extensions(WineD3D_GL_Info *gl_info) {
/* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems /* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems
* with fixed function fragment processing. Ideally this flag should be detected with a test shader * with fixed function fragment processing. Ideally this flag should be detected with a test shader
* and opengl feedback mode, but some GL implementations(MacOS ATI at least, propably all macos ones) * and OpenGL feedback mode, but some GL implementations (MacOS ATI at least, probably all MacOS ones)
* do not like vertex shaders in feedback mode and return an error, even though it should be valid * do not like vertex shaders in feedback mode and return an error, even though it should be valid
* according to the spec. * according to the spec.
* *
......
...@@ -1099,7 +1099,7 @@ void drawPrimitive(IWineD3DDevice *iface, ...@@ -1099,7 +1099,7 @@ void drawPrimitive(IWineD3DDevice *iface,
} }
} }
/* Finshed updating the screen, restore lock */ /* Finished updating the screen, restore lock */
LEAVE_GL(); LEAVE_GL();
TRACE("Done all gl drawing\n"); TRACE("Done all gl drawing\n");
...@@ -1160,7 +1160,7 @@ static void normalize_normal(float *n) { ...@@ -1160,7 +1160,7 @@ static void normalize_normal(float *n) {
* *
* The problem is that OpenGL does not offer a direct way to return the tesselated primitives, * The problem is that OpenGL does not offer a direct way to return the tesselated primitives,
* and they can't be sent off for rendering directly either. Tesselating is slow, so we want * and they can't be sent off for rendering directly either. Tesselating is slow, so we want
* to chache the patches in a vertex buffer. But more importantly, gl can't bind generated * to cache the patches in a vertex buffer. But more importantly, gl can't bind generated
* attributes to numbered shader attributes, so we have to store them and rebind them as needed * attributes to numbered shader attributes, so we have to store them and rebind them as needed
* in drawprim. * in drawprim.
* *
......
...@@ -105,7 +105,7 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_GetFunction(IWineD3DPixelShader* ...@@ -105,7 +105,7 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_GetFunction(IWineD3DPixelShader*
} }
CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = { CONST SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[] = {
/* Arithmethic */ /* Arithmetic */
{WINED3DSIO_NOP, "nop", "NOP", 0, 0, pshader_hw_map2gl, NULL, 0, 0}, {WINED3DSIO_NOP, "nop", "NOP", 0, 0, pshader_hw_map2gl, NULL, 0, 0},
{WINED3DSIO_MOV, "mov", "MOV", 1, 2, pshader_hw_map2gl, shader_glsl_mov, 0, 0}, {WINED3DSIO_MOV, "mov", "MOV", 1, 2, pshader_hw_map2gl, shader_glsl_mov, 0, 0},
{WINED3DSIO_ADD, "add", "ADD", 1, 3, pshader_hw_map2gl, shader_glsl_arith, 0, 0}, {WINED3DSIO_ADD, "add", "ADD", 1, 3, pshader_hw_map2gl, shader_glsl_arith, 0, 0},
...@@ -510,7 +510,7 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i ...@@ -510,7 +510,7 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *i
} }
/* Don't do any register mapping magic if it is not needed, or if we can't /* Don't do any register mapping magic if it is not needed, or if we can't
* achive anything anyway * achieve anything anyway
*/ */
if(highest_reg_used < (GL_LIMITS(glsl_varyings) / 4) || if(highest_reg_used < (GL_LIMITS(glsl_varyings) / 4) ||
num_regs_used > (GL_LIMITS(glsl_varyings) / 4) ) { num_regs_used > (GL_LIMITS(glsl_varyings) / 4) ) {
......
...@@ -134,7 +134,7 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa ...@@ -134,7 +134,7 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
if(pData == NULL || dwSize == 0) break; if(pData == NULL || dwSize == 0) break;
for(i = 0; i < WINED3DRTYPECOUNT; i++){ for(i = 0; i < WINED3DRTYPECOUNT; i++){
/*I'm setting the default values to 1 so as to reduce the risk of a div/0 in the caller*/ /*I'm setting the default values to 1 so as to reduce the risk of a div/0 in the caller*/
/* isTextureResident could be used to get some of this infomration */ /* isTextureResident could be used to get some of this information */
data->stats[i].bThrashing = FALSE; data->stats[i].bThrashing = FALSE;
data->stats[i].ApproxBytesDownloaded = 1; data->stats[i].ApproxBytesDownloaded = 1;
data->stats[i].NumEvicts = 1; data->stats[i].NumEvicts = 1;
...@@ -187,7 +187,7 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa ...@@ -187,7 +187,7 @@ static HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pDa
DWORD* data = pData; DWORD* data = pData;
if(This->state == QUERY_CREATED) { if(This->state == QUERY_CREATED) {
/* D3D allows GetData on a new query, opengl doesn't. So just invent the data outselves */ /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves */
TRACE("Query wasn't yet started, returning S_OK\n"); TRACE("Query wasn't yet started, returning S_OK\n");
res = S_OK; res = S_OK;
if(data) *data = 0; if(data) *data = 0;
......
...@@ -88,11 +88,11 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){ ...@@ -88,11 +88,11 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){
if (This->resource.wineD3DDevice != NULL) { if (This->resource.wineD3DDevice != NULL) {
IWineD3DDevice_ResourceReleased((IWineD3DDevice *)This->resource.wineD3DDevice, iface); IWineD3DDevice_ResourceReleased((IWineD3DDevice *)This->resource.wineD3DDevice, iface);
}/* NOTE: this is not really an error for systemmem resoruces */ }/* NOTE: this is not really an error for systemmem resources */
return; return;
} }
/* IWineD3DResource Interface follow: */ /* IWineD3DResource Interface follows: */
HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice** ppDevice) { HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice** ppDevice) {
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
TRACE("(%p) : returning %p\n", This, This->resource.wineD3DDevice); TRACE("(%p) : returning %p\n", This, This->resource.wineD3DDevice);
......
...@@ -83,8 +83,8 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine ...@@ -83,8 +83,8 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
/* Lighting is not enabled if transformed vertices are drawn /* Lighting is not enabled if transformed vertices are drawn
* but lighting does not affect the stream sources, so it is not grouped for performance reasons. * but lighting does not affect the stream sources, so it is not grouped for performance reasons.
* This state reads the decoded vertex decl, so if it is dirty don't do anything. The * This state reads the decoded vertex declaration, so if it is dirty don't do anything. The
* vertex declaration appplying function calls this function for updating * vertex declaration applying function calls this function for updating
*/ */
if(isStateDirty(context, STATE_VDECL)) { if(isStateDirty(context, STATE_VDECL)) {
...@@ -435,7 +435,7 @@ static void state_clipping(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine ...@@ -435,7 +435,7 @@ static void state_clipping(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
if (use_vs(stateblock->wineD3DDevice)) { if (use_vs(stateblock->wineD3DDevice)) {
/* The spec says that opengl clipping planes are disabled when using shaders. Direct3D planes aren't, /* The spec says that opengl clipping planes are disabled when using shaders. Direct3D planes aren't,
* so that is an issue. The MacOS ATI driver keeps clipping planes activated with shaders in some * so that is an issue. The MacOS ATI driver keeps clipping planes activated with shaders in some
* contitions I got sick of tracking down. The shader state handler disables all clip planes because * conditions I got sick of tracking down. The shader state handler disables all clip planes because
* of that - don't do anything here and keep them disabled * of that - don't do anything here and keep them disabled
*/ */
if(stateblock->renderState[WINED3DRS_CLIPPLANEENABLE]) { if(stateblock->renderState[WINED3DRS_CLIPPLANEENABLE]) {
...@@ -1457,7 +1457,7 @@ static void state_wrap(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC ...@@ -1457,7 +1457,7 @@ static void state_wrap(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/texture/ http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/texture/
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/programmingguide/FixedFunction/Textures/texturewrapping.asp http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/programmingguide/FixedFunction/Textures/texturewrapping.asp
http://www.gamedev.net/reference/programming/features/rendererdll3/page2.asp http://www.gamedev.net/reference/programming/features/rendererdll3/page2.asp
Descussion that ways to turn on WRAPing to solve an opengl conversion problem. Discussion on the ways to turn on WRAPing to solve an OpenGL conversion problem.
http://www.flipcode.org/cgi-bin/fcmsg.cgi?thread_show=10248 http://www.flipcode.org/cgi-bin/fcmsg.cgi?thread_show=10248
so far as I can tell, wrapping and texture-coordinate generate go hand in hand, so far as I can tell, wrapping and texture-coordinate generate go hand in hand,
...@@ -1916,7 +1916,7 @@ static void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D ...@@ -1916,7 +1916,7 @@ static void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
DWORD op, arg1, arg2, arg0; DWORD op, arg1, arg2, arg0;
TRACE("Setting alpha op for stage %d\n", stage); TRACE("Setting alpha op for stage %d\n", stage);
/* Do not care for enabled / disabled stages, just assign the settigns. colorop disables / enables required stuff */ /* Do not care for enabled / disabled stages, just assign the settings. colorop disables / enables required stuff */
if (mapped_stage != -1) { if (mapped_stage != -1) {
if (GL_SUPPORT(ARB_MULTITEXTURE)) { if (GL_SUPPORT(ARB_MULTITEXTURE)) {
if (tex_used && mapped_stage >= GL_LIMITS(textures)) { if (tex_used && mapped_stage >= GL_LIMITS(textures)) {
...@@ -2543,7 +2543,7 @@ static void transform_world(DWORD state, IWineD3DStateBlockImpl *stateblock, Win ...@@ -2543,7 +2543,7 @@ static void transform_world(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
* *
* Deliberately no check if the vertex declaration is dirty because the vdecl state * Deliberately no check if the vertex declaration is dirty because the vdecl state
* does not always update the world matrix, only on a switch between transformed * does not always update the world matrix, only on a switch between transformed
* and untrannsformed draws. It *may* happen that the world matrix is set 2 times during one * and untransformed draws. It *may* happen that the world matrix is set 2 times during one
* draw, but that should be rather rare and cheaper in total. * draw, but that should be rather rare and cheaper in total.
*/ */
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
...@@ -3198,7 +3198,7 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte ...@@ -3198,7 +3198,7 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte
/* min(WINED3D_ATR_SIZE(position),3) to Disable RHW mode as 'w' coord /* min(WINED3D_ATR_SIZE(position),3) to Disable RHW mode as 'w' coord
handling for rhw mode should not impact screen position whereas in GL it does. handling for rhw mode should not impact screen position whereas in GL it does.
This may result in very slightly distored textures in rhw mode, but This may result in very slightly distorted textures in rhw mode, but
a very minimal different. There's always the other option of a very minimal different. There's always the other option of
fixing the view matrix to prevent w from having any effect fixing the view matrix to prevent w from having any effect
...@@ -3247,9 +3247,9 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte ...@@ -3247,9 +3247,9 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte
/* WARNING: Data here MUST be in RGBA format, so cannot */ /* WARNING: Data here MUST be in RGBA format, so cannot */
/* go directly into fast mode from app pgm, because */ /* go directly into fast mode from app pgm, because */
/* directx requires data in BGRA format. */ /* directx requires data in BGRA format. */
/* currently fixupVertices swizels the format, but this isn't */ /* currently fixupVertices swizzles the format, but this isn't */
/* very practical when using VBOS */ /* very practical when using VBOS */
/* NOTE: Unless we write a vertex shader to swizel the colour */ /* NOTE: Unless we write a vertex shader to swizzle the colour */
/* , or the user doesn't care and wants the speed advantage */ /* , or the user doesn't care and wants the speed advantage */
if (sd->u.s.diffuse.lpData || sd->u.s.diffuse.VBO) { if (sd->u.s.diffuse.lpData || sd->u.s.diffuse.VBO) {
......
...@@ -350,7 +350,7 @@ static WINED3DGLTYPE const glTypeLookupTemplate[WINED3DDECLTYPE_UNUSED] = { ...@@ -350,7 +350,7 @@ static WINED3DGLTYPE const glTypeLookupTemplate[WINED3DDECLTYPE_UNUSED] = {
void init_type_lookup(WineD3D_GL_Info *gl_info) { void init_type_lookup(WineD3D_GL_Info *gl_info) {
memcpy(gl_info->glTypeLookup, glTypeLookupTemplate, sizeof(glTypeLookupTemplate)); memcpy(gl_info->glTypeLookup, glTypeLookupTemplate, sizeof(glTypeLookupTemplate));
if(!GL_SUPPORT(NV_HALF_FLOAT)) { if(!GL_SUPPORT(NV_HALF_FLOAT)) {
/* Do not change the size of the type, it is CPU side. Whe have to change the GPU-side information though. /* Do not change the size of the type, it is CPU side. We have to change the GPU-side information though.
* It is the job of the vertex buffer code to make sure that the vbos have the right format * It is the job of the vertex buffer code to make sure that the vbos have the right format
*/ */
gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_2].glType = GL_FLOAT; gl_info->glTypeLookup[WINED3DDECLTYPE_FLOAT16_2].glType = GL_FLOAT;
...@@ -2603,7 +2603,7 @@ void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, B ...@@ -2603,7 +2603,7 @@ void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, B
case WINED3DDECLTYPE_FLOAT3: /* Opengl defaults match dx defaults */ case WINED3DDECLTYPE_FLOAT3: /* Opengl defaults match dx defaults */
case WINED3DDECLTYPE_FLOAT4: /* No defaults apply, all app defined */ case WINED3DDECLTYPE_FLOAT4: /* No defaults apply, all app defined */
/* This is to prevent swaping the matrix lines and put the default 4th coord = 1.0 /* This is to prevent swapping the matrix lines and put the default 4th coord = 1.0
* into a bad place. The division elimination below will apply to make sure the * into a bad place. The division elimination below will apply to make sure the
* 1.0 doesn't do anything bad. The caller will set this value if the stride is 0 * 1.0 doesn't do anything bad. The caller will set this value if the stride is 0
*/ */
...@@ -2737,7 +2737,7 @@ WINED3DFORMAT pixelformat_for_depth(DWORD depth) { ...@@ -2737,7 +2737,7 @@ WINED3DFORMAT pixelformat_for_depth(DWORD depth) {
case 15: return WINED3DFMT_X1R5G5B5; case 15: return WINED3DFMT_X1R5G5B5;
case 16: return WINED3DFMT_R5G6B5; case 16: return WINED3DFMT_R5G6B5;
case 24: return WINED3DFMT_X8R8G8B8; /* Robots needs 24bit to be X8R8G8B8 */ case 24: return WINED3DFMT_X8R8G8B8; /* Robots needs 24bit to be X8R8G8B8 */
case 32: return WINED3DFMT_X8R8G8B8; /* EVE online and the Fur demo need 32bit AdapterDisplatMode to return X8R8G8B8 */ case 32: return WINED3DFMT_X8R8G8B8; /* EVE online and the Fur demo need 32bit AdapterDisplayMode to return X8R8G8B8 */
default: return WINED3DFMT_UNKNOWN; default: return WINED3DFMT_UNKNOWN;
} }
} }
......
...@@ -301,7 +301,7 @@ inline BOOL WINAPI IWineD3DVertexBufferImpl_FindDecl(IWineD3DVertexBufferImpl *T ...@@ -301,7 +301,7 @@ inline BOOL WINAPI IWineD3DVertexBufferImpl_FindDecl(IWineD3DVertexBufferImpl *T
* that concern the current buffer. A problem with this is that this can change between draws, so we have to validate * that concern the current buffer. A problem with this is that this can change between draws, so we have to validate
* the information and reprocess the buffer if it changes, and avoid false positives for performance reasons. * the information and reprocess the buffer if it changes, and avoid false positives for performance reasons.
* *
* We have do destinguish between vertex shaders and fixed function to pick the way we access the * We have to distinguish between vertex shaders and fixed function to pick the way we access the
* strided vertex information. * strided vertex information.
* *
* This code sets up a per-byte array with the size of the detected stride of the arrays in the * This code sets up a per-byte array with the size of the detected stride of the arrays in the
...@@ -429,7 +429,7 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if ...@@ -429,7 +429,7 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if
declChanged = IWineD3DVertexBufferImpl_FindDecl(This); declChanged = IWineD3DVertexBufferImpl_FindDecl(This);
} else if(This->Flags & VBFLAG_HASDESC) { } else if(This->Flags & VBFLAG_HASDESC) {
/* Reuse the declaration stored in the buffer. It will most likely not change, and if it does /* Reuse the declaration stored in the buffer. It will most likely not change, and if it does
* the stream source state handler will call PreLoad again and the change will be cought * the stream source state handler will call PreLoad again and the change will be caught
*/ */
} else { } else {
/* Cannot get a declaration, and no declaration is stored in the buffer. It is pointless to preload /* Cannot get a declaration, and no declaration is stored in the buffer. It is pointless to preload
...@@ -440,8 +440,8 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if ...@@ -440,8 +440,8 @@ static void WINAPI IWineD3DVertexBufferImpl_PreLoad(IWineD3DVertexBuffer *if
} }
/* If applications change the declaration over and over, reconverting all the time is a huge /* If applications change the declaration over and over, reconverting all the time is a huge
* performance hit. So count the declaration changes and release the VBO if there are too much * performance hit. So count the declaration changes and release the VBO if there are too many
* of them(and thus stop converting) * of them (and thus stop converting)
*/ */
if(declChanged) { if(declChanged) {
This->declChanges++; This->declChanges++;
......
...@@ -75,8 +75,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); ...@@ -75,8 +75,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader);
* http://developer.nvidia.com/view.asp?IO=var_memory_management * http://developer.nvidia.com/view.asp?IO=var_memory_management
*/ */
/* TODO: Vertex and Pixel shaders are almost identicle, the only exception being the way that some of the data is looked up or the availablity of some of the data i.e. some instructions are only valid for pshaders and some for vshaders /* TODO: Vertex and Pixel shaders are almost identical, the only exception being the way that some of the data is looked up or the availability of some of the data i.e. some instructions are only valid for pshaders and some for vshaders
because of this the bulk of the software pipeline can be shared between pixel and vertex shaders... and it wouldn't supprise me if the programes can be cross compiled using a large body body shared code */ because of this the bulk of the software pipeline can be shared between pixel and vertex shaders... and it wouldn't surprise me if the program can be cross compiled using a large body of shared code */
#define GLNAME_REQUIRE_GLSL ((const char *)1) #define GLNAME_REQUIRE_GLSL ((const char *)1)
...@@ -418,8 +418,8 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( ...@@ -418,8 +418,8 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
/* Z coord [0;1]->[-1;1] mapping, see comment in transform_projection in state.c /* Z coord [0;1]->[-1;1] mapping, see comment in transform_projection in state.c
* *
* Basically we want(in homogenous coordinates) z = z * 2 - 1. However, shaders are run * Basically we want (in homogeneous coordinates) z = z * 2 - 1. However, shaders are run
* before the homogenous divide, so we have to take the w into account: z = ((z / w) * 2 - 1) * w, * before the homogeneous divide, so we have to take the w into account: z = ((z / w) * 2 - 1) * w,
* which is the same as z = z / 2 - w. * which is the same as z = z / 2 - w.
*/ */
shader_addline(&buffer, "gl_Position.z = gl_Position.z * 2.0 - gl_Position.w;\n"); shader_addline(&buffer, "gl_Position.z = gl_Position.z * 2.0 - gl_Position.w;\n");
......
...@@ -488,7 +488,7 @@ struct WineD3DContext { ...@@ -488,7 +488,7 @@ struct WineD3DContext {
IWineD3DSurface *surface; IWineD3DSurface *surface;
DWORD tid; /* Thread ID which owns this context at the moment */ DWORD tid; /* Thread ID which owns this context at the moment */
/* Stores some inforation about the context state for optimization */ /* Stores some information about the context state for optimization */
GLint last_draw_buffer; GLint last_draw_buffer;
BOOL last_was_rhw; /* true iff last draw_primitive was in xyzrhw mode */ BOOL last_was_rhw; /* true iff last draw_primitive was in xyzrhw mode */
BOOL last_was_pshader; BOOL last_was_pshader;
...@@ -513,7 +513,7 @@ struct WineD3DContext { ...@@ -513,7 +513,7 @@ struct WineD3DContext {
typedef enum ContextUsage { typedef enum ContextUsage {
CTXUSAGE_RESOURCELOAD = 1, /* Only loads textures: No State is applied */ CTXUSAGE_RESOURCELOAD = 1, /* Only loads textures: No State is applied */
CTXUSAGE_DRAWPRIM = 2, /* OpenGL states are set up for blitting DirectDraw surfacs */ CTXUSAGE_DRAWPRIM = 2, /* OpenGL states are set up for blitting DirectDraw surfaces */
CTXUSAGE_BLIT = 3, /* OpenGL states are set up 3D drawing */ CTXUSAGE_BLIT = 3, /* OpenGL states are set up 3D drawing */
CTXUSAGE_CLEAR = 4, /* Drawable and states are set up for clearing */ CTXUSAGE_CLEAR = 4, /* Drawable and states are set up for clearing */
} ContextUsage; } ContextUsage;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment