summaryrefslogtreecommitdiff
path: root/src/intel/compiler/brw_fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/compiler/brw_fs.cpp')
-rw-r--r--src/intel/compiler/brw_fs.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index eb9b4c3890..d3d2d3dd42 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -2082,6 +2082,12 @@ fs_visitor::assign_constant_locations()
if (thread_local_id_index >= 0)
push_constant_loc[thread_local_id_index] = num_push_constants++;
+ if (stage == MESA_SHADER_FRAGMENT && num_push_constants == 0 &&
+ force_enable_push_constants) {
+ assert(uniforms == 0);
+ num_push_constants = 1;
+ }
+
/* As the uniforms are going to be reordered, take the data from a temporary
* copy of the original param[].
*/
@@ -6505,7 +6511,8 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
struct gl_program *prog,
int shader_time_index8, int shader_time_index16,
bool allow_spilling,
- bool use_rep_send, struct brw_vue_map *vue_map,
+ bool use_rep_send, bool force_enable_push_constants,
+ struct brw_vue_map *vue_map,
unsigned *final_assembly_size,
char **error_str)
{
@@ -6560,6 +6567,7 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
fs_visitor v8(compiler, log_data, mem_ctx, key,
&prog_data->base, prog, shader, 8,
shader_time_index8);
+ v8.force_enable_push_constants = force_enable_push_constants;
if (!v8.run_fs(allow_spilling, false /* do_rep_send */)) {
if (error_str)
*error_str = ralloc_strdup(mem_ctx, v8.fail_msg);
@@ -6577,6 +6585,7 @@ brw_compile_fs(const struct brw_compiler *compiler, void *log_data,
fs_visitor v16(compiler, log_data, mem_ctx, key,
&prog_data->base, prog, shader, 16,
shader_time_index16);
+ v16.force_enable_push_constants = force_enable_push_constants;
v16.import_uniforms(&v8);
if (!v16.run_fs(allow_spilling, use_rep_send)) {
compiler->shader_perf_log(log_data,