Skip to content

Commit 3933ad3

Browse files
committed
Ensure mipmapping actually works :)
1 parent fb89089 commit 3933ad3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/ObjectivelyGPU/RenderDevice.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static Sampler *createSamplerLinearRepeat(RenderDevice *self) {
274274
.address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_REPEAT,
275275
.address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_REPEAT,
276276
.address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_REPEAT,
277+
.max_lod = 1000.f, // no clamp (matches Vulkan's VK_LOD_CLAMP_NONE convention)
277278
.enable_anisotropy = self->maxAnisotropy > 0.f,
278279
.max_anisotropy = self->maxAnisotropy,
279280
});
@@ -292,6 +293,7 @@ static Sampler *createSamplerLinearClamp(RenderDevice *self) {
292293
.address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
293294
.address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
294295
.address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
296+
.max_lod = 1000.f, // no clamp (matches Vulkan's VK_LOD_CLAMP_NONE convention)
295297
.enable_anisotropy = self->maxAnisotropy > 0.f,
296298
.max_anisotropy = self->maxAnisotropy,
297299
});
@@ -310,6 +312,7 @@ static Sampler *createSamplerNearestClamp(RenderDevice *self) {
310312
.address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
311313
.address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
312314
.address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
315+
.max_lod = 1000.f, // no clamp (matches Vulkan's VK_LOD_CLAMP_NONE convention)
313316
});
314317
}
315318

@@ -326,6 +329,7 @@ static Sampler *createSamplerShadowCompare(RenderDevice *self) {
326329
.address_mode_u = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
327330
.address_mode_v = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
328331
.address_mode_w = SDL_GPU_SAMPLERADDRESSMODE_CLAMP_TO_EDGE,
332+
.max_lod = 1000.f, // no clamp (matches Vulkan's VK_LOD_CLAMP_NONE convention)
329333
.compare_op = SDL_GPU_COMPAREOP_LESS_OR_EQUAL,
330334
.enable_compare = true,
331335
});

0 commit comments

Comments
 (0)