wined3d: Properly load FLOAT16_2 and FLOAT16_4 vertex data.

This commit is contained in:
H. Verbeet 2007-08-01 22:48:54 +02:00 committed by Alexandre Julliard
parent f11ca610ba
commit 82245cb5d7
2 changed files with 15 additions and 4 deletions

View File

@ -818,10 +818,18 @@ static inline void drawStridedInstanced(IWineD3DDevice *iface, WineDirect3DVerte
/* Are those 16 bit floats. C doesn't have a 16 bit float type. I could read the single bits and calculate a 4
* byte float according to the IEEE standard
*/
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_2\n");
if (GL_SUPPORT(NV_HALF_FLOAT)) {
GL_EXTCALL(glVertexAttrib2hvNV(instancedData[j], (GLhalfNV *)ptr));
} else {
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_2\n");
}
break;
case WINED3DDECLTYPE_FLOAT16_4:
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_4\n");
if (GL_SUPPORT(NV_HALF_FLOAT)) {
GL_EXTCALL(glVertexAttrib4hvNV(instancedData[j], (GLhalfNV *)ptr));
} else {
FIXME("Unsupported WINED3DDECLTYPE_FLOAT16_4\n");
}
break;
case WINED3DDECLTYPE_UNUSED:

View File

@ -139,8 +139,11 @@ static WINED3DGLTYPE const glTypeLookup[WINED3DDECLTYPE_UNUSED] = {
{WINED3DDECLTYPE_USHORT4N, 4, GL_UNSIGNED_SHORT , GL_TRUE ,sizeof(short int)},
{WINED3DDECLTYPE_UDEC3, 3, GL_UNSIGNED_SHORT , GL_FALSE ,sizeof(short int)},
{WINED3DDECLTYPE_DEC3N, 3, GL_SHORT , GL_TRUE ,sizeof(short int)},
{WINED3DDECLTYPE_FLOAT16_2, 2, GL_FLOAT , GL_FALSE ,sizeof(short int)},
{WINED3DDECLTYPE_FLOAT16_4, 4, GL_FLOAT , GL_FALSE ,sizeof(short int)}};
/* We should do an extension check for NV_HALF_FLOAT. However, without NV_HALF_FLOAT
* we won't be able to load the data at all, so at least for the moment it wouldn't
* gain us much. */
{WINED3DDECLTYPE_FLOAT16_2, 2, GL_HALF_FLOAT_NV , GL_FALSE ,sizeof(GLhalfNV)},
{WINED3DDECLTYPE_FLOAT16_4, 4, GL_HALF_FLOAT_NV , GL_FALSE ,sizeof(GLhalfNV)}};
#define WINED3D_ATR_TYPE(type) glTypeLookup[type].d3dType
#define WINED3D_ATR_SIZE(type) glTypeLookup[type].size