From 7632def9d63849e8ee328f3bfed71f7453cb2c99 Mon Sep 17 00:00:00 2001 From: Gary Sweet Date: Wed, 6 Mar 2019 12:41:13 +0000 Subject: [PATCH] Fix sample count limits in deferredmultisampling The sample count was previously fixed at 8, which is not supported on some platforms. The code now checks for the maximum supported sample count and uses that instead. If you would prefer the upper limit to be fixed at 8, that is obviously trivial to change. --- data/shaders/deferredmultisampling/debug.frag | 2 +- .../deferredmultisampling/debug.frag.spv | Bin 3268 -> 3232 bytes .../deferredmultisampling.cpp | 28 ++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/data/shaders/deferredmultisampling/debug.frag b/data/shaders/deferredmultisampling/debug.frag index 872303f8..29aa0008 100644 --- a/data/shaders/deferredmultisampling/debug.frag +++ b/data/shaders/deferredmultisampling/debug.frag @@ -8,7 +8,7 @@ layout (location = 0) in vec3 inUV; layout (location = 0) out vec4 outFragColor; -#define NUM_SAMPLES 8 +layout (constant_id = 0) const int NUM_SAMPLES = 8; vec4 resolve(sampler2DMS tex, ivec2 uv) { diff --git a/data/shaders/deferredmultisampling/debug.frag.spv b/data/shaders/deferredmultisampling/debug.frag.spv index b334d148778c1283fbd580b2060d6399866eac5a..03e4c9f4e891b6c047a5237c5aecea3f527baa79 100644 GIT binary patch delta 101 zcmX>ixj>SWnMs+Qfq{{MeIjQvKL-N?12YgZ0qH}G3=V~|sPacV(gQDRAI zd~rr%N@`Jjeo|Iya!E0&8lY5WUV3~^VqSV_VtQ)4iIG7;VsiGx>f*^vjPEuv^)NDO ePwr(_7tjV8%?7l@7>I$uaq|}D1ss!8cx(Xme