diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /gfx/wr/webrender/res/gpu_buffer.glsl | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/wr/webrender/res/gpu_buffer.glsl')
-rw-r--r-- | gfx/wr/webrender/res/gpu_buffer.glsl | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/gfx/wr/webrender/res/gpu_buffer.glsl b/gfx/wr/webrender/res/gpu_buffer.glsl index 25f4622db2..4923a28ef9 100644 --- a/gfx/wr/webrender/res/gpu_buffer.glsl +++ b/gfx/wr/webrender/res/gpu_buffer.glsl @@ -2,41 +2,47 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -uniform HIGHP_SAMPLER_FLOAT sampler2D sGpuBuffer; +uniform HIGHP_SAMPLER_FLOAT sampler2D sGpuBufferF; +uniform HIGHP_SAMPLER_FLOAT isampler2D sGpuBufferI; ivec2 get_gpu_buffer_uv(HIGHP_FS_ADDRESS int address) { return ivec2(uint(address) % WR_MAX_VERTEX_TEXTURE_WIDTH, uint(address) / WR_MAX_VERTEX_TEXTURE_WIDTH); } -vec4 fetch_from_gpu_buffer_1(HIGHP_FS_ADDRESS int address) { +vec4 fetch_from_gpu_buffer_1f(HIGHP_FS_ADDRESS int address) { ivec2 uv = get_gpu_buffer_uv(address); - return texelFetch(sGpuBuffer, uv, 0); + return texelFetch(sGpuBufferF, uv, 0); } -vec4[2] fetch_from_gpu_buffer_2(HIGHP_FS_ADDRESS int address) { +vec4[2] fetch_from_gpu_buffer_2f(HIGHP_FS_ADDRESS int address) { ivec2 uv = get_gpu_buffer_uv(address); return vec4[2]( - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(0, 0)), - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(1, 0)) + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(0, 0)), + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(1, 0)) ); } -vec4[3] fetch_from_gpu_buffer_3(HIGHP_FS_ADDRESS int address) { +vec4[3] fetch_from_gpu_buffer_3f(HIGHP_FS_ADDRESS int address) { ivec2 uv = get_gpu_buffer_uv(address); return vec4[3]( - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(0, 0)), - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(1, 0)), - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(2, 0)) + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(0, 0)), + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(1, 0)), + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(2, 0)) ); } -vec4[4] fetch_from_gpu_buffer_4(HIGHP_FS_ADDRESS int address) { +vec4[4] fetch_from_gpu_buffer_4f(HIGHP_FS_ADDRESS int address) { ivec2 uv = get_gpu_buffer_uv(address); return vec4[4]( - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(0, 0)), - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(1, 0)), - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(2, 0)), - TEXEL_FETCH(sGpuBuffer, uv, 0, ivec2(3, 0)) + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(0, 0)), + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(1, 0)), + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(2, 0)), + TEXEL_FETCH(sGpuBufferF, uv, 0, ivec2(3, 0)) ); } + +ivec4 fetch_from_gpu_buffer_1i(HIGHP_FS_ADDRESS int address) { + ivec2 uv = get_gpu_buffer_uv(address); + return texelFetch(sGpuBufferI, uv, 0); +} |