Win64, LCL, simple shapes - something got broken

Yes. It was also visible in the OpenGL report you send earlier. This is OK, these values are OK and unrelated to shader rendering or Phong shading.

Yes, this commit fixes it.

Can we do more fine-grained testing while we are both at it, or is the game not worth the candles ?


Yes (I want to do more testing and fix it better), but not today :slight_smile:

As I mentioned above, I’d like to do something better for this GPU. The current solution is “hacky”, i.e. we treat your GPU as a bit special (BuggyPureShaderPipeline) and we do a special thing in this case (deactivate whole shader rendering, relying on only old fixed-function). As this path doesn’t happen on most GPUs, it’s not well tested.

Ideally, I’d like to localize the reason why shader pipeline fails on this very specific GPU, and fix it (i.e. make shader pipeline working – instead of deactivating it). Ideally the flag BuggyPureShaderPipeline and the whole “alternative logic” it causes should not exist.

But I need to think of proper tests, and for sure there will be lots of tests to perform to localize it :slight_smile: I’ll try to get my hands affected GPU family. I’ll let you know when I have something useful to test.

i found i have three videodriver versiosn installed on my computer, 2010, 2012 and 2013

one reason could be because of that old 690G mainboard, it BSODded if newer Radeon drivers were installed, which meant if i removed my Radeon 7700 - it crashed. While if i put it in - it still worked with old drivers. There was seomthing abotu DLL conflicts between Radeon 1xxx and 4xxx/7xxx

Right now i switched to 2013 drivers (latest) and the diusplay is all distorted, barely visible, i am going for reboot.

if it won’t do boot - l’ll ping you on github from phone.

if it would - would report here.

And I think I found a cheap used-but-in-good-condition offer to buy such GPU, AMD RADEON HD 5450 (it’s older than you have, but I suspect the issue should be equal).

I’ll think about just buying it for the sake of testing.

Now that i stumbled upon the drivers issue… Oh, good ideas come latests.

I remember i had to give-up on light-wieght Falkon WWW browser ffor it kept crashing exacty over old Radeon drivers…
So, it could be more about about drivers than chips, ATi always more focused on D3D than GL.


2022-05-04 02_30_06-Свойства_ ATI Radeon HD 4250

GL Summary - last drivers

OpenGL information (detected by castle-editor):

Version string: 3.3.11672 Compatibility Profile Context
Version parsed: major: 3, minor: 3, release exists: True, release: 11672, vendor-specific information: “Compatibility Profile Context”
Vendor-specific version parsed: major: 0, minor: 0, release: 0
Vendor: ATI Technologies Inc.
Vendor type: ATI

Renderer: ATI Radeon HD 4250
Fglrx (ATI on Linux): False
Mesa: False

Buggy glGenerateMipmap(EXT): False
Buggy VBO: False
Buggy shader shadow map: False
Buggy FBO rendering to multi-sampling texture: False
Buggy FBO rendering to cube map texture: False
Buggy swap buffers with non-standard glViewport: False
Buggy 32-bit depth buffer: False
Buggy GLSL gl_FrontFacing: False
Buggy GLSL read varying: False
Buggy Pure Shader Pipeline: True
Buggy Texture Size Above 2048: False
Buggy Shader Bump Mapping num_steps: False

Real versions available:
(checks both version string and actual functions availability in GL library, to secure from buggy implementations)

1.2: True
1.3: True
1.4: True
1.5: True
2.0: True
2.1: True
3.0: True
3.1: True
3.2: True
3.3: True
4.0: False

Shaders (GLSL) support: Standard
=> Enable deprecated (fixed-function) support: True
Multi-texturing: True
Framebuffer Object: Standard (or ARB “core extension”)
Multi-sampling for FBO buffers and textures: True
Vertex Buffer Object: True
GenerateMipmap available (and reliable): True
Cube map textures: Standard
Compressed textures supported: [DXT1_RGB, DXT1_RGBA, DXT3, DXT5]
3D textures: Standard
Textures non-power-of-2: True
Blend constant parameter: True
Float textures: True
Depth textures: True
Packed depth + stencil: True

All extensions: GL_AMDX_debug_output GL_AMD_conservative_depth GL_AMD_debug_output GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_name_gen_delete GL_AMD_performance_monitor GL_AMD_pinned_memory GL_AMD_sample_positions GL_AMD_shader_stencil_export GL_ARB_ES2_compatibility GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shader_precision GL_ARB_shader_stencil_export GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_snorm GL_ARB_texture_storage GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_transform_feedback_instanced GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap GL_ATI_fragment_shader GL_ATI_meminfo GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_buffer GL_EXT_copy_texture GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_histogram GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_explicit_multisample GL_NV_float_buffer GL_NV_half_float GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_barrier GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_swap_control

Current buffers bit depths:
Color (red / green / blue / alpha): 8 / 8 / 8 / 8
Depth: 24
Index: 0
Stencil: 8
Accumulation (red / green / blue / alpha): 0 / 0 / 0 / 0
Double buffer: True
Multi-sampling (full-screen anti-aliasing) possible: True
Current: 1 samples per pixel

Stack depths:
Attributes: 16
Client attributes: 16
Modelview: 32
Projection: 10
Texture: 10
Name: 64

Max clip planes: 8
Max lights (fixed-function limit): 8
Max eval order: 40
Max list nesting: 64
Max pixel map table: 256
Max texture size: 8192
Max viewport dims (width, height): 8192 8192
Max texture units (shader pipeline): 16
Max texture units (fixed-function): 8
Max cube map texture size: 8192
Max 3d texture size: 8192
Max texture max anisotropy: 16
Query counter bits (for occlusion query): 32
Max renderbuffer size: 8192

Memory (in Kb):
Total: 0 (unknown)
Current: 0 (unknown)
Current for VBO: 229814
Current for Textures: 229814
Current for Renderbuffers: 229814

…no, still broken :slight_smile:

undone your last commit - and nothing rendered again. With the commit - it works. I wonder what went wrong…

Well, it still CAN be about drivers. Try to find if any your Radeon video can work with some older Win64 drivers of 2010-2013 timespan, maybe you won’t have to buy anything.

And guess what?..

it was… optimistic :slight_smile:

    UseShaderRendering := {$ifdef OpenGLES} true {$else}
      (not GLFeatures.EnableFixedFunction) or
      ((RenderOptions.Mode = rmFull) and Shader.ShapeRequiresShaders)


UPD 2. … what a barbarian i am…

Oookay… is here something a lucky passer by like me can debug fiurther? Or is it rocket science with GLSL assembler from here onward ?

That’s release = 11672.

I see I do have a report that it fails even with later release, 13492 (links in castleglversion at FBuggyPureShaderPipeline setting).

Indeed the culprit is likely within ATI drivers (i.e. OpenGL implementation), not with any particular hardware.

Disabling the lines if PhongShading then Shader.ShapeRequiresShaders := true will not really do you much good. Without shaders, you cannot have Phong shading.

I’m afraid this doesn’t help much. You’re just disabling shaders in later stages. The end result is the same as my fix. In the end, without shaders, there’s no Phong shading.

The “ideal” fix is to instead have EnableFixedFunction=false, BuggyPureShaderPipeline=false, and allow all the shader code to just run on your GPU (as it does on any other GPU). And we need to find why it fails (that is, why did we even need BuggyPureShaderPipeline in the first place), according to both you and other reports ( like view3dscene 3.18.0 shader-pipeline issues on AMD E1-2500 APU (Radeon HD 8200/R3) · Issue #9 · castle-engine/view3dscene · GitHub ). This is our entry point to improving CGE on these GPUs more, such that we can actually use shaders there.

IOW BuggyPureShaderPipeline was our “nuclear solution” done long time ago. Just disable shaders on this GPU. But we need more “surgical solution”. Fix the shaders (it may be some small thing in how we initialize GLSL, maybe some very local OpenGL implementation bug), I don’t believe that shaders are completely broken for this GPU.

Okay, thank you then and good night, sorry for keeping you awake.

Good thing is that at least we have a temporary fix :slight_smile: Thank you for reporting and patiently testing and bisecting. Good night!

The opposite.

My 4250 is “Terascale 1” and Radeon 5xxxx is Terascale 2.
So, frankly, if you won’t be able to reproduce it by videodrivers alone, purchasing this chip might be wrong avenue.

…oh, i remember my Radeon 4850, it was a first good Radeon after long bad years :slight_smile:

Just random hit: c++ - GLSL shader not working on AMD/ATI, but works on NVIDIA - Stack Overflow

UPD. Just a note…
function TShaderSource.GetSource(const AType: TShaderType): TCastleStringList;

In Delphi i learnt that TList<string> is MUCH faster a container than TStringList, so unless special bels and whistles are requires, like key-value pairs, objects store, etc, one better avoid TStringList.

Just tested on Intel 520 on Win 10 - works like charm. So indeed old Radoen specific.

Also, you know, could not help noticing that end-user support maybe makes some habits :slight_smile:

Use the “Help → System Information” from the CGE editor

Frankly, would’ve been easier for me would you just say to call and save function GLInformationString: String; :smiley:

Maybe would be of some use for you later: castle-engine/tools/__bug_test_AMD4250 at bug_OpenGL_Radeon_4250_drv2013 · the-Arioch/castle-engine · GitHub

1 Like