Skip to content

Commit

Permalink
Auto merge of #3206 - kvark:gpu-split, r=gw3583
Browse files Browse the repository at this point in the history
Remove the local rect from plane splitting GPU data

This is a simple refinement in the context of bigger changes coming.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3206)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Oct 17, 2018
2 parents f1bfb3a + 7dd4494 commit 1d4f27e
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 @@ -560,7 +560,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 1d4f27e

Please sign in to comment.