Compare commits
30 Commits
mesa-17.3.
...
17.3
Author | SHA1 | Date | |
---|---|---|---|
|
cf0864dc63 | ||
|
6d88ea9dd4 | ||
|
25028e8413 | ||
|
220b67ffa1 | ||
|
83518bf6fa | ||
|
0bb53b38ae | ||
|
5327bc21f3 | ||
|
26aafd84b0 | ||
|
9cd35f8aa6 | ||
|
d0956ec98b | ||
|
dda82e3403 | ||
|
83c9118300 | ||
|
229f9f20b3 | ||
|
b0bcb170b7 | ||
|
90dbec703a | ||
|
95802a9b77 | ||
|
9a38ef9acc | ||
|
542951a9f0 | ||
|
51b4bdc776 | ||
|
34ec708ae8 | ||
|
0773d8e176 | ||
|
2f1cc016e1 | ||
|
ea590a1374 | ||
|
637eae55bc | ||
|
4ca4e879c4 | ||
|
a5c47bf943 | ||
|
ad2e723a4d | ||
|
081e4a1425 | ||
|
25a49b8e7c | ||
|
ba371c7262 |
@@ -176,3 +176,10 @@ fb5825e7ceeb16ac05f870ffe1e5a5daa09e68dd glsl: Fix memory leak with known glsl_t
|
||||
|
||||
# stable: Explicit 18.0 only nominations
|
||||
d77844a5290948a490ce6921c1623d1dd7af6c31 docs: fix 18.0 release note version
|
||||
|
||||
# stable: Explicit 18.0 only nominations
|
||||
1866f76f7bc3ec54b4e91eb7d329b2e6f7b6277c freedreno/a5xx: fix page faults on last level
|
||||
2f175bfe5d8ca59a8a68b6d6d072cd7bf2f8baa9 freedreno/a5xx: don't align height for PIPE_BUFFER
|
||||
|
||||
# fixes: A specific backport of this commit was applied for this branch.
|
||||
4503ff760c794c3bb15b978a47c530037d56498e ac/nir: Add workaround for GFX9 buffer views.
|
||||
|
@@ -88,22 +88,40 @@ This is a work-around for that.
|
||||
<li>MESA_GL_VERSION_OVERRIDE - changes the value returned by
|
||||
glGetString(GL_VERSION) and possibly the GL API type.
|
||||
<ul>
|
||||
<li> The format should be MAJOR.MINOR[FC]
|
||||
<li> FC is an optional suffix that indicates a forward compatible context.
|
||||
This is only valid for versions >= 3.0.
|
||||
<li> GL versions < 3.0 are set to a compatibility (non-Core) profile
|
||||
<li> GL versions = 3.0, see below
|
||||
<li> GL versions > 3.0 are set to a Core profile
|
||||
<li> Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
|
||||
<ul>
|
||||
<li> 2.1 - select a compatibility (non-Core) profile with GL version 2.1
|
||||
<li> 3.0 - select a compatibility (non-Core) profile with GL version 3.0
|
||||
<li> 3.0FC - select a Core+Forward Compatible profile with GL version 3.0
|
||||
<li> 3.1 - select a Core profile with GL version 3.1
|
||||
<li> 3.1FC - select a Core+Forward Compatible profile with GL version 3.1
|
||||
</ul>
|
||||
<li> Mesa may not really implement all the features of the given version.
|
||||
(for developers only)
|
||||
<li>The format should be MAJOR.MINOR[FC|COMPAT]
|
||||
<li>FC is an optional suffix that indicates a forward compatible
|
||||
context. This is only valid for versions >= 3.0.
|
||||
<li>COMPAT is an optional suffix that indicates a compatibility
|
||||
context or GL_ARB_compatibility support. This is only valid for
|
||||
versions >= 3.1.
|
||||
<li>GL versions <= 3.0 are set to a compatibility (non-Core)
|
||||
profile
|
||||
<li>GL versions = 3.1, depending on the driver, it may or may not
|
||||
have the ARB_compatibility extension enabled.
|
||||
<li>GL versions >= 3.2 are set to a Core profile
|
||||
<li>Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC, 3.1COMPAT, X.Y, X.YFC,
|
||||
X.YCOMPAT.
|
||||
<ul>
|
||||
<li>2.1 - select a compatibility (non-Core) profile with GL
|
||||
version 2.1.
|
||||
<li>3.0 - select a compatibility (non-Core) profile with GL
|
||||
version 3.0.
|
||||
<li>3.0FC - select a Core+Forward Compatible profile with GL
|
||||
version 3.0.
|
||||
<li>3.1 - select GL version 3.1 with GL_ARB_compatibility enabled
|
||||
per the driver default.
|
||||
<li>3.1FC - select GL version 3.1 with forward compatibility and
|
||||
GL_ARB_compatibility disabled.
|
||||
<li>3.1COMPAT - select GL version 3.1 with GL_ARB_compatibility
|
||||
enabled.
|
||||
<li>X.Y - override GL version to X.Y without changing the profile.
|
||||
<li>X.YFC - select a Core+Forward Compatible profile with GL
|
||||
version X.Y.
|
||||
<li>X.YCOMPAT - select a Compatibility profile with GL version
|
||||
X.Y.
|
||||
</ul>
|
||||
<li>Mesa may not really implement all the features of the given
|
||||
version. (for developers only)
|
||||
</ul>
|
||||
<li>MESA_GLES_VERSION_OVERRIDE - changes the value returned by
|
||||
glGetString(GL_VERSION) for OpenGL ES.
|
||||
|
@@ -31,7 +31,8 @@ because compatibility contexts are not supported.
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
175d2ca9be2af3a8db6cd603986096d75da70f59699528d7b6675d542a305e23 mesa-17.3.8.tar.gz
|
||||
8f9d9bf281c48e4a8f5228816577263b4c655248dc7666e75034ab422951a6b1 mesa-17.3.8.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
|
162
docs/relnotes/17.3.9.html
Normal file
162
docs/relnotes/17.3.9.html
Normal file
@@ -0,0 +1,162 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 17.3.9 Release Notes / April 18, 2018</h1>
|
||||
|
||||
<p>
|
||||
Mesa 17.3.9 is a bug fix release which fixes bugs found since the 17.3.8 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 17.3.9 implements the OpenGL 4.5 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
|
||||
4.5 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
4d625f65a1ff4cd8cfeb39e38f047507c6dea047502a0d53113c96f54588f340 mesa-17.3.9.tar.gz
|
||||
c5beb5fc05f0e0c294fefe1a393ee118cb67e27a4dca417d77c297f7d4b6e479 mesa-17.3.9.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None</p>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98281">Bug 98281</a> - 'message's in ctx->Debug.LogMessages[] seem to leak.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=101408">Bug 101408</a> - [Gen8+] Xonotic fails to render one of the weapons</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=102342">Bug 102342</a> - mesa-17.1.7/src/gallium/auxiliary/pipebuffer/pb_cache.c:169]: (style) Suspicious condition</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=105317">Bug 105317</a> - The GPU Vega 56 was hang while try to pass #GraphicsFuzz shader15 test</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=105440">Bug 105440</a> - GEN7: rendering issue on citra</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=105442">Bug 105442</a> - Hang when running nine ff lighting shader with radeonsi</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=105994">Bug 105994</a> - surface state leak when creating and destroying image views with aspectMask depth and stencil</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Andres Gomez (2):</p>
|
||||
<ul>
|
||||
<li>dri_util: when overriding, always reset the core version</li>
|
||||
<li>mesa: adds some comments regarding MESA_GLES_VERSION_OVERRIDE usage</li>
|
||||
</ul>
|
||||
|
||||
<p>Axel Davy (2):</p>
|
||||
<ul>
|
||||
<li>st/nine: Declare lighting consts for ff shaders</li>
|
||||
<li>st/nine: Do not use scratch for face register</li>
|
||||
</ul>
|
||||
|
||||
<p>Bas Nieuwenhuizen (1):</p>
|
||||
<ul>
|
||||
<li>ac/nir: Add workaround for GFX9 buffer views.</li>
|
||||
</ul>
|
||||
|
||||
<p>Daniel Stone (1):</p>
|
||||
<ul>
|
||||
<li>st/dri: Initialise modifier to INVALID for DRI2</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (1):</p>
|
||||
<ul>
|
||||
<li>glsl: remove unreachable assert()</li>
|
||||
</ul>
|
||||
|
||||
<p>Eric Engestrom (1):</p>
|
||||
<ul>
|
||||
<li>gbm: remove never-implemented function</li>
|
||||
</ul>
|
||||
|
||||
<p>Henri Verbeet (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Inherit texture view multi-sample information from the original texture images.</li>
|
||||
</ul>
|
||||
|
||||
<p>Iago Toral Quiroga (1):</p>
|
||||
<ul>
|
||||
<li>compiler/spirv: set is_shadow for depth comparitor sampling opcodes</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (4):</p>
|
||||
<ul>
|
||||
<li>nir/vars_to_ssa: Remove copies from the correct set</li>
|
||||
<li>nir/lower_indirect_derefs: Support interp_var_at intrinsics</li>
|
||||
<li>intel/vec4: Set channel_sizes for MOV_INDIRECT sources</li>
|
||||
<li>nir/lower_vec_to_movs: Only coalesce if the vec had a SSA destination</li>
|
||||
</ul>
|
||||
|
||||
<p>Juan A. Suarez Romero (3):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 17.3.8</li>
|
||||
<li>cherry-ignore: Explicit 18.0 only nominations</li>
|
||||
<li>Update version to 17.3.9</li>
|
||||
</ul>
|
||||
|
||||
<p>Lionel Landwerlin (1):</p>
|
||||
<ul>
|
||||
<li>anv: fix number of planes for depth & stencil</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>mesa: simplify MESA_GL_VERSION_OVERRIDE behavior of API override</li>
|
||||
</ul>
|
||||
|
||||
<p>Samuel Pitoiset (1):</p>
|
||||
<ul>
|
||||
<li>radv: fix picking the method for resolve subpass</li>
|
||||
</ul>
|
||||
|
||||
<p>Sergii Romantsov (1):</p>
|
||||
<ul>
|
||||
<li>i965: Extend the negative 32-bit deltas to 64-bits</li>
|
||||
</ul>
|
||||
|
||||
<p>Timothy Arceri (6):</p>
|
||||
<ul>
|
||||
<li>gallium/pipebuffer: fix parenthesis location</li>
|
||||
<li>glsl: always call do_lower_jumps() after loop unrolling</li>
|
||||
<li>ac: add if/loop build helpers</li>
|
||||
<li>radeonsi: make use of if/loop build helpers in ac</li>
|
||||
<li>ac: make use of if/loop build helpers</li>
|
||||
<li>mesa: free debug messages when destroying the debug state</li>
|
||||
</ul>
|
||||
|
||||
<p>Xiong, James (1):</p>
|
||||
<ul>
|
||||
<li>i965: return the fourcc saved in __DRIimage when possible</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -41,6 +41,16 @@
|
||||
|
||||
#include "shader_enums.h"
|
||||
|
||||
#define AC_LLVM_INITIAL_CF_DEPTH 4
|
||||
|
||||
/* Data for if/else/endif and bgnloop/endloop control flow structures.
|
||||
*/
|
||||
struct ac_llvm_flow {
|
||||
/* Loop exit or next part of if/else/endif. */
|
||||
LLVMBasicBlockRef next_block;
|
||||
LLVMBasicBlockRef loop_entry_block;
|
||||
};
|
||||
|
||||
/* Initialize module-independent parts of the context.
|
||||
*
|
||||
* The caller is responsible for initializing ctx::module and ctx::builder.
|
||||
@@ -92,6 +102,14 @@ ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context,
|
||||
ctx->empty_md = LLVMMDNodeInContext(ctx->context, NULL, 0);
|
||||
}
|
||||
|
||||
void
|
||||
ac_llvm_context_dispose(struct ac_llvm_context *ctx)
|
||||
{
|
||||
free(ctx->flow);
|
||||
ctx->flow = NULL;
|
||||
ctx->flow_depth_max = 0;
|
||||
}
|
||||
|
||||
unsigned
|
||||
ac_get_type_size(LLVMTypeRef type)
|
||||
{
|
||||
@@ -960,6 +978,26 @@ LLVMValueRef ac_build_buffer_load_format(struct ac_llvm_context *ctx,
|
||||
AC_FUNC_ATTR_READONLY);
|
||||
}
|
||||
|
||||
LLVMValueRef ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context *ctx,
|
||||
LLVMValueRef rsrc,
|
||||
LLVMValueRef vindex,
|
||||
LLVMValueRef voffset,
|
||||
bool can_speculate)
|
||||
{
|
||||
LLVMValueRef elem_count = LLVMBuildExtractElement(ctx->builder, rsrc, LLVMConstInt(ctx->i32, 2, 0), "");
|
||||
LLVMValueRef stride = LLVMBuildExtractElement(ctx->builder, rsrc, LLVMConstInt(ctx->i32, 1, 0), "");
|
||||
stride = LLVMBuildLShr(ctx->builder, stride, LLVMConstInt(ctx->i32, 16, 0), "");
|
||||
|
||||
LLVMValueRef new_elem_count = LLVMBuildSelect(ctx->builder,
|
||||
LLVMBuildICmp(ctx->builder, LLVMIntUGT, elem_count, stride, ""),
|
||||
elem_count, stride, "");
|
||||
|
||||
LLVMValueRef new_rsrc = LLVMBuildInsertElement(ctx->builder, rsrc, new_elem_count,
|
||||
LLVMConstInt(ctx->i32, 2, 0), "");
|
||||
|
||||
return ac_build_buffer_load_format(ctx, new_rsrc, vindex, voffset, can_speculate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set range metadata on an instruction. This can only be used on load and
|
||||
* call instructions. If you know an instruction can only produce the values
|
||||
@@ -1742,3 +1780,174 @@ void ac_init_exec_full_mask(struct ac_llvm_context *ctx)
|
||||
"llvm.amdgcn.init.exec", ctx->voidt,
|
||||
&full_mask, 1, AC_FUNC_ATTR_CONVERGENT);
|
||||
}
|
||||
|
||||
static struct ac_llvm_flow *
|
||||
get_current_flow(struct ac_llvm_context *ctx)
|
||||
{
|
||||
if (ctx->flow_depth > 0)
|
||||
return &ctx->flow[ctx->flow_depth - 1];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct ac_llvm_flow *
|
||||
get_innermost_loop(struct ac_llvm_context *ctx)
|
||||
{
|
||||
for (unsigned i = ctx->flow_depth; i > 0; --i) {
|
||||
if (ctx->flow[i - 1].loop_entry_block)
|
||||
return &ctx->flow[i - 1];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct ac_llvm_flow *
|
||||
push_flow(struct ac_llvm_context *ctx)
|
||||
{
|
||||
struct ac_llvm_flow *flow;
|
||||
|
||||
if (ctx->flow_depth >= ctx->flow_depth_max) {
|
||||
unsigned new_max = MAX2(ctx->flow_depth << 1,
|
||||
AC_LLVM_INITIAL_CF_DEPTH);
|
||||
|
||||
ctx->flow = realloc(ctx->flow, new_max * sizeof(*ctx->flow));
|
||||
ctx->flow_depth_max = new_max;
|
||||
}
|
||||
|
||||
flow = &ctx->flow[ctx->flow_depth];
|
||||
ctx->flow_depth++;
|
||||
|
||||
flow->next_block = NULL;
|
||||
flow->loop_entry_block = NULL;
|
||||
return flow;
|
||||
}
|
||||
|
||||
static void set_basicblock_name(LLVMBasicBlockRef bb, const char *base,
|
||||
int label_id)
|
||||
{
|
||||
char buf[32];
|
||||
snprintf(buf, sizeof(buf), "%s%d", base, label_id);
|
||||
LLVMSetValueName(LLVMBasicBlockAsValue(bb), buf);
|
||||
}
|
||||
|
||||
/* Append a basic block at the level of the parent flow.
|
||||
*/
|
||||
static LLVMBasicBlockRef append_basic_block(struct ac_llvm_context *ctx,
|
||||
const char *name)
|
||||
{
|
||||
assert(ctx->flow_depth >= 1);
|
||||
|
||||
if (ctx->flow_depth >= 2) {
|
||||
struct ac_llvm_flow *flow = &ctx->flow[ctx->flow_depth - 2];
|
||||
|
||||
return LLVMInsertBasicBlockInContext(ctx->context,
|
||||
flow->next_block, name);
|
||||
}
|
||||
|
||||
LLVMValueRef main_fn =
|
||||
LLVMGetBasicBlockParent(LLVMGetInsertBlock(ctx->builder));
|
||||
return LLVMAppendBasicBlockInContext(ctx->context, main_fn, name);
|
||||
}
|
||||
|
||||
/* Emit a branch to the given default target for the current block if
|
||||
* applicable -- that is, if the current block does not already contain a
|
||||
* branch from a break or continue.
|
||||
*/
|
||||
static void emit_default_branch(LLVMBuilderRef builder,
|
||||
LLVMBasicBlockRef target)
|
||||
{
|
||||
if (!LLVMGetBasicBlockTerminator(LLVMGetInsertBlock(builder)))
|
||||
LLVMBuildBr(builder, target);
|
||||
}
|
||||
|
||||
void ac_build_bgnloop(struct ac_llvm_context *ctx, int label_id)
|
||||
{
|
||||
struct ac_llvm_flow *flow = push_flow(ctx);
|
||||
flow->loop_entry_block = append_basic_block(ctx, "LOOP");
|
||||
flow->next_block = append_basic_block(ctx, "ENDLOOP");
|
||||
set_basicblock_name(flow->loop_entry_block, "loop", label_id);
|
||||
LLVMBuildBr(ctx->builder, flow->loop_entry_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->builder, flow->loop_entry_block);
|
||||
}
|
||||
|
||||
void ac_build_break(struct ac_llvm_context *ctx)
|
||||
{
|
||||
struct ac_llvm_flow *flow = get_innermost_loop(ctx);
|
||||
LLVMBuildBr(ctx->builder, flow->next_block);
|
||||
}
|
||||
|
||||
void ac_build_continue(struct ac_llvm_context *ctx)
|
||||
{
|
||||
struct ac_llvm_flow *flow = get_innermost_loop(ctx);
|
||||
LLVMBuildBr(ctx->builder, flow->loop_entry_block);
|
||||
}
|
||||
|
||||
void ac_build_else(struct ac_llvm_context *ctx, int label_id)
|
||||
{
|
||||
struct ac_llvm_flow *current_branch = get_current_flow(ctx);
|
||||
LLVMBasicBlockRef endif_block;
|
||||
|
||||
assert(!current_branch->loop_entry_block);
|
||||
|
||||
endif_block = append_basic_block(ctx, "ENDIF");
|
||||
emit_default_branch(ctx->builder, endif_block);
|
||||
|
||||
LLVMPositionBuilderAtEnd(ctx->builder, current_branch->next_block);
|
||||
set_basicblock_name(current_branch->next_block, "else", label_id);
|
||||
|
||||
current_branch->next_block = endif_block;
|
||||
}
|
||||
|
||||
void ac_build_endif(struct ac_llvm_context *ctx, int label_id)
|
||||
{
|
||||
struct ac_llvm_flow *current_branch = get_current_flow(ctx);
|
||||
|
||||
assert(!current_branch->loop_entry_block);
|
||||
|
||||
emit_default_branch(ctx->builder, current_branch->next_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->builder, current_branch->next_block);
|
||||
set_basicblock_name(current_branch->next_block, "endif", label_id);
|
||||
|
||||
ctx->flow_depth--;
|
||||
}
|
||||
|
||||
void ac_build_endloop(struct ac_llvm_context *ctx, int label_id)
|
||||
{
|
||||
struct ac_llvm_flow *current_loop = get_current_flow(ctx);
|
||||
|
||||
assert(current_loop->loop_entry_block);
|
||||
|
||||
emit_default_branch(ctx->builder, current_loop->loop_entry_block);
|
||||
|
||||
LLVMPositionBuilderAtEnd(ctx->builder, current_loop->next_block);
|
||||
set_basicblock_name(current_loop->next_block, "endloop", label_id);
|
||||
ctx->flow_depth--;
|
||||
}
|
||||
|
||||
static void if_cond_emit(struct ac_llvm_context *ctx, LLVMValueRef cond,
|
||||
int label_id)
|
||||
{
|
||||
struct ac_llvm_flow *flow = push_flow(ctx);
|
||||
LLVMBasicBlockRef if_block;
|
||||
|
||||
if_block = append_basic_block(ctx, "IF");
|
||||
flow->next_block = append_basic_block(ctx, "ELSE");
|
||||
set_basicblock_name(if_block, "if", label_id);
|
||||
LLVMBuildCondBr(ctx->builder, cond, if_block, flow->next_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->builder, if_block);
|
||||
}
|
||||
|
||||
void ac_build_if(struct ac_llvm_context *ctx, LLVMValueRef value,
|
||||
int label_id)
|
||||
{
|
||||
LLVMValueRef cond = LLVMBuildFCmp(ctx->builder, LLVMRealUNE,
|
||||
value, ctx->f32_0, "");
|
||||
if_cond_emit(ctx, cond, label_id);
|
||||
}
|
||||
|
||||
void ac_build_uif(struct ac_llvm_context *ctx, LLVMValueRef value,
|
||||
int label_id)
|
||||
{
|
||||
LLVMValueRef cond = LLVMBuildICmp(ctx->builder, LLVMIntNE,
|
||||
ac_to_integer(ctx, value),
|
||||
ctx->i32_0, "");
|
||||
if_cond_emit(ctx, cond, label_id);
|
||||
}
|
||||
|
@@ -34,6 +34,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct ac_llvm_flow;
|
||||
|
||||
struct ac_llvm_context {
|
||||
LLVMContextRef context;
|
||||
LLVMModuleRef module;
|
||||
@@ -57,6 +59,10 @@ struct ac_llvm_context {
|
||||
LLVMValueRef f32_0;
|
||||
LLVMValueRef f32_1;
|
||||
|
||||
struct ac_llvm_flow *flow;
|
||||
unsigned flow_depth;
|
||||
unsigned flow_depth_max;
|
||||
|
||||
unsigned range_md_kind;
|
||||
unsigned invariant_load_md_kind;
|
||||
unsigned uniform_md_kind;
|
||||
@@ -71,6 +77,9 @@ void
|
||||
ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context,
|
||||
enum chip_class chip_class);
|
||||
|
||||
void
|
||||
ac_llvm_context_dispose(struct ac_llvm_context *ctx);
|
||||
|
||||
unsigned ac_get_type_size(LLVMTypeRef type);
|
||||
|
||||
LLVMTypeRef ac_to_integer_type(struct ac_llvm_context *ctx, LLVMTypeRef t);
|
||||
@@ -188,6 +197,14 @@ LLVMValueRef ac_build_buffer_load_format(struct ac_llvm_context *ctx,
|
||||
LLVMValueRef voffset,
|
||||
bool can_speculate);
|
||||
|
||||
/* load_format that handles the stride & element count better if idxen is
|
||||
* disabled by LLVM. */
|
||||
LLVMValueRef ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context *ctx,
|
||||
LLVMValueRef rsrc,
|
||||
LLVMValueRef vindex,
|
||||
LLVMValueRef voffset,
|
||||
bool can_speculate);
|
||||
|
||||
LLVMValueRef
|
||||
ac_get_thread_id(struct ac_llvm_context *ctx);
|
||||
|
||||
@@ -282,6 +299,18 @@ void ac_optimize_vs_outputs(struct ac_llvm_context *ac,
|
||||
uint32_t num_outputs,
|
||||
uint8_t *num_param_exports);
|
||||
void ac_init_exec_full_mask(struct ac_llvm_context *ctx);
|
||||
|
||||
void ac_build_bgnloop(struct ac_llvm_context *ctx, int lable_id);
|
||||
void ac_build_break(struct ac_llvm_context *ctx);
|
||||
void ac_build_continue(struct ac_llvm_context *ctx);
|
||||
void ac_build_else(struct ac_llvm_context *ctx, int lable_id);
|
||||
void ac_build_endif(struct ac_llvm_context *ctx, int lable_id);
|
||||
void ac_build_endloop(struct ac_llvm_context *ctx, int lable_id);
|
||||
void ac_build_if(struct ac_llvm_context *ctx, LLVMValueRef value,
|
||||
int lable_id);
|
||||
void ac_build_uif(struct ac_llvm_context *ctx, LLVMValueRef value,
|
||||
int lable_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -2257,11 +2257,19 @@ static LLVMValueRef build_tex_intrinsic(struct ac_nir_context *ctx,
|
||||
struct ac_image_args *args)
|
||||
{
|
||||
if (instr->sampler_dim == GLSL_SAMPLER_DIM_BUF) {
|
||||
return ac_build_buffer_load_format(&ctx->ac,
|
||||
args->resource,
|
||||
args->addr,
|
||||
LLVMConstInt(ctx->ac.i32, 0, false),
|
||||
true);
|
||||
if (ctx->abi->gfx9_stride_size_workaround) {
|
||||
return ac_build_buffer_load_format_gfx9_safe(&ctx->ac,
|
||||
args->resource,
|
||||
args->addr,
|
||||
ctx->ac.i32_0,
|
||||
true);
|
||||
} else {
|
||||
return ac_build_buffer_load_format(&ctx->ac,
|
||||
args->resource,
|
||||
args->addr,
|
||||
ctx->ac.i32_0,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
args->opcode = ac_image_sample;
|
||||
@@ -3613,8 +3621,23 @@ static void visit_image_store(struct ac_nir_context *ctx,
|
||||
glc = i1true;
|
||||
|
||||
if (glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_BUF) {
|
||||
LLVMValueRef rsrc = get_sampler_desc(ctx, instr->variables[0], AC_DESC_BUFFER, true, true);
|
||||
|
||||
if (ctx->abi->gfx9_stride_size_workaround) {
|
||||
LLVMValueRef elem_count = LLVMBuildExtractElement(ctx->ac.builder, rsrc, LLVMConstInt(ctx->ac.i32, 2, 0), "");
|
||||
LLVMValueRef stride = LLVMBuildExtractElement(ctx->ac.builder, rsrc, LLVMConstInt(ctx->ac.i32, 1, 0), "");
|
||||
stride = LLVMBuildLShr(ctx->ac.builder, stride, LLVMConstInt(ctx->ac.i32, 16, 0), "");
|
||||
|
||||
LLVMValueRef new_elem_count = LLVMBuildSelect(ctx->ac.builder,
|
||||
LLVMBuildICmp(ctx->ac.builder, LLVMIntUGT, elem_count, stride, ""),
|
||||
elem_count, stride, "");
|
||||
|
||||
rsrc = LLVMBuildInsertElement(ctx->ac.builder, rsrc, new_elem_count,
|
||||
LLVMConstInt(ctx->ac.i32, 2, 0), "");
|
||||
}
|
||||
|
||||
params[0] = ac_to_float(&ctx->ac, get_src(ctx, instr->src[2])); /* data */
|
||||
params[1] = get_sampler_desc(ctx, instr->variables[0], AC_DESC_BUFFER, true, true);
|
||||
params[1] = rsrc;
|
||||
params[2] = LLVMBuildExtractElement(ctx->ac.builder, get_src(ctx, instr->src[0]),
|
||||
ctx->ac.i32_0, ""); /* vindex */
|
||||
params[3] = ctx->ac.i32_0; /* voffset */
|
||||
@@ -4961,17 +4984,15 @@ static void visit_ssa_undef(struct ac_nir_context *ctx,
|
||||
_mesa_hash_table_insert(ctx->defs, &instr->def, undef);
|
||||
}
|
||||
|
||||
static void visit_jump(struct ac_nir_context *ctx,
|
||||
static void visit_jump(struct ac_llvm_context *ctx,
|
||||
const nir_jump_instr *instr)
|
||||
{
|
||||
switch (instr->type) {
|
||||
case nir_jump_break:
|
||||
LLVMBuildBr(ctx->ac.builder, ctx->break_block);
|
||||
LLVMClearInsertionPosition(ctx->ac.builder);
|
||||
ac_build_break(ctx);
|
||||
break;
|
||||
case nir_jump_continue:
|
||||
LLVMBuildBr(ctx->ac.builder, ctx->continue_block);
|
||||
LLVMClearInsertionPosition(ctx->ac.builder);
|
||||
ac_build_continue(ctx);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unknown NIR jump instr: ");
|
||||
@@ -5009,7 +5030,7 @@ static void visit_block(struct ac_nir_context *ctx, nir_block *block)
|
||||
visit_ssa_undef(ctx, nir_instr_as_ssa_undef(instr));
|
||||
break;
|
||||
case nir_instr_type_jump:
|
||||
visit_jump(ctx, nir_instr_as_jump(instr));
|
||||
visit_jump(&ctx->ac, nir_instr_as_jump(instr));
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Unknown NIR instr type: ");
|
||||
@@ -5026,56 +5047,34 @@ static void visit_if(struct ac_nir_context *ctx, nir_if *if_stmt)
|
||||
{
|
||||
LLVMValueRef value = get_src(ctx, if_stmt->condition);
|
||||
|
||||
LLVMValueRef fn = LLVMGetBasicBlockParent(LLVMGetInsertBlock(ctx->ac.builder));
|
||||
LLVMBasicBlockRef merge_block =
|
||||
LLVMAppendBasicBlockInContext(ctx->ac.context, fn, "");
|
||||
LLVMBasicBlockRef if_block =
|
||||
LLVMAppendBasicBlockInContext(ctx->ac.context, fn, "");
|
||||
LLVMBasicBlockRef else_block = merge_block;
|
||||
if (!exec_list_is_empty(&if_stmt->else_list))
|
||||
else_block = LLVMAppendBasicBlockInContext(
|
||||
ctx->ac.context, fn, "");
|
||||
nir_block *then_block =
|
||||
(nir_block *) exec_list_get_head(&if_stmt->then_list);
|
||||
|
||||
LLVMValueRef cond = LLVMBuildICmp(ctx->ac.builder, LLVMIntNE, value,
|
||||
LLVMConstInt(ctx->ac.i32, 0, false), "");
|
||||
LLVMBuildCondBr(ctx->ac.builder, cond, if_block, else_block);
|
||||
ac_build_uif(&ctx->ac, value, then_block->index);
|
||||
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, if_block);
|
||||
visit_cf_list(ctx, &if_stmt->then_list);
|
||||
if (LLVMGetInsertBlock(ctx->ac.builder))
|
||||
LLVMBuildBr(ctx->ac.builder, merge_block);
|
||||
|
||||
if (!exec_list_is_empty(&if_stmt->else_list)) {
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, else_block);
|
||||
nir_block *else_block =
|
||||
(nir_block *) exec_list_get_head(&if_stmt->else_list);
|
||||
|
||||
ac_build_else(&ctx->ac, else_block->index);
|
||||
visit_cf_list(ctx, &if_stmt->else_list);
|
||||
if (LLVMGetInsertBlock(ctx->ac.builder))
|
||||
LLVMBuildBr(ctx->ac.builder, merge_block);
|
||||
}
|
||||
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, merge_block);
|
||||
ac_build_endif(&ctx->ac, then_block->index);
|
||||
}
|
||||
|
||||
static void visit_loop(struct ac_nir_context *ctx, nir_loop *loop)
|
||||
{
|
||||
LLVMValueRef fn = LLVMGetBasicBlockParent(LLVMGetInsertBlock(ctx->ac.builder));
|
||||
LLVMBasicBlockRef continue_parent = ctx->continue_block;
|
||||
LLVMBasicBlockRef break_parent = ctx->break_block;
|
||||
nir_block *first_loop_block =
|
||||
(nir_block *) exec_list_get_head(&loop->body);
|
||||
|
||||
ctx->continue_block =
|
||||
LLVMAppendBasicBlockInContext(ctx->ac.context, fn, "");
|
||||
ctx->break_block =
|
||||
LLVMAppendBasicBlockInContext(ctx->ac.context, fn, "");
|
||||
ac_build_bgnloop(&ctx->ac, first_loop_block->index);
|
||||
|
||||
LLVMBuildBr(ctx->ac.builder, ctx->continue_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, ctx->continue_block);
|
||||
visit_cf_list(ctx, &loop->body);
|
||||
|
||||
if (LLVMGetInsertBlock(ctx->ac.builder))
|
||||
LLVMBuildBr(ctx->ac.builder, ctx->continue_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, ctx->break_block);
|
||||
|
||||
ctx->continue_block = continue_parent;
|
||||
ctx->break_block = break_parent;
|
||||
ac_build_endloop(&ctx->ac, first_loop_block->index);
|
||||
}
|
||||
|
||||
static void visit_cf_list(struct ac_nir_context *ctx,
|
||||
@@ -6429,6 +6428,8 @@ static void ac_llvm_finalize_module(struct nir_to_llvm_context * ctx)
|
||||
|
||||
LLVMDisposeBuilder(ctx->builder);
|
||||
LLVMDisposePassManager(passmgr);
|
||||
|
||||
ac_llvm_context_dispose(&ctx->ac);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -6645,6 +6646,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(LLVMTargetMachineRef tm,
|
||||
ctx.abi.load_ssbo = radv_load_ssbo;
|
||||
ctx.abi.load_sampler_desc = radv_get_sampler_desc;
|
||||
ctx.abi.clamp_shadow_reference = false;
|
||||
ctx.abi.gfx9_stride_size_workaround = ctx.ac.chip_class == GFX9;
|
||||
|
||||
if (shader_count >= 2)
|
||||
ac_init_exec_full_mask(&ctx.ac);
|
||||
|
@@ -92,6 +92,10 @@ struct ac_shader_abi {
|
||||
/* Whether to clamp the shadow reference value to [0,1]on VI. Radeonsi currently
|
||||
* uses it due to promoting D16 to D32, but radv needs it off. */
|
||||
bool clamp_shadow_reference;
|
||||
|
||||
/* Whether to workaround GFX9 ignoring the stride for the buffer size if IDXEN=0
|
||||
* and LLVM optimizes an indexed load with constant index to IDXEN=0. */
|
||||
bool gfx9_stride_size_workaround;
|
||||
};
|
||||
|
||||
#endif /* AC_SHADER_ABI_H */
|
||||
|
@@ -614,7 +614,7 @@ radv_cmd_buffer_resolve_subpass(struct radv_cmd_buffer *cmd_buffer)
|
||||
struct radv_image *dst_img = cmd_buffer->state.framebuffer->attachments[dest_att.attachment].attachment->image;
|
||||
struct radv_image *src_img = cmd_buffer->state.framebuffer->attachments[src_att.attachment].attachment->image;
|
||||
|
||||
radv_pick_resolve_method_images(dst_img, src_img, &resolve_method);
|
||||
radv_pick_resolve_method_images(src_img, dst_img, &resolve_method);
|
||||
if (resolve_method == RESOLVE_FRAGMENT) {
|
||||
break;
|
||||
}
|
||||
|
@@ -2251,6 +2251,24 @@ do_common_optimization(exec_list *ir, bool linked,
|
||||
loop_progress = false;
|
||||
loop_progress |= do_constant_propagation(ir);
|
||||
loop_progress |= do_if_simplification(ir);
|
||||
|
||||
/* Some drivers only call do_common_optimization() once rather
|
||||
* than in a loop. So we must call do_lower_jumps() after
|
||||
* unrolling a loop because for drivers that use LLVM validation
|
||||
* will fail if a jump is not the last instruction in the block.
|
||||
* For example the following will fail LLVM validation:
|
||||
*
|
||||
* (loop (
|
||||
* ...
|
||||
* break
|
||||
* (assign (x) (var_ref v124) (expression int + (var_ref v124)
|
||||
* (constant int (1)) ) )
|
||||
* ))
|
||||
*/
|
||||
loop_progress |= do_lower_jumps(ir, true, true,
|
||||
options->EmitNoMainReturn,
|
||||
options->EmitNoCont,
|
||||
options->EmitNoLoops);
|
||||
}
|
||||
progress |= loop_progress;
|
||||
}
|
||||
|
@@ -528,8 +528,6 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
|
||||
unsigned term_count = 0;
|
||||
bool first_term_then_continue = false;
|
||||
foreach_in_list(loop_terminator, t, &ls->terminators) {
|
||||
assert(term_count < 2);
|
||||
|
||||
ir_if *ir_if = t->ir->as_if();
|
||||
assert(ir_if != NULL);
|
||||
|
||||
|
@@ -95,9 +95,15 @@ emit_load_store(nir_builder *b, nir_intrinsic_instr *orig_instr,
|
||||
if (src == NULL) {
|
||||
/* This is a load instruction */
|
||||
nir_intrinsic_instr *load =
|
||||
nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_var);
|
||||
nir_intrinsic_instr_create(b->shader, orig_instr->intrinsic);
|
||||
load->num_components = orig_instr->num_components;
|
||||
load->variables[0] = nir_deref_var_clone(deref, load);
|
||||
|
||||
/* Copy over any sources. This is needed for interp_var_at */
|
||||
for (unsigned i = 0;
|
||||
i < nir_intrinsic_infos[orig_instr->intrinsic].num_srcs; i++)
|
||||
nir_src_copy(&load->src[i], &orig_instr->src[i], load);
|
||||
|
||||
unsigned bit_size = orig_instr->dest.ssa.bit_size;
|
||||
nir_ssa_dest_init(&load->instr, &load->dest,
|
||||
load->num_components, bit_size, NULL);
|
||||
@@ -142,6 +148,9 @@ lower_indirect_block(nir_block *block, nir_builder *b,
|
||||
|
||||
nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr);
|
||||
if (intrin->intrinsic != nir_intrinsic_load_var &&
|
||||
intrin->intrinsic != nir_intrinsic_interp_var_at_centroid &&
|
||||
intrin->intrinsic != nir_intrinsic_interp_var_at_sample &&
|
||||
intrin->intrinsic != nir_intrinsic_interp_var_at_offset &&
|
||||
intrin->intrinsic != nir_intrinsic_store_var)
|
||||
continue;
|
||||
|
||||
@@ -158,7 +167,7 @@ lower_indirect_block(nir_block *block, nir_builder *b,
|
||||
|
||||
b->cursor = nir_before_instr(&intrin->instr);
|
||||
|
||||
if (intrin->intrinsic == nir_intrinsic_load_var) {
|
||||
if (intrin->intrinsic != nir_intrinsic_store_var) {
|
||||
nir_ssa_def *result;
|
||||
emit_load_store(b, intrin, intrin->variables[0],
|
||||
&intrin->variables[0]->deref, &result, NULL);
|
||||
|
@@ -464,7 +464,7 @@ lower_copies_to_load_store(struct deref_node *node,
|
||||
|
||||
struct set_entry *arg_entry = _mesa_set_search(arg_node->copies, copy);
|
||||
assert(arg_entry);
|
||||
_mesa_set_remove(node->copies, arg_entry);
|
||||
_mesa_set_remove(arg_node->copies, arg_entry);
|
||||
}
|
||||
|
||||
nir_instr_remove(©->instr);
|
||||
|
@@ -230,6 +230,7 @@ lower_vec_to_movs_block(nir_block *block, nir_function_impl *impl)
|
||||
continue; /* The loop */
|
||||
}
|
||||
|
||||
bool vec_had_ssa_dest = vec->dest.dest.is_ssa;
|
||||
if (vec->dest.dest.is_ssa) {
|
||||
/* Since we insert multiple MOVs, we have a register destination. */
|
||||
nir_register *reg = nir_local_reg_create(impl);
|
||||
@@ -263,7 +264,11 @@ lower_vec_to_movs_block(nir_block *block, nir_function_impl *impl)
|
||||
if (!(vec->dest.write_mask & (1 << i)))
|
||||
continue;
|
||||
|
||||
if (!(finished_write_mask & (1 << i)))
|
||||
/* Coalescing moves the register writes from the vec up to the ALU
|
||||
* instruction in the source. We can only do this if the original
|
||||
* vecN had an SSA destination.
|
||||
*/
|
||||
if (vec_had_ssa_dest && !(finished_write_mask & (1 << i)))
|
||||
finished_write_mask |= try_coalesce(vec, i);
|
||||
|
||||
if (!(finished_write_mask & (1 << i)))
|
||||
|
@@ -1526,7 +1526,6 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
|
||||
const struct glsl_type *image_type = sampled.type->type;
|
||||
const enum glsl_sampler_dim sampler_dim = glsl_get_sampler_dim(image_type);
|
||||
const bool is_array = glsl_sampler_type_is_array(image_type);
|
||||
const bool is_shadow = glsl_sampler_type_is_shadow(image_type);
|
||||
|
||||
/* Figure out the base texture operation */
|
||||
nir_texop texop;
|
||||
@@ -1650,6 +1649,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
|
||||
break;
|
||||
}
|
||||
|
||||
bool is_shadow = false;
|
||||
unsigned gather_component = 0;
|
||||
switch (opcode) {
|
||||
case SpvOpImageSampleDrefImplicitLod:
|
||||
@@ -1658,6 +1658,7 @@ vtn_handle_texture(struct vtn_builder *b, SpvOp opcode,
|
||||
case SpvOpImageSampleProjDrefExplicitLod:
|
||||
case SpvOpImageDrefGather:
|
||||
/* These all have an explicit depth value as their next source */
|
||||
is_shadow = true;
|
||||
(*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_comparator);
|
||||
break;
|
||||
|
||||
|
@@ -167,7 +167,7 @@ pb_cache_reclaim_buffer(struct pb_cache *mgr, pb_size size,
|
||||
cur_entry = LIST_ENTRY(struct pb_cache_entry, cur, head);
|
||||
|
||||
if (!entry && (ret = pb_cache_is_buffer_compat(cur_entry, size,
|
||||
alignment, usage) > 0))
|
||||
alignment, usage)) > 0)
|
||||
entry = cur_entry;
|
||||
else if (os_time_timeout(cur_entry->start, cur_entry->end, now))
|
||||
destroy_buffer_locked(cur_entry);
|
||||
|
@@ -43,13 +43,9 @@ struct ac_shader_binary;
|
||||
#define RADEON_LLVM_MAX_INPUTS 32 * 4
|
||||
#define RADEON_LLVM_MAX_OUTPUTS 32 * 4
|
||||
|
||||
#define RADEON_LLVM_INITIAL_CF_DEPTH 4
|
||||
|
||||
#define RADEON_LLVM_MAX_SYSTEM_VALUES 11
|
||||
#define RADEON_LLVM_MAX_ADDRS 16
|
||||
|
||||
struct si_llvm_flow;
|
||||
|
||||
struct si_shader_context {
|
||||
struct lp_build_tgsi_context bld_base;
|
||||
struct gallivm_state gallivm;
|
||||
@@ -98,10 +94,6 @@ struct si_shader_context {
|
||||
LLVMValueRef *imms;
|
||||
unsigned imms_num;
|
||||
|
||||
struct si_llvm_flow *flow;
|
||||
unsigned flow_depth;
|
||||
unsigned flow_depth_max;
|
||||
|
||||
struct lp_build_if_state merged_wrap_if_state;
|
||||
|
||||
struct tgsi_array_info *temp_arrays;
|
||||
|
@@ -41,14 +41,6 @@
|
||||
#include <llvm-c/Transforms/IPO.h>
|
||||
#include <llvm-c/Transforms/Scalar.h>
|
||||
|
||||
/* Data for if/else/endif and bgnloop/endloop control flow structures.
|
||||
*/
|
||||
struct si_llvm_flow {
|
||||
/* Loop exit or next part of if/else/endif. */
|
||||
LLVMBasicBlockRef next_block;
|
||||
LLVMBasicBlockRef loop_entry_block;
|
||||
};
|
||||
|
||||
enum si_llvm_calling_convention {
|
||||
RADEON_LLVM_AMDGPU_VS = 87,
|
||||
RADEON_LLVM_AMDGPU_GS = 88,
|
||||
@@ -224,45 +216,6 @@ LLVMValueRef si_llvm_bound_index(struct si_shader_context *ctx,
|
||||
return index;
|
||||
}
|
||||
|
||||
static struct si_llvm_flow *
|
||||
get_current_flow(struct si_shader_context *ctx)
|
||||
{
|
||||
if (ctx->flow_depth > 0)
|
||||
return &ctx->flow[ctx->flow_depth - 1];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct si_llvm_flow *
|
||||
get_innermost_loop(struct si_shader_context *ctx)
|
||||
{
|
||||
for (unsigned i = ctx->flow_depth; i > 0; --i) {
|
||||
if (ctx->flow[i - 1].loop_entry_block)
|
||||
return &ctx->flow[i - 1];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct si_llvm_flow *
|
||||
push_flow(struct si_shader_context *ctx)
|
||||
{
|
||||
struct si_llvm_flow *flow;
|
||||
|
||||
if (ctx->flow_depth >= ctx->flow_depth_max) {
|
||||
unsigned new_max = MAX2(ctx->flow_depth << 1, RADEON_LLVM_INITIAL_CF_DEPTH);
|
||||
ctx->flow = REALLOC(ctx->flow,
|
||||
ctx->flow_depth_max * sizeof(*ctx->flow),
|
||||
new_max * sizeof(*ctx->flow));
|
||||
ctx->flow_depth_max = new_max;
|
||||
}
|
||||
|
||||
flow = &ctx->flow[ctx->flow_depth];
|
||||
ctx->flow_depth++;
|
||||
|
||||
flow->next_block = NULL;
|
||||
flow->loop_entry_block = NULL;
|
||||
return flow;
|
||||
}
|
||||
|
||||
static LLVMValueRef emit_swizzle(struct lp_build_tgsi_context *bld_base,
|
||||
LLVMValueRef value,
|
||||
unsigned swizzle_x,
|
||||
@@ -951,42 +904,13 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base,
|
||||
}
|
||||
}
|
||||
|
||||
static void set_basicblock_name(LLVMBasicBlockRef bb, const char *base, int pc)
|
||||
static int get_line(int pc)
|
||||
{
|
||||
char buf[32];
|
||||
/* Subtract 1 so that the number shown is that of the corresponding
|
||||
* opcode in the TGSI dump, e.g. an if block has the same suffix as
|
||||
* the instruction number of the corresponding TGSI IF.
|
||||
*/
|
||||
snprintf(buf, sizeof(buf), "%s%d", base, pc - 1);
|
||||
LLVMSetValueName(LLVMBasicBlockAsValue(bb), buf);
|
||||
}
|
||||
|
||||
/* Append a basic block at the level of the parent flow.
|
||||
*/
|
||||
static LLVMBasicBlockRef append_basic_block(struct si_shader_context *ctx,
|
||||
const char *name)
|
||||
{
|
||||
assert(ctx->flow_depth >= 1);
|
||||
|
||||
if (ctx->flow_depth >= 2) {
|
||||
struct si_llvm_flow *flow = &ctx->flow[ctx->flow_depth - 2];
|
||||
|
||||
return LLVMInsertBasicBlockInContext(ctx->ac.context,
|
||||
flow->next_block, name);
|
||||
}
|
||||
|
||||
return LLVMAppendBasicBlockInContext(ctx->ac.context, ctx->main_fn, name);
|
||||
}
|
||||
|
||||
/* Emit a branch to the given default target for the current block if
|
||||
* applicable -- that is, if the current block does not already contain a
|
||||
* branch from a break or continue.
|
||||
*/
|
||||
static void emit_default_branch(LLVMBuilderRef builder, LLVMBasicBlockRef target)
|
||||
{
|
||||
if (!LLVMGetBasicBlockTerminator(LLVMGetInsertBlock(builder)))
|
||||
LLVMBuildBr(builder, target);
|
||||
return pc - 1;
|
||||
}
|
||||
|
||||
static void bgnloop_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -994,12 +918,7 @@ static void bgnloop_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct si_llvm_flow *flow = push_flow(ctx);
|
||||
flow->loop_entry_block = append_basic_block(ctx, "LOOP");
|
||||
flow->next_block = append_basic_block(ctx, "ENDLOOP");
|
||||
set_basicblock_name(flow->loop_entry_block, "loop", bld_base->pc);
|
||||
LLVMBuildBr(ctx->ac.builder, flow->loop_entry_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, flow->loop_entry_block);
|
||||
ac_build_bgnloop(&ctx->ac, get_line(bld_base->pc));
|
||||
}
|
||||
|
||||
static void brk_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -1007,9 +926,7 @@ static void brk_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct si_llvm_flow *flow = get_innermost_loop(ctx);
|
||||
|
||||
LLVMBuildBr(ctx->ac.builder, flow->next_block);
|
||||
ac_build_break(&ctx->ac);
|
||||
}
|
||||
|
||||
static void cont_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -1017,9 +934,7 @@ static void cont_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct si_llvm_flow *flow = get_innermost_loop(ctx);
|
||||
|
||||
LLVMBuildBr(ctx->ac.builder, flow->loop_entry_block);
|
||||
ac_build_continue(&ctx->ac);
|
||||
}
|
||||
|
||||
static void else_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -1027,18 +942,7 @@ static void else_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct si_llvm_flow *current_branch = get_current_flow(ctx);
|
||||
LLVMBasicBlockRef endif_block;
|
||||
|
||||
assert(!current_branch->loop_entry_block);
|
||||
|
||||
endif_block = append_basic_block(ctx, "ENDIF");
|
||||
emit_default_branch(ctx->ac.builder, endif_block);
|
||||
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, current_branch->next_block);
|
||||
set_basicblock_name(current_branch->next_block, "else", bld_base->pc);
|
||||
|
||||
current_branch->next_block = endif_block;
|
||||
ac_build_else(&ctx->ac, get_line(bld_base->pc));
|
||||
}
|
||||
|
||||
static void endif_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -1046,15 +950,7 @@ static void endif_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct si_llvm_flow *current_branch = get_current_flow(ctx);
|
||||
|
||||
assert(!current_branch->loop_entry_block);
|
||||
|
||||
emit_default_branch(ctx->ac.builder, current_branch->next_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, current_branch->next_block);
|
||||
set_basicblock_name(current_branch->next_block, "endif", bld_base->pc);
|
||||
|
||||
ctx->flow_depth--;
|
||||
ac_build_endif(&ctx->ac, get_line(bld_base->pc));
|
||||
}
|
||||
|
||||
static void endloop_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -1062,31 +958,7 @@ static void endloop_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct si_llvm_flow *current_loop = get_current_flow(ctx);
|
||||
|
||||
assert(current_loop->loop_entry_block);
|
||||
|
||||
emit_default_branch(ctx->ac.builder, current_loop->loop_entry_block);
|
||||
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, current_loop->next_block);
|
||||
set_basicblock_name(current_loop->next_block, "endloop", bld_base->pc);
|
||||
ctx->flow_depth--;
|
||||
}
|
||||
|
||||
static void if_cond_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_tgsi_context *bld_base,
|
||||
struct lp_build_emit_data *emit_data,
|
||||
LLVMValueRef cond)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
struct si_llvm_flow *flow = push_flow(ctx);
|
||||
LLVMBasicBlockRef if_block;
|
||||
|
||||
if_block = append_basic_block(ctx, "IF");
|
||||
flow->next_block = append_basic_block(ctx, "ELSE");
|
||||
set_basicblock_name(if_block, "if", bld_base->pc);
|
||||
LLVMBuildCondBr(ctx->ac.builder, cond, if_block, flow->next_block);
|
||||
LLVMPositionBuilderAtEnd(ctx->ac.builder, if_block);
|
||||
ac_build_endloop(&ctx->ac, get_line(bld_base->pc));
|
||||
}
|
||||
|
||||
static void if_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -1094,13 +966,7 @@ static void if_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
LLVMValueRef cond;
|
||||
|
||||
cond = LLVMBuildFCmp(ctx->ac.builder, LLVMRealUNE,
|
||||
emit_data->args[0],
|
||||
ctx->ac.f32_0, "");
|
||||
|
||||
if_cond_emit(action, bld_base, emit_data, cond);
|
||||
ac_build_if(&ctx->ac, emit_data->args[0], get_line(bld_base->pc));
|
||||
}
|
||||
|
||||
static void uif_emit(const struct lp_build_tgsi_action *action,
|
||||
@@ -1108,12 +974,7 @@ static void uif_emit(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_emit_data *emit_data)
|
||||
{
|
||||
struct si_shader_context *ctx = si_shader_context(bld_base);
|
||||
LLVMValueRef cond;
|
||||
|
||||
cond = LLVMBuildICmp(ctx->ac.builder, LLVMIntNE,
|
||||
ac_to_integer(&ctx->ac, emit_data->args[0]), ctx->i32_0, "");
|
||||
|
||||
if_cond_emit(action, bld_base, emit_data, cond);
|
||||
ac_build_uif(&ctx->ac, emit_data->args[0], get_line(bld_base->pc));
|
||||
}
|
||||
|
||||
static void emit_immediate(struct lp_build_tgsi_context *bld_base,
|
||||
@@ -1409,7 +1270,5 @@ void si_llvm_dispose(struct si_shader_context *ctx)
|
||||
FREE(ctx->imms);
|
||||
ctx->imms = NULL;
|
||||
ctx->imms_num = 0;
|
||||
FREE(ctx->flow);
|
||||
ctx->flow = NULL;
|
||||
ctx->flow_depth_max = 0;
|
||||
ac_llvm_context_dispose(&ctx->ac);
|
||||
}
|
||||
|
@@ -722,6 +722,7 @@ dri2_allocate_textures(struct dri_context *ctx,
|
||||
whandle.handle = buf->name;
|
||||
whandle.stride = buf->pitch;
|
||||
whandle.offset = 0;
|
||||
whandle.modifier = DRM_FORMAT_MOD_INVALID;
|
||||
if (screen->can_share_buffer)
|
||||
whandle.type = DRM_API_HANDLE_TYPE_SHARED;
|
||||
else
|
||||
|
@@ -810,6 +810,10 @@ nine_ff_build_vs(struct NineDevice9 *device, struct vs_build_ctx *vs)
|
||||
|
||||
const unsigned loop_label = l++;
|
||||
|
||||
/* Declare all light constants to allow indirect adressing */
|
||||
for (i = 32; i < 96; i++)
|
||||
ureg_DECL_constant(ureg, i);
|
||||
|
||||
ureg_MOV(ureg, rCtr, ureg_imm1f(ureg, 32.0f)); /* &lightconst(0) */
|
||||
ureg_MOV(ureg, rD, ureg_imm1f(ureg, 0.0f));
|
||||
ureg_MOV(ureg, rA, ureg_imm1f(ureg, 0.0f));
|
||||
|
@@ -1079,7 +1079,7 @@ tx_src_param(struct shader_translator *tx, const struct sm1_src_param *param)
|
||||
case D3DSMO_FACE:
|
||||
if (ureg_src_is_undef(tx->regs.vFace)) {
|
||||
if (tx->face_is_sysval_integer) {
|
||||
tmp = tx_scratch(tx);
|
||||
tmp = ureg_DECL_temporary(ureg);
|
||||
tx->regs.vFace =
|
||||
ureg_DECL_system_value(ureg, TGSI_SEMANTIC_FACE, 0);
|
||||
|
||||
|
@@ -32,7 +32,6 @@ gbm_bo_get_user_data
|
||||
gbm_bo_destroy
|
||||
gbm_surface_create
|
||||
gbm_surface_create_with_modifiers
|
||||
gbm_surface_needs_lock_front_buffer
|
||||
gbm_surface_lock_front_buffer
|
||||
gbm_surface_release_buffer
|
||||
gbm_surface_has_free_buffers
|
||||
|
@@ -386,8 +386,6 @@ gbm_surface_create_with_modifiers(struct gbm_device *gbm,
|
||||
uint32_t format,
|
||||
const uint64_t *modifiers,
|
||||
const unsigned int count);
|
||||
int
|
||||
gbm_surface_needs_lock_front_buffer(struct gbm_surface *surface);
|
||||
|
||||
struct gbm_bo *
|
||||
gbm_surface_lock_front_buffer(struct gbm_surface *surface);
|
||||
|
@@ -688,8 +688,11 @@ vec4_visitor::pack_uniform_registers()
|
||||
* the next part of our packing algorithm.
|
||||
*/
|
||||
int reg = inst->src[0].nr;
|
||||
for (unsigned i = 0; i < vec4s_read; i++)
|
||||
int channel_size = type_sz(inst->src[0].type) / 4;
|
||||
for (unsigned i = 0; i < vec4s_read; i++) {
|
||||
chans_used[reg + i] = 4;
|
||||
channel_sizes[reg + i] = MAX2(channel_sizes[reg + i], channel_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2246,6 +2246,10 @@ anv_image_aspect_get_planes(VkImageAspectFlags aspect_mask)
|
||||
if (aspect_mask & VK_IMAGE_ASPECT_PLANE_2_BIT_KHR)
|
||||
planes++;
|
||||
|
||||
if ((aspect_mask & VK_IMAGE_ASPECT_DEPTH_BIT) != 0 &&
|
||||
(aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT) != 0)
|
||||
planes++;
|
||||
|
||||
return planes;
|
||||
}
|
||||
|
||||
|
@@ -968,10 +968,10 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
|
||||
|
||||
struct anv_image_view *iview = framebuffer->attachments[i];
|
||||
anv_assert(iview->vk_format == att->format);
|
||||
anv_assert(iview->n_planes == 1);
|
||||
|
||||
union isl_color_value clear_color = { .u32 = { 0, } };
|
||||
if (att_aspects & VK_IMAGE_ASPECT_ANY_COLOR_BIT) {
|
||||
anv_assert(iview->n_planes == 1);
|
||||
assert(att_aspects == VK_IMAGE_ASPECT_COLOR_BIT);
|
||||
color_attachment_compute_aux_usage(cmd_buffer->device,
|
||||
state, i, begin->renderArea,
|
||||
|
@@ -160,11 +160,9 @@ driCreateNewScreen2(int scrn, int fd,
|
||||
|
||||
api = API_OPENGL_COMPAT;
|
||||
if (_mesa_override_gl_version_contextless(&consts, &api, &version)) {
|
||||
if (api == API_OPENGL_CORE) {
|
||||
psp->max_gl_core_version = version;
|
||||
} else {
|
||||
psp->max_gl_core_version = version;
|
||||
if (api == API_OPENGL_COMPAT)
|
||||
psp->max_gl_compat_version = version;
|
||||
}
|
||||
}
|
||||
|
||||
psp->api_mask = 0;
|
||||
|
@@ -954,7 +954,7 @@ brw_batch_references(struct intel_batchbuffer *batch, struct brw_bo *bo)
|
||||
static uint64_t
|
||||
emit_reloc(struct intel_batchbuffer *batch,
|
||||
struct brw_reloc_list *rlist, uint32_t offset,
|
||||
struct brw_bo *target, uint32_t target_offset,
|
||||
struct brw_bo *target, int32_t target_offset,
|
||||
unsigned int reloc_flags)
|
||||
{
|
||||
assert(target != NULL);
|
||||
|
@@ -377,10 +377,16 @@ intel_image_format_lookup(int fourcc)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static boolean intel_lookup_fourcc(int dri_format, int *fourcc)
|
||||
static boolean
|
||||
intel_image_get_fourcc(__DRIimage *image, int *fourcc)
|
||||
{
|
||||
if (image->planar_format) {
|
||||
*fourcc = image->planar_format->fourcc;
|
||||
return true;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
|
||||
if (intel_image_formats[i].planes[0].dri_format == dri_format) {
|
||||
if (intel_image_formats[i].planes[0].dri_format == image->dri_format) {
|
||||
*fourcc = intel_image_formats[i].fourcc;
|
||||
return true;
|
||||
}
|
||||
@@ -567,6 +573,7 @@ intel_create_image_from_texture(__DRIcontext *context, int target,
|
||||
intel_setup_image_from_mipmap_tree(brw, image, iobj->mt, level, zoffset);
|
||||
image->dri_format = driGLFormatToImageFormat(image->format);
|
||||
image->has_depthstencil = iobj->mt->stencil_mt? true : false;
|
||||
image->planar_format = iobj->planar_format;
|
||||
if (image->dri_format == MESA_FORMAT_NONE) {
|
||||
*error = __DRI_IMAGE_ERROR_BAD_PARAMETER;
|
||||
free(image);
|
||||
@@ -797,7 +804,7 @@ intel_query_image(__DRIimage *image, int attrib, int *value)
|
||||
case __DRI_IMAGE_ATTRIB_FD:
|
||||
return !brw_bo_gem_export_to_prime(image->bo, value);
|
||||
case __DRI_IMAGE_ATTRIB_FOURCC:
|
||||
return intel_lookup_fourcc(image->dri_format, value);
|
||||
return intel_image_get_fourcc(image, value);
|
||||
case __DRI_IMAGE_ATTRIB_NUM_PLANES:
|
||||
if (isl_drm_modifier_has_aux(image->modifier)) {
|
||||
assert(!image->planar_format || image->planar_format->nplanes == 1);
|
||||
|
@@ -501,6 +501,28 @@ debug_clear_group(struct gl_debug_state *debug)
|
||||
debug->Groups[gstack] = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the oldest debug messages out of the log.
|
||||
*/
|
||||
static void
|
||||
debug_delete_messages(struct gl_debug_state *debug, int count)
|
||||
{
|
||||
struct gl_debug_log *log = &debug->Log;
|
||||
|
||||
if (count > log->NumMessages)
|
||||
count = log->NumMessages;
|
||||
|
||||
while (count--) {
|
||||
struct gl_debug_message *msg = &log->Messages[log->NextMessage];
|
||||
|
||||
debug_message_clear(msg);
|
||||
|
||||
log->NumMessages--;
|
||||
log->NextMessage++;
|
||||
log->NextMessage %= MAX_DEBUG_LOGGED_MESSAGES;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loop through debug group stack tearing down states for
|
||||
* filtering debug messages. Then free debug output state.
|
||||
@@ -514,6 +536,7 @@ debug_destroy(struct gl_debug_state *debug)
|
||||
}
|
||||
|
||||
debug_clear_group(debug);
|
||||
debug_delete_messages(debug, debug->Log.NumMessages);
|
||||
free(debug);
|
||||
}
|
||||
|
||||
@@ -648,28 +671,6 @@ debug_fetch_message(const struct gl_debug_state *debug)
|
||||
return (log->NumMessages) ? &log->Messages[log->NextMessage] : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the oldest debug messages out of the log.
|
||||
*/
|
||||
static void
|
||||
debug_delete_messages(struct gl_debug_state *debug, int count)
|
||||
{
|
||||
struct gl_debug_log *log = &debug->Log;
|
||||
|
||||
if (count > log->NumMessages)
|
||||
count = log->NumMessages;
|
||||
|
||||
while (count--) {
|
||||
struct gl_debug_message *msg = &log->Messages[log->NextMessage];
|
||||
|
||||
debug_message_clear(msg);
|
||||
|
||||
log->NumMessages--;
|
||||
log->NextMessage++;
|
||||
log->NextMessage %= MAX_DEBUG_LOGGED_MESSAGES;
|
||||
}
|
||||
}
|
||||
|
||||
static struct gl_debug_message *
|
||||
debug_get_group_message(struct gl_debug_state *debug)
|
||||
{
|
||||
|
@@ -837,8 +837,8 @@ clear_teximage_fields(struct gl_texture_image *img)
|
||||
* Fills in the fields of \p img with the given information.
|
||||
* Note: width, height and depth include the border.
|
||||
*/
|
||||
static void
|
||||
init_teximage_fields_ms(struct gl_context *ctx,
|
||||
void
|
||||
_mesa_init_teximage_fields_ms(struct gl_context *ctx,
|
||||
struct gl_texture_image *img,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLint border, GLenum internalFormat,
|
||||
@@ -950,8 +950,8 @@ _mesa_init_teximage_fields(struct gl_context *ctx,
|
||||
GLint border, GLenum internalFormat,
|
||||
mesa_format format)
|
||||
{
|
||||
init_teximage_fields_ms(ctx, img, width, height, depth, border,
|
||||
internalFormat, format, 0, GL_TRUE);
|
||||
_mesa_init_teximage_fields_ms(ctx, img, width, height, depth, border,
|
||||
internalFormat, format, 0, GL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -5838,9 +5838,9 @@ texture_image_multisample(struct gl_context *ctx, GLuint dims,
|
||||
|
||||
if (_mesa_is_proxy_texture(target)) {
|
||||
if (samplesOK && dimensionsOK && sizeOK) {
|
||||
init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
|
||||
internalformat, texFormat,
|
||||
samples, fixedsamplelocations);
|
||||
_mesa_init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
|
||||
internalformat, texFormat,
|
||||
samples, fixedsamplelocations);
|
||||
}
|
||||
else {
|
||||
/* clear all image fields */
|
||||
@@ -5867,9 +5867,9 @@ texture_image_multisample(struct gl_context *ctx, GLuint dims,
|
||||
|
||||
ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
|
||||
|
||||
init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
|
||||
internalformat, texFormat,
|
||||
samples, fixedsamplelocations);
|
||||
_mesa_init_teximage_fields_ms(ctx, texImage, width, height, depth, 0,
|
||||
internalformat, texFormat,
|
||||
samples, fixedsamplelocations);
|
||||
|
||||
if (width > 0 && height > 0 && depth > 0) {
|
||||
if (memObj) {
|
||||
|
@@ -130,6 +130,14 @@ _mesa_init_teximage_fields(struct gl_context *ctx,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLint border, GLenum internalFormat,
|
||||
mesa_format format);
|
||||
extern void
|
||||
_mesa_init_teximage_fields_ms(struct gl_context *ctx,
|
||||
struct gl_texture_image *img,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLint border, GLenum internalFormat,
|
||||
mesa_format format,
|
||||
GLuint numSamples,
|
||||
GLboolean fixedSampleLocations);
|
||||
|
||||
|
||||
extern mesa_format
|
||||
|
@@ -304,7 +304,8 @@ initialize_texture_fields(struct gl_context *ctx,
|
||||
struct gl_texture_object *texObj,
|
||||
GLint levels,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLenum internalFormat, mesa_format texFormat)
|
||||
GLenum internalFormat, mesa_format texFormat,
|
||||
GLuint numSamples, GLboolean fixedSampleLocations)
|
||||
{
|
||||
const GLuint numFaces = _mesa_num_tex_faces(target);
|
||||
GLint level, levelWidth = width, levelHeight = height, levelDepth = depth;
|
||||
@@ -326,9 +327,10 @@ initialize_texture_fields(struct gl_context *ctx,
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
_mesa_init_teximage_fields(ctx, texImage,
|
||||
_mesa_init_teximage_fields_ms(ctx, texImage,
|
||||
levelWidth, levelHeight, levelDepth,
|
||||
0, internalFormat, texFormat);
|
||||
0, internalFormat, texFormat,
|
||||
numSamples, fixedSampleLocations);
|
||||
}
|
||||
|
||||
_mesa_next_mipmap_level_size(target, 0,
|
||||
@@ -676,7 +678,9 @@ texture_view(struct gl_context *ctx, struct gl_texture_object *origTexObj,
|
||||
|
||||
if (!initialize_texture_fields(ctx, target, texObj, newViewNumLevels,
|
||||
width, height, depth,
|
||||
internalformat, texFormat)) {
|
||||
internalformat, texFormat,
|
||||
origTexImage->NumSamples,
|
||||
origTexImage->FixedSampleLocations)) {
|
||||
return; /* Already recorded error */
|
||||
}
|
||||
|
||||
|
@@ -134,16 +134,26 @@ create_version_string(struct gl_context *ctx, const char *prefix)
|
||||
}
|
||||
|
||||
/**
|
||||
* Override the context's version and/or API type if the
|
||||
* environment variable MESA_GL_VERSION_OVERRIDE is set.
|
||||
* Override the context's version and/or API type if the environment variables
|
||||
* MESA_GL_VERSION_OVERRIDE or MESA_GLES_VERSION_OVERRIDE are set.
|
||||
*
|
||||
* Example uses of MESA_GL_VERSION_OVERRIDE:
|
||||
*
|
||||
* 2.1: select a compatibility (non-Core) profile with GL version 2.1
|
||||
* 3.0: select a compatibility (non-Core) profile with GL version 3.0
|
||||
* 3.0FC: select a Core+Forward Compatible profile with GL version 3.0
|
||||
* 3.1: select a Core profile with GL version 3.1
|
||||
* 3.1FC: select a Core+Forward Compatible profile with GL version 3.1
|
||||
* 2.1: select a compatibility (non-Core) profile with GL version 2.1.
|
||||
* 3.0: select a compatibility (non-Core) profile with GL version 3.0.
|
||||
* 3.0FC: select a Core+Forward Compatible profile with GL version 3.0.
|
||||
* 3.1: select GL version 3.1 with GL_ARB_compatibility enabled per the driver default.
|
||||
* 3.1FC: select GL version 3.1 with forward compatibility and GL_ARB_compatibility disabled.
|
||||
* 3.1COMPAT: select GL version 3.1 with GL_ARB_compatibility enabled.
|
||||
* X.Y: override GL version to X.Y without changing the profile.
|
||||
* X.YFC: select a Core+Forward Compatible profile with GL version X.Y.
|
||||
* X.YCOMPAT: select a Compatibility profile with GL version X.Y.
|
||||
*
|
||||
* Example uses of MESA_GLES_VERSION_OVERRIDE:
|
||||
*
|
||||
* 2.0: select GLES version 2.0.
|
||||
* 3.0: select GLES version 3.0.
|
||||
* 3.1: select GLES version 3.1.
|
||||
*/
|
||||
bool
|
||||
_mesa_override_gl_version_contextless(struct gl_constants *consts,
|
||||
@@ -157,17 +167,12 @@ _mesa_override_gl_version_contextless(struct gl_constants *consts,
|
||||
if (version > 0) {
|
||||
*versionOut = version;
|
||||
|
||||
/* If the API is a desktop API, adjust the context flags. We may also
|
||||
* need to modify the API depending on the version. For example, Mesa
|
||||
* does not support a GL 3.3 compatibility profile.
|
||||
*/
|
||||
/* Modify the API and context flags as needed. */
|
||||
if (*apiOut == API_OPENGL_CORE || *apiOut == API_OPENGL_COMPAT) {
|
||||
if (version >= 30 && fwd_context) {
|
||||
*apiOut = API_OPENGL_CORE;
|
||||
consts->ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT;
|
||||
} else if (version >= 31 && !compat_context) {
|
||||
*apiOut = API_OPENGL_CORE;
|
||||
} else {
|
||||
} else if (compat_context) {
|
||||
*apiOut = API_OPENGL_COMPAT;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user