Skip to content

Commit

Permalink
tiler: avoid usage of 8 bit types in 1d tiler
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Oct 2, 2024
1 parent 60cecf4 commit 995c982
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions rpcsx-gpu/lib/amdgpu-tiler/shaders/detiler1d.comp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ void main() {

uint32_t bpp = (config.bitsPerElement + 7) / 8;

if (bpp == 1 && (linearByteOffset & 1) != 0) {
return;
}

if (config.srcAddress + tiledByteOffset + bpp > config.srcEndAddress) {
debugPrintfEXT("detiler1d: out of src buffer %d x %d x %d", pos.x, pos.y, pos.z);
return;
Expand All @@ -59,9 +63,6 @@ void main() {

switch (bpp) {
case 1:
buffer_reference_uint8_t(config.dstAddress + linearByteOffset).data = buffer_reference_uint8_t(config.srcAddress + tiledByteOffset).data;
break;

case 2:
buffer_reference_uint16_t(config.dstAddress + linearByteOffset).data = buffer_reference_uint16_t(config.srcAddress + tiledByteOffset).data;
break;
Expand Down
8 changes: 5 additions & 3 deletions rpcsx-gpu/lib/amdgpu-tiler/shaders/tiler1d.comp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ void main() {

uint32_t bpp = (config.bitsPerElement + 7) / 8;

if (bpp == 1 && (linearByteOffset & 1) != 0) {
return;
}


#ifdef DEBUG
if (config.srcAddress + linearByteOffset + bpp > config.srcEndAddress) {
debugPrintfEXT("tiler1d: out of src buffer %d x %d x %d", pos.x, pos.y, pos.z);
Expand All @@ -64,9 +69,6 @@ void main() {

switch (bpp) {
case 1:
buffer_reference_uint8_t(config.dstAddress + tiledByteOffset).data = buffer_reference_uint8_t(config.srcAddress + linearByteOffset).data;
break;

case 2:
buffer_reference_uint16_t(config.dstAddress + tiledByteOffset).data = buffer_reference_uint16_t(config.srcAddress + linearByteOffset).data;
break;
Expand Down

0 comments on commit 995c982

Please sign in to comment.