Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.2k
    • Issues 3.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1k
    • Merge requests 1k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MesaMesa
  • mesamesa
  • Issues
  • #340
Closed
Open
Issue created Sep 18, 2019 by Bugzilla Migration User@bugzilla-migration

[r300g] piglit vs-clip-vertex-const-reject fails

Submitted by Pavel Ondračka

Assigned to Default DRI bug account

Link to original bug (#45913)

Description

Found while comparing piglit runs on r300g RV530 between 7.11 and 8.0. llvmpipe is also affected.

7d68c639 is the first bad commit commit 7d68c639 Author: Paul Berry stereotype441@gmail.com Date: Mon Sep 26 13:15:57 2011 -0700

mesa: Add a gl_vert_result for gl_ClipVertex.

Before this patch, clip planes didn't work properly in Mesa when using
vertex shaders, because Mesa assigned both gl_ClipVertex and
gl_Position to the same gl_vert_result (VERT_RESULT_HPOS).  As a
result, backends couldn't distinguish between the two variables, so
any shader that wrote different values to them would fail to work
properly.

This patch paves the way for proper support of gl_ClipVertex by
creating a new enumerated value in gl_vert_result for it
(VERT_RESULT_CLIP_VERTEX).  After this patch, a back-end may add
support for gl_ClipVertex using the following algorithm:

- If using a user-supplied GLSL vertex shader:
  - If the bit corresponding to VERT_RESULT_CLIP_VERTEX is set in
    gl_program::OutputsWritten:
    - Clip using the vertex shader output VERT_RESULT_CLIP_VERTEX and
      the clip planes defined in gl_context::Transform.EyeUserPlane.
  - Else:
    - Clip using the vertex shader output VERT_RESULT_HPOS and the
      clip planes defined in gl_context::Transform.EyeUserPlane.
- Else (either using fixed function or an ARB vertex program):
  - Clip using the vertex shader output VERT_RESULT_HPOS and the clip
    planes defined in gl_context::Transform._ClipUserPlane (*)

where (*) represents the normal Mesa behavior before this patch.

An example of implementing the above algorithm can be found in the
patch that follows this one, which implements gl_ClipVertex in i965
Gen6.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

My system: GPU: RV530 Mesa: a8cc228e Kernel: 3.2.3 Libdrm 2.4.31

Version: git

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking