mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 21:13:02 +01:00
Fixed DX9 lack of non-normalized UINT16 vertex decl type.
This commit is contained in:
@@ -207,7 +207,7 @@ namespace bgfx
|
||||
}
|
||||
break;
|
||||
|
||||
case AttribType::Uint16:
|
||||
case AttribType::Int16:
|
||||
{
|
||||
uint16_t* packed = (uint16_t*)data;
|
||||
if (_inputNormalized)
|
||||
@@ -216,20 +216,20 @@ namespace bgfx
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = uint16_t(*_input++ * 32767.0f + 32768.0f);
|
||||
case 3: *packed++ = uint16_t(*_input++ * 32767.0f + 32768.0f);
|
||||
case 2: *packed++ = uint16_t(*_input++ * 32767.0f + 32768.0f);
|
||||
case 1: *packed++ = uint16_t(*_input++ * 32767.0f + 32768.0f);
|
||||
default: *packed++ = uint16_t(*_input++ * 32767.0f);
|
||||
case 3: *packed++ = uint16_t(*_input++ * 32767.0f);
|
||||
case 2: *packed++ = uint16_t(*_input++ * 32767.0f);
|
||||
case 1: *packed++ = uint16_t(*_input++ * 32767.0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = uint16_t(*_input++ * 65535.0f);
|
||||
case 3: *packed++ = uint16_t(*_input++ * 65535.0f);
|
||||
case 2: *packed++ = uint16_t(*_input++ * 65535.0f);
|
||||
case 1: *packed++ = uint16_t(*_input++ * 65535.0f);
|
||||
default: *packed++ = uint16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
case 3: *packed++ = uint16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
case 2: *packed++ = uint16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
case 1: *packed++ = uint16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,27 +311,27 @@ namespace bgfx
|
||||
}
|
||||
break;
|
||||
|
||||
case AttribType::Uint16:
|
||||
case AttribType::Int16:
|
||||
{
|
||||
uint16_t* packed = (uint16_t*)data;
|
||||
if (asInt)
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *_output++ = (float(*packed++) - 32768.0f)*1.0f/32767.0f;
|
||||
case 3: *_output++ = (float(*packed++) - 32768.0f)*1.0f/32767.0f;
|
||||
case 2: *_output++ = (float(*packed++) - 32768.0f)*1.0f/32767.0f;
|
||||
case 1: *_output++ = (float(*packed++) - 32768.0f)*1.0f/32767.0f;
|
||||
default: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
case 3: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
case 2: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
case 1: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *_output++ = float(*packed++)*1.0f/65535.0f;
|
||||
case 3: *_output++ = float(*packed++)*1.0f/65535.0f;
|
||||
case 2: *_output++ = float(*packed++)*1.0f/65535.0f;
|
||||
case 1: *_output++ = float(*packed++)*1.0f/65535.0f;
|
||||
default: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
case 3: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
case 2: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
case 1: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user