What is the cause of compile problems after 4.0?
- luluco250
- Topic Author
I'm still trying to figure out how to fix this, if someone could help I'd appreciate it.
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
crosire wrote: That happens if you use more than the allowed number of samplers in your effect in some APIs. Nothing new with the new compiler there, except that ReShade 4 defines creates separate sampler bindings for each effect, so this is even less likely to occur than before. If you don't use that many samplers, then that's a bug. Which API does this occur with?
It's happening to me with DirectX 11 in Deus Ex: Mankind Divided. I don't think it's only happening in this game, someone commented on my repo that the same problem was happening to them. Dunno if that's a DirectX 11-only problem, but I don't think it was happening in ReShade 3.x.x.
More specifically, it's Arcane Bloom, which was working fine before. I'm trying to figure out if I'm using too many samplers, but I shouldn't be, I don't think so.
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
#if ARCANE_BLOOM_USE_ADAPTATION
texture2D tArcaneBloom_Small {
Width = 1024;
Height = 1024;
Format = R32F;
MipLevels = 11;
};
sampler2D sSmall {
Texture = tArcaneBloom_Small;
};
texture2D tArcaneBloom_LastAdapt {
Format = R32F;
};
sampler2D sLastAdapt {
Texture = tArcaneBloom_LastAdapt;
MinFilter = POINT;
MagFilter = POINT;
MipFilter = POINT;
AddressU = CLAMP;
AddressV = CLAMP;
AddressW = CLAMP;
};
#endif
My guess is that the adaptation code adding more samplers is causing the problem, but it's still weird since this wasn't a problem in ReShade 3.x.x.
Please Log in or Create an account to join the conversation.
- crosire
Will try and come up with a solution.
Please Log in or Create an account to join the conversation.
- crosire
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
crosire wrote: Fixed for D3D10 and 11 in github.com/crosire/reshade/commit/aa0c37...07ae89056108f84ee157 . It will continue to not work in D3D9 though.
Wow thanks, but I'll try to slim down my sampler usage then, I think I can remove one bloom texture without it making much difference.
But still, it's good that DXGI behavior will work as it should, but I want to support D3D9 too so I'll have to optimize.
Again, thanks for the help!
Please Log in or Create an account to join the conversation.
- Wicked Sick
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
ReShade.fxh
// Global variables
#if defined(__RESHADE_FXC__)
float GetAspectRatio() { return BUFFER_WIDTH * BUFFER_RCP_HEIGHT; }
float2 GetPixelSize() { return float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT); }
float2 GetScreenSize() { return float2(BUFFER_WIDTH, BUFFER_HEIGHT); }
#define AspectRatio GetAspectRatio()
#define PixelSize GetPixelSize()
#define ScreenSize GetScreenSize()
#else
static const float AspectRatio = BUFFER_WIDTH * BUFFER_RCP_HEIGHT;
static const float2 PixelSize = float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT);
static const float2 ScreenSize = float2(BUFFER_WIDTH, BUFFER_HEIGHT);
#endif
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
Please Log in or Create an account to join the conversation.
- crosire
It's for a standalone compiler, where the BUFFER_WIDTH and BUFFER_HEIGHT defines are not actual defines, but uniform variables. This is not currently in-use by ReShade itself.luluco250 wrote: I'm curious about the meaning of this "__RESHADE_FXC__" macro and if I should replicate it.
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
crosire wrote: It's for a standalone compiler, where the BUFFER_WIDTH and BUFFER_HEIGHT defines are not actual defines, but uniform variables. This is not currently in-use by ReShade itself.
Oh I see, I guess I'll replicate it exactly as it is just to be safe then.
Please Log in or Create an account to join the conversation.
- OtisInf
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
OtisInf wrote: Can't you use mipmaps in this situation? That would give you more headroom wrt the # of samplers. (Disc: I'm not a mipmap expert so it might be mipmaps can only be a power of 2)
I've tested this before and the quality isn't great, mipmaps are too stretchy and blocky for high quality bloom.
Please Log in or Create an account to join the conversation.
- OtisInf
Please Log in or Create an account to join the conversation.
- luluco250
- Topic Author
Please Log in or Create an account to join the conversation.