mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-18 16:21:39 +00:00
Support Sampler binding in the shader.
In the cases where we support the binding layout keyword, use it for more than binding UBO location. This changes it so it is supported for samplers as well. Instances when this is enabled is if a device supports GL_ARB_shading_language_420pack, or if it supports GLES 3.10.
This commit is contained in:
parent
b9dc69105d
commit
bc9ef95643
51 changed files with 76 additions and 75 deletions
|
@ -169,7 +169,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
|||
{
|
||||
// non-msaa, so just fetch the pixel
|
||||
sampler =
|
||||
"uniform sampler2D samp9;\n"
|
||||
"SAMPLER_BINDING(9) uniform sampler2D samp9;\n"
|
||||
"vec4 sampleEFB(ivec2 pos) {\n"
|
||||
" return texelFetch(samp9, pos, 0);\n"
|
||||
"}\n";
|
||||
|
@ -180,7 +180,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
|||
// This will lead to sample shading, but it's the only way to not loose
|
||||
// the values of each sample.
|
||||
sampler =
|
||||
"uniform sampler2DMS samp9;\n"
|
||||
"SAMPLER_BINDING(9) uniform sampler2DMS samp9;\n"
|
||||
"vec4 sampleEFB(ivec2 pos) {\n"
|
||||
" return texelFetch(samp9, pos, gl_SampleID);\n"
|
||||
"}\n";
|
||||
|
@ -191,7 +191,7 @@ FramebufferManager::FramebufferManager(int targetWidth, int targetHeight, int ms
|
|||
std::stringstream samples;
|
||||
samples << m_msaaSamples;
|
||||
sampler =
|
||||
"uniform sampler2DMS samp9;\n"
|
||||
"SAMPLER_BINDING(9) uniform sampler2DMS samp9;\n"
|
||||
"vec4 sampleEFB(ivec2 pos) {\n"
|
||||
" vec4 color = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
||||
" for(int i=0; i<" + samples.str() + "; i++)\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue