rsx/common/d3d12: Separate int type buffer from float type buffer.

This commit is contained in:
Vincent Lejeune 2016-02-24 18:45:43 +01:00
parent a6ba47265f
commit 35db227af4
3 changed files with 26 additions and 4 deletions

View File

@ -44,7 +44,7 @@ namespace
{
if (static_cast<size_t>(real_input.location) != std::get<0>(attribute))
continue;
OS << "Buffer<float4> " << std::get<1>(attribute) << "_buffer : register(t" << reg++ << ");\n";
OS << "Buffer<" << (real_input.int_type ? "int4" : "float4") << "> " << std::get<1>(attribute) << "_buffer : register(t" << reg++ << ");\n";
return true;
}
return false;

View File

@ -568,6 +568,25 @@ namespace rsx
}
}
namespace
{
bool is_int_type(rsx::vertex_base_type type)
{
switch (type)
{
case rsx::vertex_base_type::s32k:
case rsx::vertex_base_type::ub256:
return true;
case rsx::vertex_base_type::f:
case rsx::vertex_base_type::cmp:
case rsx::vertex_base_type::sf:
case rsx::vertex_base_type::s1:
case rsx::vertex_base_type::ub:
return false;
}
}
}
std::array<u32, 4> thread::get_color_surface_addresses() const
{
u32 offset_color[] =
@ -636,7 +655,8 @@ namespace rsx
vertex_arrays_info[index].size,
vertex_arrays_info[index].frequency,
!!((modulo_mask >> index) & 0x1),
true
true,
is_int_type(vertex_arrays_info[index].type)
}
);
}
@ -648,7 +668,8 @@ namespace rsx
register_vertex_info[index].size,
register_vertex_info[index].frequency,
!!((modulo_mask >> index) & 0x1),
false
false,
is_int_type(vertex_arrays_info[index].type)
}
);
}

View File

@ -197,10 +197,11 @@ struct rsx_vertex_input
u16 frequency;
bool is_modulo; // either modulo frequency or divide frequency
bool is_array; // false if "reg value"
bool int_type;
bool operator==(const rsx_vertex_input other) const
{
return location == other.location && size == other.size && frequency == other.frequency && is_modulo == other.is_modulo && is_array == other.is_array;
return location == other.location && size == other.size && frequency == other.frequency && is_modulo == other.is_modulo && is_array == other.is_array && int_type == other.int_type;
}
};