Hackintosh: WebGL: NPOT textures bugged
Reported by
spectral...@gmail.com,
Jul 9 2017
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0 Steps to reproduce the problem: Fetch texels off of a NPOT texture in a shader. What is the expected behavior? What went wrong? The texel fetches return wrong results. Did this work before? N/A Does this work in other browsers? No The behavior is the same, see the comment below. Chrome version: 59.0.3071.115 Channel: n/a OS Version: 10.12.4 Flash Version: I tracked it down to existing on Hackintosh. This actually happens on all browsers, however I do not know enough to know where the issue originates (e.g. do all browser on Mac use the same WebGL implementation?) Note that on official Macs this doesn't happen. I attached a test that generates a float texture of any dimensions, with known pixel values, and then it gets each and every pixel in the texture, and matches it against the expected color. The test page includes a couple of tests at the bottom, that run upon page load. When a test ends, it logs to the console whether it was successful or not. Every POT texture that I tried passed, and every NPOT texture I tried failed. I am not sure if this is an issue directly related to Blink, however I am posting it here in the hopes that you developers will know who to show this too.
,
Jul 9 2017
Your test is sampling on the boundary between texels. In order to be reliable it needs to sample solidly within each texel. The original version of your test fails the 25x1 and 25x8 tests on my Retina MacBook Pro with NVIDIA GPU, so it isn't limited to Hackintoshes (which we can not possibly support -- we do report graphics driver bugs to Apple on a regular basis, but Apple obviously will not fix bugs reported against Hackintoshes).
Here is a fixed version which adds in a half-texel offset during the texture fetches and which passes all the tests. I suspect it will work on your machine too. Please try it and report back whether it does.
Also, here is about:gpu from my machine; please always provide this for graphics-related bug reports.
Graphics Feature Status
Canvas: Hardware accelerated
CheckerImaging: Enabled
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Hardware accelerated
Rasterization: Hardware accelerated
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
adjust_src_dst_region_for_blitframebuffer
decode_encode_srgb_for_generatemipmap
disable_framebuffer_cmaa
disable_multimonitor_multisampling
get_frag_data_info_bug
needs_offscreen_buffer_workaround
pack_parameters_workaround_with_pack_buffer
regenerate_struct_names
remove_invariant_and_centroid_for_essl3
scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap
unfold_short_circuit_as_ternary_operation
unpack_alignment_workaround_with_unpack_buffer
unpack_overlapping_rows_separately_unpack_buffer
use_intermediary_for_copy_texture_image
use_unused_standard_shared_blocks
Problems Detected
Work around a bug in offscreen buffers on NVIDIA GPUs on Macs: 89557
Applied Workarounds: needs_offscreen_buffer_workaround
Multisampling is buggy on OSX when multiple monitors are connected: 237931
Applied Workarounds: disable_multimonitor_multisampling
Unfold short circuit on Mac OS X: 307751
Applied Workarounds: unfold_short_circuit_as_ternary_operation
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Mac drivers handle struct scopes incorrectly: 403957
Applied Workarounds: regenerate_struct_names
glGenerateMipmap fails if the zero texture level is not set on some Mac drivers: 560499
Applied Workarounds: set_zero_level_before_generating_mipmap
Pack parameters work incorrectly with pack buffer bound: 563714
Applied Workarounds: pack_parameters_workaround_with_pack_buffer
Alignment works incorrectly with unpack buffer bound: 563714
Applied Workarounds: unpack_alignment_workaround_with_unpack_buffer
copyTexImage2D fails when reading from IOSurface on multiple GPU types.: 581777
Applied Workarounds: use_intermediary_for_copy_texture_image
Unpacking overlapping rows from unpack buffers is unstable on NVIDIA GL driver: 596774
Applied Workarounds: unpack_overlapping_rows_separately_unpack_buffer
Limited enabling of Chromium GL_INTEL_framebuffer_CMAA: 535198
Applied Workarounds: disable_framebuffer_cmaa
glGetFragData{Location|Index} works incorrectly on Max: 638340
Applied Workarounds: get_frag_data_info_bug
Decode and encode before generateMipmap for srgb format textures on macosx: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Insert statements to reference all members in unused std140/shared blocks on Mac: 618464
Applied Workarounds: use_unused_standard_shared_blocks
adjust src/dst region if blitting pixels outside read framebuffer on Mac: 644740
Applied Workarounds: adjust_src_dst_region_for_blitframebuffer
Mac driver GL 4.1 requires invariant and centroid to match between shaders: 639760, 641129
Applied Workarounds: remove_invariant_and_centroid_for_essl3
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Version Information
Data exported 7/9/2017, 1:28:53 PM
Chrome version Chrome/61.0.3150.0
Operating system Mac OS X 10.12.5
Software rendering list version 13.9
Driver bug list version 10.16
ANGLE commit id e145def0fc48
2D graphics backend Skia/61 7aad8cc2ff7a580bd5852d57289ace8c8dced6f5-
Command Line /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary -psn_0_61455 --restore-last-session --flag-switches-begin --enable-features=WebAssembly --flag-switches-end
Driver Information
Initialization time 27
In-process GPU false
Passthrough Command Decoder false
Supports overlays false
Sandboxed true
GPU0 VENDOR = 0x10de, DEVICE= 0x0fe9 *ACTIVE*
GPU1 VENDOR = 0x8086, DEVICE= 0x0d26
Optimus true
Optimus true
AMD switchable false
Driver vendor
Driver version 10.17.5 355.10.05.45f01
Driver date
Pixel shader version 4.10
Vertex shader version 4.10
Max. MSAA samples 8
Machine model name MacBookPro
Machine model version 11.3
GL_VENDOR NVIDIA Corporation
GL_RENDERER NVIDIA GeForce GT 750M OpenGL Engine
GL_VERSION 4.1 NVIDIA-10.17.5 355.10.05.45f01
GL_EXTENSIONS GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_depth_bounds_test GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_mirror_clamp GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier
Disabled Extensions GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Window system binding vendor
Window system binding version
Window system binding extensions
Direct rendering Yes
Reset notification strategy 0x0000
GPU process crash count 1
Compositor Information
Tile Update Mode Zero-copy
Partial Raster Enabled
GpuMemoryBuffers Status
ATC Software only
ATCIA Software only
DXT1 Software only
DXT5 Software only
ETC1 Software only
R_8 GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
R_16 Software only
RG_88 Software only
BGR_565 Software only
RGBA_4444 Software only
RGBX_8888 Software only
RGBA_8888 GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_8888 GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRA_8888 GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBA_F16 GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
YVU_420 Software only
YUV_420_BIPLANAR GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
UYVY_422 GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
,
Jul 9 2017
I can confirm now that the test page above also failed for someone on a Windows 10 machine with Nvidia GTX 970 with updated drivers. I didn't expect it to fail, but it did in the NPOT tests.
,
Jul 9 2017
I didn't include the about:gpu because everything passes for me, I am asking other people who I know have issues run the tests. Your fixed page passed everything for the Windows guy. Can't get hold of the Hackintosh one, but I assume this was indeed the error. So in the end, the real issue is what I thought to begin with, tiny floating point errors? I actually wasn't aware you can sample in the middle of a pixel, I learned something new today. Thanks!
,
Jul 9 2017
(Ok, I was aware, since that's just how sampling works, but I didn't think about it in this context of using a texture as a plain array)
,
Jul 10 2017
There are no tiny floating point errors -- the test case was deliberately sampling on the boundaries between texels, and depending on how the texture coordinate interpolation is done on the GPU, the sample point will land in one texel or another. To make it reliably sample a certain texel it's necessary to make sure that the texture coordinates reliably fall within that texel. Thanks for confirming that the problem's fixed on at least one machine. Closing as WontFix (not a bug). |
|||
►
Sign in to add a comment |
|||
Comment 1 by spectral...@gmail.com
, Jul 9 2017I feel like the test description is a bit misleading, so let me clarify. It uses the texture to render each and every pixel on a quad that fills the whole canvas. The first pixel is then fetched on the JS side, and compared to what the pixel at the current {x, y} coordinate is supposed to do. It also checks every channel separately, rather than comparing the whole RGBA pixels.