From 326a82a255c1a72376ce2b7f3d878bfff5cb9621 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 24 Feb 2017 19:24:56 +0100 Subject: mesa: add support for glUniformHandleui64*ARB() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bindless sampler/image handles are represented using 64-bit unsigned integers. The ARB_bindless_texture spec says: "The error INVALID_OPERATION is generated by UniformHandleui64{v}ARB if the sampler or image uniform being updated has the "bound_sampler" or "bound_image" layout qualifier"." Signed-off-by: Samuel Pitoiset Reviewed-by: Nicolai Hähnle --- src/compiler/glsl/ir_uniform.h | 6 ++++++ src/compiler/glsl/link_uniforms.cpp | 1 + src/compiler/glsl/shader_cache.cpp | 2 ++ 3 files changed, 9 insertions(+) (limited to 'src/compiler') diff --git a/src/compiler/glsl/ir_uniform.h b/src/compiler/glsl/ir_uniform.h index b6aec7fc4af..9841df8cde1 100644 --- a/src/compiler/glsl/ir_uniform.h +++ b/src/compiler/glsl/ir_uniform.h @@ -201,6 +201,12 @@ struct gl_uniform_storage { * top-level shader storage block member. (GL_TOP_LEVEL_ARRAY_STRIDE). */ unsigned top_level_array_stride; + + /** + * Whether this uniform variable has the bindless_sampler or bindless_image + * layout qualifier as specified by ARB_bindless_texture. + */ + bool is_bindless; }; #ifdef __cplusplus diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index b11739ce78a..7c3ca75416d 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -754,6 +754,7 @@ private: this->uniforms[id].is_shader_storage = current_var->is_in_shader_storage_block(); + this->uniforms[id].is_bindless = current_var->data.bindless; /* Do not assign storage if the uniform is a builtin or buffer object */ if (!this->uniforms[id].builtin && diff --git a/src/compiler/glsl/shader_cache.cpp b/src/compiler/glsl/shader_cache.cpp index dd56501258c..1ad8fdd62a4 100644 --- a/src/compiler/glsl/shader_cache.cpp +++ b/src/compiler/glsl/shader_cache.cpp @@ -578,6 +578,7 @@ write_uniforms(struct blob *metadata, struct gl_shader_program *prog) blob_write_uint32(metadata, prog->data->UniformStorage[i].is_shader_storage); blob_write_uint32(metadata, prog->data->UniformStorage[i].matrix_stride); blob_write_uint32(metadata, prog->data->UniformStorage[i].row_major); + blob_write_uint32(metadata, prog->data->UniformStorage[i].is_bindless); blob_write_uint32(metadata, prog->data->UniformStorage[i].num_compatible_subroutines); blob_write_uint32(metadata, @@ -642,6 +643,7 @@ read_uniforms(struct blob_reader *metadata, struct gl_shader_program *prog) uniforms[i].is_shader_storage = blob_read_uint32(metadata); uniforms[i].matrix_stride = blob_read_uint32(metadata); uniforms[i].row_major = blob_read_uint32(metadata); + uniforms[i].is_bindless = blob_read_uint32(metadata); uniforms[i].num_compatible_subroutines = blob_read_uint32(metadata); uniforms[i].top_level_array_size = blob_read_uint32(metadata); uniforms[i].top_level_array_stride = blob_read_uint32(metadata); -- cgit v1.2.3