Validate varying count when compiling shaders
This avoids crashing on devices when a number of varyings greater than the device limit is used. For now this accurately prints an error when compiling the shader, but the error text only pops up in the editor if the number of user varyings is above the limit.
This commit is contained in:
parent
296de7da83
commit
35100396e4
17 changed files with 92 additions and 27 deletions
|
|
@ -6234,6 +6234,8 @@ uint64_t RenderingDeviceDriverD3D12::limit_get(Limit p_limit) {
|
|||
case LIMIT_VRS_MAX_FRAGMENT_WIDTH:
|
||||
case LIMIT_VRS_MAX_FRAGMENT_HEIGHT:
|
||||
return vrs_capabilities.ss_max_fragment_size;
|
||||
case LIMIT_MAX_SHADER_VARYINGS:
|
||||
return MIN(D3D12_VS_OUTPUT_REGISTER_COUNT, D3D12_PS_INPUT_REGISTER_COUNT);
|
||||
default: {
|
||||
#ifdef DEV_ENABLED
|
||||
WARN_PRINT("Returning maximum value for unknown limit " + itos(p_limit) + ".");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue