rsx/common/gl: s32k is actually signed short unormalized.

gl fix
This commit is contained in:
Vincent Lejeune 2016-02-22 22:07:38 +01:00
parent 62246f75c8
commit a6ba47265f
4 changed files with 8 additions and 8 deletions

View File

@ -66,13 +66,13 @@ void write_vertex_array_data_to_buffer(gsl::span<gsl::byte> raw_dst_span, const
}
case rsx::vertex_base_type::s1:
case rsx::vertex_base_type::sf:
case rsx::vertex_base_type::s32k:
{
gsl::span<u16> dst_span = as_span_workaround<u16>(raw_dst_span);
copy_whole_attribute_array<be_t<u16>>(dst_span, src_ptr, vector_element_count, element_size, attribute_src_stride, first, count);
return;
}
case rsx::vertex_base_type::f:
case rsx::vertex_base_type::s32k:
{
gsl::span<u32> dst_span = as_span_workaround<u32>(raw_dst_span);
copy_whole_attribute_array<be_t<u32>>(dst_span, src_ptr, vector_element_count, element_size, attribute_src_stride, first, count);

View File

@ -1124,11 +1124,11 @@ namespace
{
switch (rsx::to_vertex_base_type(type))
{
case rsx::vertex_base_type::s1: return "Short";
case rsx::vertex_base_type::s1: return "Signed short normalized";
case rsx::vertex_base_type::f: return "Float";
case rsx::vertex_base_type::sf: return "Half float";
case rsx::vertex_base_type::ub: return "Unsigned byte normalized";
case rsx::vertex_base_type::s32k: return "Signed int";
case rsx::vertex_base_type::s32k: return "Signed short unormalized";
case rsx::vertex_base_type::cmp: return "CMP";
case rsx::vertex_base_type::ub256: return "Unsigned byte unormalized";
}

View File

@ -37,10 +37,10 @@ namespace
* The buffer texture spec only allows fetches aligned to 8, 16, 32, etc...
* This rules out most 3-component formats, except for the 32-wide RGB32F, RGB32I, RGB32UI
*/
const u32 vec1_types[] = { GL_R16, GL_R32F, GL_R16F, GL_R8, GL_R32I, GL_R16, GL_R8UI };
const u32 vec2_types[] = { GL_RG16, GL_RG32F, GL_RG16F, GL_RG8, GL_RG32I, GL_RG16, GL_RG8UI };
const u32 vec3_types[] = { GL_RGBA16, GL_RGB32F, GL_RGBA16F, GL_RGBA8, GL_RGB32I, GL_RGBA16, GL_RGBA8UI }; //VEC3 COMPONENTS NOT SUPPORTED!
const u32 vec4_types[] = { GL_RGBA16, GL_RGBA32F, GL_RGBA16F, GL_RGBA8, GL_RGBA32I, GL_RGBA16, GL_RGBA8UI };
const u32 vec1_types[] = { GL_R16, GL_R32F, GL_R16F, GL_R8, GL_R16I, GL_R16, GL_R8UI };
const u32 vec2_types[] = { GL_RG16, GL_RG32F, GL_RG16F, GL_RG8, GL_RG16I, GL_RG16, GL_RG8UI };
const u32 vec3_types[] = { GL_RGBA16, GL_RGB32F, GL_RGBA16F, GL_RGBA8, GL_RGBA16I, GL_RGBA16, GL_RGBA8UI }; //VEC3 COMPONENTS NOT SUPPORTED!
const u32 vec4_types[] = { GL_RGBA16, GL_RGBA32F, GL_RGBA16F, GL_RGBA8, GL_RGBA16I, GL_RGBA16, GL_RGBA8UI };
const u32* vec_selectors[] = { 0, vec1_types, vec2_types, vec3_types, vec4_types };

View File

@ -127,6 +127,7 @@ namespace rsx
switch (type)
{
case vertex_base_type::s1:
case vertex_base_type::s32k:
switch (size)
{
case 1:
@ -160,7 +161,6 @@ namespace rsx
return sizeof(u8) * 4;
}
throw EXCEPTION("Wrong vector size");
case vertex_base_type::s32k: return sizeof(u32) * size;
case vertex_base_type::cmp: return sizeof(u16) * 4;
case vertex_base_type::ub256: Expects(size == 4); return sizeof(u8) * 4;
}