vulkan: unify Tex/OutColorManagementData
This commit is contained in:
parent
05bf029a55
commit
a2e089d9e3
6 changed files with 31 additions and 31 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#define EOTFS_GLSL
|
||||
|
||||
#include "frag_spec_const.glsl"
|
||||
#include "tex_set.glsl"
|
||||
|
||||
#define TF_LINEAR 1
|
||||
#define TF_ST2084_PQ 2
|
||||
|
|
|
|||
|
|
@ -3,18 +3,17 @@
|
|||
#extension GL_EXT_samplerless_texture_functions : require
|
||||
#extension GL_EXT_scalar_block_layout : require
|
||||
|
||||
#include "frag_spec_const.glsl"
|
||||
#include "eotfs.glsl"
|
||||
#include "out.common.glsl"
|
||||
#define TEX_SET 0
|
||||
|
||||
#include "frag_spec_const.glsl"
|
||||
#include "out.common.glsl"
|
||||
#include "tex_set.glsl"
|
||||
#include "eotfs.glsl"
|
||||
|
||||
layout(set = 0, binding = 0) uniform texture2D in_color;
|
||||
layout(set = 0, binding = 1, row_major, std430) uniform ColorManagementData {
|
||||
mat4x4 matrix;
|
||||
} cm_data;
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
void main() {
|
||||
vec4 c = texelFetch(in_color, ivec2(gl_FragCoord.xy), 0);
|
||||
vec4 c = texelFetch(tex, ivec2(gl_FragCoord.xy), 0);
|
||||
if (eotf != inv_eotf || has_matrix) {
|
||||
vec3 rgb = c.rgb;
|
||||
rgb /= mix(c.a, 1.0, c.a == 0.0);
|
||||
|
|
|
|||
|
|
@ -2,15 +2,14 @@
|
|||
|
||||
#extension GL_EXT_scalar_block_layout : require
|
||||
|
||||
#define TEX_SET 1
|
||||
|
||||
#include "frag_spec_const.glsl"
|
||||
#include "eotfs.glsl"
|
||||
#include "tex.common.glsl"
|
||||
#include "tex_set.glsl"
|
||||
#include "eotfs.glsl"
|
||||
|
||||
layout(set = 0, binding = 0) uniform sampler sam;
|
||||
layout(set = 1, binding = 0) uniform texture2D tex;
|
||||
layout(set = 1, binding = 1, row_major, std430) uniform ColorManagementData {
|
||||
mat4x4 matrix;
|
||||
} cm_data;
|
||||
layout(location = 0) in vec2 tex_pos;
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
|
|
|
|||
9
src/gfx_apis/vulkan/shaders/tex_set.glsl
Normal file
9
src/gfx_apis/vulkan/shaders/tex_set.glsl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef TEX_SET_GLSL
|
||||
#define TEX_SET_GLSL
|
||||
|
||||
layout(set = TEX_SET, binding = 0) uniform texture2D tex;
|
||||
layout(set = TEX_SET, binding = 1, row_major, std430) uniform ColorManagementData {
|
||||
mat4x4 matrix;
|
||||
} cm_data;
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue