Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-03-03 23:10:55 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-03-18 22:53:52 +0300
commit3f484c502f3efe3f04b359a196034827d46fd9b9 (patch)
treede6de2102a8a542909bbe04d3c72595bfaa6a79f /source/blender/gpu/intern/gpu_shader_create_info.hh
parent0f08453ea9216c3cd957c17278a7158c98525219 (diff)
GPUShaderCreateInfo: Add explicit early_fragment_test
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader_create_info.hh')
-rw-r--r--source/blender/gpu/intern/gpu_shader_create_info.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_shader_create_info.hh b/source/blender/gpu/intern/gpu_shader_create_info.hh
index da63d372669..9984295457c 100644
--- a/source/blender/gpu/intern/gpu_shader_create_info.hh
+++ b/source/blender/gpu/intern/gpu_shader_create_info.hh
@@ -271,6 +271,8 @@ struct ShaderCreateInfo {
bool finalized_ = false;
/** If true, all resources will have an automatic location assigned. */
bool auto_resource_location_ = false;
+ /** If true, force depth and stencil tests to always happen before fragment shader invocation. */
+ bool early_fragment_test_ = false;
/**
* Maximum length of all the resource names including each null terminator.
* Only for names used by gpu::ShaderInterface.
@@ -522,6 +524,16 @@ struct ShaderCreateInfo {
}
/**
+ * Force fragment tests before fragment shader invocation.
+ * IMPORTANT: This is incompatible with using the gl_FragDepth output.
+ */
+ Self &early_fragment_test(bool enable)
+ {
+ early_fragment_test_ = enable;
+ return *(Self *)this;
+ }
+
+ /**
* Only needed if geometry shader is enabled.
* IMPORTANT: Input and output instance name will have respectively "_in" and "_out" suffix
* appended in the geometry shader IF AND ONLY IF the vertex_out interface instance name matches