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

Precision not output for sampler2DArray #146

Open
C0lumbo opened this issue Feb 4, 2019 · 0 comments
Open

Precision not output for sampler2DArray #146

C0lumbo opened this issue Feb 4, 2019 · 0 comments

Comments

@C0lumbo
Copy link

C0lumbo commented Feb 4, 2019

In the function ir_print_glsl_visitor::print_precision the following block of code skips writing the default lowp precision when possible:

// skip precision for samplers that end up being lowp (default anyway) or undefined;
// except always emit it for shadowmap samplers (some drivers don't implement
// default EXT_shadow_samplers precision) and 3D textures (they always require precision)
if (type && type->is_sampler() && !type->sampler_shadow && !type->sampler_array && !(type->sampler_dimensionality > GLSL_SAMPLER_DIM_2D))
{
	if (prec == glsl_precision_low || prec == glsl_precision_undefined)
		return;
}

This wrongly skips writing precision for 2D array textures. The fixed conditional should also check for sampler_array:

if (type && type->is_sampler() && !type->sampler_shadow && !type->sampler_array && !(type->sampler_dimensionality > GLSL_SAMPLER_DIM_2D))

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

No branches or pull requests

1 participant