Log shader warnings

This commit is contained in:
Joshua Barretto 2023-10-18 21:50:40 +01:00
parent cea7636e29
commit e81516a154
43 changed files with 56 additions and 48 deletions

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
layout(set = 0, binding = 0)
uniform texture2D t_src_color;

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
layout(location = 0) out vec2 uv;

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#define HAS_SHADOW_MAPS

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <globals.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
layout(set = 0, binding = 0)
uniform texture2D t_src_color;

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
layout(set = 0, binding = 0)
uniform texture2D t_src_color;

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
layout(set = 0, binding = 0)
uniform texture2D t_src_color;

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#define FIGURE_SHADER

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -58,7 +58,7 @@ vec4 fxaa(texture2D tex, sampler smplr, vec2 fragCoord, vec2 resolution,
vec2 v_rgbSW, vec2 v_rgbSE,
vec2 v_rgbM) {
vec4 color;
mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);
vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);
vec3 rgbNW = texture(sampler2D(tex, smplr), v_rgbNW).xyz;
vec3 rgbNE = texture(sampler2D(tex, smplr), v_rgbNE).xyz;
vec3 rgbSW = texture(sampler2D(tex, smplr), v_rgbSW).xyz;
@ -74,7 +74,7 @@ vec4 fxaa(texture2D tex, sampler smplr, vec2 fragCoord, vec2 resolution,
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
mediump vec2 dir;
vec2 dir;
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
@ -121,11 +121,11 @@ vec4 fxaa_apply(
vec2 resolution,
float sampleScale
) {
mediump vec2 v_rgbNW;
mediump vec2 v_rgbNE;
mediump vec2 v_rgbSW;
mediump vec2 v_rgbSE;
mediump vec2 v_rgbM;
vec2 v_rgbNW;
vec2 v_rgbNE;
vec2 v_rgbSW;
vec2 v_rgbSE;
vec2 v_rgbM;
float fxaa_scale = textureSize(sampler2D(tex, smplr), 0).x / resolution.x * sampleScale;

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <globals.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
// #extension ARB_texture_storage : enable
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
// #extension ARB_texture_storage : enable
#define FIGURE_SHADER

View File

@ -2,7 +2,7 @@
//
// However, in the future we might apply some depth transforms here.
#version 420 core
#version 430 core
// #extension ARB_texture_storage : enable
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
// #extension ARB_texture_storage : enable
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#extension GL_EXT_samplerless_texture_functions : enable
layout(set = 0, binding = 0)

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
layout(push_constant) uniform Params {
// Size of the source image.

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
// #extension ARB_texture_storage : enable
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
// #extension ARB_texture_storage : enable
#define FIGURE_SHADER

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
// #extension GL_ARB_texture_storage : require
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <globals.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <globals.glsl>
#include <constants.glsl>

View File

@ -1,4 +1,4 @@
#version 420 core
#version 430 core
#include <globals.glsl>

View File

@ -14,6 +14,7 @@ use super::{
};
use common_base::{prof_span, prof_span_alloc};
use std::sync::Arc;
use tracing::warn;
/// All the pipelines
pub struct Pipelines {
@ -401,6 +402,13 @@ fn create_shader_module(
.compile_into_spirv(source, kind, file_name, "main", Some(options))
.map_err(|e| (file_name, e))?;
if spv.get_num_warnings() > 0 {
warn!(
"shaderc emitted compilation warnings for {file_name}:\n\n{}",
spv.get_warning_messages()
);
}
let label = [file_name, "\n\n", source].concat();
Ok(device.create_shader_module(&wgpu::ShaderModuleDescriptor {
label: Some(&label),