mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 11:20:11 +01:00
st/glsl_to_nir: run lower_output_reads on !PIPE_CAP_TGSI_CAN_READ_OUTPUTS
this is required for Drivers which don't allow reading from outputs. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Signed-off-by: Karol Herbst <kherbst@redhat.com>
This commit is contained in:
parent
a77cb724da
commit
04b443104d
1 changed files with 6 additions and 0 deletions
|
|
@ -45,6 +45,7 @@
|
||||||
#include "compiler/glsl/glsl_to_nir.h"
|
#include "compiler/glsl/glsl_to_nir.h"
|
||||||
#include "compiler/glsl/gl_nir.h"
|
#include "compiler/glsl/gl_nir.h"
|
||||||
#include "compiler/glsl/ir.h"
|
#include "compiler/glsl/ir.h"
|
||||||
|
#include "compiler/glsl/ir_optimization.h"
|
||||||
#include "compiler/glsl/string_to_uint_map.h"
|
#include "compiler/glsl/string_to_uint_map.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -563,6 +564,7 @@ st_nir_get_mesa_program(struct gl_context *ctx,
|
||||||
struct gl_linked_shader *shader)
|
struct gl_linked_shader *shader)
|
||||||
{
|
{
|
||||||
struct st_context *st = st_context(ctx);
|
struct st_context *st = st_context(ctx);
|
||||||
|
struct pipe_screen *pscreen = ctx->st->pipe->screen;
|
||||||
struct gl_program *prog;
|
struct gl_program *prog;
|
||||||
|
|
||||||
validate_ir_tree(shader->ir);
|
validate_ir_tree(shader->ir);
|
||||||
|
|
@ -575,6 +577,10 @@ st_nir_get_mesa_program(struct gl_context *ctx,
|
||||||
_mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader,
|
_mesa_generate_parameters_list_for_uniforms(ctx, shader_program, shader,
|
||||||
prog->Parameters);
|
prog->Parameters);
|
||||||
|
|
||||||
|
/* Remove reads from output registers. */
|
||||||
|
if (!pscreen->get_param(pscreen, PIPE_CAP_TGSI_CAN_READ_OUTPUTS))
|
||||||
|
lower_output_reads(shader->Stage, shader->ir);
|
||||||
|
|
||||||
if (ctx->_Shader->Flags & GLSL_DUMP) {
|
if (ctx->_Shader->Flags & GLSL_DUMP) {
|
||||||
_mesa_log("\n");
|
_mesa_log("\n");
|
||||||
_mesa_log("GLSL IR for linked %s program %d:\n",
|
_mesa_log("GLSL IR for linked %s program %d:\n",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue