3#ifndef vtkWebGPURenderWindow_h
4#define vtkWebGPURenderWindow_h
8#include "vtkRenderingWebGPUModule.h"
9#include "vtkTypeUInt8Array.h"
12VTK_ABI_NAMESPACE_BEGIN
23 this->PowerPreference =
24 high ? wgpu::PowerPreference::HighPerformance : wgpu::PowerPreference::LowPower;
76 unsigned char*
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
override;
80 int x,
int y,
int x2,
int y2,
unsigned char* data,
int front,
int right)
override;
89 float*
GetRGBAPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
91 int x,
int y,
int x2,
int y2,
int front,
vtkFloatArray* data,
int right = 0)
override;
93 int x,
int y,
int x2,
int y2,
float* data,
int front,
int blend = 0,
int right = 0)
override;
95 int right = 0)
override;
98 int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
102 int blend = 0,
int right = 0)
override;
104 int blend = 0,
int right = 0)
override;
150 inline wgpu::RenderPassEncoder
NewRenderPass(wgpu::RenderPassDescriptor& descriptor)
152 return this->CommandEncoder.BeginRenderPass(&descriptor);
156 wgpu::RenderBundleEncoderDescriptor& descriptor)
158 return this->Device.CreateRenderBundleEncoder(&descriptor);
165 inline bool HasStencil() {
return this->DepthStencil.HasStencil; }
166 inline wgpu::Device
GetDevice() {
return this->Device; }
193 bool WGPUInitialized =
false;
194 wgpu::PowerPreference PowerPreference = wgpu::PowerPreference::HighPerformance;
250 } BufferMapReadContext;
dynamic, self-adjusting array of float
a simple class to control print indentation
Allocate and hold a VTK object.
virtual void Modified()
Update the modification time for this object.
create a window for renderers to draw into
Hold a reference to a vtkObjectBase instance.
dynamic, self-adjusting array of unsigned char
void DestroyDepthStencilTexture()
virtual bool Initialize()=0
Concrete render windows must create a platform window and initialize this->WindowId.
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
wgpu::TextureFormat GetDepthStencilFormat()
vtkWGPUSwapChain SwapChain
void End() override
Update the system, if needed, at end of render process.
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
int SetZbufferData(int x1, int y1, int x2, int y2, float *buffer) override
Set/Get the zbuffer data from an image.
void ReadPixels()
Reads pixels into the CachedPixelBytes variable.
float * GetRGBAPixelData(int x, int y, int x2, int y2, int front, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
wgpu::CommandEncoder GetCommandEncoder()
void CreateOffscreenColorAttachments()
vtkWGPUColorAttachment ColorAttachment
const char * ReportCapabilities() override
Get report of capabilities for the render window.
int GetPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB... front in this context indicates that the...
virtual void CreateAWindow()=0
Create a not-off-screen window.
void SetPowerPreference(bool high=true)
int GetRGBAPixelData(int x, int y, int x2, int y2, int front, vtkFloatArray *data, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
void ReleaseRGBAPixelData(float *data) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
void DestroyOffscreenColorAttachments()
int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB... front in this context indicates that the...
unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
float * GetZbufferData(int x1, int y1, int x2, int y2) override
Set/Get the zbuffer data from an image.
void DestroyFSQGraphicsPipeline()
void WaitForCompletion() override
Block the thread until work queue completes all submitted work.
int SetPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB... front in this context indicates that the...
wgpu::CommandEncoder CommandEncoder
void ReleaseGraphicsResources(vtkWindow *) override
Free up any graphics resources associated with this window a value of NULL means the context may alre...
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
wgpu::TextureView GetDepthStencilView()
int SetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer) override
Set/Get the zbuffer data from an image.
int GetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer) override
Set/Get the zbuffer data from an image.
void Render() override
Handle opengl specific code and calls superclass.
wgpu::TextureFormat GetPreferredSwapChainTextureFormat()
int SetRGBAPixelData(int x, int y, int x2, int y2, float *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
vtkNew< vtkTypeUInt8Array > CachedPixelBytes
wgpu::RenderBundleEncoder NewRenderBundleEncoder(wgpu::RenderBundleEncoderDescriptor &descriptor)
void RenderOffscreenTexture()
void FlushCommandBuffers(vtkTypeUInt32 count, wgpu::CommandBuffer *buffers)
void Start() override
Start the rendering process for a frame.
const char * GetRenderingBackend() override
What rendering backend has the user requested.
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
wgpu::RenderPassEncoder NewRenderPass(wgpu::RenderPassDescriptor &descriptor)
int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
void CreateFSQGraphicsPipeline()
~vtkWebGPURenderWindow() override
void CreateDepthStencilTexture()
int GetZbufferData(int x1, int y1, int x2, int y2, float *z) override
Set/Get the zbuffer data from an image.
wgpu::TextureView GetOffscreenColorAttachmentView()
vtkWGPUUserStagingPixelData StagingPixelData
int SetRGBAPixelData(int x, int y, int x2, int y2, vtkFloatArray *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
vtkWGPUFullScreenQuad FSQ
void StereoMidpoint() override
Intermediate method performs operations required between the rendering of the left and right eye.
vtkWGPUDeptStencil DepthStencil
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
unsigned char * GetPixelData(int x, int y, int x2, int y2, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB... front in this context indicates that the...
window superclass for vtkRenderWindow
vtkSmartPointer< vtkTypeUInt8Array > dst
wgpu::TextureFormat Format
wgpu::Buffer OffscreenBuffer
wgpu::TextureFormat Format
wgpu::BindGroup BindGroup
wgpu::RenderPipeline Pipeline
wgpu::PresentMode PresentMode
wgpu::TextureView Framebuffer
wgpu::TextureFormat TexFormat
wgpu::TextureDataLayout Layout