Skip to content

Commit

Permalink
rsx: Allow compressed textures to be unaligned in size
Browse files Browse the repository at this point in the history
- Align based on row length but let the texture itself be of arbitrary dimensions
  • Loading branch information
kd-11 committed Oct 25, 2019
1 parent f3ed26e commit cbc3b07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 1 addition & 3 deletions rpcs3/Emu/RSX/Common/texture_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -1756,9 +1756,7 @@ namespace rsx

if (options.is_compressed_format)
{
attributes.width = align(attributes.width, 4);
attributes.height = align(attributes.height, 4);

// Compressed textures cannot be 1D in some APIs
extended_dimension = std::max(extended_dimension, rsx::texture_dimension_extended::texture_dimension_2d);
}

Expand Down
7 changes: 2 additions & 5 deletions rpcs3/Emu/RSX/GL/GLTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,9 @@ namespace gl

if (LIKELY(is_compressed_format(format)))
{
//Compressed formats have a 4-byte alignment
//TODO: Verify that samplers are not affected by the padding
width = align(width, 4);
height = align(height, 4);

caps.supports_vtc_decoding = gl::get_driver_caps().vendor_NVIDIA;

unpack_settings.row_length(align(width, 4));
unpack_settings.apply();

for (const rsx_subresource_layout& layout : input_layouts)
Expand Down

0 comments on commit cbc3b07

Please sign in to comment.