ro/wo
Closes: #16
Fixes:
dEQP-GLES31.functional.image_load_store.*.format_reinterpret.*
dEQP-GLES31.functional.image_load_store.*.image_size.writeonly_*
dEQP-GLES31.functional.image_load_store.*.load_store.*
dEQP-GLES31.functional.image_load_store.*.qualifiers.restrict
dEQP-GLES31.functional.image_load_store.*.store.*
v2: remove superfluous check (Erik)
v3: Only emit the writeonly tag for these image formats when on
gles (Erik)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (v2)
Some extensions that are by default available on GLSL 3.20 ES need to
be enabled when on GLSL 3.10 ES on a as-needed bases.
Closes: #25
Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
In order to ensure that all the errors in the initialization are handled
before entering this routine assert on pre-existsing errors.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Consequently calling glGetIntegerv with GL_MAX_IMAGE_SAMPLES would results
in an error state on GLES that is not cleaned up and this has
consequences for the following processing.
Closes: #28
Fixes: 950de33c32
renderer: add image support. (v4)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This way we can report the actual max texture, rather than a
conservative guess like we do now.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The vertex shader always gl_PerVertex, but the tesselation shaders only
define the structure when the point size extension is enabled, otherwise
gl_PointSize is passed as a generic varying and can not be written to.
If one enables the extension based on whether the value gl_PointSize is
actually accessed in the tess shaders then it might happend that tess_ctrl
doesn't touch the value, and the extension isn't enabled, and tess_eval
accesses it and the extension is enabled. In such a case gl_PointSize is
passed as a generic to and from the tess_ctrl shader and linking of the
shaders will fail because of different definitions of gl_PerVertex.
Since in this case there is no indication in the tess_ctrl shader that
point_size is accessed, and it is not known whether the shader will be
linked with a tess_eval shader that uses gl_PointSize the workaround is to
always enable the extension for all tesselation shaders.
Fixes:
dEQP-GLES31.functional.tessellation_geometry_interaction.
point_size.evaluation_set
point_size.vertex_set_control_set
point_size.vertex_set_evaluation_set
point_size.vertex_set_evaluation_set_geometry_default
dEQP-GLES31.functional.primitive_bounding_box.wide_points.
global_state.vertex_tessellation_fragment.
default_framebuffer_bbox_equal
default_framebuffer_bbox_larger
default_framebuffer_bbox_smaller
fbo_bbox_equal
fbo_bbox_larger
fbo_bbox_smaller
dEQP-GLES31.functional.primitive_bounding_box.wide_points.
tessellation_set_per_draw.vertex_tessellation_fragment.
default_framebuffer_bbox_equal
default_framebuffer_bbox_equal
default_framebuffer_bbox_larger
default_framebuffer_bbox_smaller
fbo_bbox_equal
fbo_bbox_larger
fbo_bbox_smaller
tessellation_set_per_primitive.vertex_tessellation_fragment.
default_framebuffer
fragment.fbo
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
GLES 3.1 might support tesselation shaders through the extension, but
this requires the extension to be enabled manually.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(i|u)mulextended require that the all parameters are of the same
signedness. Accordingly create both, the output variabale for MSB and
the (unused) variable for the LSB to be of the same corresponding
signedness. Closes: #17
Fixes:
dEQP-
GLES31.functional.shaders.builtin_functions.integer.imulextended.*
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Certain source regs (GRID_SIZE, THREAD_ID, BLOCK_ID) don't need
to be cast.
Fixes:
dEQP-GLES31.functional.compute.basic.image_atomic_op_local_size_1
dEQP-GLES31.functional.compute.basic.image_atomic_op_local_size_8
dEQP-GLES31.functional.compute.basic.image_barrier_multiple
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
findLSB, findMSB, and countBits always return a signed integer
Fixes:
dEQP-GLES31.functional.shaders.builtin_functions.uniform.findLSBMinusOne.*
dEQP-GLES31.functional.shaders.builtin_functions.integer.findmsb.*
dEQP-GLES31.functional.shaders.builtin_functions.integer.bitcount.*
Changes resulting from the discussion on mesa-dev with
Roland Schneidegger:
v2: Set values in infer_(src|dst)_type only
v3: Set values in the common infer_type code path, and only add
the source type for UMSB
Signed-off-by: Gert Wollny gert.wollny@collabora.com
Reviewed-by: Dave Airlie <airlied@redhat.com>
Fixes:
tests/spec/arb_gpu_shader5/execution/ubo_array_indexing/vs-mixed-with-const-access.shader_test
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
We didn't correctly reject textures that would fail glTexImage2D with an
GL_INVALID_OPERATION error. Trying to use the so accepted texture formats would later
lead to errors.
Correct this error and also the definition of VIRGL_FORMAT_X24S8_UINT that is needed
for GLES 3.1.
Closes: #15
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
When using OpenGL ES 3.1, we either need to emit a precision qualifier,
or set a default precision.
Since it's not unthinkable that we'd want to forward lowp/mediump
in the future, let's use the precision qualifier so it's easier
to get this right later on.
This gets rid of a shader compile error.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenGL ES 3.1 only supports writing to a few formats, while it can
read from all of them. So let's make sure we emit readonly, so the
OpenGL driver knows we'll only read.
This avoids a shader-compiler error on OpenGL ES 3.1.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenGL ES 3.1 doesn't support using glUniform1i() for binding
images, so let's use layout qualifiers instead. This should in
theory be slightly more performant as well, as we do less API
calls.
A future improvement would be to also do this on GL 4.2 and later
as well.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We essentially repeat the same code twice here, with a small
variation. Let's factor out the common code into a helper, so we
don't have to keep updating two copies. This is similar to what's
already done for samplers.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
There's no point in copying the two only members out of the struct and
onto the stack. So let's just pass the struct directly.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
In GLES, these need a precision specifier, otherwise we get
compile errors.
This fixes a shader-compile error on OpenGL ES 3.1.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
glTexBuffer doesn't accept GL_RGBA8_SNORM, so use GL_RGBA8UI
instead. Unfortunately, we can't use our texture table since
Gallium requests PIPE_FORMAT_R8_UNORM for texture buffers. For
normal sampler views, the correct semantics are passed down later,
but for images (where texture and image formats can differ) this
is not case.
Fixes:
dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8ui_rgba8_snorm
dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.r32ui_rgba8_snorm
dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8i_rgba8_snorm
dEQP-GLES31.functional.image_load_store.buffer.format_reinterpret.rgba8_rgba8_snorm
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
We can emit them during the second pass. Since a load
or store can come before an atomic max or min, we have to
type the memory before we emit instructions.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Add a check for nonterminated string passed into the create_shader
code.
No point checking len <= 0, since it's a uint32_t.
Signed-off-by: Dave Airlie <airlied@redhat.com>
vrend_shader.c:4400: Warning: Comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ctx->cfg->max_draw_buffers; i++) {
^
vrend_shader.c:4728:28: Warning: Unused variable »i« [-Wunused-variable]
int start, count, i;
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Only decorate function as noreturn when DEBUG is not defined, because
when compiled in DEBUG mode the function actually executes an int3 and
may return, fixes:
u_debug.c: In function '_debug_assert_fail':
u_debug.c:309:1: warning: 'noreturn' function does return
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
tgsi_scan.c:37:0:
tgsi_scan.c: In function 'tgsi_scan_shader':
tgsi_scan.c:212:46: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
assert(src->Register.Index < Elements(info->is_msaa_sampler));
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Change the type of util_cpu_caps::nr_cpus to int because sysconfig
returns a signed value, fixes:
u_cpu_detect.c: In function 'util_cpu_detect':
u_cpu_detect.c:317:30: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (util_cpu_caps.nr_cpus == -1)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
u_debug_describe.c: In function 'debug_describe_reference':
u_debug_describe.c:33:65: warning: unused parameter 'ptr' [-Wunused-
parameter]
debug_describe_reference(char* buf, const struct pipe_reference*ptr)
u_format.c: In function 'util_format_is_float':
u_format.c:57:10: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (i == -1) {
v2: Replace VREND_UNUSED by UNUSED (Erik)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
tgsi_ureg.c: In function 'ureg_DECL_sampler':
tgsi_ureg.c:601:34: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->sampler[i].Index == nr)
^~
tgsi_ureg.c: In function 'validate':
tgsi_ureg.c:908:32: warning: unused parameter 'opcode' [-Wunused-
parameter]
static void validate( unsigned opcode,
^~~~~~
tgsi_ureg.c:909:32: warning: unused parameter 'nr_dst' [-Wunused-
parameter]
unsigned nr_dst,
^~~~~~
tgsi_ureg.c:910:32: warning: unused parameter 'nr_src' [-Wunused-
parameter]
unsigned nr_src )
^~~~~~
tgsi_ureg.c: In function 'emit_decls':
tgsi_ureg.c:1335:31: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->properties[i] != ~0)
^~
tgsi_ureg.c: In function 'ureg_create':
tgsi_ureg.c:1594:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(ureg->properties); i++)
^
v2: Replace VREND_UNUSED by UNUSED (Erik)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
tgsi_ureg.c: In function 'ureg_DECL_sampler':
tgsi_ureg.c:601:34: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->sampler[i].Index == nr)
^~
tgsi_ureg.c: In function 'validate':
tgsi/tgsi_ureg.c:908:32: warning: unused parameter 'opcode' [-Wunused-
parameter]
static void validate( unsigned opcode,
^~~~~~
tgsi_ureg.c:909:32: warning: unused parameter 'nr_dst' [-Wunused-
parameter]
unsigned nr_dst,
^~~~~~
tgsi_ureg.c:910:32: warning: unused parameter 'nr_src' [-Wunused-
parameter]
unsigned nr_src )
^~~~~~
tgsi_ureg.c: In function 'emit_decls':
tgsi_ureg.c:1335:31: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->properties[i] != ~0)
^~
tgsi_ureg.c: In function 'ureg_create':
tgsi_ureg.c:1594:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(ureg->properties); i++)
^
CC tgsi/tgsi_util.lo
tgsi_util.c: In function 'tgsi_util_get_full_src_register_sign_mode':
tgsi_util.c:109:13: warning: unused parameter 'component' [-Wunused-
parameter]
unsigned component )
^~~~~~~~~
v2: Eliminate use of VREND_UNUSED (Erik)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
_surface.c: In function 'util_copy_rect':
u_surface.c:101:37: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (width == dst_stride && width == src_stride)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
In function 'parse_identifier':
tgsi_text.c:190:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (i == len - 1)
^~
tgsi_text.c: In function 'parse_optional_swizzle':
tgsi_text.c:816:21: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < components; i++) {
^
tgsi_text.c: In function 'parse_instruction':
tgsi_text.c:1025:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < info->num_dst + info->num_src + info->is_tex; i++) {
^
tgsi_text.c:1040:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
else if (i < info->num_dst + info->num_src) {
^
tgsi_text.c: In function 'parse_immediate':
tgsi/tgsi_text.c:1525:24: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (type = 0; type < Elements(tgsi_immediate_type_names); ++type) {
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
tgsi_sanity.c: In function 'iter_instruction':
tgsi_sanity.c:316:29: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ctx->index_of_END != ~0) {
^~
tgsi_sanity.c: In function 'epilog':
tgsi_sanity.c:488:26: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ctx->index_of_END == ~0) {
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
tgsi_parse.c: In function 'tgsi_parse_free':
tgsi_parse.c:54:31: warning: unused parameter 'ctx' [-Wunused-parameter]
struct tgsi_parse_context *ctx )
^~~
tgsi_parse.c: In function 'tgsi_parse_end_of_tokens':
tgsi_parse.c:62:25: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
return ctx->Position >=
v2: Replace VREND_UNUSED by UNUSED (Erik)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
tgsi_dump.c: In function 'iter_property':
tgsi_dump.c:443:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < prop->Property.NrTokens - 1; ++i) {
^
tgsi_dump.c:459:13: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (i < prop->Property.NrTokens - 2)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
/tgsi_build.c: In function 'tgsi_build_full_immediate':
tgsi_build.c:599:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for( i = 0; i < full_imm->Immediate.NrTokens - 1; i++ ) {
^
tgsi_build.c: In function 'tgsi_build_instruction_label':
tgsi_build.c:689:24: warning: unused parameter 'prev_token' [-Wunused-
parameter]
struct tgsi_token *prev_token,
^~~~~~~~~~
tgsi_build.c: In function 'tgsi_build_instruction_texture':
tgsi_build.c:720:23: warning: unused parameter 'prev_token' [-Wunused-
parameter]
struct tgsi_token *prev_token,
^~~~~~~~~~
tgsi_build.c: In function 'tgsi_build_texture_offset':
tgsi_build.c:755:23: warning: unused parameter 'prev_token' [-Wunused-
parameter]
struct tgsi_token *prev_token,
^~~~~~~~~~
tgsi_build.c: In function 'tgsi_build_full_property':
tgsi_build.c:1307:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for( i = 0; i < full_prop->Property.NrTokens - 1; i++ ) {
v2: remove the unused prev_token (in sync with mesa)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Gallium copy_image redirects calls to resource_copy_region for equal src
and dst formats or if at least one of the two is compressed. Handle the
condition for selecting blit vs. glCopyImageSubRegion accordingly.
Fixes piglit: bptc-float-modes
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
When emitting an image array, the code errorously used the loop
counter instead of the image entry for looking up the resource.
The rest of the code uses idx, which seems like the right thing
to do. So let's match that instead.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>