Skip to content

Commit

Permalink
Remove the local rect from plane splitting GPU data
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Oct 16, 2018
1 parent 9eda2df commit 7dd4494
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ wrench/ron_frames
*.iws
*.iml

#Gradle
# Gradle
.gradle

# VSCode
.vscode
.vs

# System
.fuse_hidden*
5 changes: 1 addition & 4 deletions webrender/res/ps_split_composite.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ flat varying vec4 vUvSampleBounds;
#ifdef WR_VERTEX_SHADER
struct SplitGeometry {
vec2 local[4];
RectWithSize local_rect;
};

SplitGeometry fetch_split_geometry(int address) {
ivec2 uv = get_gpu_cache_uv(address);

vec4 data0 = TEXEL_FETCH(sGpuCache, uv, 0, ivec2(0, 0));
vec4 data1 = TEXEL_FETCH(sGpuCache, uv, 0, ivec2(1, 0));
vec4 data2 = TEXEL_FETCH(sGpuCache, uv, 0, ivec2(2, 0));

SplitGeometry geo;
geo.local = vec2[4](
Expand All @@ -27,7 +25,6 @@ SplitGeometry fetch_split_geometry(int address) {
data1.xy,
data1.zw
);
geo.local_rect = RectWithSize(data2.xy, data2.zw);

return geo;
}
Expand Down Expand Up @@ -98,7 +95,7 @@ void main(void) {
max_uv - vec2(0.5)
) / texture_size.xyxy;

vec2 f = (local_pos - geometry.local_rect.p0) / geometry.local_rect.size;
vec2 f = (local_pos - ph.local_rect.p0) / ph.local_rect.size;

f = bilerp(
extra_data.st_tl, extra_data.st_tr,
Expand Down
1 change: 0 additions & 1 deletion webrender/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ impl AlphaBatchBuilder {
let gpu_blocks = [
[local_points[0].x, local_points[0].y, local_points[1].x, local_points[1].y].into(),
[local_points[2].x, local_points[2].y, local_points[3].x, local_points[3].y].into(),
pic_metadata.local_rect.into(),
];

let gpu_handle = gpu_cache.push_per_frame_blocks(&gpu_blocks);
Expand Down

0 comments on commit 7dd4494

Please sign in to comment.