diff options
author | quou <quou@disroot.org> | 2025-03-14 21:23:41 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-03-14 21:23:41 +1100 |
commit | 750b192a0229ecf401fbe4dd727725a6ef5350d9 (patch) | |
tree | 7b08bc8d891ea1b6c6c097d4f55b089adbd58ca6 /pipeline.cpp | |
parent | dae6866161ca59a6b23b41ae7008411116127f76 (diff) |
implementing shader variants
Diffstat (limited to 'pipeline.cpp')
-rw-r--r-- | pipeline.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pipeline.cpp b/pipeline.cpp index 374dad8..4d34ebd 100644 --- a/pipeline.cpp +++ b/pipeline.cpp @@ -254,6 +254,14 @@ Pipeline_Builder& Pipeline_Builder::shader(Shader_Id s) { return *this; } +Pipeline_Builder& Pipeline_Builder::option( + Shader_Type type, + int mask +) { + pip->shader_masks[type] = mask; + return *this; +} + Pipeline_Builder& Pipeline_Builder::texture( int binding, Texture_Id t, @@ -321,6 +329,7 @@ Pipeline& Pipeline_Builder::build() { } void Pipeline::hash() { + int i; #define h(n, v) \ n = fnv1a64_2(n, (uint8_t*)&v, sizeof v) pipeline_hash = fnv1a64(0, 0); @@ -347,8 +356,10 @@ void Pipeline::hash() { h(pipeline_hash, blend_src_alpha); h(pipeline_hash, blend_dst_alpha); h(pipeline_hash, cull_mode); + for (i = 0; i < shader_type_count; i++) + h(pipeline_hash, shader_masks[i]); { - int i, e = descriptor_count; + int e = descriptor_count; descriptor_resource_hash = fnv1a64(0, 0); for (i = 0; i < e; i++) { Descriptor* d = &descriptors[i]; |