Commit 9489f8bd authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

- mor usefull debug functions debug_d3dusage and debug_d3ddevicetype

- fix a crash in pixel shader parser (happened with unreal2) - currently desactive pixel shaders caps (with #define) while hw shaders code isn't merged - when we have a special debug channel for shader, use it ;) - fix again some stubs return value - more more readable traces now (principaly IDirect3D8 capacities check and surface locking code) using new debug functions - fix/cleaning the surface locking code - now we support D3DTOP_SUBSTRACT so declare it in caps - now support true 32bit (well X 24 bit can be used as 32 bit in caps code) - first try to get D3DTSS_TCI_CAMERASPACENORMAL and D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR look good - native support 32 bit support (now application can choose 16 or 32 bit support) if current resolution is 24 bit (as we can only launch games in windowed mode) - textures palettes support - fix reflexion placement code (the sdk sample begin to work) - fix a stupid crash when using traces in vshaderdeclaration - more more readable traces (init/caps) - more cubetextures fixes
parent 16675029
......@@ -88,11 +88,13 @@ HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASET
}
DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew) {
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface) {
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface) {
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
......@@ -107,15 +109,18 @@ D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8
/* IDirect3DBaseTexture8 */
DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew) {
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface) {
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface) {
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl =
......
......@@ -138,6 +138,7 @@ void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8
TRACE("(%p) : About to load texture\n", This);
for (i = 0; i < This->levels; i++) {
if (i == 0 && This->surfaces[0][i]->textureName != 0 && This->Dirty == FALSE) {
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
#if defined(GL_VERSION_1_3)
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, This->surfaces[0][i]->textureName);
#else
......
......@@ -55,10 +55,11 @@ extern void (*wine_tsx11_unlock_ptr)(void);
#include "d3d8.h"
/* Device caps */
#define MAX_PALETTES 256
#define MAX_STREAMS 16
#define MAX_ACTIVE_LIGHTS 8
#define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
#define MAX_LEVELS 256
#define MAX_LEVELS 256
/* Other useful values */
#define HIGHEST_RENDER_STATE 174
......@@ -272,13 +273,16 @@ struct IDirect3DDevice8Impl
float lightPosn[MAX_ACTIVE_LIGHTS][4];
float lightDirn[MAX_ACTIVE_LIGHTS][4];
/* palettes texture management */
PALETTEENTRY palettes[MAX_PALETTES][256];
UINT currentPalette;
/* Optimization */
D3DMATRIX lastProj;
D3DMATRIX lastView;
D3DMATRIX lastWorld0;
D3DMATRIX lastTexTrans[8];
/* OpenGL related */
GLXContext glCtx;
XVisualInfo *visInfo;
......@@ -1132,6 +1136,8 @@ DWORD fmt2glType(D3DFORMAT fmt);
/**
* Internals debug functions
*/
const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
const char* debug_d3dusage(DWORD usage);
const char* debug_d3dformat(D3DFORMAT fmt);
const char* debug_d3dressourcetype(D3DRESOURCETYPE res);
......
......@@ -83,11 +83,13 @@ HRESULT WINAPI IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE
}
DWORD WINAPI IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface, DWORD PriorityNew) {
ICOM_THIS(IDirect3DResource8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
DWORD WINAPI IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface) {
ICOM_THIS(IDirect3DResource8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
void WINAPI IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface) {
ICOM_THIS(IDirect3DResource8Impl,iface);
......
......@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader);
/* Shader debugging - Change the following line to enable debugging of software
vertex shaders */
#if 0
#if 1
# define VSTRACE(A) TRACE A
# define TRACE_VECTOR(name) TRACE( #name "=(%f, %f, %f, %f)\n", name.x, name.y, name.z, name.w)
#else
......@@ -604,6 +604,8 @@ HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* vs
TRACE_VECTOR(input->V[D3DVSDE_TEXCOORD1]);
#endif
TRACE_VECTOR(vshader->data->C[64]);
/* the first dword is the version tag */
/* TODO: parse it */
......
......@@ -55,6 +55,7 @@ static const float idmatrix[16] = {
HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* This) {
D3DLINEPATTERN lp;
int i;
int j;
LPDIRECT3DDEVICE8 iface = (LPDIRECT3DDEVICE8) This;
/* Note this may have a large overhead but it should only be executed
......@@ -153,8 +154,8 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T
IDirect3DDevice8Impl_SetRenderState(iface, D3DRS_NORMALORDER, D3DORDER_LINEAR);
/* Texture Stage States - Put directly into state block, we will call function below */
for (i=0; i<This->TextureUnits;i++) {
memcpy(&This->StateBlock->transforms[D3DTS_TEXTURE0+i], &idmatrix, sizeof(idmatrix));
for (i = 0; i < This->TextureUnits; i++) {
memcpy(&This->StateBlock->transforms[D3DTS_TEXTURE0 + i], &idmatrix, sizeof(idmatrix));
This->StateBlock->texture_state[i][D3DTSS_COLOROP ] = (i==0)? D3DTOP_MODULATE : D3DTOP_DISABLE;
This->StateBlock->texture_state[i][D3DTSS_COLORARG1 ] = D3DTA_TEXTURE;
This->StateBlock->texture_state[i][D3DTSS_COLORARG2 ] = D3DTA_CURRENT;
......@@ -227,6 +228,17 @@ HRESULT WINAPI IDirect3DDeviceImpl_InitStartupStateBlock(IDirect3DDevice8Impl* T
setupTextureStates(iface, i);
}
/* defaulting palettes */
for (i = 0; i < MAX_PALETTES; ++i) {
for (j = 0; j < 256; ++j) {
This->palettes[i][j].peRed = 0xFF;
This->palettes[i][j].peGreen = 0xFF;
This->palettes[i][j].peBlue = 0xFF;
This->palettes[i][j].peFlags = 0xFF;
}
}
This->currentPalette = 0;
TRACE("-----------------------> Device defaults now set up...\n");
return D3D_OK;
......
......@@ -28,7 +28,7 @@
#include "d3d8_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
/* trace: */
#if 0
......@@ -131,7 +131,17 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
return D3DERR_INVALIDCALL;
}
TRACE("(%p) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->allocatedMemory);
if (This == This->Device->backBuffer || This == This->Device->frontBuffer || This->Device->depthStencilBuffer) {
if (This == This->Device->backBuffer) {
TRACE("(%p, backBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->allocatedMemory);
} else if (This == This->Device->frontBuffer) {
TRACE("(%p, frontBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->allocatedMemory);
} else if (This == This->Device->depthStencilBuffer) {
TRACE("(%p, stencilBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->allocatedMemory);
}
} else {
TRACE("(%p) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->allocatedMemory);
}
pLockedRect->Pitch = This->bytesPerPixel * This->myDesc.Width; /* Bytes / row */
......@@ -183,25 +193,50 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
}
vcheckGLcall("glReadBuffer");
/** TODO: use an enhanced version of fmt2glintFmt here instad this switch */
#if 0
switch (This->myDesc.Format) {
case D3DFMT_R5G6B5:
{
glReadPixels(This->lockedRect.left, This->lockedRect.top,
This->lockedRect.right - This->lockedRect.left, This->lockedRect.bottom - This->lockedRect.top,
GL_RGB, GL_UNSIGNED_SHORT_5_6_5, pLockedRect->pBits);
vcheckGLcall("glReadPixels");
{
/*
glReadPixels(This->lockedRect.left, This->lockedRect.top,
This->lockedRect.right - This->lockedRect.left, This->lockedRect.bottom - This->lockedRect.top,
GL_RGB, GL_UNSIGNED_SHORT_5_6_5, pLockedRect->pBits);
vcheckGLcall("glReadPixels");
*/
long j;
for (j = This->lockedRect.top; j < This->lockedRect.bottom - This->lockedRect.top; ++j) {
glReadPixels(This->lockedRect.left,
This->lockedRect.bottom - j - 1,
This->lockedRect.right - This->lockedRect.left,
1,
GL_RGB, GL_UNSIGNED_SHORT_5_6_5, pLockedRect->pBits);
vcheckGLcall("glReadPixels");
}
}
break;
case D3DFMT_R8G8B8:
{
/*
glReadPixels(This->lockedRect.left, This->lockedRect.top,
This->lockedRect.right - This->lockedRect.left, This->lockedRect.bottom - This->lockedRect.top,
GL_RGB, GL_UNSIGNED_BYTE, pLockedRect->pBits);
vcheckGLcall("glReadPixels");
*/
long j;
for (j = This->lockedRect.top; j < This->lockedRect.bottom - This->lockedRect.top; ++j) {
glReadPixels(This->lockedRect.left,
This->lockedRect.bottom - j - 1,
This->lockedRect.right - This->lockedRect.left,
1,
GL_RGB, GL_UNSIGNED_BYTE, pLockedRect->pBits);
vcheckGLcall("glReadPixels");
}
}
break;
case D3DFMT_A8R8G8B8:
{
/*
glPixelStorei(GL_PACK_SWAP_BYTES, TRUE);
vcheckGLcall("glPixelStorei");
glReadPixels(This->lockedRect.left, This->lockedRect.top,
......@@ -210,11 +245,38 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
vcheckGLcall("glReadPixels");
glPixelStorei(GL_PACK_SWAP_BYTES, prev_store);
vcheckGLcall("glPixelStorei");
*/
long j;
glPixelStorei(GL_PACK_SWAP_BYTES, TRUE);
vcheckGLcall("glPixelStorei");
for (j = This->lockedRect.top; j < This->lockedRect.bottom - This->lockedRect.top; ++j) {
glReadPixels(This->lockedRect.left,
This->lockedRect.bottom - j - 1,
This->lockedRect.right - This->lockedRect.left,
1,
GL_BGRA, GL_UNSIGNED_BYTE, pLockedRect->pBits);
vcheckGLcall("glReadPixels");
}
glPixelStorei(GL_PACK_SWAP_BYTES, prev_store);
vcheckGLcall("glPixelStorei");
}
break;
default:
FIXME("Unsupported Format %u in locking func\n", This->myDesc.Format);
}
#endif
{
long j;
for (j = This->lockedRect.top; j < This->lockedRect.bottom - This->lockedRect.top; ++j) {
glReadPixels(This->lockedRect.left,
This->lockedRect.bottom - j - 1,
This->lockedRect.right - This->lockedRect.left,
1,
fmt2glFmt(This->myDesc.Format), fmt2glType(This->myDesc.Format), pLockedRect->pBits);
vcheckGLcall("glReadPixels");
}
}
glReadBuffer(prev_read);
vcheckGLcall("glReadBuffer");
......@@ -262,7 +324,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
}
}
TRACE("returning pBits=%p, pitch=%d\n", pLockedRect->pBits, pLockedRect->Pitch);
TRACE("returning memory@%p, pitch(%d) dirtyfied(%d)\n", pLockedRect->pBits, pLockedRect->Pitch, This->Dirty);
This->locked = TRUE;
return D3D_OK;
......@@ -275,7 +337,18 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
return D3DERR_INVALIDCALL;
}
TRACE("(%p) : see if behavior is correct\n", This);
if (This == This->Device->backBuffer || This == This->Device->frontBuffer || This->Device->depthStencilBuffer) {
if (This == This->Device->backBuffer) {
TRACE("(%p, backBuffer) : dirtyfied(%d)\n", This, This->Dirty);
} else if (This == This->Device->frontBuffer) {
TRACE("(%p, frontBuffer) : dirtyfied(%d)\n", This, This->Dirty);
} else if (This == This->Device->depthStencilBuffer) {
TRACE("(%p, stencilBuffer) : dirtyfied(%d)\n", This, This->Dirty);
}
} else {
TRACE("(%p) : dirtyfied(%d)\n", This, This->Dirty);
}
/*TRACE("(%p) see if behavior is correct\n", This);*/
if (FALSE == This->Dirty) {
TRACE("(%p) : Not Dirtified so nothing to do, return now\n", This);
......@@ -311,7 +384,8 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
if (This == This->Device->backBuffer || This == This->Device->frontBuffer) {
GLint prev_store;
GLenum prev_draw;
GLint prev_rasterpos[4];
ENTER_GL();
glFlush();
......@@ -320,6 +394,8 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
vcheckGLcall("glIntegerv");
glGetIntegerv(GL_PACK_SWAP_BYTES, &prev_store);
vcheckGLcall("glIntegerv");
glGetIntegerv(GL_CURRENT_RASTER_POSITION, &prev_rasterpos[0]);
vcheckGLcall("glIntegerv");
if (This == This->Device->backBuffer) {
glDrawBuffer(GL_BACK);
......@@ -362,6 +438,8 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
glDrawBuffer(prev_draw);
vcheckGLcall("glDrawBuffer");
glRasterPos3iv(&prev_rasterpos[0]);
vcheckGLcall("glRasterPos3iv");
LEAVE_GL();
} else {
FIXME("unsupported unlocking to Rendering surface surf@%p usage(%lu)\n", This, This->myDesc.Usage);
......
......@@ -61,7 +61,7 @@ ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface) {
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
if (ref == 0) {
for (i=0; i<This->levels; i++) {
for (i = 0; i < This->levels; i++) {
if (This->surfaces[i] != NULL) {
TRACE("(%p) : Releasing surface %p\n", This, This->surfaces[i]);
IDirect3DSurface8Impl_Release((LPDIRECT3DSURFACE8) This->surfaces[i]);
......@@ -98,63 +98,62 @@ HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8
}
DWORD WINAPI IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface, DWORD PriorityNew) {
ICOM_THIS(IDirect3DTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
DWORD WINAPI IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface) {
ICOM_THIS(IDirect3DTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface) {
int i;
ICOM_THIS(IDirect3DTexture8Impl,iface);
TRACE("(%p) : About to load texture\n", This);
for (i=0; i<This->levels; i++)
{
if (i==0 && This->surfaces[i]->textureName != 0 && This->Dirty == FALSE) {
glBindTexture(GL_TEXTURE_2D, This->surfaces[i]->textureName);
checkGLcall("glBindTexture");
TRACE("Texture %p (level %d) given name %d\n", This->surfaces[i], i, This->surfaces[i]->textureName);
/* No need to walk through all mip-map levels, since already all assigned */
i = This->levels;
} else {
if (i==0) {
if (This->surfaces[i]->textureName == 0) {
glGenTextures(1, &This->surfaces[i]->textureName);
checkGLcall("glGenTextures");
TRACE("Texture %p (level %d) given name %d\n", This->surfaces[i], i, This->surfaces[i]->textureName);
}
glBindTexture(GL_TEXTURE_2D, This->surfaces[i]->textureName);
checkGLcall("glBindTexture");
TRACE("Setting GL_TEXTURE_MAX_LEVEL to %d\n", This->levels-1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, This->levels-1);
checkGLcall("glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, This->levels)");
}
TRACE("Calling glTexImage2D %x i=%d, intfmt=%x, w=%d, h=%d,0=%d, glFmt=%x, glType=%lx, Mem=%p\n",
GL_TEXTURE_2D, i, fmt2glintFmt(This->format), This->surfaces[i]->myDesc.Width,
This->surfaces[i]->myDesc.Height, 0, fmt2glFmt(This->format),fmt2glType(This->format),
This->surfaces[i]->allocatedMemory);
glTexImage2D(GL_TEXTURE_2D, i,
fmt2glintFmt(This->format),
This->surfaces[i]->myDesc.Width,
This->surfaces[i]->myDesc.Height,
0,
fmt2glFmt(This->format),
fmt2glType(This->format),
This->surfaces[i]->allocatedMemory
);
checkGLcall("glTexImage2D");
/* Removed glTexParameterf now TextureStageStates are initialized at startup */
This->Dirty = FALSE;
}
for (i = 0; i < This->levels; i++) {
if (i == 0 && This->surfaces[i]->textureName != 0 && This->Dirty == FALSE) {
glBindTexture(GL_TEXTURE_2D, This->surfaces[i]->textureName);
checkGLcall("glBindTexture");
TRACE("Texture %p (level %d) given name %d\n", This->surfaces[i], i, This->surfaces[i]->textureName);
/* No need to walk through all mip-map levels, since already all assigned */
i = This->levels;
} else {
if (i == 0) {
if (This->surfaces[i]->textureName == 0) {
glGenTextures(1, &This->surfaces[i]->textureName);
checkGLcall("glGenTextures");
TRACE("Texture %p (level %d) given name %d\n", This->surfaces[i], i, This->surfaces[i]->textureName);
}
glBindTexture(GL_TEXTURE_2D, This->surfaces[i]->textureName);
checkGLcall("glBindTexture");
TRACE("Setting GL_TEXTURE_MAX_LEVEL to %d\n", This->levels - 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, This->levels - 1);
checkGLcall("glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, This->levels)");
}
TRACE("Calling glTexImage2D %x i=%d, intfmt=%x, w=%d, h=%d,0=%d, glFmt=%x, glType=%lx, Mem=%p\n",
GL_TEXTURE_2D, i, fmt2glintFmt(This->format),
This->surfaces[i]->myDesc.Width, This->surfaces[i]->myDesc.Height,
0, fmt2glFmt(This->format), fmt2glType(This->format),
This->surfaces[i]->allocatedMemory);
glTexImage2D(GL_TEXTURE_2D,
i,
fmt2glintFmt(This->format),
This->surfaces[i]->myDesc.Width,
This->surfaces[i]->myDesc.Height,
0,
fmt2glFmt(This->format),
fmt2glType(This->format),
This->surfaces[i]->allocatedMemory);
checkGLcall("glTexImage2D");
/* Removed glTexParameterf now TextureStageStates are initialized at startup */
This->Dirty = FALSE;
}
}
return;
return ;
}
D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface) {
ICOM_THIS(IDirect3DTexture8Impl,iface);
......@@ -165,11 +164,13 @@ D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface) {
/* IDirect3DTexture8 IDirect3DBaseTexture8 Interface follow: */
DWORD WINAPI IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface, DWORD LODNew) {
ICOM_THIS(IDirect3DTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
DWORD WINAPI IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface) {
ICOM_THIS(IDirect3DTexture8Impl,iface);
FIXME("(%p) : stub\n", This); return D3D_OK;
FIXME("(%p) : stub\n", This);
return 0;
}
DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface) {
ICOM_THIS(IDirect3DTexture8Impl,iface);
......@@ -183,7 +184,7 @@ HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 ifa
if (Level < This->levels) {
TRACE("(%p) Level (%d)\n", This, Level);
return IDirect3DSurface8Impl_GetDesc((LPDIRECT3DSURFACE8)This->surfaces[Level], pDesc);
return IDirect3DSurface8Impl_GetDesc((LPDIRECT3DSURFACE8) This->surfaces[Level], pDesc);
} else {
FIXME("(%p) Level (%d)\n", This, Level);
}
......
......@@ -30,7 +30,7 @@
#include "d3d8_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader);
/**
* DirectX9 SDK download
......@@ -65,7 +65,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
*/
/** Vertex Shader Declaration data types tokens */
static CONST char* VertexShaderDeclDataTypes [] = {
#define MAX_VSHADER_DECL_TYPES 8
static CONST char* VertexShaderDeclDataTypes[] = {
"D3DVSDT_FLOAT1",
"D3DVSDT_FLOAT2",
"D3DVSDT_FLOAT3",
......@@ -77,7 +78,7 @@ static CONST char* VertexShaderDeclDataTypes [] = {
NULL
};
static CONST char* VertexShaderDeclRegister [] = {
static CONST char* VertexShaderDeclRegister[] = {
"D3DVSDE_POSITION",
"D3DVSDE_BLENDWEIGHT",
"D3DVSDE_BLENDINDICES",
......@@ -99,7 +100,7 @@ static CONST char* VertexShaderDeclRegister [] = {
};
/** todo check decl validity */
inline static DWORD Direct3DVextexShaderDeclarationImpl_ParseToken(const DWORD* pToken) {
/*inline static*/ DWORD Direct3DVextexShaderDeclarationImpl_ParseToken(const DWORD* pToken) {
const DWORD token = *pToken;
DWORD tokenlen = 1;
......@@ -143,16 +144,24 @@ inline static DWORD Direct3DVextexShaderDeclarationImpl_ParseToken(const DWORD*
TRACE(" 0x%08lx CONST(%lu, %lu)\n", token, constaddress, count);
++pToken;
for (i = 0; i < count; ++i) {
#if 0
TRACE(" c[%lu] = (0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx)\n",
constaddress,
*pToken,
*(pToken + 1),
*(pToken + 2),
*(pToken + 3));
#endif
TRACE(" c[%lu] = (%8f, %8f, %8f, %8f)\n",
constaddress,
*(float*) pToken,
*(float*) (pToken + 1),
*(float*) (pToken + 2),
*(float*) (pToken + 3));
pToken += 4;
++constaddress;
}
tokenlen = count + 1;
tokenlen = (4 * count) + 1;
}
break;
case D3DVSD_TOKEN_EXT:
......@@ -225,7 +234,11 @@ HRESULT WINAPI IDirect3DDeviceImpl_CreateVertexShaderDeclaration8(IDirect3DDevic
default:
/** errooooorr mismatched use of a register, invalid fvf computing */
invalid_fvf = TRUE;
TRACE("Mismatched use in VertexShader declaration of D3DVSDE_POSITION register: unsupported type %s\n", VertexShaderDeclDataTypes[type]);
if (type >= MAX_VSHADER_DECL_TYPES) {
TRACE("Mismatched use in VertexShader declaration of D3DVSDE_POSITION register: unsupported and unrecognized type %08lx\n", type);
} else {
TRACE("Mismatched use in VertexShader declaration of D3DVSDE_POSITION register: unsupported type %s\n", VertexShaderDeclDataTypes[type]);
}
}
break;
......@@ -354,7 +367,8 @@ HRESULT WINAPI IDirect3DDeviceImpl_FillVertexShaderInput(IDirect3DDevice8Impl* T
SHORT u, v, r, t;
DWORD dw;
/*TRACE("(%p) - This:%p - stream:%p, startIdx=%lu, idxDecal=%lu\n", vshader, This, vertexFirstStream, StartVertexIndex, idxDecal);*/
TRACE("(%p) - This:%p - stream:%p, startIdx=%lu, idxDecal=%lu\n", vshader, This, vertexFirstStream, StartVertexIndex, idxDecal);
while (D3DVSD_END() != *pToken) {
token = *pToken;
tokentype = ((token & D3DVSD_TOKENTYPEMASK) >> D3DVSD_TOKENTYPESHIFT);
......
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