X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fopengl%2Fpipelinestate_backend.cpp;h=8ffa47fcda75d8ea44e9ff9e74673ca54f43a21a;hb=8f12c5d2527f61183b2ae36aab224eefbf52086a;hp=3b8c6a5ae736c3f33543f9febb1c4b5a17696142;hpb=63458ee3bedacf4d498074fcec15600a4932ae7b;p=libs%2Fgl.git diff --git a/source/backends/opengl/pipelinestate_backend.cpp b/source/backends/opengl/pipelinestate_backend.cpp index 3b8c6a5a..8ffa47fc 100644 --- a/source/backends/opengl/pipelinestate_backend.cpp +++ b/source/backends/opengl/pipelinestate_backend.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -128,7 +129,7 @@ void OpenGLPipelineState::apply() const call.func(call.location, call.size, data+call.location*16); } } - else if(r.type==PipelineState::TEXTURE) + else if(r.type==PipelineState::SAMPLED_TEXTURE) { if(ARB_direct_state_access) glBindTextureUnit(r.binding, r.texture->id); @@ -145,6 +146,14 @@ void OpenGLPipelineState::apply() const glBindSampler(r.binding, r.sampler->id); r.sampler->refresh(); } + else if(r.type==PipelineState::STORAGE_TEXTURE) + { + static Require _req(ARB_shader_image_load_store); + GLenum gl_format = get_gl_pixelformat(r.texture->get_format()); + glBindImageTexture(r.binding, r.texture->id, 0, true, 0, GL_READ_WRITE, gl_format); + + dev_state.bound_storage_textures[r.binding] = 1; + } } r.changed = false; @@ -228,6 +237,11 @@ void OpenGLPipelineState::apply() const glDisable(GL_BLEND); glColorMask(true, true, true, true); } + + if(blend.alpha_to_coverage && self.framebuffer && self.framebuffer->get_format().get_samples()>1) + glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); + else + glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); } applied_to = &device; @@ -260,6 +274,13 @@ void OpenGLPipelineState::clear() dev_state.bound_tex_targets[i] = 0; } + for(unsigned i=0; i