mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
glsl/fp64: move context.h dependent checks into main.
allows dropping context.h include. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14437>
This commit is contained in:
parent
23b361ae12
commit
7b7f627600
2 changed files with 7 additions and 9 deletions
|
|
@ -39,7 +39,6 @@
|
|||
#include "main/errors.h"
|
||||
#include "main/mtypes.h"
|
||||
#include "main/shaderobj.h"
|
||||
#include "main/context.h"
|
||||
#include "util/u_math.h"
|
||||
|
||||
/*
|
||||
|
|
@ -2715,13 +2714,6 @@ nir_shader *
|
|||
glsl_float64_funcs_to_nir(struct gl_context *ctx,
|
||||
const nir_shader_compiler_options *options)
|
||||
{
|
||||
/* It's not possible to use float64 on GLSL ES, so don't bother trying to
|
||||
* build the support code. The support code depends on higher versions of
|
||||
* desktop GLSL, so it will fail to compile (below) anyway.
|
||||
*/
|
||||
if (!_mesa_is_desktop_gl(ctx) || ctx->Const.GLSLVersion < 400)
|
||||
return NULL;
|
||||
|
||||
/* We pretend it's a vertex shader. Ultimately, the stage shouldn't
|
||||
* matter because we're not optimizing anything here.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -375,7 +375,13 @@ st_nir_preprocess(struct st_context *st, struct gl_program *prog,
|
|||
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
|
||||
if (!st->ctx->SoftFP64 && ((nir->info.bit_sizes_int | nir->info.bit_sizes_float) & 64) &&
|
||||
(options->lower_doubles_options & nir_lower_fp64_full_software) != 0) {
|
||||
st->ctx->SoftFP64 = glsl_float64_funcs_to_nir(st->ctx, options);
|
||||
|
||||
/* It's not possible to use float64 on GLSL ES, so don't bother trying to
|
||||
* build the support code. The support code depends on higher versions of
|
||||
* desktop GLSL, so it will fail to compile (below) anyway.
|
||||
*/
|
||||
if (_mesa_is_desktop_gl(st->ctx) && st->ctx->Const.GLSLVersion >= 400)
|
||||
st->ctx->SoftFP64 = glsl_float64_funcs_to_nir(st->ctx, options);
|
||||
}
|
||||
|
||||
/* ES has strict SSO validation rules for shader IO matching so we can't
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue