make other sampling the default

This commit is contained in:
Sven Balzer
2025-03-16 21:23:34 +01:00
parent 5b6d83ed90
commit cdf6cf00a8
5 changed files with 497 additions and 568 deletions
+3 -8
View File
@@ -98,8 +98,6 @@ struct PerFrame {
Uint32 map_width;
};
Uint32 use_other_filtering;
static PerFrame per_frame = {
.aspect_ratio = 16.0f / 9.0f,
.fovy_degrees = 31.0f,
@@ -670,7 +668,7 @@ static void setup_memory_functions() {
static void setup_memory_functions() {}
#endif
bool enable_msaa = false;
bool enable_msaa = true;
SDL_GPUSampleCount highest_supported_sample_count = SDL_GPU_SAMPLECOUNT_1;
static bool recreate_graphics_pipelines() {
@@ -1179,8 +1177,6 @@ int main(int argc, char **argv) {
msaa_texture = NULL;
}
}
ImGui::CheckboxFlags("Use other filtering", &use_other_filtering, 0xffffffff);
}
ImGui::End();
@@ -1388,7 +1384,6 @@ int main(int argc, char **argv) {
per_frame.camera_y = player.pos_y;
SDL_PushGPUVertexUniformData(command_buffer, 0, &per_frame, sizeof(per_frame));
SDL_PushGPUFragmentUniformData(command_buffer, 0, &use_other_filtering, sizeof(use_other_filtering));
}
{
@@ -1424,7 +1419,7 @@ int main(int argc, char **argv) {
{ .buffer = world_buffer, .offset = 0 },
};
SDL_GPUTextureSamplerBinding texture_bindings[] = {
{ .texture = tile_atlas_texture, .sampler = use_other_filtering ? bilinear_sampler : point_sampler },
{ .texture = tile_atlas_texture, .sampler = bilinear_sampler },
};
SDL_BindGPUGraphicsPipeline(render_pass, world_graphics_pipeline);
@@ -1442,7 +1437,7 @@ int main(int argc, char **argv) {
{ .buffer = player_instance_buffer, .offset = 0 },
};
SDL_GPUTextureSamplerBinding texture_bindings[] = {
{ .texture = player_texture, .sampler = use_other_filtering ? bilinear_sampler : point_sampler },
{ .texture = player_texture, .sampler = bilinear_sampler },
};
SDL_BindGPUGraphicsPipeline(render_pass, basic_graphics_pipeline);