Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Fixes to make voxel tracinig compatible with Angle #248

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kvark
Copy link
Owner

@kvark kvark commented Nov 10, 2024

UAV error

ERR: Context11.cpp:1029 (rx::Context11::triggerDrawCallProgramRecompilation): Error compiling dynamic pixel executable: error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: PS ouputs must be declared in slots less than UAVs.  Output declared in slot 0 while UAV declared in slot 0.  Opcode #10 (count is 1-based). 
error X8000: D3D11 Internal Compiler Error: Invalid Bytecode: Can't continue validation - aborting.
[2024-11-10T08:39:40Z ERROR wgpu_hal::gles::egl] GLES: [API/Error] ID 1282 : Error: 0x00000502, in ..\..\src\libANGLE\renderer\d3d\d3d11\Context11.cpp, rx::Context11::triggerDrawCallProgramRecompilation:1030. Internal D3D11 error: HRESULT: 0x80004005: Error compiling dynamic pixel executable
ERR: Context11.cpp:1029 (rx::Context11::triggerDrawCallProgramRecompilation): Error compiling dynamic pixel executable: C:\fakepath(598,12-121): error X3662: gradient operation uses a value that may not be defined for all pixels (in ps_5_0 UAV loads can not participate in gradient operations)
C:\fakepath(544,26-45): error X3662: this memory access dependent on potentially UAV-related data
C:\fakepath(545,6-19): error X3662: this variable dependent on potentially UAV-related data: result
C:\fakepath(845,6-96): error X3662: this variable dependent on potentially UAV-related data: _Load_uint_std430_cm_x
C:\fakepath(846,10-36): error X3662: this variable dependent on potentially UAV-related data: __e222808
C:\fakepath(969,6-66): error X3662: this variable dependent on potentially UAV-related data: f_check_occupancy_int3_uint
C:\fakepath(1001,6-35): error X3662: this variable dependent on potentially UAV-related data: __e762893
C:\fakepath(478,12-19): error X3662: this variable dependent on potentially UAV-related data: x0
C:\fakepath(1004,30-87): error X3662: this variable dependent on potentially UAV-related data: uint_ctor
C:\fakepath(1006,28-61): error X3662: this variable dependent on potentially UAV-related data: _num_linear_steps2919
C:\fakepath(1018,6-40): error X3662: this variable dependent on potentially UAV-related data: _num_inner_steps_12872
C:\fakepath(1019,6-20): error X3662: this variable dependent on potentially UAV-related data: __e1582925
C:\fakepath(605,57-74): error X3662: this variable dependent on potentially UAV-related data: a
C:\fakepath(605,57-74): error X3662: this variable dependent on potentially UAV-related data: mix_emu
C:\fakepath(1027,6-102): error X3662: this variable dependent on potentially UAV-related data: mix_emu
C:\fakepath(1042,24-52): error X3662: this variable dependent on potentially UAV-related data: _voxel_shift2927
C:\fakepath(1044,5-37): error X3662: this variable dependent on potentially UAV-related data: _lod_voxel_pos2875
C:\fakepath(1045,28-41): error X3662: this variable dependent on potentially UAV-related data: __e2232938
C:\fakepath(965,3-15): error X3662: this loop dependent on potentially UAV-related data
C:\fakepath(1014,1-18): error X3662: this variable depends on potentially UAV-related data on loop exit: _pos_112873
C:\fakepath(1075,8-31): error X3662: this variable dependent on potentially UAV-related data: _pos_112873
C:\fakepath(1076,8-45): error X3662: this variable dependent on potentially UAV-related data: __e2522948
C:\fakepath(408,16-36): error X3662: this variable dependent on potentially UAV-related data: x0
C:\fakepath(409,5-21): error X3662: this variable dependent on potentially UAV-related data: structure
C:\fakepath(1076,1-46): error X3662: this variable dependent on potentially UAV-related data: _CastPoint_ctor
C:\fakepath(1076,46): error X3662: this variable dependent on potentially UAV-related data: f_cast_ray_through_voxels
C:\fakepath(1076,46): error X3662: this variable dependent on potentially UAV-related data: f_cast_ray_through_voxels
C:\fakepath(1076,46): error X3662: this variable dependent on potentially UAV-related data: f_cast_ray_through_voxels
C:\fakepath(748,34-82): error X3662: this variable dependent on potentially UAV-related data: f_cast_ray_through_voxels
C:\fakepath(754,101-153): error X3662: this variable dependent on potentially UAV-related data: _homogeneous_coords2744
C:\fakepath(438,5-26): error X3662: this variable dependent on potentially UAV-related data: x1
C:\fakepath(754,21-161): error X3662: this variable dependent on potentially UAV-related data: vec3_ctor
C:\fakepath(598,12-121): error X3662: this variable dependent on potentially UAV-related data: t

@kvark
Copy link
Owner Author

kvark commented Nov 10, 2024

Angle keeps disappointing:

    float gl_texture2D_comparisonLod(uint samplerIndex, float3 t, float lod)
    {
        const uint textureIndex = samplerIndex - textureIndexOffset2D_comparison;
        const uint samplerArrayIndex = samplerIndex - samplerIndexOffset2D_comparison;
        return textures2D_comparison[textureIndex].SampleCmp(samplers2D_comparison[samplerArrayIndex], float2(t.x, t.y), t.z);
    }

This is supposed to be a fixed-LOD sample, but Angle just ignored the LOD.

Ok, this is a real bummer.
I tried sampling LOD without comparison:

let depth = textureSampleLevel(
        t_Shadow, s_PaletteSampler,
        light_local, 0.0,
    );
let shadow = step(homogeneous_coords.z / homogeneous_coords.w, depth);

Gives me

Internal error in ShaderStages(FRAGMENT) shader: ERROR: 0:121: 'textureLod' : no matching overloaded function found

I tried loading from the texture

    let dim = vec2<f32>(textureDimensions(t_Shadow, 0).xy);
    let depth = textureLoad(t_Shadow, vec2<i32>(light_local * dim), 0);

Gives me:

Internal error in ShaderStages(FRAGMENT) shader: WGSL textureLoad from depth textures is not supported in GLSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant