From 9d5c3fc12b05d944508ef4e3b1f2ddc4f23c0a82 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 10 Nov 2016 22:36:39 -0800 Subject: i965/gs: Allow primitive id to be a system value This allows for gl_PrimitiveId to come in as a system value rather than as an input. This is the way it will come in from SPIR-V. We keeps the input path working for now so we don't break GL. Reviewed-by: Kenneth Graunke Cc: "13.0" (cherry picked from commit a5e88e66e633aaeb587b274d80e21cd46c8ee2cb) [Emil Velikov: nir_shader::info is not a pointer in branch] Signed-off-by: Emil Velikov Conflicts: src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp --- src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp index 59c7d21..b0ee289 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp @@ -626,7 +626,8 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data, shader = brw_postprocess_nir(shader, compiler->devinfo, is_scalar); prog_data->include_primitive_id = - (shader->info.inputs_read & VARYING_BIT_PRIMITIVE_ID) != 0; + (shader->info.inputs_read & VARYING_BIT_PRIMITIVE_ID) || + (shader->info.system_values_read & (1 << SYSTEM_VALUE_PRIMITIVE_ID)); prog_data->invocations = shader->info.gs.invocations; -- cgit v1.1 From e3fe51dbeee6f9d7520e99ac83efcc57646a2253 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 5 Nov 2016 15:28:37 +0100 Subject: Fix races during _mesa_HashWalk(). There is currently no protection against walking a hash (using _mesa_HashWalk()) and modifying it at the same time, for instance by inserting or deleting elements. This leads to segfaults in multithreaded code if e.g. someone calls glTexImage2D (which may have to walk the list of FBOs) while another thread is calling glDeleteFramebuffers on another thread with the two contexts sharing lists. The reason for this is that _mesa_HashWalk() doesn't actually take the mutex that normally protects the hash; it takes an entirely different mutex. Thus, walks are only protected against other walks, and there is also no outer lock taking this. There is an old comment saying that this is to fix problems with deadlock if the callback needs to take a mutex; we solve this by changing the mutex to be recursive. A demonstration Helgrind hit from a real application: ==13412== Possible data race during write of size 8 at 0x3498C6A8 by thread #1 ==13412== Locks held: 2, at addresses 0x1AF09530 0x2B3DF400 ==13412== at 0x1F040C99: _mesa_hash_table_remove (hash_table.c:395) ==13412== by 0x1EE98174: _mesa_HashRemove_unlocked (hash.c:350) ==13412== by 0x1EE98174: _mesa_HashRemove (hash.c:365) ==13412== by 0x1EE2372D: _mesa_DeleteFramebuffers (fbobject.c:2669) ==13412== by 0x6105AA4: movit::ResourcePool::cleanup_unlinked_fbos(void*) (resource_pool.cpp:473) ==13412== by 0x610615B: movit::ResourcePool::release_fbo(unsigned int) (resource_pool.cpp:442) [...] ==13412== This conflicts with a previous read of size 8 by thread #20 ==13412== Locks held: 2, at addresses 0x1AF09558 0x1AF73318 ==13412== at 0x1F040CD9: _mesa_hash_table_next_entry (hash_table.c:415) ==13412== by 0x1EE982A8: _mesa_HashWalk (hash.c:426) ==13412== by 0x1EED6DFD: _mesa_update_fbo_texture.part.33 (teximage.c:2683) ==13412== by 0x1EED9410: _mesa_update_fbo_texture (teximage.c:3043) ==13412== by 0x1EED9410: teximage (teximage.c:3073) ==13412== by 0x1EEDA28F: _mesa_TexImage2D (teximage.c:3105) ==13412== by 0x166A68: operator() (mixer.cpp:454) There are many more interactions than just these two possible. Cc: 11.2 12.0 13.0 Signed-off-by: Steinar H. Gunderson Reviewed-by: Timothy Arceri (cherry picked from commit 2e2562cabbe9a1d3fb997ccaccc20ba31b2006c3) --- src/mesa/main/hash.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/hash.c b/src/mesa/main/hash.c index 7d8a5fd..670438a 100644 --- a/src/mesa/main/hash.c +++ b/src/mesa/main/hash.c @@ -59,7 +59,6 @@ struct _mesa_HashTable { struct hash_table *ht; GLuint MaxKey; /**< highest key inserted so far */ mtx_t Mutex; /**< mutual exclusion lock */ - mtx_t WalkMutex; /**< for _mesa_HashWalk() */ GLboolean InDeleteAll; /**< Debug check */ /** Value that would be in the table for DELETED_KEY_VALUE. */ void *deleted_key_data; @@ -129,8 +128,11 @@ _mesa_NewHashTable(void) } _mesa_hash_table_set_deleted_key(table->ht, uint_key(DELETED_KEY_VALUE)); - mtx_init(&table->Mutex, mtx_plain); - mtx_init(&table->WalkMutex, mtx_plain); + /* + * Needs to be recursive, since the callback in _mesa_HashWalk() + * is allowed to call _mesa_HashRemove(). + */ + mtx_init(&table->Mutex, mtx_recursive); } else { _mesa_error_no_memory(__func__); @@ -161,7 +163,6 @@ _mesa_DeleteHashTable(struct _mesa_HashTable *table) _mesa_hash_table_destroy(table->ht, NULL); mtx_destroy(&table->Mutex); - mtx_destroy(&table->WalkMutex); free(table); } @@ -401,11 +402,6 @@ _mesa_HashDeleteAll(struct _mesa_HashTable *table, /** * Walk over all entries in a hash table, calling callback function for each. - * Note: we use a separate mutex in this function to avoid a recursive - * locking deadlock (in case the callback calls _mesa_HashRemove()) and to - * prevent multiple threads/contexts from getting tangled up. - * A lock-less version of this function could be used when the table will - * not be modified. * \param table the hash table to walk * \param callback the callback function * \param userData arbitrary pointer to pass along to the callback @@ -422,13 +418,13 @@ _mesa_HashWalk(const struct _mesa_HashTable *table, assert(table); assert(callback); - mtx_lock(&table2->WalkMutex); + mtx_lock(&table2->Mutex); hash_table_foreach(table->ht, entry) { callback((uintptr_t)entry->key, entry->data, userData); } if (table->deleted_key_data) callback(DELETED_KEY_VALUE, table->deleted_key_data, userData); - mtx_unlock(&table2->WalkMutex); + mtx_unlock(&table2->Mutex); } static void -- cgit v1.1 From 747052ee188fc17ee282ee26311187f131a7adfe Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 16 Nov 2016 20:24:25 -0800 Subject: i965: Fix compute shader crash. Fixes crashes when starting Deus Ex: Mankind Divided. Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Kenneth Graunke Reviewed-by: Anuj Phogat (cherry picked from commit ca76e6b5213c92432b9f3a641cb26f5861d53e09) --- src/mesa/drivers/dri/i965/brw_cs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c index e7dcf47..c4493d4 100644 --- a/src/mesa/drivers/dri/i965/brw_cs.c +++ b/src/mesa/drivers/dri/i965/brw_cs.c @@ -231,7 +231,7 @@ brw_upload_cs_prog(struct brw_context *brw) &brw->cs.base.prog_data)) { bool success = brw_codegen_cs_prog(brw, - ctx->Shader.CurrentProgram[MESA_SHADER_COMPUTE], + ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE], cp, &key); (void) success; assert(success); -- cgit v1.1 From 1809f17bda56d4f9d6385f63a9c4a5df890e3cad Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 15 Nov 2016 11:53:33 -0800 Subject: mesa: Drop PATH_MAX usage. GNU/Hurd does not define PATH_MAX since it doesn't have such arbitrary limitation, so this failed to compile. Apparently glibc does not enforce PATH_MAX restrictions anyway, so it's kind of a hoax: https://www.gnu.org/software/libc/manual/html_node/Limits-for-Files.html MSVC uses a different name (_MAX_PATH) as well, which is annoying. We don't really need it. We can simply asprintf() the filenames. If the filename exceeds an OS path limit, presumably fopen() will fail, and we already check that. (We actually use ralloc_asprintf because Mesa provides that everywhere, and it doesn't look like we've provided an implementation of GNU's asprintf() for all platforms.) Fixes the build on GNU/Hurd. Cc: "13.0" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98632 Signed-off-by: Samuel Thibault Signed-off-by: Kenneth Graunke Reviewed-by: Emil Velikov (cherry picked from commit 9bfee7047b70cb0aa026ca9536465762f96cb2b1) [Emil Velikov: s|prog->Id|base->Id|] Signed-off-by: Emil Velikov Conflicts: src/mesa/main/arbprogram.c --- src/mesa/main/arbprogram.c | 12 ++++-------- src/mesa/main/shaderapi.c | 37 +++++++++++-------------------------- 2 files changed, 15 insertions(+), 34 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index 911b6fa..53bd5e3 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -41,11 +41,6 @@ #include "program/program.h" #include "program/prog_print.h" -#ifdef _MSC_VER -#include -#define PATH_MAX _MAX_PATH -#endif - /** * Bind a program (make it current) * \note Called from the GL API dispatcher by both glBindProgramNV @@ -388,12 +383,12 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const char *capture_path = _mesa_get_shader_capture_path(); if (capture_path != NULL) { FILE *file; - char filename[PATH_MAX]; const char *shader_type = target == GL_FRAGMENT_PROGRAM_ARB ? "fragment" : "vertex"; + char *filename = + ralloc_asprintf(NULL, "%s/%cp-%u.shader_test", + capture_path, shader_type[0], base->Id); - _mesa_snprintf(filename, sizeof(filename), "%s/%cp-%u.shader_test", - capture_path, shader_type[0], base->Id); file = fopen(filename, "w"); if (file) { fprintf(file, @@ -403,6 +398,7 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, } else { _mesa_warning(ctx, "Failed to open %s", filename); } + ralloc_free(filename); } } diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index c40bb2d..2ed47f0 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -60,11 +60,6 @@ #include "util/hash_table.h" #include "util/mesa-sha1.h" -#ifdef _MSC_VER -#include -#define PATH_MAX _MAX_PATH -#endif - /** * Return mask of GLSL_x flags by examining the MESA_GLSL env var. */ @@ -112,13 +107,6 @@ _mesa_get_shader_capture_path(void) if (!read_env_var) { path = getenv("MESA_SHADER_CAPTURE_PATH"); read_env_var = true; - if (path && - strlen(path) > PATH_MAX - strlen("/fp-4294967295.shader_test")) { - GET_CURRENT_CONTEXT(ctx); - _mesa_warning(ctx, "MESA_SHADER_CAPTURE_PATH too long; ignoring " - "request to capture shaders"); - path = NULL; - } } return path; @@ -1101,11 +1089,8 @@ _mesa_link_program(struct gl_context *ctx, struct gl_shader_program *shProg) const char *capture_path = _mesa_get_shader_capture_path(); if (shProg->Name != 0 && shProg->Name != ~0 && capture_path != NULL) { FILE *file; - char filename[PATH_MAX]; - - _mesa_snprintf(filename, sizeof(filename), "%s/%u.shader_test", - capture_path, shProg->Name); - + char *filename = ralloc_asprintf(NULL, "%s/%u.shader_test", + capture_path, shProg->Name); file = fopen(filename, "w"); if (file) { fprintf(file, "[require]\nGLSL%s >= %u.%02u\n", @@ -1124,6 +1109,8 @@ _mesa_link_program(struct gl_context *ctx, struct gl_shader_program *shProg) } else { _mesa_warning(ctx, "Failed to open %s", filename); } + + ralloc_free(filename); } if (shProg->LinkStatus == GL_FALSE && @@ -1618,9 +1605,9 @@ generate_sha1(const char *source, char sha_str[64]) * * /_.glsl */ -static void +static char * construct_name(const gl_shader_stage stage, const char *source, - const char *path, char *name, unsigned length) + const char *path) { char sha[64]; static const char *types[] = { @@ -1628,8 +1615,7 @@ construct_name(const gl_shader_stage stage, const char *source, }; generate_sha1(source, sha); - _mesa_snprintf(name, length, "%s/%s_%s.glsl", path, types[stage], - sha); + return ralloc_asprintf(NULL, "%s/%s_%s.glsl", path, types[stage], sha); } /** @@ -1638,7 +1624,6 @@ construct_name(const gl_shader_stage stage, const char *source, static void dump_shader(const gl_shader_stage stage, const char *source) { - char name[PATH_MAX]; static bool path_exists = true; char *dump_path; FILE *f; @@ -1652,7 +1637,7 @@ dump_shader(const gl_shader_stage stage, const char *source) return; } - construct_name(stage, source, dump_path, name, PATH_MAX); + char *name = construct_name(stage, source, dump_path); f = fopen(name, "w"); if (f) { @@ -1663,6 +1648,7 @@ dump_shader(const gl_shader_stage stage, const char *source) _mesa_warning(ctx, "could not open %s for dumping shader (%s)", name, strerror(errno)); } + ralloc_free(name); } /** @@ -1672,7 +1658,6 @@ dump_shader(const gl_shader_stage stage, const char *source) static GLcharARB * read_shader(const gl_shader_stage stage, const char *source) { - char name[PATH_MAX]; char *read_path; static bool path_exists = true; int len, shader_size = 0; @@ -1688,9 +1673,9 @@ read_shader(const gl_shader_stage stage, const char *source) return NULL; } - construct_name(stage, source, read_path, name, PATH_MAX); - + char *name = construct_name(stage, source, read_path); f = fopen(name, "r"); + ralloc_free(name); if (!f) return NULL; -- cgit v1.1 From 8691daef62d3a40014757426c3f25960095b8d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 17 Aug 2016 10:37:45 +0300 Subject: mesa: fix empty program log length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case we have empty log (""), we should return 0. This fixes Khronos WebGL conformance test 'program-infolog'. From OpenGL ES 3.1 (and OpenGL 4.5 Core) spec: "If pname is INFO_LOG_LENGTH , the length of the info log, including a null terminator, is returned. If there is no info log, zero is returned." v2: apply same fix for get_shaderiv and _mesa_GetProgramPipelineiv (Ian) Signed-off-by: Tapani Pälli Reviewed-by: Iago Toral Quiroga (v1) Reviewed-by: Ian Romanick Reviewed-by: Nicolai Hähnle Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97321 Cc: "13.0" (cherry picked from commit ec4e71f75e9b8a1c427994efa32a61593e3172f9) --- src/mesa/main/pipelineobj.c | 3 ++- src/mesa/main/shaderapi.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c index 8229840..310b745 100644 --- a/src/mesa/main/pipelineobj.c +++ b/src/mesa/main/pipelineobj.c @@ -645,7 +645,8 @@ _mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) *params = pipe->ActiveProgram ? pipe->ActiveProgram->Name : 0; return; case GL_INFO_LOG_LENGTH: - *params = pipe->InfoLog ? strlen(pipe->InfoLog) + 1 : 0; + *params = (pipe->InfoLog && pipe->InfoLog[0] != '\0') ? + strlen(pipe->InfoLog) + 1 : 0; return; case GL_VALIDATE_STATUS: *params = pipe->Validated; diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 2ed47f0..15f324b 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -642,7 +642,8 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, *params = shProg->Validated; return; case GL_INFO_LOG_LENGTH: - *params = shProg->InfoLog ? strlen(shProg->InfoLog) + 1 : 0; + *params = (shProg->InfoLog && shProg->InfoLog[0] != '\0') ? + strlen(shProg->InfoLog) + 1 : 0; return; case GL_ATTACHED_SHADERS: *params = shProg->NumShaders; @@ -890,7 +891,8 @@ get_shaderiv(struct gl_context *ctx, GLuint name, GLenum pname, GLint *params) *params = shader->CompileStatus; break; case GL_INFO_LOG_LENGTH: - *params = shader->InfoLog ? strlen(shader->InfoLog) + 1 : 0; + *params = (shader->InfoLog && shader->InfoLog[0] != '\0') ? + strlen(shader->InfoLog) + 1 : 0; break; case GL_SHADER_SOURCE_LENGTH: *params = shader->Source ? strlen((char *) shader->Source) + 1 : 0; -- cgit v1.1 From 3c9e8660e936cb8e2d4dd44066d038cda0e664ef Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 14 Nov 2016 15:59:57 -0800 Subject: i965: Fix GS push inputs with enhanced layouts. We weren't taking first_component into account when handling GS push inputs. We hardly ever push GS inputs, so this was not caught by existing tests. When I started using component qualifiers for the gl_ClipDistance arrays, glsl-1.50-transform-feedback-type-and-size started catching this. Cc: "13.0" Signed-off-by: Kenneth Graunke Reviewed-by: Jason Ekstrand (cherry picked from commit c4be6e0b8d91746eccf334b9e20861af4036d06a) --- src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 4baadc9..e4102c6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -1984,7 +1984,7 @@ fs_visitor::emit_gs_input_load(const fs_reg &dst, } else { for (unsigned i = 0; i < num_components; i++) { bld.MOV(offset(dst, bld, i), - fs_reg(ATTR, imm_offset + i, dst.type)); + fs_reg(ATTR, imm_offset + i + first_component, dst.type)); } } return; -- cgit v1.1 From d6964bbf54a526d4a28ff88c61349eb24a64af6f Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sat, 19 Nov 2016 14:52:29 -0800 Subject: i965/hsw: Set integer mode in sampling state for stencil texturing Fixes: ES31-CTS.functional.texture.border_clamp.formats.depth24_stencil8_sample_stencil.nearest_size_pot ES31-CTS.functional.texture.border_clamp.formats.depth24_stencil8_sample_stencil.nearest_size_npot ES31-CTS.functional.texture.border_clamp.formats.depth32f_stencil8_sample_stencil.nearest_size_pot ES31-CTS.functional.texture.border_clamp.formats.depth32f_stencil8_sample_stencil.nearest_size_npot ES31-CTS.functional.texture.border_clamp.unused_channels.depth24_stencil8_sample_stencil ES31-CTS.functional.texture.border_clamp.unused_channels.depth32f_stencil8_sample_stencil Cc: "13.0" Signed-off-by: Jordan Justen Reviewed-by: Jason Ekstrand (cherry picked from commit 44c5ed02d1b173c061c3188e245d384fd4c0abba) --- src/mesa/drivers/dri/i965/brw_sampler_state.c | 18 +++++++++--------- src/mesa/drivers/dri/i965/brw_state.h | 9 --------- 2 files changed, 9 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_sampler_state.c b/src/mesa/drivers/dri/i965/brw_sampler_state.c index 0eed8f9..b649072 100644 --- a/src/mesa/drivers/dri/i965/brw_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_sampler_state.c @@ -213,7 +213,7 @@ static void upload_default_color(struct brw_context *brw, const struct gl_sampler_object *sampler, mesa_format format, GLenum base_format, - bool is_integer_format, + bool is_integer_format, bool is_stencil_sampling, uint32_t *sdc_offset) { union gl_color_union color; @@ -277,7 +277,7 @@ upload_default_color(struct brw_context *brw, uint32_t *sdc = brw_state_batch(brw, AUB_TRACE_SAMPLER_DEFAULT_COLOR, 4 * 4, 64, sdc_offset); memcpy(sdc, color.ui, 4 * 4); - } else if (brw->is_haswell && is_integer_format) { + } else if (brw->is_haswell && (is_integer_format || is_stencil_sampling)) { /* Haswell's integer border color support is completely insane: * SAMPLER_BORDER_COLOR_STATE is 20 DWords. The first four are * for float colors. The next 12 DWords are MBZ and only exist to @@ -291,10 +291,9 @@ upload_default_color(struct brw_context *brw, memset(sdc, 0, 20 * 4); sdc = &sdc[16]; + bool stencil = format == MESA_FORMAT_S_UINT8 || is_stencil_sampling; const int bits_per_channel = - _mesa_get_format_bits(format, - format == MESA_FORMAT_S_UINT8 ? - GL_STENCIL_BITS : GL_RED_BITS); + _mesa_get_format_bits(format, stencil ? GL_STENCIL_BITS : GL_RED_BITS); /* From the Haswell PRM, "Command Reference: Structures", Page 36: * "If any color channel is missing from the surface format, @@ -389,12 +388,13 @@ upload_default_color(struct brw_context *brw, * Sets the sampler state for a single unit based off of the sampler key * entry. */ -void +static void brw_update_sampler_state(struct brw_context *brw, GLenum target, bool tex_cube_map_seamless, GLfloat tex_unit_lod_bias, mesa_format format, GLenum base_format, bool is_integer_format, + bool is_stencil_sampling, const struct gl_sampler_object *sampler, uint32_t *sampler_state, uint32_t batch_offset_for_sampler_state) @@ -516,8 +516,8 @@ brw_update_sampler_state(struct brw_context *brw, if (wrap_mode_needs_border_color(wrap_s) || wrap_mode_needs_border_color(wrap_t) || wrap_mode_needs_border_color(wrap_r)) { - upload_default_color(brw, sampler, - format, base_format, is_integer_format, + upload_default_color(brw, sampler, format, base_format, + is_integer_format, is_stencil_sampling, &border_color_offset); } @@ -555,7 +555,7 @@ update_sampler_state(struct brw_context *brw, brw_update_sampler_state(brw, texObj->Target, ctx->Texture.CubeMapSeamless, texUnit->LodBias, firstImage->TexFormat, firstImage->_BaseFormat, - texObj->_IsIntegerFormat, + texObj->_IsIntegerFormat, texObj->StencilSampling, sampler, sampler_state, batch_offset_for_sampler_state); } diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index b42b9af..b8aa97b 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -337,15 +337,6 @@ void brw_emit_sampler_state(struct brw_context *brw, bool non_normalized_coordinates, uint32_t border_color_offset); -void brw_update_sampler_state(struct brw_context *brw, - GLenum target, bool tex_cube_map_seamless, - GLfloat tex_unit_lod_bias, - mesa_format format, GLenum base_format, - bool is_integer_format, - const struct gl_sampler_object *sampler, - uint32_t *sampler_state, - uint32_t batch_offset_for_sampler_state); - /* gen6_wm_state.c */ void gen6_upload_wm_state(struct brw_context *brw, -- cgit v1.1