[GPU] Viewport in draw_util with host API flexibility
This commit is contained in:
@@ -33,6 +33,28 @@ namespace draw_util {
|
||||
// for use with the top-left rasterization rule later.
|
||||
int32_t FloatToD3D11Fixed16p8(float f32);
|
||||
|
||||
struct ViewportInfo {
|
||||
// The returned viewport will always be in the positive quarter-plane for
|
||||
// simplicity of clamping to the maximum size supported by the host, negative
|
||||
// offset will be applied via ndc_offset.
|
||||
float left;
|
||||
float top;
|
||||
float width;
|
||||
float height;
|
||||
float z_min;
|
||||
float z_max;
|
||||
float ndc_scale[3];
|
||||
float ndc_offset[3];
|
||||
};
|
||||
// Converts the guest viewport (or fakes one if drawing without a viewport) to
|
||||
// a viewport, plus values to multiply-add the returned position by, usable on
|
||||
// host graphics APIs such as Direct3D 11+ and Vulkan, also forcing it to the
|
||||
// Direct3D clip space with 0...W Z rather than -W...W.
|
||||
void GetHostViewportInfo(const RegisterFile& regs, float pixel_size_x,
|
||||
float pixel_size_y, bool origin_bottom_left,
|
||||
float xy_max, bool allow_reverse_z,
|
||||
ViewportInfo& viewport_info_out);
|
||||
|
||||
struct Scissor {
|
||||
uint32_t left;
|
||||
uint32_t top;
|
||||
|
||||
Reference in New Issue
Block a user