SlideShare a Scribd company logo
1 of 26
EXT_window_rectangles
Mark Kilgard
NVIDIA
June 9, 2016
What is EXT_window_rectangles?
• Provides new per-fragment pipeline stage:
window rectangles tests
– Provide an array of window-space rectangles
• Maintained as GL context state
– Rasterized fragments must be inclusive or exclusive
to the set of active window rectangles
– Limited to framebuffer objects (FBOs), not windows
– Fast because discards prior to shading & pixel
operations
• Specified as multi-vendor OpenGL extension
Standard OpenGL Per-fragment
Operations
NEW Window Rectangles Test in
Per-fragment Operations
Window
Rectangles
Test
NEW
stage
Rationale for
EXT_window_rectangles
• Often rendering is obscured by opaque regions
in window space
– Wasteful to render to obscured regions
– Discarding such rendering = easy performance
• Common applications
– Web page background often
obscured by overlapping
• Complication: modern web pages
use lots of rounded rectangle sections
– Windowed rendering in UI
– Virtual reality limited views
Rationale for FBO-only Behavior
• Window rectangles test hardware is used to aide
conventional window clip enforcement for
windows
– Called “pixel ownership test” in OpenGL specification
– Details of pixel ownership depend on underlying
window system’s clipping
• But FBO rendering is unclipped by window
system
– So window rectangles test functionality can be re-
tasked for FBO rendering under application control
• Reasonable because modern OpenGL rendering
is FBO-focused
All Rendering Subject to Window
Rectangles Test
• Affects
– point/line/polygon rasterizaton
– framebuffer clears (glClear, etc.)
– framebuffer blits (glBlitFramebuffer, etc.)
– image rectangles (glDrawPixels, glCopyPixels,
glDrawTextureNV)
– bitmaps (glBitmap)
• Means regions excluded or not inclusive simply
have no effort spent on shading or pixel
operations
– Excellent at avoiding wasted rasterization, shading,
and pixel update bandwidth & effort
Straightforward API
• glWindowRectanglesEXT(GLenum mode, GLsizei count,
const GLint rects[]);
– mode can be either GL_INCLUSIVE_EXT or
GL_EXCLUSIVE_EXT
– count can be from 0 to maximum number of supported window
rectangles
• Must be at least 8
– Rectangles allowed to overlap and/or disjoint
• Each rectangle is (x,y,width,height)
• width & height must be non-negative
• Initial state
– GL_EXCLUSIVE_NV with zero rectangles
– Excluding rendering from zero rectangles means nothing is
discarded by window rectangles test
API Queries
• State can be queried
– GL_WINDOW_RECTANGLE_MODE_EXT
• Use glGetIntegerv to query mode
– Either inclusive or exclusive
– GL_WINDOW_RECTANGLE_EXT
• Use indexed glGetIntegeri_v to query (x,y,width,height) of a
window rectangle by index
– GL_NUM_WINDOW_RECTANGLES_EXT
• Use glGetIntegerv to get number of active window rectangles
• Implementation-dependent limit query
– GL_MAX_WINDOW_RECTANGLES_EXT
• Number of window rectangles supported, at least 8
Window Rectangles Test
Pseudo-Code
• Given a fragment at window-space position (x,y)
• And winrect state structure with EXT_window_rectangles state
• Determine if this fragment should be discarded or not
const bool inclusive = (winrects.mode == GL_INCLUSIVE_EXT);
bool in_some_rect = false;
// For each window rectangle...
for (int r = 0; r < winrects.count; r++) {
const WinRect &rect = winrects.rect[r];
const int box_x0 = rect.x;
const int box_y0 = rect.y;
const int box_x1 = int(rect.x + rect.width);
const int box_y1 = int(rect.y + rect.height);
// Is this fragment [i,j] within this rectangle r?
if ((x >= box_x0) && (y >= box_y0) && (x < box_x1) && (y < box_y1)) {
in_some_rect = true;
}
}
if (inclusive ^ in_some_rect) {
// INCLUSIVE: Fragment not in any inclusive rectangle; discard.
// EXCLUSIVE: Fragment in one or more exclusive rectangles; discard.
discard;
} else {
// INCLUSIVE: Fragment included in at least one rectangle; accept.
// EXCLUSIVE: Fragment not within any exclusive rectangles; accept.
}
Rasterization Performance Benefits
• Being able to throwing away useless work quickly is
always a boon to performance
• Software rasterization details
– Scan-line rasterizers can quick “skip over” window rectangles
along scan-lines
– Happens before expensive shading & pixel operations
– MMX friendly
• Hardware rasterization details
– Today, GPUs can enforce rectangular windows
• Details vary but rectangular region discard commonly supported
• Example: OpenVG exposes at least 32 window rectangles
– Very fast discard since done in rasterizer and requires no reads
to video memory (e.g. stencil buffer reads)
– EXT_window_rectangles allows this same hardware to be re-
tasked for application use
Skia Support
• Skia has patches to support this
functionality
– Implemented by Chris Dalton
• For acceleration of Google’s Chrome
browser
– <div> sections in web pages provide
exploitable knowledge of opaque layered
occlusion
– Rounded rectangles can be approximated by
two overlapped rectangles
Skia Performance Gains
• Not drawing to obscured web page regions helps a lot
• Skia’s Nanobench running captured web page scenes at
1800x2560
4 sample 8 sample 16 sample
scene improvement improvement improvement
keymobi_wordpress.skp_1 143.3% 301.8% 606.6%
keymobi_blogger.skp_1 137.2% 341.2% 566.7%
keymobi_digg_com.skp_1 125.3% 308.0% 621.9%
keymobi_shop_mobileweb_ebay_com.skp_1 119.7% 289.3% 593.2%
keymobi_pinterest.skp_1 105.6% 272.0% 571.9%
desk_wikipedia.skp_1 103.6% 224.7% 490.1%
desk_jsfiddlebigcar.skp_1 102.3% 190.0% 231.7%
top25desk_wordpress.skp_1 102.2% 271.0% 564.8%
keymobi_linkedin.skp_1 97.2% 264.3% 525.6%
desk_pokemonwiki.skp_1 89.6% 254.3% 457.3%
keymobi_boingboing_net.skp_1 89.4% 182.1% 416.7%
keymobi_androidpolice_com_2012_.skp_1 77.0% 177.1% 189.0%
keymobi_bing_com_search_q_sloth.skp_1 63.9% 168.8% 354.3%
keymobi_amazon_com_gp_aw_s_ref_.skp_1 60.5% 135.6% 286.4%
keymobi_cnn_com.skp_1 59.8% 133.2% 299.4%
keymobi_ftw_usatoday_com_2014_0.skp_1 53.9% 68.3% 75.5%
top25desk_google_com_search_q_c.skp_1 49.3% 170.3% 401.5%
keymobi_gsp_ro.skp_1 46.0% 180.2% 376.8%
keymobi_online_wsj_com_home_pag.skp_1 39.9% 107.6% 309.9%
Example Scene
• Scenario: draw the green background to be overlapped
by 5 irregular regions
Waste of rendering
to rasterize green
into regions to be
subsequently
overdrawn
Window Rectangles to the Rescue
• Naively, just want to draw a big rectangles
• Use all 8 window rectangles to restrict rendering
– Using exclusive mode, GL_EXCLUSIVE_NV
Window Rectangles to the Rescue
• Checkerboard regions show discarded rendering that
gets excluded by GL_EXCLUSIVE_NV window
rectangles test
Visualization
• Rounded rectangles & non-pixel aligned rectangles still
need additional discarding
Shader discarded
regions shown in
gray checkerboard
Window rectangles
test regions shown
in orange/yellow
hash
Usage of Window Rectangles Test
• Shows rectangle drawn in 8 inclusive and 8 exclusive
situations
– Notice how window rectangles allowed to overlap
Real-world Web Pages that Benefit
89% improvement @ 4x 46% improvement @ 4x 59% improvement @ 4x
Consider a Standard Rectangular
Viewport
• Normal rendering
Restricted to a Non-rectangular
View
• Limit rasterization to approximately circular
region cheaply with window rectangles test
Restricted to a Non-rectangular
View
• Visualizing the 8 inclusive rectangles
Alternatively Exclusive
• Visualizing the 8 inclusive rectangles
– Overlap of two sets of window rectangles means exclusive &
inclusive scenes have overlap of pixels
Alternatively Exclusive
• Possible to render unfocused area with less
detail using exclusive window rectangles test
Specification, Driver, & Library
Status
• Specification public
– https://www.opengl.org/registry/specs/EXT/window_rectangles.txt
– Identical API for OpenGL 4.5, ES 2.0, and ES 3.2
• Patches in progress for Google’s Skia library
– 2D graphics library used by Chrome browser
• NVIDIA OpenGL drivers
– Fermi, Kepler, Maxwell, and Pascal
– So GeForce 4xx and up
– In drivers mid-2016
• Mesa3D
– Considered by Brian Paul
Thanks
• Brian Paul, VMware
• Brian Salomon, Google
• Chris Dalton, Google
• Jeff Bolz, NVIDIA
• Mark Callow, Khronos
• Walt Steiner, NVIDIA

More Related Content

What's hot

FlameWorks GTC 2014
FlameWorks GTC 2014FlameWorks GTC 2014
FlameWorks GTC 2014Simon Green
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMark Kilgard
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityMark Kilgard
 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineNarann29
 
Sig13 ce future_gfx
Sig13 ce future_gfxSig13 ce future_gfx
Sig13 ce future_gfxCass Everitt
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing StuffMark Kilgard
 
OpenGL NVIDIA Command-List: Approaching Zero Driver Overhead
OpenGL NVIDIA Command-List: Approaching Zero Driver OverheadOpenGL NVIDIA Command-List: Approaching Zero Driver Overhead
OpenGL NVIDIA Command-List: Approaching Zero Driver OverheadTristan Lorach
 
Virtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsVirtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsMark Kilgard
 
OpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesOpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesNarann29
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and MoreMark Kilgard
 
Oit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked ListsOit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked ListsHolger Gruen
 
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Mark Kilgard
 
SIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLSIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLMark Kilgard
 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14AMD Developer Central
 
GTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path RenderingGTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path Rendering Mark Kilgard
 
SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012Mark Kilgard
 
CS 354 Introduction
CS 354 IntroductionCS 354 Introduction
CS 354 IntroductionMark Kilgard
 
vkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APIvkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APITristan Lorach
 

What's hot (20)

FlameWorks GTC 2014
FlameWorks GTC 2014FlameWorks GTC 2014
FlameWorks GTC 2014
 
Migrating from OpenGL to Vulkan
Migrating from OpenGL to VulkanMigrating from OpenGL to Vulkan
Migrating from OpenGL to Vulkan
 
NVIDIA's OpenGL Functionality
NVIDIA's OpenGL FunctionalityNVIDIA's OpenGL Functionality
NVIDIA's OpenGL Functionality
 
OpenGL 4 for 2010
OpenGL 4 for 2010OpenGL 4 for 2010
OpenGL 4 for 2010
 
Advanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering PipelineAdvanced Scenegraph Rendering Pipeline
Advanced Scenegraph Rendering Pipeline
 
Sig13 ce future_gfx
Sig13 ce future_gfxSig13 ce future_gfx
Sig13 ce future_gfx
 
CS 354 Viewing Stuff
CS 354 Viewing StuffCS 354 Viewing Stuff
CS 354 Viewing Stuff
 
OpenGL NVIDIA Command-List: Approaching Zero Driver Overhead
OpenGL NVIDIA Command-List: Approaching Zero Driver OverheadOpenGL NVIDIA Command-List: Approaching Zero Driver Overhead
OpenGL NVIDIA Command-List: Approaching Zero Driver Overhead
 
Virtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUsVirtual Reality Features of NVIDIA GPUs
Virtual Reality Features of NVIDIA GPUs
 
OpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering TechniquesOpenGL 4.4 - Scene Rendering Techniques
OpenGL 4.4 - Scene Rendering Techniques
 
OpenGL 3.2 and More
OpenGL 3.2 and MoreOpenGL 3.2 and More
OpenGL 3.2 and More
 
Oit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked ListsOit And Indirect Illumination Using Dx11 Linked Lists
Oit And Indirect Illumination Using Dx11 Linked Lists
 
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
Slides: Accelerating Vector Graphics Rendering using the Graphics Hardware Pi...
 
SIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGLSIGGRAPH Asia 2008 Modern OpenGL
SIGGRAPH Asia 2008 Modern OpenGL
 
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
Vertex Shader Tricks by Bill Bilodeau - AMD at GDC14
 
GTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path RenderingGTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path Rendering
 
SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012
 
Open gl
Open glOpen gl
Open gl
 
CS 354 Introduction
CS 354 IntroductionCS 354 Introduction
CS 354 Introduction
 
vkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APIvkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan API
 

Similar to EXT_window_rectangles

Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Martin Spier
 
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016Alex Vlachos
 
Aggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream WindowsAggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream WindowsParis Carbone
 
Stop-the-world GCs on milticores
Stop-the-world GCs on milticoresStop-the-world GCs on milticores
Stop-the-world GCs on milticoresAliya Ibragimova
 
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...Intel® Software
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With GatlingKnoldus Inc.
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptxssuser255bf1
 
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...NETWAYS
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtNick Santamaria
 
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Restlet
 
Scylla Summit 2022: Scylla 5.0 New Features, Part 2
Scylla Summit 2022: Scylla 5.0 New Features, Part 2Scylla Summit 2022: Scylla 5.0 New Features, Part 2
Scylla Summit 2022: Scylla 5.0 New Features, Part 2ScyllaDB
 
Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...Aleksandr Tarasov
 
Machine Learning - Convolutional Neural Network
Machine Learning - Convolutional Neural NetworkMachine Learning - Convolutional Neural Network
Machine Learning - Convolutional Neural NetworkRichard Kuo
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applicationsaccount inactive
 
Solving Large Scale Optimization Problems using CPLEX Optimization Studio
Solving Large Scale Optimization Problems using CPLEX Optimization StudioSolving Large Scale Optimization Problems using CPLEX Optimization Studio
Solving Large Scale Optimization Problems using CPLEX Optimization Studiooptimizatiodirectdirect
 
CPLEX Optimization Studio, Modeling, Theory, Best Practices and Case Studies
CPLEX Optimization Studio, Modeling, Theory, Best Practices and Case StudiesCPLEX Optimization Studio, Modeling, Theory, Best Practices and Case Studies
CPLEX Optimization Studio, Modeling, Theory, Best Practices and Case Studiesoptimizatiodirectdirect
 

Similar to EXT_window_rectangles (20)

Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
 
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
Alex_Vlachos_Advanced_VR_Rendering_Performance_GDC2016
 
Aggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream WindowsAggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream Windows
 
Stop-the-world GCs on milticores
Stop-the-world GCs on milticoresStop-the-world GCs on milticores
Stop-the-world GCs on milticores
 
Digi sudoku
Digi sudokuDigi sudoku
Digi sudoku
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
Use Variable Rate Shading (VRS) to Improve the User Experience in Real-Time G...
 
Gatling
Gatling Gatling
Gatling
 
Performance Test Automation With Gatling
Performance Test Automation  With GatlingPerformance Test Automation  With Gatling
Performance Test Automation With Gatling
 
3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx3 CG_U1_P2_PPT_3 OpenGL.pptx
3 CG_U1_P2_PPT_3 OpenGL.pptx
 
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
OSMC 2023 | What’s new with Grafana Labs’s Open Source Observability stack by...
 
DrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an AfterthoughtDrupalSouth 2015 - Performance: Not an Afterthought
DrupalSouth 2015 - Performance: Not an Afterthought
 
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
Cassandra Summit 2015 - Building a multi-tenant API PaaS with DataStax Enterp...
 
Scylla Summit 2022: Scylla 5.0 New Features, Part 2
Scylla Summit 2022: Scylla 5.0 New Features, Part 2Scylla Summit 2022: Scylla 5.0 New Features, Part 2
Scylla Summit 2022: Scylla 5.0 New Features, Part 2
 
Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...
 
Machine Learning - Convolutional Neural Network
Machine Learning - Convolutional Neural NetworkMachine Learning - Convolutional Neural Network
Machine Learning - Convolutional Neural Network
 
Optimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based ApplicationsOptimizing Performance in Qt-Based Applications
Optimizing Performance in Qt-Based Applications
 
Solving Large Scale Optimization Problems using CPLEX Optimization Studio
Solving Large Scale Optimization Problems using CPLEX Optimization StudioSolving Large Scale Optimization Problems using CPLEX Optimization Studio
Solving Large Scale Optimization Problems using CPLEX Optimization Studio
 
CPLEX Optimization Studio, Modeling, Theory, Best Practices and Case Studies
CPLEX Optimization Studio, Modeling, Theory, Best Practices and Case StudiesCPLEX Optimization Studio, Modeling, Theory, Best Practices and Case Studies
CPLEX Optimization Studio, Modeling, Theory, Best Practices and Case Studies
 

More from Mark Kilgard

D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...Mark Kilgard
 
Computers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsComputers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsMark Kilgard
 
NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017Mark Kilgard
 
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017Mark Kilgard
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineMark Kilgard
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingMark Kilgard
 
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondMark Kilgard
 
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...Mark Kilgard
 
GPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardGPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardMark Kilgard
 
GPU-accelerated Path Rendering
GPU-accelerated Path RenderingGPU-accelerated Path Rendering
GPU-accelerated Path RenderingMark Kilgard
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingMark Kilgard
 
GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012Mark Kilgard
 
CS 354 Final Exam Review
CS 354 Final Exam ReviewCS 354 Final Exam Review
CS 354 Final Exam ReviewMark Kilgard
 
CS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR GraphicsCS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR GraphicsMark Kilgard
 
CS 354 Performance Analysis
CS 354 Performance AnalysisCS 354 Performance Analysis
CS 354 Performance AnalysisMark Kilgard
 
CS 354 Acceleration Structures
CS 354 Acceleration StructuresCS 354 Acceleration Structures
CS 354 Acceleration StructuresMark Kilgard
 
CS 354 Global Illumination
CS 354 Global IlluminationCS 354 Global Illumination
CS 354 Global IlluminationMark Kilgard
 
CS 354 Ray Casting & Tracing
CS 354 Ray Casting & TracingCS 354 Ray Casting & Tracing
CS 354 Ray Casting & TracingMark Kilgard
 
CS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path RenderingCS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path RenderingMark Kilgard
 

More from Mark Kilgard (20)

D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...D11: a high-performance, protocol-optional, transport-optional, window system...
D11: a high-performance, protocol-optional, transport-optional, window system...
 
Computers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School StudentsComputers, Graphics, Engineering, Math, and Video Games for High School Students
Computers, Graphics, Engineering, Math, and Video Games for High School Students
 
NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017NVIDIA OpenGL and Vulkan Support for 2017
NVIDIA OpenGL and Vulkan Support for 2017
 
NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017NVIDIA OpenGL 4.6 in 2017
NVIDIA OpenGL 4.6 in 2017
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
 
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
 
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...Programming with NV_path_rendering:  An Annex to the SIGGRAPH Asia 2012 paper...
Programming with NV_path_rendering: An Annex to the SIGGRAPH Asia 2012 paper...
 
GPU accelerated path rendering fastforward
GPU accelerated path rendering fastforwardGPU accelerated path rendering fastforward
GPU accelerated path rendering fastforward
 
GPU-accelerated Path Rendering
GPU-accelerated Path RenderingGPU-accelerated Path Rendering
GPU-accelerated Path Rendering
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
 
GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012
 
CS 354 Final Exam Review
CS 354 Final Exam ReviewCS 354 Final Exam Review
CS 354 Final Exam Review
 
CS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR GraphicsCS 354 Surfaces, Programmable Tessellation, and NPR Graphics
CS 354 Surfaces, Programmable Tessellation, and NPR Graphics
 
CS 354 Performance Analysis
CS 354 Performance AnalysisCS 354 Performance Analysis
CS 354 Performance Analysis
 
CS 354 Acceleration Structures
CS 354 Acceleration StructuresCS 354 Acceleration Structures
CS 354 Acceleration Structures
 
CS 354 Global Illumination
CS 354 Global IlluminationCS 354 Global Illumination
CS 354 Global Illumination
 
CS 354 Ray Casting & Tracing
CS 354 Ray Casting & TracingCS 354 Ray Casting & Tracing
CS 354 Ray Casting & Tracing
 
CS 354 Typography
CS 354 TypographyCS 354 Typography
CS 354 Typography
 
CS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path RenderingCS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path Rendering
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 

EXT_window_rectangles

  • 2. What is EXT_window_rectangles? • Provides new per-fragment pipeline stage: window rectangles tests – Provide an array of window-space rectangles • Maintained as GL context state – Rasterized fragments must be inclusive or exclusive to the set of active window rectangles – Limited to framebuffer objects (FBOs), not windows – Fast because discards prior to shading & pixel operations • Specified as multi-vendor OpenGL extension
  • 4. NEW Window Rectangles Test in Per-fragment Operations Window Rectangles Test NEW stage
  • 5. Rationale for EXT_window_rectangles • Often rendering is obscured by opaque regions in window space – Wasteful to render to obscured regions – Discarding such rendering = easy performance • Common applications – Web page background often obscured by overlapping • Complication: modern web pages use lots of rounded rectangle sections – Windowed rendering in UI – Virtual reality limited views
  • 6. Rationale for FBO-only Behavior • Window rectangles test hardware is used to aide conventional window clip enforcement for windows – Called “pixel ownership test” in OpenGL specification – Details of pixel ownership depend on underlying window system’s clipping • But FBO rendering is unclipped by window system – So window rectangles test functionality can be re- tasked for FBO rendering under application control • Reasonable because modern OpenGL rendering is FBO-focused
  • 7. All Rendering Subject to Window Rectangles Test • Affects – point/line/polygon rasterizaton – framebuffer clears (glClear, etc.) – framebuffer blits (glBlitFramebuffer, etc.) – image rectangles (glDrawPixels, glCopyPixels, glDrawTextureNV) – bitmaps (glBitmap) • Means regions excluded or not inclusive simply have no effort spent on shading or pixel operations – Excellent at avoiding wasted rasterization, shading, and pixel update bandwidth & effort
  • 8. Straightforward API • glWindowRectanglesEXT(GLenum mode, GLsizei count, const GLint rects[]); – mode can be either GL_INCLUSIVE_EXT or GL_EXCLUSIVE_EXT – count can be from 0 to maximum number of supported window rectangles • Must be at least 8 – Rectangles allowed to overlap and/or disjoint • Each rectangle is (x,y,width,height) • width & height must be non-negative • Initial state – GL_EXCLUSIVE_NV with zero rectangles – Excluding rendering from zero rectangles means nothing is discarded by window rectangles test
  • 9. API Queries • State can be queried – GL_WINDOW_RECTANGLE_MODE_EXT • Use glGetIntegerv to query mode – Either inclusive or exclusive – GL_WINDOW_RECTANGLE_EXT • Use indexed glGetIntegeri_v to query (x,y,width,height) of a window rectangle by index – GL_NUM_WINDOW_RECTANGLES_EXT • Use glGetIntegerv to get number of active window rectangles • Implementation-dependent limit query – GL_MAX_WINDOW_RECTANGLES_EXT • Number of window rectangles supported, at least 8
  • 10. Window Rectangles Test Pseudo-Code • Given a fragment at window-space position (x,y) • And winrect state structure with EXT_window_rectangles state • Determine if this fragment should be discarded or not const bool inclusive = (winrects.mode == GL_INCLUSIVE_EXT); bool in_some_rect = false; // For each window rectangle... for (int r = 0; r < winrects.count; r++) { const WinRect &rect = winrects.rect[r]; const int box_x0 = rect.x; const int box_y0 = rect.y; const int box_x1 = int(rect.x + rect.width); const int box_y1 = int(rect.y + rect.height); // Is this fragment [i,j] within this rectangle r? if ((x >= box_x0) && (y >= box_y0) && (x < box_x1) && (y < box_y1)) { in_some_rect = true; } } if (inclusive ^ in_some_rect) { // INCLUSIVE: Fragment not in any inclusive rectangle; discard. // EXCLUSIVE: Fragment in one or more exclusive rectangles; discard. discard; } else { // INCLUSIVE: Fragment included in at least one rectangle; accept. // EXCLUSIVE: Fragment not within any exclusive rectangles; accept. }
  • 11. Rasterization Performance Benefits • Being able to throwing away useless work quickly is always a boon to performance • Software rasterization details – Scan-line rasterizers can quick “skip over” window rectangles along scan-lines – Happens before expensive shading & pixel operations – MMX friendly • Hardware rasterization details – Today, GPUs can enforce rectangular windows • Details vary but rectangular region discard commonly supported • Example: OpenVG exposes at least 32 window rectangles – Very fast discard since done in rasterizer and requires no reads to video memory (e.g. stencil buffer reads) – EXT_window_rectangles allows this same hardware to be re- tasked for application use
  • 12. Skia Support • Skia has patches to support this functionality – Implemented by Chris Dalton • For acceleration of Google’s Chrome browser – <div> sections in web pages provide exploitable knowledge of opaque layered occlusion – Rounded rectangles can be approximated by two overlapped rectangles
  • 13. Skia Performance Gains • Not drawing to obscured web page regions helps a lot • Skia’s Nanobench running captured web page scenes at 1800x2560 4 sample 8 sample 16 sample scene improvement improvement improvement keymobi_wordpress.skp_1 143.3% 301.8% 606.6% keymobi_blogger.skp_1 137.2% 341.2% 566.7% keymobi_digg_com.skp_1 125.3% 308.0% 621.9% keymobi_shop_mobileweb_ebay_com.skp_1 119.7% 289.3% 593.2% keymobi_pinterest.skp_1 105.6% 272.0% 571.9% desk_wikipedia.skp_1 103.6% 224.7% 490.1% desk_jsfiddlebigcar.skp_1 102.3% 190.0% 231.7% top25desk_wordpress.skp_1 102.2% 271.0% 564.8% keymobi_linkedin.skp_1 97.2% 264.3% 525.6% desk_pokemonwiki.skp_1 89.6% 254.3% 457.3% keymobi_boingboing_net.skp_1 89.4% 182.1% 416.7% keymobi_androidpolice_com_2012_.skp_1 77.0% 177.1% 189.0% keymobi_bing_com_search_q_sloth.skp_1 63.9% 168.8% 354.3% keymobi_amazon_com_gp_aw_s_ref_.skp_1 60.5% 135.6% 286.4% keymobi_cnn_com.skp_1 59.8% 133.2% 299.4% keymobi_ftw_usatoday_com_2014_0.skp_1 53.9% 68.3% 75.5% top25desk_google_com_search_q_c.skp_1 49.3% 170.3% 401.5% keymobi_gsp_ro.skp_1 46.0% 180.2% 376.8% keymobi_online_wsj_com_home_pag.skp_1 39.9% 107.6% 309.9%
  • 14. Example Scene • Scenario: draw the green background to be overlapped by 5 irregular regions Waste of rendering to rasterize green into regions to be subsequently overdrawn
  • 15. Window Rectangles to the Rescue • Naively, just want to draw a big rectangles • Use all 8 window rectangles to restrict rendering – Using exclusive mode, GL_EXCLUSIVE_NV
  • 16. Window Rectangles to the Rescue • Checkerboard regions show discarded rendering that gets excluded by GL_EXCLUSIVE_NV window rectangles test
  • 17. Visualization • Rounded rectangles & non-pixel aligned rectangles still need additional discarding Shader discarded regions shown in gray checkerboard Window rectangles test regions shown in orange/yellow hash
  • 18. Usage of Window Rectangles Test • Shows rectangle drawn in 8 inclusive and 8 exclusive situations – Notice how window rectangles allowed to overlap
  • 19. Real-world Web Pages that Benefit 89% improvement @ 4x 46% improvement @ 4x 59% improvement @ 4x
  • 20. Consider a Standard Rectangular Viewport • Normal rendering
  • 21. Restricted to a Non-rectangular View • Limit rasterization to approximately circular region cheaply with window rectangles test
  • 22. Restricted to a Non-rectangular View • Visualizing the 8 inclusive rectangles
  • 23. Alternatively Exclusive • Visualizing the 8 inclusive rectangles – Overlap of two sets of window rectangles means exclusive & inclusive scenes have overlap of pixels
  • 24. Alternatively Exclusive • Possible to render unfocused area with less detail using exclusive window rectangles test
  • 25. Specification, Driver, & Library Status • Specification public – https://www.opengl.org/registry/specs/EXT/window_rectangles.txt – Identical API for OpenGL 4.5, ES 2.0, and ES 3.2 • Patches in progress for Google’s Skia library – 2D graphics library used by Chrome browser • NVIDIA OpenGL drivers – Fermi, Kepler, Maxwell, and Pascal – So GeForce 4xx and up – In drivers mid-2016 • Mesa3D – Considered by Brian Paul
  • 26. Thanks • Brian Paul, VMware • Brian Salomon, Google • Chris Dalton, Google • Jeff Bolz, NVIDIA • Mark Callow, Khronos • Walt Steiner, NVIDIA