MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk::PipeLine Class Reference

Clipped software rasterization pipeline for lines and filled triangles. More...

#include <mxvk/include/mxvk/mxvk_math.h>

Public Types

enum  LINE_CODE {
  CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 , CODE_E = 0x0002 ,
  CODE_W = 0x0001 , CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 ,
  CODE_E = 0x0002 , CODE_W = 0x0001
}
 Cohen-Sutherland region codes for line clipping. More...
enum  LINE_CODE {
  CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 , CODE_E = 0x0002 ,
  CODE_W = 0x0001 , CODE_C = 0x0000 , CODE_N = 0x0008 , CODE_S = 0x0004 ,
  CODE_E = 0x0002 , CODE_W = 0x0001
}
 Cohen-Sutherland region codes for line clipping. More...

Public Member Functions

void Begin (int width, int height, std::function< void(int, int, MXCOLOR)> plotter)
 Begin rendering with a custom pixel plotter.
void Begin (int width, int height, std::function< void(int, int, MXCOLOR)> plotter)
 Begin rendering with a custom pixel plotter.
void Begin (SDL_Renderer *renderer, int width, int height)
 Begin rendering to an SDL renderer.
void Begin (SDL_Renderer *renderer, int width, int height)
 Begin rendering to an SDL renderer.
void Begin (VK_Sprite &sprite, int width, int height, int pixel_size=1)
 Begin rendering to a VK_Sprite with optional square pixel size.
void Begin (VK_Sprite &sprite, int width, int height, int pixel_size=1)
 Begin rendering to a VK_Sprite with optional square pixel size.
bool ClipLine (int &x0, int &y0, int &x1, int &y1) const
 Clip a line segment to the active clip rectangle.
bool ClipLine (int &x0, int &y0, int &x1, int &y1) const
 Clip a line segment to the active clip rectangle.
int ComputeCode (int x, int y) const
 Compute the Cohen-Sutherland region code for a point.
int ComputeCode (int x, int y) const
 Compute the Cohen-Sutherland region code for a point.
void DrawClipedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const
 Draw a clipped line. Kept with the original misspelled name for compatibility.
void DrawClipedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const
 Draw a clipped line. Kept with the original misspelled name for compatibility.
void DrawClippedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const
 Draw a clipped line.
void DrawClippedLine (int x0, int y0, int x1, int y1, MXCOLOR color) const
 Draw a clipped line.
void DrawDepthTestedLine (const vec4D &first, const vec4D &second, MXCOLOR color, std::span< float > depth_buffer) const
 Draw a clipped screen-space line with perspective-correct depth testing.
void DrawDepthTestedLine (const vec4D &first, const vec4D &second, MXCOLOR color, std::span< float > depth_buffer) const
 Draw a clipped screen-space line with perspective-correct depth testing.
void DrawFilledTriangle (const vec2D &p0, const vec2D &p1, const vec2D &p2, MXCOLOR color) const
 Draw a clipped filled triangle from 2D screen-space vertices.
void DrawFilledTriangle (const vec2D &p0, const vec2D &p1, const vec2D &p2, MXCOLOR color) const
 Draw a clipped filled triangle from 2D screen-space vertices.
void DrawFilledTriangle (const vec4D &p0, const vec4D &p1, const vec4D &p2, MXCOLOR color) const
 Draw a clipped filled triangle from homogeneous screen-space vertices.
void DrawFilledTriangle (const vec4D &p0, const vec4D &p1, const vec4D &p2, MXCOLOR color) const
 Draw a clipped filled triangle from homogeneous screen-space vertices.
void DrawObject (const mxObject &object) const
 Draw an object's active transformed triangles as clipped wireframes.
void DrawObject (const mxObject &object) const
 Draw an object's active transformed triangles as clipped wireframes.
void DrawObject (const mxObject &object, std::span< float > depth_buffer) const
 Draw an object's active transformed triangles as depth-tested clipped wireframes.
void DrawObject (const mxObject &object, std::span< float > depth_buffer) const
 Draw an object's active transformed triangles as depth-tested clipped wireframes.
void DrawPolys (const RenderList &list) const
 Draw active render-list triangles as clipped wireframes.
void DrawPolys (const RenderList &list) const
 Draw active render-list triangles as clipped wireframes.
void DrawPolys (const RenderList &list, std::span< float > depth_buffer) const
 Draw active render-list triangles as depth-tested clipped wireframes.
void DrawPolys (const RenderList &list, std::span< float > depth_buffer) const
 Draw active render-list triangles as depth-tested clipped wireframes.
void DrawSolidPolys (const RenderList &list) const
 Draw active render-list triangles as filled polygons.
void DrawSolidPolys (const RenderList &list) const
 Draw active render-list triangles as filled polygons.
void DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color) const
 Draw a clipped wireframe triangle without depth testing.
void DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color) const
 Draw a clipped wireframe triangle without depth testing.
void DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color, std::span< float > depth_buffer) const
 Draw a clipped wireframe triangle with perspective-correct depth testing.
void DrawWireframeTriangle (const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color, std::span< float > depth_buffer) const
 Draw a clipped wireframe triangle with perspective-correct depth testing.
void End ()
 End rendering and release the current plotting callbacks.
void End ()
 End rendering and release the current plotting callbacks.

Public Attributes

int clip_max_x = 0
 Active maximum clip X coordinate.
int clip_max_y = 0
 Active maximum clip Y coordinate.
int clip_min_x = 0
 Active minimum clip X coordinate.
int clip_min_y = 0
 Active minimum clip Y coordinate.
int max_clip_x = 0
 Maximum clip X coordinate.
int max_clip_y = 0
 Maximum clip Y coordinate.
int min_clip_x = 0
 Minimum clip X coordinate.
int min_clip_y = 0
 Minimum clip Y coordinate.

Detailed Description

Clipped software rasterization pipeline for lines and filled triangles.

Definition at line 2104 of file mxvk_math.h.

Member Enumeration Documentation

◆ LINE_CODE [1/2]

Cohen-Sutherland region codes for line clipping.

Enumerator
CODE_C 

Center/inside code.

CODE_N 

North/top code.

CODE_S 

South/bottom code.

CODE_E 

East/right code.

CODE_W 

West/left code.

CODE_C 

Center/inside code.

CODE_N 

North/top code.

CODE_S 

South/bottom code.

CODE_E 

East/right code.

CODE_W 

West/left code.

Definition at line 2107 of file mxvk_math.h.

2107 {
2108 /// Center/inside code.
2109 CODE_C = 0x0000,
2110
2111 /// North/top code.
2112 CODE_N = 0x0008,
2113
2114 /// South/bottom code.
2115 CODE_S = 0x0004,
2116
2117 /// East/right code.
2118 CODE_E = 0x0002,
2119
2120 /// West/left code.
2121 CODE_W = 0x0001
2122 };
@ CODE_E
East/right code.
Definition mxvk_math.h:2118
@ CODE_C
Center/inside code.
Definition mxvk_math.h:2109
@ CODE_S
South/bottom code.
Definition mxvk_math.h:2115
@ CODE_W
West/left code.
Definition mxvk_math.h:2121
@ CODE_N
North/top code.
Definition mxvk_math.h:2112

◆ LINE_CODE [2/2]

Cohen-Sutherland region codes for line clipping.

Enumerator
CODE_C 

Center/inside code.

CODE_N 

North/top code.

CODE_S 

South/bottom code.

CODE_E 

East/right code.

CODE_W 

West/left code.

CODE_C 

Center/inside code.

CODE_N 

North/top code.

CODE_S 

South/bottom code.

CODE_E 

East/right code.

CODE_W 

West/left code.

Definition at line 2076 of file mxvk_math_eigen.hpp.

2076 {
2077 /// Center/inside code.
2078 CODE_C = 0x0000,
2079
2080 /// North/top code.
2081 CODE_N = 0x0008,
2082
2083 /// South/bottom code.
2084 CODE_S = 0x0004,
2085
2086 /// East/right code.
2087 CODE_E = 0x0002,
2088
2089 /// West/left code.
2090 CODE_W = 0x0001
2091 };

Member Function Documentation

◆ Begin() [1/6]

void mxvk::PipeLine::Begin ( int width,
int height,
std::function< void(int, int, MXCOLOR)> plotter )
inline

Begin rendering with a custom pixel plotter.

Definition at line 2149 of file mxvk_math.h.

2149 {
2150 plot_pixel = std::move(plotter);
2151 plot_span = [this](int x0, int x1, int y, MXCOLOR color) {
2152 for (int x = x0; x <= x1; ++x) {
2153 plot_pixel(x, y, color);
2154 }
2155 };
2156 clip_min_x = min_clip_x = 0;
2157 clip_min_y = min_clip_y = 0;
2158 clip_max_x = max_clip_x = std::max(0, width - 1);
2159 clip_max_y = max_clip_y = std::max(0, height - 1);
2160 [[maybe_unused]] static const bool PIPELINE_LOGGED = [width, height] {
2161 std::cout << "mxvk_math: software raster pipeline ready (" << width << 'x' << height << ")\n";
2162 return true;
2163 }();
2164 }
int min_clip_x
Minimum clip X coordinate.
Definition mxvk_math.h:2131
int min_clip_y
Minimum clip Y coordinate.
Definition mxvk_math.h:2134
int clip_min_x
Active minimum clip X coordinate.
Definition mxvk_math.h:2137
int clip_max_x
Active maximum clip X coordinate.
Definition mxvk_math.h:2140
int max_clip_y
Maximum clip Y coordinate.
Definition mxvk_math.h:2128
int clip_min_y
Active minimum clip Y coordinate.
Definition mxvk_math.h:2143
int max_clip_x
Maximum clip X coordinate.
Definition mxvk_math.h:2125
int clip_max_y
Active maximum clip Y coordinate.
Definition mxvk_math.h:2146
std::uint32_t MXCOLOR
Packed 32-bit color in ARGB byte order.
Definition mxvk_math.h:40

◆ Begin() [2/6]

void mxvk::PipeLine::Begin ( int width,
int height,
std::function< void(int, int, MXCOLOR)> plotter )
inline

Begin rendering with a custom pixel plotter.

Definition at line 2118 of file mxvk_math_eigen.hpp.

2118 {
2119 plot_pixel = std::move(plotter);
2120 plot_span = [this](int x0, int x1, int y, MXCOLOR color) {
2121 for (int x = x0; x <= x1; ++x) {
2122 plot_pixel(x, y, color);
2123 }
2124 };
2125 clip_min_x = min_clip_x = 0;
2126 clip_min_y = min_clip_y = 0;
2127 clip_max_x = max_clip_x = std::max(0, width - 1);
2128 clip_max_y = max_clip_y = std::max(0, height - 1);
2129 [[maybe_unused]] static const bool PIPELINE_LOGGED = [width, height] {
2130 std::cout << "mxvk_math_eigen: software raster pipeline ready (" << width << 'x' << height << ")\n";
2131 return true;
2132 }();
2133 }

◆ Begin() [3/6]

void mxvk::PipeLine::Begin ( SDL_Renderer * renderer,
int width,
int height )
inline

Begin rendering to an SDL renderer.

Definition at line 2167 of file mxvk_math.h.

2167 {
2168 Begin(width, height, [renderer](int x, int y, MXCOLOR color) { SDLRendererPixelPlotter{renderer}(x, y, color); });
2169 plot_span = [renderer](int x0, int x1, int y, MXCOLOR color) {
2170 if (renderer == nullptr) {
2171 return;
2172 }
2173 SDL_SetRenderDrawColor(renderer, color_r(color), color_g(color), color_b(color), color_a(color));
2174 SDL_RenderLine(renderer, static_cast<float>(x0), static_cast<float>(y), static_cast<float>(x1), static_cast<float>(y));
2175 };
2176 }
void Begin(int width, int height, std::function< void(int, int, MXCOLOR)> plotter)
Begin rendering with a custom pixel plotter.
Definition mxvk_math.h:2149
constexpr std::uint8_t color_r(MXCOLOR color)
Extract the red component from a packed ARGB color.
Definition mxvk_math.h:52
constexpr std::uint8_t color_g(MXCOLOR color)
Extract the green component from a packed ARGB color.
Definition mxvk_math.h:55
constexpr std::uint8_t color_a(MXCOLOR color)
Extract the alpha component from a packed ARGB color.
Definition mxvk_math.h:61
constexpr std::uint8_t color_b(MXCOLOR color)
Extract the blue component from a packed ARGB color.
Definition mxvk_math.h:58

◆ Begin() [4/6]

void mxvk::PipeLine::Begin ( SDL_Renderer * renderer,
int width,
int height )
inline

Begin rendering to an SDL renderer.

Definition at line 2136 of file mxvk_math_eigen.hpp.

2136 {
2137 Begin(width, height, [renderer](int x, int y, MXCOLOR color) { SDLRendererPixelPlotter{renderer}(x, y, color); });
2138 plot_span = [renderer](int x0, int x1, int y, MXCOLOR color) {
2139 if (renderer == nullptr) {
2140 return;
2141 }
2142 SDL_SetRenderDrawColor(renderer, color_r(color), color_g(color), color_b(color), color_a(color));
2143 SDL_RenderLine(renderer, static_cast<float>(x0), static_cast<float>(y), static_cast<float>(x1), static_cast<float>(y));
2144 };
2145 }

◆ Begin() [5/6]

void mxvk::PipeLine::Begin ( VK_Sprite & sprite,
int width,
int height,
int pixel_size = 1 )
inline

Begin rendering to a VK_Sprite with optional square pixel size.

Definition at line 2179 of file mxvk_math.h.

2179 {
2180 Begin(width, height, [&sprite, pixel_size](int x, int y, MXCOLOR color) { VKSpritePixelPlotter{&sprite, pixel_size}(x, y, color); });
2181 plot_span = [&sprite, pixel_size](int x0, int x1, int y, MXCOLOR) {
2182 const int size = std::max(1, pixel_size);
2183 sprite.drawSpriteRect(x0, y, std::max(1, x1 - x0 + 1), size);
2184 };
2185 }

◆ Begin() [6/6]

void mxvk::PipeLine::Begin ( VK_Sprite & sprite,
int width,
int height,
int pixel_size = 1 )
inline

Begin rendering to a VK_Sprite with optional square pixel size.

Definition at line 2148 of file mxvk_math_eigen.hpp.

2148 {
2149 Begin(width, height, [&sprite, pixel_size](int x, int y, MXCOLOR color) { VKSpritePixelPlotter{&sprite, pixel_size}(x, y, color); });
2150 plot_span = [&sprite, pixel_size](int x0, int x1, int y, MXCOLOR) {
2151 const int size = std::max(1, pixel_size);
2152 sprite.drawSpriteRect(x0, y, std::max(1, x1 - x0 + 1), size);
2153 };
2154 }

◆ ClipLine() [1/2]

bool mxvk::PipeLine::ClipLine ( int & x0,
int & y0,
int & x1,
int & y1 ) const
inline

Clip a line segment to the active clip rectangle.

Parameters
x0Start X coordinate, updated to clipped value.
y0Start Y coordinate, updated to clipped value.
x1End X coordinate, updated to clipped value.
y1End Y coordinate, updated to clipped value.
Returns
True when some portion of the line remains visible.

Definition at line 2211 of file mxvk_math.h.

2211 {
2212 int code0 = ComputeCode(x0, y0);
2213 int code1 = ComputeCode(x1, y1);
2214
2215 while (true) {
2216 if ((code0 | code1) == 0) {
2217 return true;
2218 }
2219 if ((code0 & code1) != 0) {
2220 return false;
2221 }
2222
2223 const int out_code = code0 != 0 ? code0 : code1;
2224 int x = 0;
2225 int y = 0;
2226
2227 if ((out_code & CODE_N) != 0) {
2228 if (y1 == y0) {
2229 return false;
2230 }
2231 x = x0 + (x1 - x0) * (clip_min_y - y0) / (y1 - y0);
2232 y = clip_min_y;
2233 } else if ((out_code & CODE_S) != 0) {
2234 if (y1 == y0) {
2235 return false;
2236 }
2237 x = x0 + (x1 - x0) * (clip_max_y - y0) / (y1 - y0);
2238 y = clip_max_y;
2239 } else if ((out_code & CODE_E) != 0) {
2240 if (x1 == x0) {
2241 return false;
2242 }
2243 y = y0 + (y1 - y0) * (clip_max_x - x0) / (x1 - x0);
2244 x = clip_max_x;
2245 } else {
2246 if (x1 == x0) {
2247 return false;
2248 }
2249 y = y0 + (y1 - y0) * (clip_min_x - x0) / (x1 - x0);
2250 x = clip_min_x;
2251 }
2252
2253 if (out_code == code0) {
2254 x0 = x;
2255 y0 = y;
2256 code0 = ComputeCode(x0, y0);
2257 } else {
2258 x1 = x;
2259 y1 = y;
2260 code1 = ComputeCode(x1, y1);
2261 }
2262 }
2263 }
int ComputeCode(int x, int y) const
Compute the Cohen-Sutherland region code for a point.
Definition mxvk_math.h:2188

◆ ClipLine() [2/2]

bool mxvk::PipeLine::ClipLine ( int & x0,
int & y0,
int & x1,
int & y1 ) const
inline

Clip a line segment to the active clip rectangle.

Parameters
x0Start X coordinate, updated to clipped value.
y0Start Y coordinate, updated to clipped value.
x1End X coordinate, updated to clipped value.
y1End Y coordinate, updated to clipped value.
Returns
True when some portion of the line remains visible.

Definition at line 2180 of file mxvk_math_eigen.hpp.

2180 {
2181 int code0 = ComputeCode(x0, y0);
2182 int code1 = ComputeCode(x1, y1);
2183 const auto interpolate = [](int dependent0, int dependent1, int independent0, int independent1, int boundary) {
2184 const double value = static_cast<double>(dependent0) + (static_cast<double>(dependent1) - static_cast<double>(dependent0)) * (static_cast<double>(boundary) - static_cast<double>(independent0)) / (static_cast<double>(independent1) - static_cast<double>(independent0));
2185 return static_cast<int>(std::lround(value));
2186 };
2187
2188 while (true) {
2189 if ((code0 | code1) == 0) {
2190 return true;
2191 }
2192 if ((code0 & code1) != 0) {
2193 return false;
2194 }
2195
2196 const int out_code = code0 != 0 ? code0 : code1;
2197 int x = 0;
2198 int y = 0;
2199
2200 if ((out_code & CODE_N) != 0) {
2201 if (y1 == y0) {
2202 return false;
2203 }
2204 x = interpolate(x0, x1, y0, y1, clip_min_y);
2205 y = clip_min_y;
2206 } else if ((out_code & CODE_S) != 0) {
2207 if (y1 == y0) {
2208 return false;
2209 }
2210 x = interpolate(x0, x1, y0, y1, clip_max_y);
2211 y = clip_max_y;
2212 } else if ((out_code & CODE_E) != 0) {
2213 if (x1 == x0) {
2214 return false;
2215 }
2216 y = interpolate(y0, y1, x0, x1, clip_max_x);
2217 x = clip_max_x;
2218 } else {
2219 if (x1 == x0) {
2220 return false;
2221 }
2222 y = interpolate(y0, y1, x0, x1, clip_min_x);
2223 x = clip_min_x;
2224 }
2225
2226 if (out_code == code0) {
2227 x0 = x;
2228 y0 = y;
2229 code0 = ComputeCode(x0, y0);
2230 } else {
2231 x1 = x;
2232 y1 = y;
2233 code1 = ComputeCode(x1, y1);
2234 }
2235 }
2236 }

◆ ComputeCode() [1/2]

int mxvk::PipeLine::ComputeCode ( int x,
int y ) const
inlinenodiscard

Compute the Cohen-Sutherland region code for a point.

Definition at line 2188 of file mxvk_math.h.

2188 {
2189 int code = CODE_C;
2190 if (x < clip_min_x) {
2191 code |= CODE_W;
2192 } else if (x > clip_max_x) {
2193 code |= CODE_E;
2194 }
2195 if (y < clip_min_y) {
2196 code |= CODE_N;
2197 } else if (y > clip_max_y) {
2198 code |= CODE_S;
2199 }
2200 return code;
2201 }

◆ ComputeCode() [2/2]

int mxvk::PipeLine::ComputeCode ( int x,
int y ) const
inlinenodiscard

Compute the Cohen-Sutherland region code for a point.

Definition at line 2157 of file mxvk_math_eigen.hpp.

2157 {
2158 int code = CODE_C;
2159 if (x < clip_min_x) {
2160 code |= CODE_W;
2161 } else if (x > clip_max_x) {
2162 code |= CODE_E;
2163 }
2164 if (y < clip_min_y) {
2165 code |= CODE_N;
2166 } else if (y > clip_max_y) {
2167 code |= CODE_S;
2168 }
2169 return code;
2170 }

◆ DrawClipedLine() [1/2]

void mxvk::PipeLine::DrawClipedLine ( int x0,
int y0,
int x1,
int y1,
MXCOLOR color ) const
inline

Draw a clipped line. Kept with the original misspelled name for compatibility.

Definition at line 2266 of file mxvk_math.h.

2266 {
2267 if (plot_pixel && ClipLine(x0, y0, x1, y1)) {
2268 draw_line(x0, y0, x1, y1, color, plot_pixel);
2269 }
2270 }
bool ClipLine(int &x0, int &y0, int &x1, int &y1) const
Clip a line segment to the active clip rectangle.
Definition mxvk_math.h:2211
void draw_line(int x0, int y0, int x1, int y1, MXCOLOR color, PlotPixel &&plot_pixel)
Draw a line with Bresenham-style integer stepping.
Definition mxvk_math.h:1941

◆ DrawClipedLine() [2/2]

void mxvk::PipeLine::DrawClipedLine ( int x0,
int y0,
int x1,
int y1,
MXCOLOR color ) const
inline

Draw a clipped line. Kept with the original misspelled name for compatibility.

Definition at line 2239 of file mxvk_math_eigen.hpp.

2239 {
2240 if (plot_pixel && ClipLine(x0, y0, x1, y1)) {
2241 draw_line(x0, y0, x1, y1, color, plot_pixel);
2242 }
2243 }

◆ DrawClippedLine() [1/2]

void mxvk::PipeLine::DrawClippedLine ( int x0,
int y0,
int x1,
int y1,
MXCOLOR color ) const
inline

Draw a clipped line.

Definition at line 2273 of file mxvk_math.h.

2273{ DrawClipedLine(x0, y0, x1, y1, color); }
void DrawClipedLine(int x0, int y0, int x1, int y1, MXCOLOR color) const
Draw a clipped line. Kept with the original misspelled name for compatibility.
Definition mxvk_math.h:2266

◆ DrawClippedLine() [2/2]

void mxvk::PipeLine::DrawClippedLine ( int x0,
int y0,
int x1,
int y1,
MXCOLOR color ) const
inline

Draw a clipped line.

Definition at line 2246 of file mxvk_math_eigen.hpp.

2246{ DrawClipedLine(x0, y0, x1, y1, color); }

◆ DrawDepthTestedLine() [1/2]

void mxvk::PipeLine::DrawDepthTestedLine ( const vec4D & first,
const vec4D & second,
MXCOLOR color,
std::span< float > depth_buffer ) const
inline

Draw a clipped screen-space line with perspective-correct depth testing.

Parameters
firstFirst endpoint; x/y are screen coordinates and z is positive view depth.
secondSecond endpoint; x/y are screen coordinates and z is positive view depth.
colorPacked line color.
depth_bufferFull framebuffer depth buffer initialized to a far value.

Definition at line 2282 of file mxvk_math.h.

2282 {
2283 if (!plot_pixel || first.z <= EPSILON || second.z <= EPSILON || !std::isfinite(first.x) || !std::isfinite(first.y) || !std::isfinite(first.z) || !std::isfinite(second.x) || !std::isfinite(second.y) || !std::isfinite(second.z)) {
2284 return;
2285 }
2286
2287 const int framebuffer_width = max_clip_x + 1;
2288 const int framebuffer_height = max_clip_y + 1;
2289 const std::size_t required_depth_values = static_cast<std::size_t>(framebuffer_width) * static_cast<std::size_t>(framebuffer_height);
2290 if (framebuffer_width <= 0 || framebuffer_height <= 0 || depth_buffer.size() < required_depth_values) {
2291 return;
2292 }
2293
2294 const float delta_x = second.x - first.x;
2295 const float delta_y = second.y - first.y;
2296 float first_fraction = 0.0f;
2297 float last_fraction = 1.0f;
2298 const auto clip_fraction = [&first_fraction, &last_fraction](float direction, float distance) {
2299 if (std::abs(direction) <= EPSILON) {
2300 return distance >= 0.0f;
2301 }
2302
2303 const float fraction = distance / direction;
2304 if (direction < 0.0f) {
2305 first_fraction = std::max(first_fraction, fraction);
2306 } else {
2307 last_fraction = std::min(last_fraction, fraction);
2308 }
2309 return first_fraction <= last_fraction;
2310 };
2311
2312 if (!clip_fraction(-delta_x, first.x - static_cast<float>(clip_min_x)) || !clip_fraction(delta_x, static_cast<float>(clip_max_x) - first.x) || !clip_fraction(-delta_y, first.y - static_cast<float>(clip_min_y)) || !clip_fraction(delta_y, static_cast<float>(clip_max_y) - first.y)) {
2313 return;
2314 }
2315
2316 const float clipped_delta_x = delta_x * (last_fraction - first_fraction);
2317 const float clipped_delta_y = delta_y * (last_fraction - first_fraction);
2318 const float step_count = std::ceil(std::max(std::abs(clipped_delta_x), std::abs(clipped_delta_y)));
2319 if (step_count > static_cast<float>(std::numeric_limits<int>::max())) {
2320 return;
2321 }
2322 const int steps = std::max(1, static_cast<int>(step_count));
2323 const float first_reciprocal_depth = 1.0f / first.z;
2324 const float second_reciprocal_depth = 1.0f / second.z;
2325
2326 for (int step = 0; step <= steps; ++step) {
2327 const float clipped_fraction = static_cast<float>(step) / static_cast<float>(steps);
2328 const float fraction = first_fraction + (last_fraction - first_fraction) * clipped_fraction;
2329 const int x = static_cast<int>(std::lround(first.x + delta_x * fraction));
2330 const int y = static_cast<int>(std::lround(first.y + delta_y * fraction));
2331 if (x < clip_min_x || x > clip_max_x || y < clip_min_y || y > clip_max_y) {
2332 continue;
2333 }
2334
2335 const float reciprocal_depth = first_reciprocal_depth + (second_reciprocal_depth - first_reciprocal_depth) * fraction;
2336 if (reciprocal_depth <= EPSILON) {
2337 continue;
2338 }
2339
2340 const float depth = 1.0f / reciprocal_depth;
2341 const std::size_t pixel_index = static_cast<std::size_t>(y) * static_cast<std::size_t>(framebuffer_width) + static_cast<std::size_t>(x);
2342 if (depth >= depth_buffer[pixel_index]) {
2343 continue;
2344 }
2345
2346 depth_buffer[pixel_index] = depth;
2347 plot_pixel(x, y, color);
2348 }
2349 }
constexpr float EPSILON
Default tolerance used for floating-point singularity and zero-length checks.
Definition mxvk_math.h:37

◆ DrawDepthTestedLine() [2/2]

void mxvk::PipeLine::DrawDepthTestedLine ( const vec4D & first,
const vec4D & second,
MXCOLOR color,
std::span< float > depth_buffer ) const
inline

Draw a clipped screen-space line with perspective-correct depth testing.

Parameters
firstFirst endpoint; x/y are screen coordinates and z is positive view depth.
secondSecond endpoint; x/y are screen coordinates and z is positive view depth.
colorPacked line color.
depth_bufferFull framebuffer depth buffer initialized to a far value.

Definition at line 2255 of file mxvk_math_eigen.hpp.

2255 {
2256 if (!plot_pixel || first.z <= EPSILON || second.z <= EPSILON || !std::isfinite(first.x) || !std::isfinite(first.y) || !std::isfinite(first.z) || !std::isfinite(second.x) || !std::isfinite(second.y) || !std::isfinite(second.z)) {
2257 return;
2258 }
2259
2260 const int framebuffer_width = max_clip_x + 1;
2261 const int framebuffer_height = max_clip_y + 1;
2262 const std::size_t required_depth_values = static_cast<std::size_t>(framebuffer_width) * static_cast<std::size_t>(framebuffer_height);
2263 if (framebuffer_width <= 0 || framebuffer_height <= 0 || depth_buffer.size() < required_depth_values) {
2264 return;
2265 }
2266
2267 const float delta_x = second.x - first.x;
2268 const float delta_y = second.y - first.y;
2269 float first_fraction = 0.0f;
2270 float last_fraction = 1.0f;
2271 const auto clip_fraction = [&first_fraction, &last_fraction](float direction, float distance) {
2272 if (std::abs(direction) <= EPSILON) {
2273 return distance >= 0.0f;
2274 }
2275
2276 const float fraction = distance / direction;
2277 if (direction < 0.0f) {
2278 first_fraction = std::max(first_fraction, fraction);
2279 } else {
2280 last_fraction = std::min(last_fraction, fraction);
2281 }
2282 return first_fraction <= last_fraction;
2283 };
2284
2285 if (!clip_fraction(-delta_x, first.x - static_cast<float>(clip_min_x)) || !clip_fraction(delta_x, static_cast<float>(clip_max_x) - first.x) || !clip_fraction(-delta_y, first.y - static_cast<float>(clip_min_y)) || !clip_fraction(delta_y, static_cast<float>(clip_max_y) - first.y)) {
2286 return;
2287 }
2288
2289 const float clipped_delta_x = delta_x * (last_fraction - first_fraction);
2290 const float clipped_delta_y = delta_y * (last_fraction - first_fraction);
2291 const float step_count = std::ceil(std::max(std::abs(clipped_delta_x), std::abs(clipped_delta_y)));
2292 if (step_count > static_cast<float>(std::numeric_limits<int>::max())) {
2293 return;
2294 }
2295 const int steps = std::max(1, static_cast<int>(step_count));
2296 const float first_reciprocal_depth = 1.0f / first.z;
2297 const float second_reciprocal_depth = 1.0f / second.z;
2298
2299 for (int step = 0; step <= steps; ++step) {
2300 const float clipped_fraction = static_cast<float>(step) / static_cast<float>(steps);
2301 const float fraction = first_fraction + (last_fraction - first_fraction) * clipped_fraction;
2302 const int x = static_cast<int>(std::lround(first.x + delta_x * fraction));
2303 const int y = static_cast<int>(std::lround(first.y + delta_y * fraction));
2304 if (x < clip_min_x || x > clip_max_x || y < clip_min_y || y > clip_max_y) {
2305 continue;
2306 }
2307
2308 const float reciprocal_depth = first_reciprocal_depth + (second_reciprocal_depth - first_reciprocal_depth) * fraction;
2309 if (reciprocal_depth <= EPSILON) {
2310 continue;
2311 }
2312
2313 const float depth = 1.0f / reciprocal_depth;
2314 const std::size_t pixel_index = static_cast<std::size_t>(y) * static_cast<std::size_t>(framebuffer_width) + static_cast<std::size_t>(x);
2315 if (depth >= depth_buffer[pixel_index]) {
2316 continue;
2317 }
2318
2319 depth_buffer[pixel_index] = depth;
2320 plot_pixel(x, y, color);
2321 }
2322 }

◆ DrawFilledTriangle() [1/4]

void mxvk::PipeLine::DrawFilledTriangle ( const vec2D & p0,
const vec2D & p1,
const vec2D & p2,
MXCOLOR color ) const
inline

Draw a clipped filled triangle from 2D screen-space vertices.

Definition at line 2366 of file mxvk_math.h.

2366 {
2367 if (!plot_pixel) {
2368 return;
2369 }
2370
2371 const int min_x = static_cast<int>(std::floor(std::min({p0.x, p1.x, p2.x})));
2372 const int max_x = static_cast<int>(std::ceil(std::max({p0.x, p1.x, p2.x})));
2373 const int min_y = static_cast<int>(std::floor(std::min({p0.y, p1.y, p2.y})));
2374 const int max_y = static_cast<int>(std::ceil(std::max({p0.y, p1.y, p2.y})));
2375 if (max_x < clip_min_x || min_x > clip_max_x || max_y < clip_min_y || min_y > clip_max_y) {
2376 return;
2377 }
2378
2379 draw_filled_triangle_spans_clipped(p0, p1, p2, clip_min_y, clip_max_y, color, [this](int x0, int x1, int y, MXCOLOR pixel_color) {
2380 if (x1 < clip_min_x || x0 > clip_max_x) {
2381 return;
2382 }
2383 x0 = std::max(x0, clip_min_x);
2384 x1 = std::min(x1, clip_max_x);
2385 if (plot_span) {
2386 plot_span(x0, x1, y, pixel_color);
2387 }
2388 });
2389 }
void draw_filled_triangle_spans_clipped(vec2D p0, vec2D p1, vec2D p2, int clip_min_y, int clip_max_y, MXCOLOR color, DrawSpan &&draw_span)
Rasterize a filled triangle as horizontal spans.
Definition mxvk_math.h:2024

◆ DrawFilledTriangle() [2/4]

void mxvk::PipeLine::DrawFilledTriangle ( const vec2D & p0,
const vec2D & p1,
const vec2D & p2,
MXCOLOR color ) const
inline

Draw a clipped filled triangle from 2D screen-space vertices.

Definition at line 2339 of file mxvk_math_eigen.hpp.

2339 {
2340 if (!plot_pixel) {
2341 return;
2342 }
2343
2344 const int min_x = static_cast<int>(std::floor(std::min({p0.x, p1.x, p2.x})));
2345 const int max_x = static_cast<int>(std::ceil(std::max({p0.x, p1.x, p2.x})));
2346 const int min_y = static_cast<int>(std::floor(std::min({p0.y, p1.y, p2.y})));
2347 const int max_y = static_cast<int>(std::ceil(std::max({p0.y, p1.y, p2.y})));
2348 if (max_x < clip_min_x || min_x > clip_max_x || max_y < clip_min_y || min_y > clip_max_y) {
2349 return;
2350 }
2351
2352 draw_filled_triangle_spans_clipped(p0, p1, p2, clip_min_y, clip_max_y, color, [this](int x0, int x1, int y, MXCOLOR pixel_color) {
2353 if (x1 < clip_min_x || x0 > clip_max_x) {
2354 return;
2355 }
2356 x0 = std::max(x0, clip_min_x);
2357 x1 = std::min(x1, clip_max_x);
2358 if (plot_span) {
2359 plot_span(x0, x1, y, pixel_color);
2360 }
2361 });
2362 }

◆ DrawFilledTriangle() [3/4]

void mxvk::PipeLine::DrawFilledTriangle ( const vec4D & p0,
const vec4D & p1,
const vec4D & p2,
MXCOLOR color ) const
inline

Draw a clipped filled triangle from homogeneous screen-space vertices.

Definition at line 2392 of file mxvk_math.h.

2392{ DrawFilledTriangle(vec2D(p0.x, p0.y), vec2D(p1.x, p1.y), vec2D(p2.x, p2.y), color); }
void DrawFilledTriangle(const vec2D &p0, const vec2D &p1, const vec2D &p2, MXCOLOR color) const
Draw a clipped filled triangle from 2D screen-space vertices.
Definition mxvk_math.h:2366
constexpr vec2D()
Construct the zero vector.
Definition mxvk_math.h:167

◆ DrawFilledTriangle() [4/4]

void mxvk::PipeLine::DrawFilledTriangle ( const vec4D & p0,
const vec4D & p1,
const vec4D & p2,
MXCOLOR color ) const
inline

Draw a clipped filled triangle from homogeneous screen-space vertices.

Definition at line 2365 of file mxvk_math_eigen.hpp.

2365{ DrawFilledTriangle(vec2D(p0.x, p0.y), vec2D(p1.x, p1.y), vec2D(p2.x, p2.y), color); }

◆ DrawObject() [1/4]

void mxvk::PipeLine::DrawObject ( const mxObject & object) const
inline

Draw an object's active transformed triangles as clipped wireframes.

Definition at line 2425 of file mxvk_math.h.

2425 {
2426 if ((object.state & MX_CULLED) != 0) {
2427 return;
2428 }
2429 for (const auto &poly : object.vlist) {
2430 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2431 continue;
2432 }
2433 const auto a = static_cast<std::size_t>(poly.vert[0]);
2434 const auto b = static_cast<std::size_t>(poly.vert[1]);
2435 const auto c = static_cast<std::size_t>(poly.vert[2]);
2436 if (a >= object.trans.size() || b >= object.trans.size() || c >= object.trans.size()) {
2437 continue;
2438 }
2439 DrawWireframeTriangle(object.trans[a], object.trans[b], object.trans[c], poly.color);
2440 }
2441 }
void DrawWireframeTriangle(const vec4D &first, const vec4D &second, const vec4D &third, MXCOLOR color) const
Draw a clipped wireframe triangle without depth testing.
Definition mxvk_math.h:2352
@ MX_CULLED
Object or polygon is culled.
Definition mxvk_math.h:1228
@ MX_BACKFACE
Polygon is marked as a backface.
Definition mxvk_math.h:1225

◆ DrawObject() [2/4]

void mxvk::PipeLine::DrawObject ( const mxObject & object) const
inline

Draw an object's active transformed triangles as clipped wireframes.

Definition at line 2398 of file mxvk_math_eigen.hpp.

2398 {
2399 if ((object.state & MX_CULLED) != 0) {
2400 return;
2401 }
2402 for (const auto &poly : object.vlist) {
2403 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2404 continue;
2405 }
2406 const auto a = static_cast<std::size_t>(poly.vert[0]);
2407 const auto b = static_cast<std::size_t>(poly.vert[1]);
2408 const auto c = static_cast<std::size_t>(poly.vert[2]);
2409 if (a >= object.trans.size() || b >= object.trans.size() || c >= object.trans.size()) {
2410 continue;
2411 }
2412 DrawWireframeTriangle(object.trans[a], object.trans[b], object.trans[c], poly.color);
2413 }
2414 }

◆ DrawObject() [3/4]

void mxvk::PipeLine::DrawObject ( const mxObject & object,
std::span< float > depth_buffer ) const
inline

Draw an object's active transformed triangles as depth-tested clipped wireframes.

Definition at line 2444 of file mxvk_math.h.

2444 {
2445 if ((object.state & MX_CULLED) != 0) {
2446 return;
2447 }
2448 for (const auto &poly : object.vlist) {
2449 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2450 continue;
2451 }
2452 const auto a = static_cast<std::size_t>(poly.vert[0]);
2453 const auto b = static_cast<std::size_t>(poly.vert[1]);
2454 const auto c = static_cast<std::size_t>(poly.vert[2]);
2455 if (a >= object.trans.size() || b >= object.trans.size() || c >= object.trans.size()) {
2456 continue;
2457 }
2458 DrawWireframeTriangle(object.trans[a], object.trans[b], object.trans[c], poly.color, depth_buffer);
2459 }
2460 }

◆ DrawObject() [4/4]

void mxvk::PipeLine::DrawObject ( const mxObject & object,
std::span< float > depth_buffer ) const
inline

Draw an object's active transformed triangles as depth-tested clipped wireframes.

Definition at line 2417 of file mxvk_math_eigen.hpp.

2417 {
2418 if ((object.state & MX_CULLED) != 0) {
2419 return;
2420 }
2421 for (const auto &poly : object.vlist) {
2422 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2423 continue;
2424 }
2425 const auto a = static_cast<std::size_t>(poly.vert[0]);
2426 const auto b = static_cast<std::size_t>(poly.vert[1]);
2427 const auto c = static_cast<std::size_t>(poly.vert[2]);
2428 if (a >= object.trans.size() || b >= object.trans.size() || c >= object.trans.size()) {
2429 continue;
2430 }
2431 DrawWireframeTriangle(object.trans[a], object.trans[b], object.trans[c], poly.color, depth_buffer);
2432 }
2433 }

◆ DrawPolys() [1/4]

void mxvk::PipeLine::DrawPolys ( const RenderList & list) const
inline

Draw active render-list triangles as clipped wireframes.

Definition at line 2405 of file mxvk_math.h.

2405 {
2406 for (const auto &poly : list.polys) {
2407 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2408 continue;
2409 }
2410 DrawWireframeTriangle(poly.tlist[0], poly.tlist[1], poly.tlist[2], poly.color);
2411 }
2412 }

◆ DrawPolys() [2/4]

void mxvk::PipeLine::DrawPolys ( const RenderList & list) const
inline

Draw active render-list triangles as clipped wireframes.

Definition at line 2378 of file mxvk_math_eigen.hpp.

2378 {
2379 for (const auto &poly : list.polys) {
2380 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2381 continue;
2382 }
2383 DrawWireframeTriangle(poly.tlist[0], poly.tlist[1], poly.tlist[2], poly.color);
2384 }
2385 }

◆ DrawPolys() [3/4]

void mxvk::PipeLine::DrawPolys ( const RenderList & list,
std::span< float > depth_buffer ) const
inline

Draw active render-list triangles as depth-tested clipped wireframes.

Definition at line 2415 of file mxvk_math.h.

2415 {
2416 for (const auto &poly : list.polys) {
2417 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2418 continue;
2419 }
2420 DrawWireframeTriangle(poly.tlist[0], poly.tlist[1], poly.tlist[2], poly.color, depth_buffer);
2421 }
2422 }

◆ DrawPolys() [4/4]

void mxvk::PipeLine::DrawPolys ( const RenderList & list,
std::span< float > depth_buffer ) const
inline

Draw active render-list triangles as depth-tested clipped wireframes.

Definition at line 2388 of file mxvk_math_eigen.hpp.

2388 {
2389 for (const auto &poly : list.polys) {
2390 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2391 continue;
2392 }
2393 DrawWireframeTriangle(poly.tlist[0], poly.tlist[1], poly.tlist[2], poly.color, depth_buffer);
2394 }
2395 }

◆ DrawSolidPolys() [1/2]

void mxvk::PipeLine::DrawSolidPolys ( const RenderList & list) const
inline

Draw active render-list triangles as filled polygons.

Definition at line 2395 of file mxvk_math.h.

2395 {
2396 for (const auto &poly : list.polys) {
2397 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2398 continue;
2399 }
2400 DrawFilledTriangle(poly.tlist[0], poly.tlist[1], poly.tlist[2], poly.color);
2401 }
2402 }

◆ DrawSolidPolys() [2/2]

void mxvk::PipeLine::DrawSolidPolys ( const RenderList & list) const
inline

Draw active render-list triangles as filled polygons.

Definition at line 2368 of file mxvk_math_eigen.hpp.

2368 {
2369 for (const auto &poly : list.polys) {
2370 if (poly.state == 0 || (poly.state & MX_BACKFACE) != 0) {
2371 continue;
2372 }
2373 DrawFilledTriangle(poly.tlist[0], poly.tlist[1], poly.tlist[2], poly.color);
2374 }
2375 }

◆ DrawWireframeTriangle() [1/4]

void mxvk::PipeLine::DrawWireframeTriangle ( const vec4D & first,
const vec4D & second,
const vec4D & third,
MXCOLOR color ) const
inline

Draw a clipped wireframe triangle without depth testing.

Definition at line 2352 of file mxvk_math.h.

2352 {
2353 DrawClippedLine(static_cast<int>(std::lround(first.x)), static_cast<int>(std::lround(first.y)), static_cast<int>(std::lround(second.x)), static_cast<int>(std::lround(second.y)), color);
2354 DrawClippedLine(static_cast<int>(std::lround(second.x)), static_cast<int>(std::lround(second.y)), static_cast<int>(std::lround(third.x)), static_cast<int>(std::lround(third.y)), color);
2355 DrawClippedLine(static_cast<int>(std::lround(third.x)), static_cast<int>(std::lround(third.y)), static_cast<int>(std::lround(first.x)), static_cast<int>(std::lround(first.y)), color);
2356 }
void DrawClippedLine(int x0, int y0, int x1, int y1, MXCOLOR color) const
Draw a clipped line.
Definition mxvk_math.h:2273

◆ DrawWireframeTriangle() [2/4]

void mxvk::PipeLine::DrawWireframeTriangle ( const vec4D & first,
const vec4D & second,
const vec4D & third,
MXCOLOR color ) const
inline

Draw a clipped wireframe triangle without depth testing.

Definition at line 2325 of file mxvk_math_eigen.hpp.

2325 {
2326 DrawClippedLine(static_cast<int>(std::lround(first.x)), static_cast<int>(std::lround(first.y)), static_cast<int>(std::lround(second.x)), static_cast<int>(std::lround(second.y)), color);
2327 DrawClippedLine(static_cast<int>(std::lround(second.x)), static_cast<int>(std::lround(second.y)), static_cast<int>(std::lround(third.x)), static_cast<int>(std::lround(third.y)), color);
2328 DrawClippedLine(static_cast<int>(std::lround(third.x)), static_cast<int>(std::lround(third.y)), static_cast<int>(std::lround(first.x)), static_cast<int>(std::lround(first.y)), color);
2329 }

◆ DrawWireframeTriangle() [3/4]

void mxvk::PipeLine::DrawWireframeTriangle ( const vec4D & first,
const vec4D & second,
const vec4D & third,
MXCOLOR color,
std::span< float > depth_buffer ) const
inline

Draw a clipped wireframe triangle with perspective-correct depth testing.

Definition at line 2359 of file mxvk_math.h.

2359 {
2360 DrawDepthTestedLine(first, second, color, depth_buffer);
2361 DrawDepthTestedLine(second, third, color, depth_buffer);
2362 DrawDepthTestedLine(third, first, color, depth_buffer);
2363 }
void DrawDepthTestedLine(const vec4D &first, const vec4D &second, MXCOLOR color, std::span< float > depth_buffer) const
Draw a clipped screen-space line with perspective-correct depth testing.
Definition mxvk_math.h:2282

◆ DrawWireframeTriangle() [4/4]

void mxvk::PipeLine::DrawWireframeTriangle ( const vec4D & first,
const vec4D & second,
const vec4D & third,
MXCOLOR color,
std::span< float > depth_buffer ) const
inline

Draw a clipped wireframe triangle with perspective-correct depth testing.

Definition at line 2332 of file mxvk_math_eigen.hpp.

2332 {
2333 DrawDepthTestedLine(first, second, color, depth_buffer);
2334 DrawDepthTestedLine(second, third, color, depth_buffer);
2335 DrawDepthTestedLine(third, first, color, depth_buffer);
2336 }

◆ End() [1/2]

void mxvk::PipeLine::End ( )
inline

End rendering and release the current plotting callbacks.

Definition at line 2463 of file mxvk_math.h.

2463 {
2464 plot_pixel = nullptr;
2465 plot_span = nullptr;
2466 }

◆ End() [2/2]

void mxvk::PipeLine::End ( )
inline

End rendering and release the current plotting callbacks.

Definition at line 2436 of file mxvk_math_eigen.hpp.

2436 {
2437 plot_pixel = nullptr;
2438 plot_span = nullptr;
2439 }

Member Data Documentation

◆ clip_max_x

int mxvk::PipeLine::clip_max_x = 0

Active maximum clip X coordinate.

Definition at line 2140 of file mxvk_math.h.

◆ clip_max_y

int mxvk::PipeLine::clip_max_y = 0

Active maximum clip Y coordinate.

Definition at line 2146 of file mxvk_math.h.

◆ clip_min_x

int mxvk::PipeLine::clip_min_x = 0

Active minimum clip X coordinate.

Definition at line 2137 of file mxvk_math.h.

◆ clip_min_y

int mxvk::PipeLine::clip_min_y = 0

Active minimum clip Y coordinate.

Definition at line 2143 of file mxvk_math.h.

◆ max_clip_x

int mxvk::PipeLine::max_clip_x = 0

Maximum clip X coordinate.

Definition at line 2125 of file mxvk_math.h.

◆ max_clip_y

int mxvk::PipeLine::max_clip_y = 0

Maximum clip Y coordinate.

Definition at line 2128 of file mxvk_math.h.

◆ min_clip_x

int mxvk::PipeLine::min_clip_x = 0

Minimum clip X coordinate.

Definition at line 2131 of file mxvk_math.h.

◆ min_clip_y

int mxvk::PipeLine::min_clip_y = 0

Minimum clip Y coordinate.

Definition at line 2134 of file mxvk_math.h.


The documentation for this class was generated from the following files: