Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
panloader
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Panfrost
panloader
Commits
174fab41
Commit
174fab41
authored
May 11, 2018
by
Alyssa Rosenzweig
💜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix swizzling artifacts on non-aligned images
parent
8acfddaa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
4 deletions
+20
-4
trans/limare-swizzle.c
trans/limare-swizzle.c
+11
-1
trans/texture-swizzle.h
trans/texture-swizzle.h
+3
-0
trans/trans-builder.c
trans/trans-builder.c
+5
-2
trans/trans-test.c
trans/trans-test.c
+1
-1
No files found.
trans/limare-swizzle.c
View file @
174fab41
...
...
@@ -87,7 +87,6 @@ trans_texture_swizzle(int width, int height, int bytes_per_pixel, int source_str
{
/* Calculate maximum size, overestimating a bit */
int
block_pitch
=
ALIGN
(
width
,
16
)
>>
4
;
uint32_t
sz
=
bytes_per_pixel
*
256
*
((
height
>>
4
)
+
1
)
*
block_pitch
;
/* Use fast path if available */
if
(
bytes_per_pixel
==
4
/* && (ALIGN(width, 16) == width) */
)
{
...
...
@@ -117,6 +116,17 @@ trans_texture_swizzle(int width, int height, int bytes_per_pixel, int source_str
}
}
unsigned
trans_swizzled_size
(
int
width
,
int
height
,
int
bytes_per_pixel
)
{
/* Calculate maximum size, overestimating a bit */
int
block_pitch
=
ALIGN
(
width
,
16
)
>>
4
;
unsigned
sz
=
bytes_per_pixel
*
256
*
((
height
>>
4
)
+
1
)
*
block_pitch
;
return
sz
;
}
#if 0
#include <stdio.h>
#include <stdlib.h>
...
...
trans/texture-swizzle.h
View file @
174fab41
...
...
@@ -25,4 +25,7 @@ trans_texture_swizzle(int width, int height, int bytes_per_pixel, int source_str
const
uint8_t
*
pixels
,
uint8_t
*
ldest
);
unsigned
trans_swizzled_size
(
int
width
,
int
height
,
int
bytes_per_pixel
);
#endif
trans/trans-builder.c
View file @
174fab41
...
...
@@ -872,10 +872,13 @@ trans_emit_for_draw(struct panfrost_context *ctx)
int
bpp
=
4
;
/* XXX: Not just RGBA32 */
int
stride
=
rsrc
->
base
.
width0
*
bpp
;
/* TODO: Alignment? */
uint8_t
*
swizzled
=
malloc
(
rsrc
->
len
);
int
swizzled_sz
=
trans_swizzled_size
(
rsrc
->
base
.
width0
,
rsrc
->
base
.
height0
,
bpp
);
uint8_t
*
swizzled
=
malloc
(
swizzled_sz
);
trans_texture_swizzle
(
rsrc
->
base
.
width0
,
rsrc
->
base
.
height0
,
bpp
,
stride
,
(
uint8_t
*
)
rsrc
->
cpu
,
swizzled
);
mali_ptr
bitmap
=
panfrost_upload
(
&
ctx
->
cmdstream
,
swizzled
,
rsrc
->
len
,
false
);
mali_ptr
bitmap
=
panfrost_upload
(
&
ctx
->
cmdstream
,
swizzled
,
swizzled_sz
,
false
);
/* Inject the address in. XXX: Should be its own dirty flag or something... */
ctx
->
sampler_views
[
t
][
i
]
->
hw
.
swizzled_bitmap_0
=
bitmap
;
...
...
trans/trans-test.c
View file @
174fab41
...
...
@@ -155,7 +155,7 @@ int main(int argc, const char **argv)
0
,
2
,
texs
);
for
(
int
i
=
0
;
i
<
60
;
++
i
)
{
for
(
int
i
=
0
;
i
<
60
0
;
++
i
)
{
const
struct
pipe_rasterizer_state
stat
=
{
.
line_width
=
10
.
0
f
,
.
front_ccw
=
false
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment