1
0
Fork 0
forked from wry/wry

vulkan: unify Tex/OutColorManagementData

This commit is contained in:
Julian Orth 2025-09-08 18:04:02 +02:00
parent 05bf029a55
commit a2e089d9e3
6 changed files with 31 additions and 31 deletions

View file

@ -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

View file

@ -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);

View file

@ -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;

View 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