summaryrefslogtreecommitdiff
path: root/video.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-03-10 13:18:03 +1100
committerquou <quou@disroot.org>2025-03-10 13:18:03 +1100
commita7ef36bc519dff1700048ba8f21658daa138a81a (patch)
tree8778d112afdf21be6c1856fc062b8969f5ee3739 /video.hpp
parent0bc95e2084b970819d15306f7e3ab8b81a108dcd (diff)
msaa
Diffstat (limited to 'video.hpp')
-rw-r--r--video.hpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/video.hpp b/video.hpp
index 4afb6ba..530b126 100644
--- a/video.hpp
+++ b/video.hpp
@@ -133,6 +133,7 @@ struct Pipeline {
Cull_Mode cull_mode;
Vertex_Format_Id vertex_format;
Shader_Id shader;
+ int samples;
Descriptor descriptors[pipeline_max_descriptors];
int descriptor_count;
@@ -161,7 +162,8 @@ struct Pipeline {
blend_dst_alpha == other.blend_dst_alpha &&
blend_mode == other.blend_mode &&
blend_mode_alpha == other.blend_mode_alpha &&
- cull_mode == other.cull_mode;
+ cull_mode == other.cull_mode &&
+ samples == other.samples;
}
bool desc_layout_eq(const Pipeline& other) const {
@@ -228,6 +230,7 @@ struct Render_Pass {
struct Target {
Texture_Id id;
Texture_Format fmt;
+ int samples;
Clear_Mode mode;
union {
Colour colour;
@@ -266,6 +269,11 @@ struct Render_Pass {
}
return true;
}
+
+ int get_samples() const {
+ if (colour_count) return colours[0].samples;
+ return depth.samples;
+ }
};
struct Vertex_Buffer_Binding {
@@ -359,6 +367,7 @@ struct Texture : public Asset {
int w, h, d;
int mip_count, array_size;
int start_mip, start_array;
+ int samples;
bool alias;
};
@@ -486,7 +495,8 @@ struct Device {
int d,
int mip_count,
int array_size,
- Buffer_Id init
+ Buffer_Id init,
+ int samples = 1
);
Texture_Id alias_texture(
Texture_Id o,
@@ -562,6 +572,7 @@ struct Context {
int w,
int h
);
+ void resolve(Texture_Id dst, Texture_Id src);
void transition(Texture_Id id, Resource_State state);
void debug_push(const char* name);
void debug_pop();