From 97f75ca87f72e8cbb744728bfd49b2c3f2f1ebdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 25 Aug 2020 18:18:43 +0200 Subject: GPUState: Move state limits getter to the area they belong This fix a GL_INVALID_VALUE error on startup due to 0.0f max line width. Also moves the max anisotropy filter to the sampler creation. This reduces code fragmentation. --- source/blender/gpu/intern/gpu_extensions.cc | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'source/blender/gpu/intern/gpu_extensions.cc') diff --git a/source/blender/gpu/intern/gpu_extensions.cc b/source/blender/gpu/intern/gpu_extensions.cc index 8074e4b64f0..1d607d79b01 100644 --- a/source/blender/gpu/intern/gpu_extensions.cc +++ b/source/blender/gpu/intern/gpu_extensions.cc @@ -71,12 +71,10 @@ static struct GPUGlobal { GLint maxubosize; GLint maxubobinds; int samples_color_texture_max; - float line_width_range[2]; /* workaround for different calculation of dfdy factors on GPUs. Some GPUs/drivers * calculate dfdy in shader differently when drawing to an off-screen buffer. First * number is factor on screen and second is off-screen */ float dfdyfactors[2]; - float max_anisotropy; /* Some Intel drivers have limited support for `GLEW_ARB_base_instance` so in * these cases it is best to indicate that it is not supported. See T67951 */ bool glew_arb_base_instance_is_supported; @@ -164,11 +162,6 @@ int GPU_max_textures_vert(void) return GG.maxtexturesvert; } -float GPU_max_texture_anisotropy(void) -{ - return GG.max_anisotropy; -} - int GPU_max_color_texture_samples(void) { return GG.samples_color_texture_max; @@ -189,11 +182,6 @@ int GPU_max_ubo_size(void) return GG.maxubosize; } -float GPU_max_line_width(void) -{ - return GG.line_width_range[1]; -} - void GPU_get_dfdy_factors(float fac[2]) { copy_v2_v2(fac, GG.dfdyfactors); @@ -264,18 +252,9 @@ void gpu_extensions_init(void) glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &GG.maxtexlayers); glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, &GG.maxcubemapsize); - if (GLEW_EXT_texture_filter_anisotropic) { - glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &GG.max_anisotropy); - } - else { - GG.max_anisotropy = 1.0f; - } - glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, &GG.maxubobinds); glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &GG.maxubosize); - glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, GG.line_width_range); - glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &GG.samples_color_texture_max); const char *vendor = (const char *)glGetString(GL_VENDOR); -- cgit v1.2.3 From 807817c0c4b6cef6acef8360394ae000be278109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 29 Aug 2020 01:28:26 +0200 Subject: GPUFrameBuffer: Use debug name support This is to make it easier to navigate captures in renderdoc. --- source/blender/gpu/intern/gpu_extensions.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/gpu/intern/gpu_extensions.cc') diff --git a/source/blender/gpu/intern/gpu_extensions.cc b/source/blender/gpu/intern/gpu_extensions.cc index 1d607d79b01..6fe08d81cda 100644 --- a/source/blender/gpu/intern/gpu_extensions.cc +++ b/source/blender/gpu/intern/gpu_extensions.cc @@ -116,7 +116,7 @@ static void gpu_detect_mip_render_workaround(void) glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, 0); GPU_texture_unbind(tex); - GPUFrameBuffer *fb = GPU_framebuffer_create(); + GPUFrameBuffer *fb = GPU_framebuffer_create(__func__); GPU_framebuffer_texture_attach(fb, tex, 0, 1); GPU_framebuffer_bind(fb); GPU_framebuffer_clear_color(fb, clear_color); -- cgit v1.2.3