mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 08:21:29 +12:00
rsx/common/d3d12: Support for texture 1d too.
They are used in after burner climax
This commit is contained in:
parent
e1eb075604
commit
5f35f2ac7d
13 changed files with 151 additions and 89 deletions
|
@ -656,6 +656,42 @@ namespace rsx
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
RSXFragmentProgram thread::get_current_fragment_program() const
|
||||
{
|
||||
RSXFragmentProgram result = {};
|
||||
u32 shader_program = rsx::method_registers[NV4097_SET_SHADER_PROGRAM];
|
||||
result.offset = shader_program & ~0x3;
|
||||
result.addr = vm::base(rsx::get_address(result.offset, (shader_program & 0x3) - 1));
|
||||
result.ctrl = rsx::method_registers[NV4097_SET_SHADER_CONTROL];
|
||||
result.unnormalized_coords = 0;
|
||||
|
||||
std::array<texture_dimension, 16> texture_dimensions;
|
||||
for (u32 i = 0; i < rsx::limits::textures_count; ++i)
|
||||
{
|
||||
if (!textures[i].enabled())
|
||||
texture_dimensions[i] = texture_dimension::texture_dimension_2d;
|
||||
else if (textures[i].dimension() == 1)
|
||||
texture_dimensions[i] = texture_dimension::texture_dimension_1d;
|
||||
else if (textures[i].dimension() == 2)
|
||||
{
|
||||
if (textures[i].cubemap())
|
||||
texture_dimensions[i] = texture_dimension::texture_dimension_cubemap;
|
||||
else
|
||||
texture_dimensions[i] = texture_dimension::texture_dimension_2d;
|
||||
}
|
||||
else if (textures[i].dimension() == 3)
|
||||
texture_dimensions[i] = texture_dimension::texture_dimension_3d;
|
||||
else
|
||||
throw EXCEPTION("Unable to determine texture dimension");
|
||||
if (textures[i].enabled() && (textures[i].format() & CELL_GCM_TEXTURE_UN))
|
||||
result.unnormalized_coords |= (1 << i);
|
||||
}
|
||||
result.set_texture_dimension(texture_dimensions);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void thread::reset()
|
||||
{
|
||||
//setup method registers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue